From c478dbd249ba7bd91e9029e2c957e3514f5d731e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Tue, 21 Apr 2020 23:58:14 +0200 Subject: [PATCH] Backport changes --- .../fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java | 6 +++--- .../fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java index 3fd910454..4e585f2ae 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java @@ -33,6 +33,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.HashMap; import java.util.Set; import java.util.UUID; import java.util.concurrent.Callable; @@ -230,7 +231,7 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks { // Remove existing tiles { - Map tiles = nmsChunk.getTileEntities(); + Map tiles = new HashMap<>(nmsChunk.getTileEntities()); if (!tiles.isEmpty()) { for (Map.Entry entry : tiles.entrySet()) { final BlockPosition pos = entry.getKey(); @@ -243,8 +244,7 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks { } if (set.getBlock(lx, ly, lz).getOrdinal() != 0) { TileEntity tile = entry.getValue(); - tile.n(); - tile.invalidateBlockCache(); + nmsChunk.removeTileEntity(tile.getPosition()); } } } diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java index f3ef44996..4a399655d 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15/BukkitGetBlocks_1_15.java @@ -33,6 +33,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.HashMap; import java.util.Set; import java.util.UUID; import java.util.concurrent.Callable; @@ -238,7 +239,7 @@ public class BukkitGetBlocks_1_15 extends CharGetBlocks { // Remove existing tiles { - Map tiles = nmsChunk.getTileEntities(); + Map tiles = new HashMap<>(nmsChunk.getTileEntities()); if (!tiles.isEmpty()) { for (Map.Entry entry : tiles.entrySet()) { final BlockPosition pos = entry.getKey(); @@ -251,8 +252,7 @@ public class BukkitGetBlocks_1_15 extends CharGetBlocks { } if (set.getBlock(lx, ly, lz).getOrdinal() != 0) { TileEntity tile = entry.getValue(); - tile.hasWorld(); - tile.invalidateBlockCache(); + nmsChunk.removeTileEntity(tile.getPosition()); } } }