9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-23 17:09:26 +00:00
Files
LeavesMC/patches/server/0126-Disable-crystal-portal-proximity-check.patch
2024-10-28 19:55:43 +08:00

65 lines
3.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bluemangoo <chenfy2006@qq.com>
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 6f867139ef83ca6d1fc26f98c4d9e4b7ce689580..98b4c79b46f2ca073d92c3bbade826df8b7c9206 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
@@ -619,12 +619,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;
@@ -642,6 +644,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
@@ -657,6 +660,7 @@ public class EndDragonFight {
}
}
// Paper end - Perf: Do crystal-portal proximity check before entity lookup
+ */
List<EndCrystal> list = Lists.newArrayList();
BlockPos blockposition1 = blockposition.above(1);