9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-03 22:26:12 +00:00

Disable crystal-portal proximity check (#260)

This commit is contained in:
Bluemangoo
2024-07-21 15:35:09 +08:00
committed by GitHub
parent df31300bdf
commit 103beaa773

View File

@@ -0,0 +1,64 @@
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 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<EndCrystal> list = Lists.newArrayList();
BlockPos blockposition1 = blockposition.above(1);