mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
17 lines
1 KiB
Diff
17 lines
1 KiB
Diff
--- a/net/minecraft/world/item/MinecartItem.java
|
|
+++ b/net/minecraft/world/item/MinecartItem.java
|
|
@@ -57,7 +_,13 @@
|
|
}
|
|
|
|
if (level instanceof ServerLevel serverLevel) {
|
|
- serverLevel.addFreshEntity(abstractMinecart);
|
|
+ // CraftBukkit start
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(context, abstractMinecart).isCancelled()) {
|
|
+ if (context.getPlayer() != null) context.getPlayer().containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync
|
|
+ return InteractionResult.FAIL;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+ if (!serverLevel.addFreshEntity(abstractMinecart)) return InteractionResult.PASS; // CraftBukkit
|
|
serverLevel.gameEvent(
|
|
GameEvent.ENTITY_PLACE, clickedPos, GameEvent.Context.of(context.getPlayer(), serverLevel.getBlockState(clickedPos.below()))
|
|
);
|