mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 02:55:47 +01:00
SPIGOT-794: Call EntityPlaceEvent for Minecart placement
This commit is contained in:
parent
2b2d084ac9
commit
0afed59271
@ -58,11 +58,16 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@@ -84,7 +118,7 @@
|
||||
@@ -84,7 +118,12 @@
|
||||
entityminecartabstract.setCustomName(itemstack.getName());
|
||||
}
|
||||
|
||||
- world.addEntity(entityminecartabstract);
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityminecartabstract).isCancelled()) {
|
||||
+ return EnumInteractionResult.FAIL;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ if (!world.addEntity(entityminecartabstract)) return EnumInteractionResult.PASS; // CraftBukkit
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user