mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-25 01:25:03 +01:00
SPIGOT-794: Call EntityPlaceEvent for Minecart placement
By: md_5 <git@md-5.net>
This commit is contained in:
parent
d085b4781b
commit
e7b5d8a7cf
1 changed files with 6 additions and 1 deletions
|
@ -58,11 +58,16 @@
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +118,7 @@
|
@@ -84,7 +118,12 @@
|
||||||
entityminecartabstract.setCustomName(itemstack.getName());
|
entityminecartabstract.setCustomName(itemstack.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
- world.addEntity(entityminecartabstract);
|
- 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
|
+ if (!world.addEntity(entityminecartabstract)) return EnumInteractionResult.PASS; // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue