mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
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.
This commit is contained in:
parent
ea53ec94c9
commit
e877697d29
1 changed files with 10 additions and 16 deletions
|
@ -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 {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue