Fix scanForLegacyEnderDragon world config (#11262)

This commit is contained in:
Lulu13022002 2024-08-16 21:45:07 +02:00 committed by GitHub
parent 81bfda8710
commit 95719832bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 29 additions and 27 deletions

View file

@ -5,17 +5,19 @@ Subject: [PATCH] Add config to disable ender dragon legacy check
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 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 1a56247191172622f2bde6d799bc44f70b9ce3ae..6f9c78b124a33212125e98905efc8a09a1891500 100644 index 1a56247191172622f2bde6d799bc44f70b9ce3ae..93337fd026fefb76c8a288674fed05cb3c1eca38 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -106,6 +106,10 @@ public class EndDragonFight { @@ -116,6 +116,12 @@ public class EndDragonFight {
this.ticksSinceLastPlayerScan = 21; if (data.isRespawning) {
this.skipArenaLoadedCheck = false; this.respawnStage = DragonRespawnAnimation.START;
this.needsStateScanning = true; }
+ // Paper start - Add config to disable ender dragon legacy check + // Paper start - Add config to disable ender dragon legacy check
+ this.needsStateScanning = world.paperConfig().entities.spawning.scanForLegacyEnderDragon; + if (data == EndDragonFight.Data.DEFAULT && !world.paperConfig().entities.spawning.scanForLegacyEnderDragon) {
+ if (!this.needsStateScanning) this.dragonKilled = true; + this.needsStateScanning = false;
+ this.dragonKilled = true;
+ }
+ // Paper end - Add config to disable ender dragon legacy check + // Paper end - Add config to disable ender dragon legacy check
this.level = world;
this.origin = origin; this.portalLocation = (BlockPos) data.exitPortalLocation.orElse(null); // CraftBukkit - decompile error
this.validPlayer = EntitySelector.ENTITY_STILL_ALIVE.and(EntitySelector.withinDistance((double) origin.getX(), (double) (128 + origin.getY()), (double) origin.getZ(), 192.0D)); this.gateways.addAll((Collection) data.gateways.orElseGet(() -> {

View file

@ -11,10 +11,10 @@ This ensures the crystals/pillars are in expected state when the dragon spawns.
See #3522 See #3522
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 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 6f9c78b124a33212125e98905efc8a09a1891500..79b63082e849f29244352b9d0d6ac9b7df7813f6 100644 index 3aa4301521ea8155287ce97a9bb69fe20d9a54b7..f90d637e5477275b870c1a1963774de04aaa218d 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -472,6 +472,7 @@ public class EndDragonFight { @@ -474,6 +474,7 @@ public class EndDragonFight {
entityenderdragon.moveTo((double) this.origin.getX(), (double) (128 + this.origin.getY()), (double) this.origin.getZ(), this.level.random.nextFloat() * 360.0F, 0.0F); entityenderdragon.moveTo((double) this.origin.getX(), (double) (128 + this.origin.getY()), (double) this.origin.getZ(), this.level.random.nextFloat() * 360.0F, 0.0F);
this.level.addFreshEntity(entityenderdragon); this.level.addFreshEntity(entityenderdragon);
this.dragonUUID = entityenderdragon.getUUID(); this.dragonUUID = entityenderdragon.getUUID();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Toggle for removing existing dragon
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 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 79b63082e849f29244352b9d0d6ac9b7df7813f6..3ea0ca395e0561d96044f0f84442a08b42b539bd 100644 index f90d637e5477275b870c1a1963774de04aaa218d..943d9f84ad839562a4e30fff1257a1224d0b70b6 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -209,7 +209,7 @@ public class EndDragonFight { @@ -211,7 +211,7 @@ public class EndDragonFight {
this.dragonUUID = entityenderdragon.getUUID(); this.dragonUUID = entityenderdragon.getUUID();
EndDragonFight.LOGGER.info("Found that there's a dragon still alive ({})", entityenderdragon); EndDragonFight.LOGGER.info("Found that there's a dragon still alive ({})", entityenderdragon);
this.dragonKilled = false; this.dragonKilled = false;

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add toggle for always placing the dragon egg
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 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 3ea0ca395e0561d96044f0f84442a08b42b539bd..f81dab25fedeed08f4d3ba2d7435e2da526e6056 100644 index 943d9f84ad839562a4e30fff1257a1224d0b70b6..412838a4eb3d29da5955bf1c279f66a2e7ccad12 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -407,7 +407,7 @@ public class EndDragonFight { @@ -409,7 +409,7 @@ public class EndDragonFight {
this.dragonEvent.setVisible(false); this.dragonEvent.setVisible(false);
this.spawnExitPortal(true); this.spawnExitPortal(true);
this.spawnNewGateway(); this.spawnNewGateway();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add DragonEggFormEvent
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 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 f81dab25fedeed08f4d3ba2d7435e2da526e6056..609b20e2b222c5b1fddf22c2621d0d7a88cabcfa 100644 index 412838a4eb3d29da5955bf1c279f66a2e7ccad12..0455c5fd2bb7955a0f343468b4bea760d6d35310 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -407,8 +407,22 @@ public class EndDragonFight { @@ -409,8 +409,22 @@ public class EndDragonFight {
this.dragonEvent.setVisible(false); this.dragonEvent.setVisible(false);
this.spawnExitPortal(true); this.spawnExitPortal(true);
this.spawnNewGateway(); this.spawnNewGateway();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent softlocked end exit portal generation
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 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 609b20e2b222c5b1fddf22c2621d0d7a88cabcfa..b8bba857aa390e5435b8a199a25065a940d6a972 100644 index 0455c5fd2bb7955a0f343468b4bea760d6d35310..e5927f378789e1d8b83ca5c84d657e0e637cc575 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -466,6 +466,11 @@ public class EndDragonFight { @@ -468,6 +468,11 @@ public class EndDragonFight {
} }
} }

View file

@ -6,7 +6,7 @@ Subject: [PATCH] ensure reset EnderDragon boss event name
Fix MC-257487 Fix MC-257487
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 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 b8bba857aa390e5435b8a199a25065a940d6a972..f6f5fad52e41d5ccc37dc28c40904fce014907fb 100644 index e5927f378789e1d8b83ca5c84d657e0e637cc575..0100d3f4cb2c1d3e2e052ee109aea707029d0c10 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -73,6 +73,7 @@ public class EndDragonFight { @@ -73,6 +73,7 @@ public class EndDragonFight {
@ -26,7 +26,7 @@ index b8bba857aa390e5435b8a199a25065a940d6a972..f6f5fad52e41d5ccc37dc28c40904fce
this.gateways = new ObjectArrayList(); this.gateways = new ObjectArrayList();
this.ticksSinceLastPlayerScan = 21; this.ticksSinceLastPlayerScan = 21;
this.skipArenaLoadedCheck = false; this.skipArenaLoadedCheck = false;
@@ -503,6 +504,10 @@ public class EndDragonFight { @@ -505,6 +506,10 @@ public class EndDragonFight {
this.ticksSinceDragonSeen = 0; this.ticksSinceDragonSeen = 0;
if (dragon.hasCustomName()) { if (dragon.hasCustomName()) {
this.dragonEvent.setName(dragon.getDisplayName()); this.dragonEvent.setName(dragon.getDisplayName());

View file

@ -10,10 +10,10 @@ public net.minecraft.world.level.dimension.end.EndDragonFight respawnCrystals
public net.minecraft.world.level.dimension.end.EndDragonFight spawnNewGateway(Lnet/minecraft/core/BlockPos;)V public net.minecraft.world.level.dimension.end.EndDragonFight spawnNewGateway(Lnet/minecraft/core/BlockPos;)V
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 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 f6f5fad52e41d5ccc37dc28c40904fce014907fb..6b59c4b5906c0fb4fdbc674452c6ff3df42b099b 100644 index 0100d3f4cb2c1d3e2e052ee109aea707029d0c10..10683807a273be95a40794a7b562a15fc5dec2cc 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -439,6 +439,24 @@ public class EndDragonFight { @@ -441,6 +441,24 @@ public class EndDragonFight {
this.gateways.clear(); this.gateways.clear();
} }

View file

@ -34,10 +34,10 @@ index 273bb38f14b8af08d123e02742d365fb5d91cdf5..5f51e64cb0611a4ba6bdcdcacbcba106
} }
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 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 6b59c4b5906c0fb4fdbc674452c6ff3df42b099b..18a1b4325cac81b040596071dab99ef9bf6f3142 100644 index 10683807a273be95a40794a7b562a15fc5dec2cc..aa7e8cdcc1979397fc60a8517f2f504bce84f19f 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -558,6 +558,12 @@ public class EndDragonFight { @@ -560,6 +560,12 @@ public class EndDragonFight {
} }
public boolean tryRespawn() { // CraftBukkit - return boolean public boolean tryRespawn() { // CraftBukkit - return boolean
@ -50,7 +50,7 @@ index 6b59c4b5906c0fb4fdbc674452c6ff3df42b099b..18a1b4325cac81b040596071dab99ef9
if (this.dragonKilled && this.respawnStage == null) { if (this.dragonKilled && this.respawnStage == null) {
BlockPos blockposition = this.portalLocation; BlockPos blockposition = this.portalLocation;
@@ -575,6 +581,22 @@ public class EndDragonFight { @@ -577,6 +583,22 @@ public class EndDragonFight {
blockposition = this.portalLocation; blockposition = this.portalLocation;
} }