From 0266a3a862fdf81264c761b9ed896ab194dd8158 Mon Sep 17 00:00:00 2001 From: Bluemangoo Date: Fri, 19 Jul 2024 15:31:12 +0800 Subject: [PATCH] Disable crystal-portal proximity check --- ...sable-crystal-portal-proximity-check.patch | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 patches/server/0129-Disable-crystal-portal-proximity-check.patch diff --git a/patches/server/0129-Disable-crystal-portal-proximity-check.patch b/patches/server/0129-Disable-crystal-portal-proximity-check.patch new file mode 100644 index 00000000..89316a94 --- /dev/null +++ b/patches/server/0129-Disable-crystal-portal-proximity-check.patch @@ -0,0 +1,64 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Bluemangoo +Date: Fri, 19 Jul 2024 15:04:03 +0800 +Subject: [PATCH] Disable crystal-portal proximity check + + +diff --git a/src/main/java/net/minecraft/world/item/EndCrystalItem.java b/src/main/java/net/minecraft/world/item/EndCrystalItem.java +index 5f51e64cb0611a4ba6bdcdcacbcba1063a7f3a5c..29c9543a1afa03b2d2864d366d526029c0f4f0d4 100644 +--- a/src/main/java/net/minecraft/world/item/EndCrystalItem.java ++++ b/src/main/java/net/minecraft/world/item/EndCrystalItem.java +@@ -30,7 +30,7 @@ public class EndCrystalItem extends Item { + if (!iblockdata.is(Blocks.OBSIDIAN) && !iblockdata.is(Blocks.BEDROCK)) { + return InteractionResult.FAIL; + } else { +- BlockPos blockposition1 = blockposition.above(); final BlockPos aboveBlockPosition = blockposition1; // Paper - OBFHELPER ++ BlockPos blockposition1 = blockposition.above(); // final BlockPos aboveBlockPosition = blockposition1; // Paper - OBFHELPER // Leaves + + if (!world.isEmptyBlock(blockposition1)) { + return InteractionResult.FAIL; +@@ -58,7 +58,8 @@ public class EndCrystalItem extends Item { + EndDragonFight enderdragonbattle = ((ServerLevel) world).getDragonFight(); + + if (enderdragonbattle != null) { +- enderdragonbattle.tryRespawn(aboveBlockPosition); // Paper - Perf: Do crystal-portal proximity check before entity lookup ++ // enderdragonbattle.tryRespawn(aboveBlockPosition); // Paper - Perf: Do crystal-portal proximity check before entity lookup ++ enderdragonbattle.tryRespawn(); // Leaves + } + } + +diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +index 478cba8137d153fe922ca7f402d306d8c12bcb31..cf76806da53ad2e34074744e97f081b37be65a10 100644 +--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java ++++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +@@ -617,12 +617,14 @@ public class EndDragonFight { + } + + public boolean tryRespawn() { // CraftBukkit - return boolean ++ /* Leaves + // Paper start - Perf: Do crystal-portal proximity check before entity lookup + return this.tryRespawn(null); + } + + public boolean tryRespawn(@Nullable BlockPos placedEndCrystalPos) { // placedEndCrystalPos is null if the tryRespawn() call was not caused by a placed end crystal + // Paper end - Perf: Do crystal-portal proximity check before entity lookup ++ */ + if (this.dragonKilled && this.respawnStage == null) { + BlockPos blockposition = this.portalLocation; + +@@ -640,6 +642,7 @@ public class EndDragonFight { + blockposition = this.portalLocation; + } + ++ /* Leaves + // Paper start - Perf: Do crystal-portal proximity check before entity lookup + if (placedEndCrystalPos != null) { + // The end crystal must be 0 or 1 higher than the portal origin +@@ -655,6 +658,7 @@ public class EndDragonFight { + } + } + // Paper end - Perf: Do crystal-portal proximity check before entity lookup ++ */ + + List list = Lists.newArrayList(); + BlockPos blockposition1 = blockposition.above(1);