From f911fd488006ee117d1063558d1907f0237f030e Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Mon, 30 Aug 2021 15:22:18 +0200 Subject: [PATCH] Prevent softlocked end exit portal generation --- .../dimension/end/EndDragonFight.java.patch | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/dimension/end/EndDragonFight.java.patch b/paper-server/patches/sources/net/minecraft/world/level/dimension/end/EndDragonFight.java.patch index 20092ff84c..c6f337107c 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/dimension/end/EndDragonFight.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/dimension/end/EndDragonFight.java.patch @@ -61,7 +61,19 @@ this.previouslyKilled = true; this.dragonKilled = true; -@@ -469,6 +489,7 @@ +@@ -449,6 +469,11 @@ + } + } + ++ // Paper start - Prevent "softlocked" exit portal generation ++ if (this.portalLocation.getY() <= this.level.getMinY()) { ++ this.portalLocation = this.portalLocation.atY(this.level.getMinY() + 1); ++ } ++ // Paper end - Prevent "softlocked" exit portal generation + if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation)) { + int i = Mth.positiveCeilDiv(4, 16); + +@@ -469,6 +494,7 @@ 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.dragonUUID = entityenderdragon.getUUID(); @@ -69,7 +81,7 @@ } return entityenderdragon; -@@ -513,7 +534,7 @@ +@@ -513,7 +539,7 @@ return this.previouslyKilled; } @@ -78,7 +90,7 @@ if (this.dragonKilled && this.respawnStage == null) { BlockPos blockposition = this.portalLocation; -@@ -540,19 +561,19 @@ +@@ -540,19 +566,19 @@ List list1 = this.level.getEntitiesOfClass(EndCrystal.class, new AABB(blockposition1.relative(enumdirection, 2))); if (list1.isEmpty()) { @@ -102,7 +114,7 @@ if (this.dragonKilled && this.respawnStage == null) { for (BlockPattern.BlockPatternMatch shapedetector_shapedetectorcollection = this.findExitPortal(); shapedetector_shapedetectorcollection != null; shapedetector_shapedetectorcollection = this.findExitPortal()) { for (int i = 0; i < this.exitPortalPattern.getWidth(); ++i) { -@@ -571,9 +592,10 @@ +@@ -571,9 +597,10 @@ this.respawnStage = DragonRespawnAnimation.START; this.respawnTime = 0; this.spawnExitPortal(false);