aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0617-Prevent-softlocked-end-exit-portal-generation.patch
blob: 9e8d9491cb87e273957f7b6157d408179d602968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Noah van der Aa <ndvdaa@gmail.com>
Date: Mon, 30 Aug 2021 15:22:18 +0200
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
index 460744ec3a1abe9a2d9d16c2ec521c52c7f8db95..98d1c097fdbbc8080624f365634e0812a5eea5ac 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
@@ -468,6 +468,11 @@ public class EndDragonFight {
             }
         }
 
+        // Paper start - Prevent "softlocked" exit portal generation
+        if (this.portalLocation.getY() <= this.level.getMinBuildHeight()) {
+            this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 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);