mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2024-11-25 03:26:14 +00:00
17 lines
969 B
Diff
17 lines
969 B
Diff
--- a/net/minecraft/world/item/ItemMinecart.java
|
|
+++ b/net/minecraft/world/item/ItemMinecart.java
|
|
@@ -67,7 +67,12 @@
|
|
if (world instanceof WorldServer) {
|
|
WorldServer worldserver = (WorldServer) world;
|
|
|
|
- worldserver.addFreshEntity(entityminecartabstract);
|
|
+ // CraftBukkit start
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityminecartabstract).isCancelled()) {
|
|
+ return EnumInteractionResult.FAIL;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+ if (!worldserver.addFreshEntity(entityminecartabstract)) return EnumInteractionResult.PASS; // CraftBukkit
|
|
worldserver.gameEvent((Holder) GameEvent.ENTITY_PLACE, blockposition, GameEvent.a.of(itemactioncontext.getPlayer(), worldserver.getBlockState(blockposition.below())));
|
|
}
|
|
|