geforkt von Mirrors/Paper
Added Cancellable interface
By: durron597 <martin.jared@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
4ef3cfa0e8
Commit
7d88f00839
6
paper-api/src/org/bukkit/event/Cancellable.java
Normale Datei
6
paper-api/src/org/bukkit/event/Cancellable.java
Normale Datei
@ -0,0 +1,6 @@
|
||||
package org.bukkit.event;
|
||||
|
||||
public interface Cancellable {
|
||||
public boolean isCancelled();
|
||||
public void setCancelled(boolean cancel);
|
||||
}
|
@ -1,19 +1,32 @@
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.Block;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Not implemented yet
|
||||
*/
|
||||
public class BlockPlacedEvent extends BlockEvent {
|
||||
|
||||
public class BlockPlacedEvent extends BlockEvent implements Cancellable {
|
||||
private boolean cancel;
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* @param theBlock
|
||||
*/
|
||||
public BlockPlacedEvent(Type type, Block theBlock) {
|
||||
super(type, theBlock);
|
||||
// TODO Auto-generated constructor stub
|
||||
cancel = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
// TODO Auto-generated method stub
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,11 +2,12 @@
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Holds information for player chat and commands
|
||||
*/
|
||||
public class PlayerChatEvent extends PlayerEvent {
|
||||
public class PlayerChatEvent extends PlayerEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
private String message;
|
||||
|
||||
|
@ -3,12 +3,13 @@ package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
* Holds information for player movement and teleportation events
|
||||
*/
|
||||
public class PlayerMoveEvent extends PlayerEvent {
|
||||
public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
private Location from;
|
||||
private Location to;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren