clone POI blockpos before dispatching

This commit is contained in:
Shane Freeder 2021-01-10 18:36:38 +00:00
parent 4768e3c4ed
commit ce8922b1d5

View file

@ -25,24 +25,28 @@ index b926cebd053bef829517c9d9bbf1c609c23ca04a..6a0f07b13eef5560dfc7c7b39618c0b8
return (Boolean) this.d(SectionPosition.a(blockposition).s()).map((villageplacesection) -> { return (Boolean) this.d(SectionPosition.a(blockposition).s()).map((villageplacesection) -> {
return villageplacesection.a(blockposition, predicate); return villageplacesection.a(blockposition, predicate);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 5b0b6edfa790918e56399ff6c83f3feb6e5aca49..b033ff44373ec87702946c3cefe664fb46d609f4 100644 index 5b0b6edfa790918e56399ff6c83f3feb6e5aca49..9c50357bb5da309b7cad74fdee15697a20e2e15f 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1942,6 +1942,13 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -1942,8 +1942,16 @@ public class WorldServer extends World implements GeneratorAccessSeed {
Optional<VillagePlaceType> optional = VillagePlaceType.b(iblockdata); Optional<VillagePlaceType> optional = VillagePlaceType.b(iblockdata);
Optional<VillagePlaceType> optional1 = VillagePlaceType.b(iblockdata1); Optional<VillagePlaceType> optional1 = VillagePlaceType.b(iblockdata1);
+ // Paper start + // Paper start
+ BlockPosition blockposition1 = blockposition.immutableCopy();
+ this.getMinecraftServer().execute(() -> { + this.getMinecraftServer().execute(() -> {
+ if (!optional.isPresent() && this.getPoiStorage().test(blockposition, com.google.common.base.Predicates.alwaysTrue())) { + if (!optional.isPresent() && this.getPoiStorage().test(blockposition1, com.google.common.base.Predicates.alwaysTrue())) {
+ this.getPoiStorage().remove(blockposition); + this.getPoiStorage().remove(blockposition1);
+ } + }
+ }); + });
+ // Paper end
if (!Objects.equals(optional, optional1)) { if (!Objects.equals(optional, optional1)) {
BlockPosition blockposition1 = blockposition.immutableCopy(); - BlockPosition blockposition1 = blockposition.immutableCopy();
+ //BlockPosition blockposition1 = blockposition.immutableCopy();
+ // Paper end
@@ -1960,6 +1967,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { optional.ifPresent((villageplacetype) -> {
this.getMinecraftServer().execute(() -> {
@@ -1960,6 +1968,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
} }
} }