Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
31 lines
1.7 KiB
Diff
31 lines
1.7 KiB
Diff
--- 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 aboveBlockPos = 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(aboveBlockPos); // Paper - Perf: Do crystal-portal proximity check before entity lookup
|
|
}
|
|
}
|
|
|