mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 19:36:41 +00:00
Upstream, generics, formatting
This commit is contained in:
@ -19,6 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.event.extent;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.sk89q.worldedit.EditSession.Stage;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
@ -28,24 +31,20 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.sk89q.worldedit.EditSession.Stage;
|
||||
|
||||
/**
|
||||
* Raised (several times) when a new {@link EditSession} is being instantiated.
|
||||
* <p>
|
||||
*
|
||||
* <p></p>Block loggers, as well as block set interceptors, can use this event to wrap
|
||||
* the given {@link Extent} with their own, which would allow them to intercept
|
||||
* all changes made to the world. For example, the code below would wrap the
|
||||
* existing extent with a custom one, and the custom extent would receive
|
||||
* all method calls <strong>before</strong> the extent fetched from
|
||||
* {@link #getExtent()} would.</p>
|
||||
* <p>
|
||||
*
|
||||
* <pre>
|
||||
* event.setExtent(new MyExtent(event.getExtent())
|
||||
* </pre>
|
||||
* <p>
|
||||
*
|
||||
* <p></p>This event is fired several times during the creation of a single
|
||||
* {@link EditSession}, but {@link #getStage()} will differ each time.
|
||||
* The stage determines at which point {@link Extent}s added to this event
|
||||
@ -72,10 +71,10 @@ public class EditSessionEvent extends Event implements Cancellable {
|
||||
/**
|
||||
* Create a new event.
|
||||
*
|
||||
* @param world the world
|
||||
* @param actor the actor, or null if there is no actor specified
|
||||
* @param world the world
|
||||
* @param actor the actor, or null if there is no actor specified
|
||||
* @param maxBlocks the maximum number of block changes
|
||||
* @param stage the stage
|
||||
* @param stage the stage
|
||||
*/
|
||||
public EditSessionEvent(@Nullable World world, Actor actor, int maxBlocks, Stage stage) {
|
||||
this.world = world;
|
||||
@ -97,9 +96,7 @@ public class EditSessionEvent extends Event implements Cancellable {
|
||||
*
|
||||
* @return the actor, which may be null if unavailable
|
||||
*/
|
||||
public
|
||||
@Nullable
|
||||
Actor getActor() {
|
||||
public @Nullable Actor getActor() {
|
||||
return actor;
|
||||
}
|
||||
|
||||
@ -108,9 +105,7 @@ public class EditSessionEvent extends Event implements Cancellable {
|
||||
*
|
||||
* @return the world
|
||||
*/
|
||||
public
|
||||
@Nullable
|
||||
World getWorld() {
|
||||
public @Nullable World getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
@ -169,10 +164,7 @@ public class EditSessionEvent extends Event implements Cancellable {
|
||||
* @return a new event
|
||||
*/
|
||||
public EditSessionEvent clone(Stage stage) {
|
||||
EditSessionEvent clone = new EditSessionEvent(world, actor, maxBlocks, stage);
|
||||
clone.setEditSession(session);
|
||||
return clone;
|
||||
return new EditSessionEvent(world, actor, maxBlocks, stage);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user