13
0
geforkt von Mirrors/Paper

Do not schedule poi task for each block write on chunk gen

Most of the time optional == optional1, so we shouldn't
schedule a task for each write.
Dieser Commit ist enthalten in:
Spottedleaf 2021-04-21 20:04:42 +01:00
Ursprung ea53ec94c9
Commit e877697d29

Datei anzeigen

@ -9,23 +9,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
Optional<VillagePlaceType> optional = VillagePlaceType.b(iblockdata);
Optional<VillagePlaceType> optional1 = VillagePlaceType.b(iblockdata1);
+ // Paper start
+ BlockPosition blockposition1 = blockposition.immutableCopy();
+ this.getMinecraftServer().execute(() -> {
+ if (!optional.isPresent() && this.getPoiStorage().test(blockposition1, com.google.common.base.Predicates.alwaysTrue())) {
+ this.getPoiStorage().remove(blockposition1);
+ }
+ });
if (!Objects.equals(optional, optional1)) {
- BlockPosition blockposition1 = blockposition.immutableCopy();
+ //BlockPosition blockposition1 = blockposition.immutableCopy();
+ // Paper end
optional.ifPresent((villageplacetype) -> {
});
optional1.ifPresent((villageplacetype) -> {
this.getMinecraftServer().execute(() -> {
+ // Paper start
+ if (!optional.isPresent() && this.getPoiStorage().test(blockposition1, com.google.common.base.Predicates.alwaysTrue())) {
+ this.getPoiStorage().remove(blockposition1);
+ }
+ // Paper end
this.y().a(blockposition1, villageplacetype);
PacketDebug.a(this, blockposition1);
});
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
}