2024-12-11 22:26:55 +01:00
|
|
|
--- a/net/minecraft/world/item/MinecartItem.java
|
|
|
|
+++ b/net/minecraft/world/item/MinecartItem.java
|
2023-08-23 22:22:09 +02:00
|
|
|
@@ -67,7 +67,13 @@
|
2024-12-11 22:26:55 +01:00
|
|
|
if (world instanceof ServerLevel) {
|
|
|
|
ServerLevel worldserver = (ServerLevel) world;
|
|
|
|
|
|
|
|
- worldserver.addFreshEntity(entityminecartabstract);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(context, entityminecartabstract).isCancelled()) {
|
2023-08-23 22:22:09 +02:00
|
|
|
+ if (context.getPlayer() != null) context.getPlayer().containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync
|
2024-12-11 22:26:55 +01:00
|
|
|
+ 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())));
|
|
|
|
}
|
|
|
|
|