mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 10:44:39 +01:00
30e4583dbe
By: Initial Source <noreply+automated@papermc.io>
16 lines
947 B
Diff
16 lines
947 B
Diff
--- a/net/minecraft/world/item/MinecartItem.java
|
|
+++ b/net/minecraft/world/item/MinecartItem.java
|
|
@@ -67,7 +67,12 @@
|
|
if (world instanceof ServerLevel) {
|
|
ServerLevel worldserver = (ServerLevel) world;
|
|
|
|
- worldserver.addFreshEntity(entityminecartabstract);
|
|
+ // CraftBukkit start
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(context, entityminecartabstract).isCancelled()) {
|
|
+ return InteractionResult.FAIL;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+ if (!worldserver.addFreshEntity(entityminecartabstract)) return InteractionResult.PASS; // CraftBukkit
|
|
worldserver.gameEvent((Holder) GameEvent.ENTITY_PLACE, blockposition, GameEvent.Context.of(context.getPlayer(), worldserver.getBlockState(blockposition.below())));
|
|
}
|
|
|