13
0
geforkt von Mirrors/Paper

Added Cancellable interface

By: durron597 <martin.jared@gmail.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2010-12-31 20:40:44 -05:00
Ursprung 4ef3cfa0e8
Commit 7d88f00839
4 geänderte Dateien mit 26 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,6 @@
package org.bukkit.event;
public interface Cancellable {
public boolean isCancelled();
public void setCancelled(boolean cancel);
}

Datei anzeigen

@ -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;
}
}

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;