|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Bluemangoo < [email protected]> |
| 3 | +Date: Fri, 19 Jul 2024 15:04:03 +0800 |
| 4 | +Subject: [PATCH] Disable crystal-portal proximity check |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/src/main/java/net/minecraft/world/item/EndCrystalItem.java b/src/main/java/net/minecraft/world/item/EndCrystalItem.java |
| 8 | +index 5f51e64cb0611a4ba6bdcdcacbcba1063a7f3a5c..29c9543a1afa03b2d2864d366d526029c0f4f0d4 100644 |
| 9 | +--- a/src/main/java/net/minecraft/world/item/EndCrystalItem.java |
| 10 | ++++ b/src/main/java/net/minecraft/world/item/EndCrystalItem.java |
| 11 | +@@ -30,7 +30,7 @@ public class EndCrystalItem extends Item { |
| 12 | + if (!iblockdata.is(Blocks.OBSIDIAN) && !iblockdata.is(Blocks.BEDROCK)) { |
| 13 | + return InteractionResult.FAIL; |
| 14 | + } else { |
| 15 | +- BlockPos blockposition1 = blockposition.above(); final BlockPos aboveBlockPosition = blockposition1; // Paper - OBFHELPER |
| 16 | ++ BlockPos blockposition1 = blockposition.above(); // final BlockPos aboveBlockPosition = blockposition1; // Paper - OBFHELPER // Leaves |
| 17 | + |
| 18 | + if (!world.isEmptyBlock(blockposition1)) { |
| 19 | + return InteractionResult.FAIL; |
| 20 | +@@ -58,7 +58,8 @@ public class EndCrystalItem extends Item { |
| 21 | + EndDragonFight enderdragonbattle = ((ServerLevel) world).getDragonFight(); |
| 22 | + |
| 23 | + if (enderdragonbattle != null) { |
| 24 | +- enderdragonbattle.tryRespawn(aboveBlockPosition); // Paper - Perf: Do crystal-portal proximity check before entity lookup |
| 25 | ++ // enderdragonbattle.tryRespawn(aboveBlockPosition); // Paper - Perf: Do crystal-portal proximity check before entity lookup |
| 26 | ++ enderdragonbattle.tryRespawn(); // Leaves |
| 27 | + } |
| 28 | + } |
| 29 | + |
| 30 | +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 |
| 31 | +index 478cba8137d153fe922ca7f402d306d8c12bcb31..cf76806da53ad2e34074744e97f081b37be65a10 100644 |
| 32 | +--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java |
| 33 | ++++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java |
| 34 | +@@ -617,12 +617,14 @@ public class EndDragonFight { |
| 35 | + } |
| 36 | + |
| 37 | + public boolean tryRespawn() { // CraftBukkit - return boolean |
| 38 | ++ /* Leaves |
| 39 | + // Paper start - Perf: Do crystal-portal proximity check before entity lookup |
| 40 | + return this.tryRespawn(null); |
| 41 | + } |
| 42 | + |
| 43 | + public boolean tryRespawn(@Nullable BlockPos placedEndCrystalPos) { // placedEndCrystalPos is null if the tryRespawn() call was not caused by a placed end crystal |
| 44 | + // Paper end - Perf: Do crystal-portal proximity check before entity lookup |
| 45 | ++ */ |
| 46 | + if (this.dragonKilled && this.respawnStage == null) { |
| 47 | + BlockPos blockposition = this.portalLocation; |
| 48 | + |
| 49 | +@@ -640,6 +642,7 @@ public class EndDragonFight { |
| 50 | + blockposition = this.portalLocation; |
| 51 | + } |
| 52 | + |
| 53 | ++ /* Leaves |
| 54 | + // Paper start - Perf: Do crystal-portal proximity check before entity lookup |
| 55 | + if (placedEndCrystalPos != null) { |
| 56 | + // The end crystal must be 0 or 1 higher than the portal origin |
| 57 | +@@ -655,6 +658,7 @@ public class EndDragonFight { |
| 58 | + } |
| 59 | + } |
| 60 | + // Paper end - Perf: Do crystal-portal proximity check before entity lookup |
| 61 | ++ */ |
| 62 | + |
| 63 | + List<EndCrystal> list = Lists.newArrayList(); |
| 64 | + BlockPos blockposition1 = blockposition.above(1); |
0 commit comments