Somehow a bunch of items were missed

This commit is contained in:
Jake Potrebic
2024-12-14 22:35:35 -08:00
parent 35afd218f5
commit 172a80cb66
25 changed files with 475 additions and 25 deletions

View File

@@ -0,0 +1,30 @@
--- a/net/minecraft/world/item/EndCrystalItem.java
+++ b/net/minecraft/world/item/EndCrystalItem.java
@@ -27,7 +_,7 @@
if (!blockState.is(Blocks.OBSIDIAN) && !blockState.is(Blocks.BEDROCK)) {
return InteractionResult.FAIL;
} else {
- BlockPos blockPos = clickedPos.above();
+ BlockPos blockPos = clickedPos.above(); final BlockPos aboveBlockPosition = blockPos; // Paper - OBFHELPER
if (!level.isEmptyBlock(blockPos)) {
return InteractionResult.FAIL;
} else {
@@ -41,11 +_,17 @@
if (level instanceof ServerLevel) {
EndCrystal endCrystal = new EndCrystal(level, d + 0.5, d1, d2 + 0.5);
endCrystal.setShowBottom(false);
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(context, endCrystal).isCancelled()) {
+ if (context.getPlayer() != null) context.getPlayer().containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync
+ return InteractionResult.FAIL;
+ }
+ // CraftBukkit end
level.addFreshEntity(endCrystal);
level.gameEvent(context.getPlayer(), GameEvent.ENTITY_PLACE, blockPos);
EndDragonFight dragonFight = ((ServerLevel)level).getDragonFight();
if (dragonFight != null) {
- dragonFight.tryRespawn();
+ dragonFight.tryRespawn(aboveBlockPosition); // Paper - Perf: Do crystal-portal proximity check before entity lookup
}
}