mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 19:36:41 +00:00
Part 1 of upstream merge and format
This commit is contained in:
@ -27,7 +27,7 @@ import com.sk89q.worldedit.WorldEdit;
|
||||
public abstract class Event {
|
||||
|
||||
/**
|
||||
* Returns true if this event was called and not cancelled
|
||||
* Returns true if this event was called and not cancelled.
|
||||
* @return !isCancelled
|
||||
*/
|
||||
public boolean call() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.sk89q.worldedit.event.extent;
|
||||
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -11,7 +10,8 @@ import java.net.URI;
|
||||
public class ActorSaveClipboardEvent extends Event implements Cancellable {
|
||||
private final Actor actor;
|
||||
private final Clipboard clipboard;
|
||||
private final URI source, destination;
|
||||
private final URI source;
|
||||
private final URI destination;
|
||||
private boolean cancelled;
|
||||
|
||||
public ActorSaveClipboardEvent(Actor actor, Clipboard clipboard, URI source, URI destination) {
|
||||
|
@ -19,9 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.event.extent;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import static com.sk89q.worldedit.EditSession.Stage;
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -32,6 +30,9 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
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.
|
||||
*
|
||||
|
@ -19,16 +19,17 @@
|
||||
|
||||
package com.sk89q.worldedit.event.extent;
|
||||
|
||||
import static com.sk89q.worldedit.EditSession.Stage;
|
||||
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import static com.sk89q.worldedit.EditSession.Stage;
|
||||
|
||||
public class PasteEvent extends Event implements Cancellable {
|
||||
|
||||
private final Actor actor;
|
||||
|
@ -19,13 +19,16 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.util.Direction;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Called when a block is interacted with.
|
||||
*/
|
||||
@ -34,6 +37,7 @@ public class BlockInteractEvent extends Event implements Cancellable {
|
||||
private final Actor cause;
|
||||
private final Location location;
|
||||
private final Interaction type;
|
||||
private final Direction face;
|
||||
private boolean cancelled;
|
||||
|
||||
/**
|
||||
@ -43,12 +47,26 @@ public class BlockInteractEvent extends Event implements Cancellable {
|
||||
* @param location the location of the block
|
||||
* @param type the type of interaction
|
||||
*/
|
||||
@Deprecated
|
||||
public BlockInteractEvent(Actor cause, Location location, Interaction type) {
|
||||
this(cause, location, null, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new event.
|
||||
*
|
||||
* @param cause the causing actor
|
||||
* @param location the location of the block
|
||||
* @param face the face of the block that was interacted with
|
||||
* @param type the type of interaction
|
||||
*/
|
||||
public BlockInteractEvent(Actor cause, Location location, @Nullable Direction face, Interaction type) {
|
||||
checkNotNull(cause);
|
||||
checkNotNull(location);
|
||||
checkNotNull(type);
|
||||
this.cause = cause;
|
||||
this.location = location;
|
||||
this.face = face;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@ -70,6 +88,16 @@ public class BlockInteractEvent extends Event implements Cancellable {
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the face of the block that was interacted with.
|
||||
*
|
||||
* @return The interacted face
|
||||
*/
|
||||
@Nullable
|
||||
public Direction getFace() {
|
||||
return face;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type of interaction.
|
||||
*
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.internal.util.Substring;
|
||||
|
@ -19,11 +19,11 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Raised when the configuration has been loaded or re-loaded.
|
||||
*/
|
||||
|
@ -19,12 +19,12 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Raised whenever a player sends input.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user