diff --git a/paper-api/src/org/bukkit/event/block/BlockBrokenEvent.java b/paper-api/src/org/bukkit/event/block/BlockBrokenEvent.java new file mode 100644 index 0000000000..6875683215 --- /dev/null +++ b/paper-api/src/org/bukkit/event/block/BlockBrokenEvent.java @@ -0,0 +1,12 @@ +package org.bukkit.event.block; + +import org.bukkit.event.Event; + +public class BlockBrokenEvent extends Event { + + public BlockBrokenEvent(Type type) { + super(type); + // TODO Auto-generated constructor stub + } + +} diff --git a/paper-api/src/org/bukkit/event/block/BlockEvent.java b/paper-api/src/org/bukkit/event/block/BlockEvent.java new file mode 100644 index 0000000000..6e50caedbd --- /dev/null +++ b/paper-api/src/org/bukkit/event/block/BlockEvent.java @@ -0,0 +1,24 @@ +package org.bukkit.event.block; + +import org.bukkit.Block; +import org.bukkit.event.Event; + +/** + * Represents a block related event + */ +public class BlockEvent extends Event { + protected Block block; + + public BlockEvent(final Event.Type type, final Block theBlock) { + super(type); + block = theBlock; + } + + /** + * Returns the block involved in this event + * @return Block which block is involved in this event + */ + public final Block getBlock() { + return block; + } +} diff --git a/paper-api/src/org/bukkit/event/block/BlockFromToEvent.java b/paper-api/src/org/bukkit/event/block/BlockFromToEvent.java new file mode 100644 index 0000000000..2bf3f05863 --- /dev/null +++ b/paper-api/src/org/bukkit/event/block/BlockFromToEvent.java @@ -0,0 +1,34 @@ +package org.bukkit.event.block; + +import org.bukkit.Block; +import org.bukkit.event.Event; + +/** + * Holds information for events with a source block and a destination block + */ +public class BlockFromToEvent extends BlockEvent { + protected Block from; + + public BlockFromToEvent(final Event.Type type, final Block from, final Block to) { + super(type, to); + this.from = from; + } + + /** + * Gets the location this player moved to + * + * @return Block the block is event originated from + */ + public Block getFrom() { + return from; + } + + /** + * Gets the target block of this event + * + * @return Block the block containing this event + */ + public Block getTo() { + return getBlock(); + } +} diff --git a/paper-api/src/org/bukkit/event/block/BlockIgniteEvent.java b/paper-api/src/org/bukkit/event/block/BlockIgniteEvent.java new file mode 100644 index 0000000000..90347096a1 --- /dev/null +++ b/paper-api/src/org/bukkit/event/block/BlockIgniteEvent.java @@ -0,0 +1,19 @@ +package org.bukkit.event.block; + +import org.bukkit.event.Event; + +/** + * @author durron597 + * + */ +public class BlockIgniteEvent extends Event { + + /** + * @param type + */ + public BlockIgniteEvent(Type type) { + super(type); + // TODO Auto-generated constructor stub + } + +} diff --git a/paper-api/src/org/bukkit/event/block/BlockListener.java b/paper-api/src/org/bukkit/event/block/BlockListener.java new file mode 100644 index 0000000000..722edb6097 --- /dev/null +++ b/paper-api/src/org/bukkit/event/block/BlockListener.java @@ -0,0 +1,71 @@ +package org.bukkit.event.block; + +import org.bukkit.event.Listener; + +/** + * Handles all events thrown in relation to a Block + * + * @author durron597 + */ +public class BlockListener implements Listener { + public BlockListener() { + } + + /** + * Called when a block is broken (or destroyed) + * + * @param event Relevant event details + */ + public void onBlockBroken(BlockBrokenEvent event) { + } + + /** + * Called when a block flows (water/lava) + * + * @param event Relevant event details + */ + public void onBlockFlow(BlockFromToEvent event) { + } + + /** + * Called when a block gets ignited + * + * @param event Relevant event details + */ + public void onBlockIgnite(BlockIgniteEvent event) { + } + + /** + * Called when block physics occurs + * + * @param event Relevant event details + */ + public void onBlockPhysics(BlockPhysicsEvent event) { + } + + /** + * Called when a player places a block + * + * @param event Relevant event details + */ + public void onBlockPlaced(BlockPlacedEvent event) { + } + + /** + * Called when a player right clicks a block + * + * @param event Relevant event details + */ + public void onBlockRightClicked(BlockRightClickedEvent event) { + } + + /** + * Called when redstone changes + * From: the source of the redstone change + * To: The redstone dust that changed + * + * @param event Relevant event details + */ + public void onRedstoneChange(BlockFromToEvent event) { + } +} diff --git a/paper-api/src/org/bukkit/event/block/BlockPhysicsEvent.java b/paper-api/src/org/bukkit/event/block/BlockPhysicsEvent.java new file mode 100644 index 0000000000..cb44ef31cd --- /dev/null +++ b/paper-api/src/org/bukkit/event/block/BlockPhysicsEvent.java @@ -0,0 +1,23 @@ +/** + * + */ +package org.bukkit.event.block; + +import org.bukkit.Block; + +/** + * @author jmartin + * + */ +public class BlockPhysicsEvent extends BlockEvent { + + /** + * @param type + * @param theBlock + */ + public BlockPhysicsEvent(Type type, Block theBlock) { + super(type, theBlock); + // TODO Auto-generated constructor stub + } + +} diff --git a/paper-api/src/org/bukkit/event/block/BlockPlacedEvent.java b/paper-api/src/org/bukkit/event/block/BlockPlacedEvent.java new file mode 100644 index 0000000000..625a1e95c7 --- /dev/null +++ b/paper-api/src/org/bukkit/event/block/BlockPlacedEvent.java @@ -0,0 +1,23 @@ +/** + * + */ +package org.bukkit.event.block; + +import org.bukkit.Block; + +/** + * @author jmartin + * + */ +public class BlockPlacedEvent extends BlockEvent { + + /** + * @param type + * @param theBlock + */ + public BlockPlacedEvent(Type type, Block theBlock) { + super(type, theBlock); + // TODO Auto-generated constructor stub + } + +} diff --git a/paper-api/src/org/bukkit/event/block/BlockRightClickedEvent.java b/paper-api/src/org/bukkit/event/block/BlockRightClickedEvent.java new file mode 100644 index 0000000000..3f8c83975e --- /dev/null +++ b/paper-api/src/org/bukkit/event/block/BlockRightClickedEvent.java @@ -0,0 +1,23 @@ +/** + * + */ +package org.bukkit.event.block; + +import org.bukkit.Block; + +/** + * @author jmartin + * + */ +public class BlockRightClickedEvent extends BlockEvent { + + /** + * @param type + * @param theBlock + */ + public BlockRightClickedEvent(Type type, Block theBlock) { + super(type, theBlock); + // TODO Auto-generated constructor stub + } + +}