aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0416-Fix-nether-portal-creation.patch
blob: da0e5cf07115e04592bb34dd58fc2c501348f4c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 7c8a99570d2da9d5839045ba2d0e35eb44c74171 Mon Sep 17 00:00:00 2001
From: Michael Himing <mhiming@gmail.com>
Date: Mon, 9 Sep 2019 13:21:17 +1000
Subject: [PATCH] Fix nether portal creation


diff --git a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
index 88fbfc01b..f66f8b323 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
@@ -38,6 +38,11 @@ public class BlockStateListPopulator extends DummyGeneratorAccess {
 
     @Override
     public boolean setTypeAndData(BlockPosition position, IBlockData data, int flag) {
+        // Paper start
+        // When a LinkedHashMap entry is overwritten, it keeps its old position. Removing the entry here before adding
+        // a new one ensures that the nether portal blocks are placed last and are not destroyed by physics.
+        list.remove(position);
+        // Paper end
         CraftBlockState state = CraftBlockState.getBlockState(world, position, flag);
         state.setData(data);
         list.put(position, state);
-- 
2.23.0.windows.1