mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Fire BlockSpreadEvent for vine growth. Fixes BUKKIT-1097
This commit is contained in:
1 parent
0c78ce40e5
commit
dca54ff187
2 files changed
+36
-7
No files matched your search
@@ -288,6 +288,19 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
|
||||
public static void handleBlockSpreadEvent(Block block, Block source, int type, int data) {
|
||||
BlockState state = block.getState();
|
||||
state.setTypeId(type);
|
||||
state.setRawData((byte) data);
|
||||
|
||||
BlockSpreadEvent event = new BlockSpreadEvent(block, source, state);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
state.update(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static EntityDeathEvent callEntityDeathEvent(EntityLiving victim) {
|
||||
return callEntityDeathEvent(victim, new ArrayList<org.bukkit.inventory.ItemStack>(0));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user