summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-07-26 20:44:03 +1000
committermd_5 <git@md-5.net>2018-07-26 20:44:03 +1000
commitc520a96024beeb557ebccbc0f18a938a232635a1 (patch)
treec750ee8b13f97e6ee495b3c1229ec0a21b5c05a0 /src
parent1949c31b9b5031ebc3f40e194773807c3bd65daa (diff)
downloadbukkit-c520a96024beeb557ebccbc0f18a938a232635a1.tar
bukkit-c520a96024beeb557ebccbc0f18a938a232635a1.tar.gz
bukkit-c520a96024beeb557ebccbc0f18a938a232635a1.tar.lz
bukkit-c520a96024beeb557ebccbc0f18a938a232635a1.tar.xz
bukkit-c520a96024beeb557ebccbc0f18a938a232635a1.zip
Add draft BlockFertilizeEvent
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/event/block/BlockFertilizeEvent.java71
-rw-r--r--src/main/java/org/bukkit/event/world/StructureGrowEvent.java4
2 files changed, 73 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/event/block/BlockFertilizeEvent.java b/src/main/java/org/bukkit/event/block/BlockFertilizeEvent.java
new file mode 100644
index 00000000..ab21c9d2
--- /dev/null
+++ b/src/main/java/org/bukkit/event/block/BlockFertilizeEvent.java
@@ -0,0 +1,71 @@
+package org.bukkit.event.block;
+
+import java.util.List;
+import org.bukkit.Warning;
+import org.bukkit.block.Block;
+import org.bukkit.block.BlockState;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.world.StructureGrowEvent;
+
+/**
+ * Called with the block changes resulting from a player fertilizing a given
+ * block with bonemeal. Will be called after the applicable
+ * {@link StructureGrowEvent}.
+ *
+ * @deprecated draft API
+ */
+@Deprecated
+@Warning(false)
+public class BlockFertilizeEvent extends BlockEvent implements Cancellable {
+
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled;
+ //
+ private final Player player;
+ private final List<BlockState> blocks;
+
+ public BlockFertilizeEvent(Block theBlock, Player player, List<BlockState> blocks) {
+ super(theBlock);
+ this.player = player;
+ this.blocks = blocks;
+ }
+
+ /**
+ * Gets the player that triggered the fertilization.
+ *
+ * @return triggering player, or null if not applicable
+ */
+ public Player getPlayer() {
+ return player;
+ }
+
+ /**
+ * Gets a list of all blocks changed by the fertilization.
+ *
+ * @return list of all changed blocks
+ */
+ public List<BlockState> getBlocks() {
+ return blocks;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java
index 62d300d7..7bf82e39 100644
--- a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java
+++ b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java
@@ -69,9 +69,9 @@ public class StructureGrowEvent extends WorldEvent implements Cancellable {
}
/**
- * Gets an ArrayList of all blocks associated with the structure.
+ * Gets a list of all blocks associated with the structure.
*
- * @return ArrayList of all blocks associated with the structure.
+ * @return list of all blocks associated with the structure.
*/
public List<BlockState> getBlocks() {
return blocks;