|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
From ceadc0a597e9b877a7aff87457e7baf8b2166195 Mon Sep 17 00:00:00 2001
|
|
|
|
From 0dbe7794dec5145f2eb0cdea358bdd30de37a8aa Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
Date: Fri, 14 Dec 2018 21:53:58 -0800
|
|
|
|
Date: Fri, 14 Dec 2018 21:53:58 -0800
|
|
|
|
Subject: [PATCH] Tuinity Server Patches
|
|
|
|
Subject: [PATCH] Tuinity Server Patches
|
|
|
|
@@ -34,11 +34,10 @@ Subject: [PATCH] Tuinity Server Patches
|
|
|
|
.../tuinity/util/set/LinkedSortedSet.java | 142 +++
|
|
|
|
.../tuinity/util/set/LinkedSortedSet.java | 142 +++
|
|
|
|
.../net/minecraft/server/ArraySetSorted.java | 41 +-
|
|
|
|
.../net/minecraft/server/ArraySetSorted.java | 41 +-
|
|
|
|
.../net/minecraft/server/AxisAlignedBB.java | 2 +
|
|
|
|
.../net/minecraft/server/AxisAlignedBB.java | 2 +
|
|
|
|
.../net/minecraft/server/BlockPosition.java | 1 +
|
|
|
|
|
|
|
|
src/main/java/net/minecraft/server/Chunk.java | 135 +++
|
|
|
|
src/main/java/net/minecraft/server/Chunk.java | 135 +++
|
|
|
|
.../java/net/minecraft/server/ChunkMap.java | 15 +-
|
|
|
|
.../java/net/minecraft/server/ChunkMap.java | 15 +-
|
|
|
|
.../minecraft/server/ChunkMapDistance.java | 387 ++++++-
|
|
|
|
.../minecraft/server/ChunkMapDistance.java | 387 ++++++-
|
|
|
|
.../minecraft/server/ChunkProviderServer.java | 187 +++-
|
|
|
|
.../minecraft/server/ChunkProviderServer.java | 182 +++-
|
|
|
|
.../minecraft/server/ChunkRegionLoader.java | 12 +-
|
|
|
|
.../minecraft/server/ChunkRegionLoader.java | 12 +-
|
|
|
|
.../net/minecraft/server/ChunkStatus.java | 5 +-
|
|
|
|
.../net/minecraft/server/ChunkStatus.java | 5 +-
|
|
|
|
.../net/minecraft/server/DedicatedServer.java | 3 +-
|
|
|
|
.../net/minecraft/server/DedicatedServer.java | 3 +-
|
|
|
|
@@ -65,7 +64,6 @@ Subject: [PATCH] Tuinity Server Patches
|
|
|
|
.../net/minecraft/server/NBTTagCompound.java | 2 +-
|
|
|
|
.../net/minecraft/server/NBTTagCompound.java | 2 +-
|
|
|
|
.../minecraft/server/NavigationAbstract.java | 24 +-
|
|
|
|
.../minecraft/server/NavigationAbstract.java | 24 +-
|
|
|
|
.../net/minecraft/server/NetworkManager.java | 36 +-
|
|
|
|
.../net/minecraft/server/NetworkManager.java | 36 +-
|
|
|
|
.../minecraft/server/NextTickListEntry.java | 41 +-
|
|
|
|
|
|
|
|
.../server/PacketPlayOutMapChunk.java | 15 +-
|
|
|
|
.../server/PacketPlayOutMapChunk.java | 15 +-
|
|
|
|
.../net/minecraft/server/PairedQueue.java | 44 +-
|
|
|
|
.../net/minecraft/server/PairedQueue.java | 44 +-
|
|
|
|
.../net/minecraft/server/PathfinderGoal.java | 15 +-
|
|
|
|
.../net/minecraft/server/PathfinderGoal.java | 15 +-
|
|
|
|
@@ -73,7 +71,7 @@ Subject: [PATCH] Tuinity Server Patches
|
|
|
|
.../server/PathfinderGoalWrapped.java | 6 +-
|
|
|
|
.../server/PathfinderGoalWrapped.java | 6 +-
|
|
|
|
.../minecraft/server/PathfinderNormal.java | 4 +-
|
|
|
|
.../minecraft/server/PathfinderNormal.java | 4 +-
|
|
|
|
.../server/PathfinderTargetCondition.java | 1 +
|
|
|
|
.../server/PathfinderTargetCondition.java | 1 +
|
|
|
|
.../net/minecraft/server/PlayerChunk.java | 99 +-
|
|
|
|
.../net/minecraft/server/PlayerChunk.java | 97 +-
|
|
|
|
.../net/minecraft/server/PlayerChunkMap.java | 995 +++++++++++++++---
|
|
|
|
.../net/minecraft/server/PlayerChunkMap.java | 995 +++++++++++++++---
|
|
|
|
.../server/PlayerInteractManager.java | 45 +-
|
|
|
|
.../server/PlayerInteractManager.java | 45 +-
|
|
|
|
.../net/minecraft/server/PlayerInventory.java | 6 +-
|
|
|
|
.../net/minecraft/server/PlayerInventory.java | 6 +-
|
|
|
|
@@ -83,9 +81,7 @@ Subject: [PATCH] Tuinity Server Patches
|
|
|
|
.../minecraft/server/RegionFileBitSet.java | 26 +-
|
|
|
|
.../minecraft/server/RegionFileBitSet.java | 26 +-
|
|
|
|
.../net/minecraft/server/RegionFileCache.java | 45 +-
|
|
|
|
.../net/minecraft/server/RegionFileCache.java | 45 +-
|
|
|
|
.../server/RegionFileCompression.java | 7 +-
|
|
|
|
.../server/RegionFileCompression.java | 7 +-
|
|
|
|
.../server/StructureBoundingBox.java | 14 +-
|
|
|
|
|
|
|
|
.../net/minecraft/server/ThreadedMailbox.java | 2 +-
|
|
|
|
.../net/minecraft/server/ThreadedMailbox.java | 2 +-
|
|
|
|
.../net/minecraft/server/TickListServer.java | 51 +
|
|
|
|
|
|
|
|
.../java/net/minecraft/server/Ticket.java | 6 +-
|
|
|
|
.../java/net/minecraft/server/Ticket.java | 6 +-
|
|
|
|
.../java/net/minecraft/server/TicketType.java | 1 +
|
|
|
|
.../java/net/minecraft/server/TicketType.java | 1 +
|
|
|
|
.../net/minecraft/server/VoxelShapeArray.java | 2 +-
|
|
|
|
.../net/minecraft/server/VoxelShapeArray.java | 2 +-
|
|
|
|
@@ -93,7 +89,7 @@ Subject: [PATCH] Tuinity Server Patches
|
|
|
|
.../server/VoxelShapeMergerList.java | 2 +-
|
|
|
|
.../server/VoxelShapeMergerList.java | 2 +-
|
|
|
|
.../net/minecraft/server/VoxelShapes.java | 2 +-
|
|
|
|
.../net/minecraft/server/VoxelShapes.java | 2 +-
|
|
|
|
src/main/java/net/minecraft/server/World.java | 23 +-
|
|
|
|
src/main/java/net/minecraft/server/World.java | 23 +-
|
|
|
|
.../net/minecraft/server/WorldServer.java | 471 ++++++++-
|
|
|
|
.../net/minecraft/server/WorldServer.java | 461 +++++++-
|
|
|
|
.../net/minecraft/server/WorldUpgrader.java | 2 +-
|
|
|
|
.../net/minecraft/server/WorldUpgrader.java | 2 +-
|
|
|
|
.../org/bukkit/craftbukkit/CraftServer.java | 7 +-
|
|
|
|
.../org/bukkit/craftbukkit/CraftServer.java | 7 +-
|
|
|
|
.../org/bukkit/craftbukkit/CraftWorld.java | 67 +-
|
|
|
|
.../org/bukkit/craftbukkit/CraftWorld.java | 67 +-
|
|
|
|
@@ -102,7 +98,7 @@ Subject: [PATCH] Tuinity Server Patches
|
|
|
|
.../craftbukkit/entity/CraftPlayer.java | 37 +-
|
|
|
|
.../craftbukkit/entity/CraftPlayer.java | 37 +-
|
|
|
|
.../java/org/spigotmc/ActivationRange.java | 41 +-
|
|
|
|
.../java/org/spigotmc/ActivationRange.java | 41 +-
|
|
|
|
src/main/java/org/spigotmc/AsyncCatcher.java | 2 +-
|
|
|
|
src/main/java/org/spigotmc/AsyncCatcher.java | 2 +-
|
|
|
|
98 files changed, 7068 insertions(+), 500 deletions(-)
|
|
|
|
94 files changed, 6965 insertions(+), 479 deletions(-)
|
|
|
|
create mode 100644 src/main/java/com/tuinity/tuinity/chunk/ChunkRegionManager.java
|
|
|
|
create mode 100644 src/main/java/com/tuinity/tuinity/chunk/ChunkRegionManager.java
|
|
|
|
create mode 100644 src/main/java/com/tuinity/tuinity/chunk/QueuedChangesMapLong2Int.java
|
|
|
|
create mode 100644 src/main/java/com/tuinity/tuinity/chunk/QueuedChangesMapLong2Int.java
|
|
|
|
create mode 100644 src/main/java/com/tuinity/tuinity/chunk/QueuedChangesMapLong2Object.java
|
|
|
|
create mode 100644 src/main/java/com/tuinity/tuinity/chunk/QueuedChangesMapLong2Object.java
|
|
|
|
@@ -173,7 +169,7 @@ index a7ee9396a0..90ca354c46 100644
|
|
|
|
<!-- we need our custom version as it fixes some bugs on case sensitive file systems -->
|
|
|
|
<!-- we need our custom version as it fixes some bugs on case sensitive file systems -->
|
|
|
|
<dependency>
|
|
|
|
<dependency>
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
|
|
|
index 132397b3f3..4e12f416f9 100644
|
|
|
|
index dfe92780ad..c088cf51ff 100644
|
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
|
|
|
@@ -215,7 +215,7 @@ public class PaperCommand extends Command {
|
|
|
|
@@ -215,7 +215,7 @@ public class PaperCommand extends Command {
|
|
|
|
@@ -4163,20 +4159,8 @@ index c950139c0f..1a3234bb47 100644
|
|
|
|
public boolean e(double d0, double d1, double d2) {
|
|
|
|
public boolean e(double d0, double d1, double d2) {
|
|
|
|
return d0 >= this.minX && d0 < this.maxX && d1 >= this.minY && d1 < this.maxY && d2 >= this.minZ && d2 < this.maxZ;
|
|
|
|
return d0 >= this.minX && d0 < this.maxX && d1 >= this.minY && d1 < this.maxY && d2 >= this.minZ && d2 < this.maxZ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
|
|
|
|
|
|
|
index e650a2e48d..83c5c83292 100644
|
|
|
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
|
|
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
|
|
|
|
|
|
|
@@ -125,6 +125,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
|
|
|
|
|
|
|
return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ public final BlockPosition add(BaseBlockPosition baseblockposition) { return this.a(baseblockposition); } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
public BlockPosition a(BaseBlockPosition baseblockposition) {
|
|
|
|
|
|
|
|
return this.b(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
index 92065fe029..4b0e3e9053 100644
|
|
|
|
index 07073af991..8b8e1d900e 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
@@ -162,6 +162,94 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -162,6 +162,94 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -4274,7 +4258,7 @@ index 92065fe029..4b0e3e9053 100644
|
|
|
|
public Chunk(World world, ProtoChunk protochunk) {
|
|
|
|
public Chunk(World world, ProtoChunk protochunk) {
|
|
|
|
this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null);
|
|
|
|
this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null);
|
|
|
|
Iterator iterator = protochunk.y().iterator();
|
|
|
|
Iterator iterator = protochunk.y().iterator();
|
|
|
|
@@ -407,6 +495,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -411,6 +499,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void a(Entity entity) {
|
|
|
|
public void a(Entity entity) {
|
|
|
|
@@ -4282,7 +4266,7 @@ index 92065fe029..4b0e3e9053 100644
|
|
|
|
this.q = true;
|
|
|
|
this.q = true;
|
|
|
|
int i = MathHelper.floor(entity.locX() / 16.0D);
|
|
|
|
int i = MathHelper.floor(entity.locX() / 16.0D);
|
|
|
|
int j = MathHelper.floor(entity.locZ() / 16.0D);
|
|
|
|
int j = MathHelper.floor(entity.locZ() / 16.0D);
|
|
|
|
@@ -476,6 +565,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -480,6 +569,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void a(Entity entity, int i) {
|
|
|
|
public void a(Entity entity, int i) {
|
|
|
|
@@ -4290,7 +4274,7 @@ index 92065fe029..4b0e3e9053 100644
|
|
|
|
if (i < 0) {
|
|
|
|
if (i < 0) {
|
|
|
|
i = 0;
|
|
|
|
i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -508,6 +598,12 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -512,6 +602,12 @@ public class Chunk implements IChunkAccess {
|
|
|
|
return ((HeightMap) this.heightMap.get(heightmap_type)).a(i & 15, j & 15) - 1;
|
|
|
|
return ((HeightMap) this.heightMap.get(heightmap_type)).a(i & 15, j & 15) - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -4303,7 +4287,7 @@ index 92065fe029..4b0e3e9053 100644
|
|
|
|
@Nullable
|
|
|
|
@Nullable
|
|
|
|
private TileEntity j(BlockPosition blockposition) {
|
|
|
|
private TileEntity j(BlockPosition blockposition) {
|
|
|
|
IBlockData iblockdata = this.getType(blockposition);
|
|
|
|
IBlockData iblockdata = this.getType(blockposition);
|
|
|
|
@@ -649,6 +745,25 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -653,6 +749,25 @@ public class Chunk implements IChunkAccess {
|
|
|
|
|
|
|
|
|
|
|
|
// CraftBukkit start
|
|
|
|
// CraftBukkit start
|
|
|
|
public void loadCallback() {
|
|
|
|
public void loadCallback() {
|
|
|
|
@@ -4329,7 +4313,7 @@ index 92065fe029..4b0e3e9053 100644
|
|
|
|
org.bukkit.Server server = this.world.getServer();
|
|
|
|
org.bukkit.Server server = this.world.getServer();
|
|
|
|
((WorldServer)this.world).getChunkProvider().addLoadedChunk(this); // Paper
|
|
|
|
((WorldServer)this.world).getChunkProvider().addLoadedChunk(this); // Paper
|
|
|
|
if (server != null) {
|
|
|
|
if (server != null) {
|
|
|
|
@@ -692,6 +807,23 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -696,6 +811,23 @@ public class Chunk implements IChunkAccess {
|
|
|
|
// note: saving can be prevented, but not forced if no saving is actually required
|
|
|
|
// note: saving can be prevented, but not forced if no saving is actually required
|
|
|
|
this.mustNotSave = !unloadEvent.isSaveChunk();
|
|
|
|
this.mustNotSave = !unloadEvent.isSaveChunk();
|
|
|
|
((WorldServer)this.world).getChunkProvider().removeLoadedChunk(this); // Paper
|
|
|
|
((WorldServer)this.world).getChunkProvider().removeLoadedChunk(this); // Paper
|
|
|
|
@@ -4353,7 +4337,7 @@ index 92065fe029..4b0e3e9053 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
|
|
|
|
@@ -700,6 +832,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -704,6 +836,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void a(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List<Entity> list, @Nullable Predicate<? super Entity> predicate) {
|
|
|
|
public void a(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List<Entity> list, @Nullable Predicate<? super Entity> predicate) {
|
|
|
|
@@ -4361,7 +4345,7 @@ index 92065fe029..4b0e3e9053 100644
|
|
|
|
int i = MathHelper.floor((axisalignedbb.minY - 2.0D) / 16.0D);
|
|
|
|
int i = MathHelper.floor((axisalignedbb.minY - 2.0D) / 16.0D);
|
|
|
|
int j = MathHelper.floor((axisalignedbb.maxY + 2.0D) / 16.0D);
|
|
|
|
int j = MathHelper.floor((axisalignedbb.maxY + 2.0D) / 16.0D);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -739,6 +872,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -743,6 +876,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public <T extends Entity> void a(@Nullable EntityTypes<?> entitytypes, AxisAlignedBB axisalignedbb, List<? super T> list, Predicate<? super T> predicate) {
|
|
|
|
public <T extends Entity> void a(@Nullable EntityTypes<?> entitytypes, AxisAlignedBB axisalignedbb, List<? super T> list, Predicate<? super T> predicate) {
|
|
|
|
@@ -4369,7 +4353,7 @@ index 92065fe029..4b0e3e9053 100644
|
|
|
|
int i = MathHelper.floor((axisalignedbb.minY - 2.0D) / 16.0D);
|
|
|
|
int i = MathHelper.floor((axisalignedbb.minY - 2.0D) / 16.0D);
|
|
|
|
int j = MathHelper.floor((axisalignedbb.maxY + 2.0D) / 16.0D);
|
|
|
|
int j = MathHelper.floor((axisalignedbb.maxY + 2.0D) / 16.0D);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -761,6 +895,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
@@ -765,6 +899,7 @@ public class Chunk implements IChunkAccess {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public <T extends Entity> void a(Class<? extends T> oclass, AxisAlignedBB axisalignedbb, List<T> list, @Nullable Predicate<? super T> predicate) {
|
|
|
|
public <T extends Entity> void a(Class<? extends T> oclass, AxisAlignedBB axisalignedbb, List<T> list, @Nullable Predicate<? super T> predicate) {
|
|
|
|
@@ -4949,23 +4933,18 @@ index 73d1570765..cb2e67d159 100644
|
|
|
|
|
|
|
|
|
|
|
|
protected b(int i) {
|
|
|
|
protected b(int i) {
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
index cf9021d605..2294db2e6d 100644
|
|
|
|
index 82168b6ae8..ac18399551 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
@@ -119,6 +119,12 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -126,7 +126,6 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Paper
|
|
|
|
// Paper end - rewrite ticklistserver
|
|
|
|
|
|
|
|
|
|
|
|
+ // Tuinity start - rewrite ticklistserver
|
|
|
|
|
|
|
|
+ public final boolean isTickingReadyMainThread(BlockPosition pos) {
|
|
|
|
|
|
|
|
+ PlayerChunk chunk = this.playerChunkMap.chunkMap.getUpdating(com.tuinity.tuinity.util.Util.getCoordinateKey(pos));
|
|
|
|
|
|
|
|
+ return chunk != null && chunk.isTickingReady();
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ // Tuinity end - rewrite ticklistserver
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
public ChunkProviderServer(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator<?> chunkgenerator, int i, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier) {
|
|
|
|
public ChunkProviderServer(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator<?> chunkgenerator, int i, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier) {
|
|
|
|
this.world = worldserver;
|
|
|
|
this.world = worldserver;
|
|
|
|
@@ -308,7 +314,16 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
this.serverThreadQueue = new ChunkProviderServer.a(worldserver);
|
|
|
|
|
|
|
|
@@ -315,7 +314,16 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void bringToStatusAsync(int x, int z, ChunkCoordIntPair chunkPos, ChunkStatus status, java.util.function.Consumer<IChunkAccess> onComplete) {
|
|
|
|
private void bringToStatusAsync(int x, int z, ChunkCoordIntPair chunkPos, ChunkStatus status, java.util.function.Consumer<IChunkAccess> onComplete) {
|
|
|
|
@@ -4983,7 +4962,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
Long identifier = Long.valueOf(this.asyncLoadSeqCounter++);
|
|
|
|
Long identifier = Long.valueOf(this.asyncLoadSeqCounter++);
|
|
|
|
int ticketLevel = MCUtil.getTicketLevelFor(status);
|
|
|
|
int ticketLevel = MCUtil.getTicketLevelFor(status);
|
|
|
|
this.addTicketAtLevel(TicketType.ASYNC_LOAD, chunkPos, ticketLevel, identifier);
|
|
|
|
this.addTicketAtLevel(TicketType.ASYNC_LOAD, chunkPos, ticketLevel, identifier);
|
|
|
|
@@ -350,9 +365,18 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -357,9 +365,18 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) {
|
|
|
|
public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) {
|
|
|
|
final int x = i; final int z = j; // Paper - conflict on variable change
|
|
|
|
final int x = i; final int z = j; // Paper - conflict on variable change
|
|
|
|
if (Thread.currentThread() != this.serverThread) {
|
|
|
|
if (Thread.currentThread() != this.serverThread) {
|
|
|
|
@@ -5005,7 +4984,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// Paper start - optimise for loaded chunks
|
|
|
|
// Paper start - optimise for loaded chunks
|
|
|
|
Chunk ifLoaded = this.getChunkAtIfLoadedMainThread(i, j);
|
|
|
|
Chunk ifLoaded = this.getChunkAtIfLoadedMainThread(i, j);
|
|
|
|
@@ -384,6 +408,19 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -391,6 +408,19 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
this.world.asyncChunkTaskManager.raisePriority(x, z, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY);
|
|
|
|
this.world.asyncChunkTaskManager.raisePriority(x, z, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY);
|
|
|
|
com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.world, x, z);
|
|
|
|
com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.world, x, z);
|
|
|
|
// Paper end
|
|
|
|
// Paper end
|
|
|
|
@@ -5025,10 +5004,10 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.world, x, z); // Paper - sync load info
|
|
|
|
com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.world, x, z); // Paper - sync load info
|
|
|
|
this.world.timings.chunkAwait.startTiming(); // Paper
|
|
|
|
this.world.timings.chunkAwait.startTiming(); // Paper
|
|
|
|
this.serverThreadQueue.awaitTasks(completablefuture::isDone);
|
|
|
|
this.serverThreadQueue.awaitTasks(completablefuture::isDone);
|
|
|
|
@@ -513,27 +550,39 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -520,27 +550,39 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public final boolean isInEntityTickingChunk(Entity entity) { return this.a(entity); } // Paper - OBFHELPER
|
|
|
|
public boolean a(Entity entity) {
|
|
|
|
@Override public boolean a(Entity entity) {
|
|
|
|
- long i = ChunkCoordIntPair.pair(MathHelper.floor(entity.locX()) >> 4, MathHelper.floor(entity.locZ()) >> 4);
|
|
|
|
- long i = ChunkCoordIntPair.pair(MathHelper.floor(entity.locX()) >> 4, MathHelper.floor(entity.locZ()) >> 4);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- return this.a(i, PlayerChunk::b);
|
|
|
|
- return this.a(i, PlayerChunk::b);
|
|
|
|
@@ -5039,8 +5018,8 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
+ // Tuinity end - optimize is ticking ready type functions
|
|
|
|
+ // Tuinity end - optimize is ticking ready type functions
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public final boolean isEntityTickingChunk(ChunkCoordIntPair chunkcoordintpair) { return this.a(chunkcoordintpair); } // Paper - OBFHELPER
|
|
|
|
public boolean a(ChunkCoordIntPair chunkcoordintpair) {
|
|
|
|
@Override public boolean a(ChunkCoordIntPair chunkcoordintpair) {
|
|
|
|
- return this.a(chunkcoordintpair.pair(), PlayerChunk::b);
|
|
|
|
- return this.a(chunkcoordintpair.pair(), PlayerChunk::b);
|
|
|
|
+ // Tuinity start - optimize is ticking ready type functions
|
|
|
|
+ // Tuinity start - optimize is ticking ready type functions
|
|
|
|
+ // is entity ticking ready
|
|
|
|
+ // is entity ticking ready
|
|
|
|
@@ -5077,7 +5056,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private boolean a(long i, Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>> function) {
|
|
|
|
private boolean a(long i, Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>> function) {
|
|
|
|
@@ -597,6 +646,11 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -604,6 +646,11 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
this.chunkMapDistance.purgeTickets();
|
|
|
|
this.chunkMapDistance.purgeTickets();
|
|
|
|
this.tickDistanceManager();
|
|
|
|
this.tickDistanceManager();
|
|
|
|
this.world.timings.doChunkMap.stopTiming(); // Spigot
|
|
|
|
this.world.timings.doChunkMap.stopTiming(); // Spigot
|
|
|
|
@@ -5089,7 +5068,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
this.world.getMethodProfiler().exitEnter("chunks");
|
|
|
|
this.world.getMethodProfiler().exitEnter("chunks");
|
|
|
|
this.world.timings.chunks.startTiming(); // Paper - timings
|
|
|
|
this.world.timings.chunks.startTiming(); // Paper - timings
|
|
|
|
this.tickChunks();
|
|
|
|
this.tickChunks();
|
|
|
|
@@ -609,6 +663,12 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -616,6 +663,12 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
this.clearCache();
|
|
|
|
this.clearCache();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -5102,7 +5081,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
private void tickChunks() {
|
|
|
|
private void tickChunks() {
|
|
|
|
long i = this.world.getTime();
|
|
|
|
long i = this.world.getTime();
|
|
|
|
long j = i - this.lastTickTime;
|
|
|
|
long j = i - this.lastTickTime;
|
|
|
|
@@ -619,6 +679,36 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -626,6 +679,36 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
boolean flag1 = this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && !world.getPlayers().isEmpty(); // CraftBukkit
|
|
|
|
boolean flag1 = this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && !world.getPlayers().isEmpty(); // CraftBukkit
|
|
|
|
|
|
|
|
|
|
|
|
if (!flag) {
|
|
|
|
if (!flag) {
|
|
|
|
@@ -5139,7 +5118,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
this.world.getMethodProfiler().enter("pollingChunks");
|
|
|
|
this.world.getMethodProfiler().enter("pollingChunks");
|
|
|
|
int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED);
|
|
|
|
int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED);
|
|
|
|
BlockPosition blockposition = this.world.getSpawn();
|
|
|
|
BlockPosition blockposition = this.world.getSpawn();
|
|
|
|
@@ -636,11 +726,10 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -643,11 +726,10 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values();
|
|
|
|
EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values();
|
|
|
|
// Paper start - per player mob spawning
|
|
|
|
// Paper start - per player mob spawning
|
|
|
|
int[] worldMobCount;
|
|
|
|
int[] worldMobCount;
|
|
|
|
@@ -5154,7 +5133,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
// re-set mob counts
|
|
|
|
// re-set mob counts
|
|
|
|
for (EntityPlayer player : this.world.players) {
|
|
|
|
for (EntityPlayer player : this.world.players) {
|
|
|
|
Arrays.fill(player.mobCounts, 0);
|
|
|
|
Arrays.fill(player.mobCounts, 0);
|
|
|
|
@@ -653,20 +742,13 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -660,20 +742,13 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
|
|
|
|
|
|
|
|
this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings
|
|
|
|
this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings
|
|
|
|
this.world.getMethodProfiler().exit();
|
|
|
|
this.world.getMethodProfiler().exit();
|
|
|
|
@@ -5182,7 +5161,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
|
|
|
|
|
|
|
|
this.world.getMethodProfiler().enter("broadcast");
|
|
|
|
this.world.getMethodProfiler().enter("broadcast");
|
|
|
|
this.world.timings.broadcastChunkUpdates.startTiming(); // Paper - timings
|
|
|
|
this.world.timings.broadcastChunkUpdates.startTiming(); // Paper - timings
|
|
|
|
@@ -676,10 +758,10 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -683,10 +758,10 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
|
|
|
|
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
|
|
|
|
|
|
|
|
|
|
|
|
this.world.timings.chunkInhibitedRangeCheck.startTiming();
|
|
|
|
this.world.timings.chunkInhibitedRangeCheck.startTiming();
|
|
|
|
@@ -5195,7 +5174,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
this.world.getMethodProfiler().enter("spawner");
|
|
|
|
this.world.getMethodProfiler().enter("spawner");
|
|
|
|
this.world.timings.mobSpawn.startTiming(); // Spigot
|
|
|
|
this.world.timings.mobSpawn.startTiming(); // Spigot
|
|
|
|
EnumCreatureType[] aenumcreaturetype1 = aenumcreaturetype;
|
|
|
|
EnumCreatureType[] aenumcreaturetype1 = aenumcreaturetype;
|
|
|
|
@@ -724,9 +806,23 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -731,9 +806,23 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
|
|
|
|
|
|
|
|
if (this.world.paperConfig.perPlayerMobSpawns) {
|
|
|
|
if (this.world.paperConfig.perPlayerMobSpawns) {
|
|
|
|
int minDiff = Integer.MAX_VALUE;
|
|
|
|
int minDiff = Integer.MAX_VALUE;
|
|
|
|
@@ -5220,7 +5199,7 @@ index cf9021d605..2294db2e6d 100644
|
|
|
|
difference = (minDiff == Integer.MAX_VALUE) ? 0 : minDiff;
|
|
|
|
difference = (minDiff == Integer.MAX_VALUE) ? 0 : minDiff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -749,7 +845,22 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
@@ -756,7 +845,22 @@ public class ChunkProviderServer extends IChunkProvider {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.world.timings.chunkInhibitedRangeCheck.stopTiming(); // Paper
|
|
|
|
this.world.timings.chunkInhibitedRangeCheck.stopTiming(); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -6180,10 +6159,10 @@ index 75d9065b32..4669f31b04 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
|
|
|
index bcd5cc9f28..dd07c67bce 100644
|
|
|
|
index b9d5844520..d1412760dd 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
|
|
|
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
|
|
|
@@ -502,9 +502,9 @@ public final class MCUtil {
|
|
|
|
@@ -500,9 +500,9 @@ public final class MCUtil {
|
|
|
|
|
|
|
|
|
|
|
|
WorldServer world = ((org.bukkit.craftbukkit.CraftWorld)bukkitWorld).getHandle();
|
|
|
|
WorldServer world = ((org.bukkit.craftbukkit.CraftWorld)bukkitWorld).getHandle();
|
|
|
|
PlayerChunkMap chunkMap = world.getChunkProvider().playerChunkMap;
|
|
|
|
PlayerChunkMap chunkMap = world.getChunkProvider().playerChunkMap;
|
|
|
|
@@ -6195,7 +6174,7 @@ index bcd5cc9f28..dd07c67bce 100644
|
|
|
|
List<EntityPlayer> players = world.players;
|
|
|
|
List<EntityPlayer> players = world.players;
|
|
|
|
|
|
|
|
|
|
|
|
int fullLoadedChunks = 0;
|
|
|
|
int fullLoadedChunks = 0;
|
|
|
|
@@ -527,7 +527,7 @@ public final class MCUtil {
|
|
|
|
@@ -525,7 +525,7 @@ public final class MCUtil {
|
|
|
|
worldData.addProperty("view-distance", world.spigotConfig.viewDistance);
|
|
|
|
worldData.addProperty("view-distance", world.spigotConfig.viewDistance);
|
|
|
|
worldData.addProperty("keep-spawn-loaded", world.keepSpawnInMemory);
|
|
|
|
worldData.addProperty("keep-spawn-loaded", world.keepSpawnInMemory);
|
|
|
|
worldData.addProperty("keep-spawn-loaded-range", world.paperConfig.keepLoadedRange);
|
|
|
|
worldData.addProperty("keep-spawn-loaded-range", world.paperConfig.keepLoadedRange);
|
|
|
|
@@ -6204,7 +6183,7 @@ index bcd5cc9f28..dd07c67bce 100644
|
|
|
|
worldData.addProperty("loaded-chunk-count", chunkMap.loadedChunks.size());
|
|
|
|
worldData.addProperty("loaded-chunk-count", chunkMap.loadedChunks.size());
|
|
|
|
worldData.addProperty("verified-fully-loaded-chunks", fullLoadedChunks);
|
|
|
|
worldData.addProperty("verified-fully-loaded-chunks", fullLoadedChunks);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -605,4 +605,28 @@ public final class MCUtil {
|
|
|
|
@@ -603,4 +603,28 @@ public final class MCUtil {
|
|
|
|
// TODO make sure the constant `33` is correct on future updates. See getChunkAt(int, int, ChunkStatus, boolean)
|
|
|
|
// TODO make sure the constant `33` is correct on future updates. See getChunkAt(int, int, ChunkStatus, boolean)
|
|
|
|
return 33 + ChunkStatus.getTicketLevelOffset(status);
|
|
|
|
return 33 + ChunkStatus.getTicketLevelOffset(status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -6394,77 +6373,6 @@ index 96a785af27..77aa911c98 100644
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NextTickListEntry.java b/src/main/java/net/minecraft/server/NextTickListEntry.java
|
|
|
|
|
|
|
|
index 33cfeabdee..11a4bb882e 100644
|
|
|
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/NextTickListEntry.java
|
|
|
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NextTickListEntry.java
|
|
|
|
|
|
|
|
@@ -5,11 +5,13 @@ import java.util.Comparator;
|
|
|
|
|
|
|
|
public class NextTickListEntry<T> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final java.util.concurrent.atomic.AtomicLong COUNTER = new java.util.concurrent.atomic.AtomicLong(); // Paper - async chunk loading
|
|
|
|
|
|
|
|
- private final T e;
|
|
|
|
|
|
|
|
- public final BlockPosition a;
|
|
|
|
|
|
|
|
- public final long b;
|
|
|
|
|
|
|
|
- public final TickListPriority c;
|
|
|
|
|
|
|
|
- private final long f;
|
|
|
|
|
|
|
|
+ private final T e; public final T getData() { return this.e; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ public final BlockPosition a; public final BlockPosition getPosition() { return this.a; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ public final long b; public final long getTargetTick() { return this.b; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ public final TickListPriority c; public final TickListPriority getPriority() { return this.c; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ private final long f; public final long getId() { return this.f; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ private final int hash; // Tuinity
|
|
|
|
|
|
|
|
+ public int tickState; // Tuinity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public NextTickListEntry(BlockPosition blockposition, T t0) {
|
|
|
|
|
|
|
|
this(blockposition, t0, 0L, TickListPriority.NORMAL);
|
|
|
|
|
|
|
|
@@ -21,6 +23,7 @@ public class NextTickListEntry<T> {
|
|
|
|
|
|
|
|
this.e = t0;
|
|
|
|
|
|
|
|
this.b = i;
|
|
|
|
|
|
|
|
this.c = ticklistpriority;
|
|
|
|
|
|
|
|
+ this.hash = this.computeHash(); // Tuinity
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean equals(Object object) {
|
|
|
|
|
|
|
|
@@ -33,19 +36,31 @@ public class NextTickListEntry<T> {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ // Tuinity start - optimize hashcode
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
|
|
|
|
+ return this.hash;
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public final int computeHash() {
|
|
|
|
|
|
|
|
+ // Tuinity end - optimize hashcode
|
|
|
|
|
|
|
|
return this.a.hashCode();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- public static <T> Comparator<Object> a() { // Paper - decompile fix
|
|
|
|
|
|
|
|
- return Comparator.comparingLong((nextticklistentry) -> {
|
|
|
|
|
|
|
|
- return ((NextTickListEntry<T>) nextticklistentry).b; // Paper - decompile fix
|
|
|
|
|
|
|
|
- }).thenComparing((nextticklistentry) -> {
|
|
|
|
|
|
|
|
- return ((NextTickListEntry<T>) nextticklistentry).c; // Paper - decompile fix
|
|
|
|
|
|
|
|
- }).thenComparingLong((nextticklistentry) -> {
|
|
|
|
|
|
|
|
- return ((NextTickListEntry<T>) nextticklistentry).f; // Paper - decompile fix
|
|
|
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
+ // Tuinity start - let's not use more functional code for no reason.
|
|
|
|
|
|
|
|
+ public static <T> Comparator<Object> comparator() { return NextTickListEntry.a(); } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ public static <T> Comparator<Object> a() {
|
|
|
|
|
|
|
|
+ return (Comparator)(Comparator<NextTickListEntry>)(NextTickListEntry nextticklistentry, NextTickListEntry nextticklistentry1) -> {
|
|
|
|
|
|
|
|
+ int i = Long.compare(nextticklistentry.getTargetTick(), nextticklistentry1.getTargetTick());
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ if (i != 0) {
|
|
|
|
|
|
|
|
+ return i;
|
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
|
|
|
+ i = nextticklistentry.getPriority().compareTo(nextticklistentry1.getPriority());
|
|
|
|
|
|
|
|
+ return i != 0 ? i : Long.compare(nextticklistentry.getId(), nextticklistentry1.getId());
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Tuinity end - let's not use more functional code for no reason.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
|
|
|
|
return this.e + ": " + this.a + ", " + this.b + ", " + this.c + ", " + this.f;
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
|
|
|
index ef7ade797b..e1ef70210a 100644
|
|
|
|
index ef7ade797b..e1ef70210a 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
|
|
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
|
|
|
@@ -6843,7 +6751,7 @@ index e35ec2db07..e7dfe22acd 100644
|
|
|
|
if (entityliving == entityliving1) {
|
|
|
|
if (entityliving == entityliving1) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
|
|
index b38bc67758..11d6347784 100644
|
|
|
|
index 9f8818c2d4..0e24f4e7a1 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
|
|
@@ -43,6 +43,18 @@ public class PlayerChunk {
|
|
|
|
@@ -43,6 +43,18 @@ public class PlayerChunk {
|
|
|
|
@@ -6962,16 +6870,7 @@ index b38bc67758..11d6347784 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
// Paper end
|
|
|
|
// Paper end
|
|
|
|
@@ -473,7 +537,7 @@ public class PlayerChunk {
|
|
|
|
@@ -505,8 +569,19 @@ public class PlayerChunk {
|
|
|
|
Chunk tickingChunk = either.left().get();
|
|
|
|
|
|
|
|
PlayerChunk.this.isTickingReady = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
+ PlayerChunk.this.chunkMap.world.onChunkSetTicking(PlayerChunk.this.location.x, PlayerChunk.this.location.z); // Tuinity - rewrite ticklistserver
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -503,8 +567,19 @@ public class PlayerChunk {
|
|
|
|
|
|
|
|
PlayerChunk.this.isEntityTickingReady = true;
|
|
|
|
PlayerChunk.this.isEntityTickingReady = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -6991,7 +6890,7 @@ index b38bc67758..11d6347784 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
// Paper end
|
|
|
|
// Paper end
|
|
|
|
@@ -513,6 +588,18 @@ public class PlayerChunk {
|
|
|
|
@@ -515,6 +590,18 @@ public class PlayerChunk {
|
|
|
|
|
|
|
|
|
|
|
|
if (flag6 && !flag7) {
|
|
|
|
if (flag6 && !flag7) {
|
|
|
|
this.entityTickingFuture.complete(PlayerChunk.UNLOADED_CHUNK); this.isEntityTickingReady = false; // Paper - cache chunk ticking stage
|
|
|
|
this.entityTickingFuture.complete(PlayerChunk.UNLOADED_CHUNK); this.isEntityTickingReady = false; // Paper - cache chunk ticking stage
|
|
|
|
@@ -9193,45 +9092,6 @@ index 3382d678e6..29137f4959 100644
|
|
|
|
public InputStream a(InputStream inputstream) throws IOException {
|
|
|
|
public InputStream a(InputStream inputstream) throws IOException {
|
|
|
|
return (InputStream) this.f.wrap(inputstream);
|
|
|
|
return (InputStream) this.f.wrap(inputstream);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/StructureBoundingBox.java b/src/main/java/net/minecraft/server/StructureBoundingBox.java
|
|
|
|
|
|
|
|
index dbb565e74d..118762778c 100644
|
|
|
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/StructureBoundingBox.java
|
|
|
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/StructureBoundingBox.java
|
|
|
|
|
|
|
|
@@ -4,12 +4,12 @@ import com.google.common.base.MoreObjects;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class StructureBoundingBox {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- public int a;
|
|
|
|
|
|
|
|
- public int b;
|
|
|
|
|
|
|
|
- public int c;
|
|
|
|
|
|
|
|
- public int d;
|
|
|
|
|
|
|
|
- public int e;
|
|
|
|
|
|
|
|
- public int f;
|
|
|
|
|
|
|
|
+ public int a; public final int getMinX() { return this.a; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ public int b; public final int getMinY() { return this.b; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ public int c; public final int getMinZ() { return this.c; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ public int d; public final int getMaxX() { return this.d; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ public int e; public final int getMaxY() { return this.e; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
+ public int f; public final int getMaxZ() { return this.f; } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public StructureBoundingBox() {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -84,6 +84,7 @@ public class StructureBoundingBox {
|
|
|
|
|
|
|
|
this.e = 512;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ public final boolean intersects(StructureBoundingBox boundingBox) { return this.b(boundingBox); } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
public boolean b(StructureBoundingBox structureboundingbox) {
|
|
|
|
|
|
|
|
return this.d >= structureboundingbox.a && this.a <= structureboundingbox.d && this.f >= structureboundingbox.c && this.c <= structureboundingbox.f && this.e >= structureboundingbox.b && this.b <= structureboundingbox.e;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -114,6 +115,7 @@ public class StructureBoundingBox {
|
|
|
|
|
|
|
|
return new StructureBoundingBox(this.a + i, this.b + j, this.c + k, this.d + i, this.e + j, this.f + k);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ public final boolean hasPoint(BaseBlockPosition baseblockposition) { return this.b(baseblockposition); } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
public boolean b(BaseBlockPosition baseblockposition) {
|
|
|
|
|
|
|
|
return baseblockposition.getX() >= this.a && baseblockposition.getX() <= this.d && baseblockposition.getZ() >= this.c && baseblockposition.getZ() <= this.f && baseblockposition.getY() >= this.b && baseblockposition.getY() <= this.e;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java
|
|
|
|
index 8082569022..8b1a3f3f98 100644
|
|
|
|
index 8082569022..8b1a3f3f98 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/ThreadedMailbox.java
|
|
|
|
--- a/src/main/java/net/minecraft/server/ThreadedMailbox.java
|
|
|
|
@@ -9245,129 +9105,6 @@ index 8082569022..8b1a3f3f98 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ThreadedMailbox(PairedQueue<? super T, ? extends Runnable> pairedqueue, Executor executor, String s) {
|
|
|
|
public ThreadedMailbox(PairedQueue<? super T, ? extends Runnable> pairedqueue, Executor executor, String s) {
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java
|
|
|
|
|
|
|
|
index f533860bbe..a54d36d90b 100644
|
|
|
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/TickListServer.java
|
|
|
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/TickListServer.java
|
|
|
|
|
|
|
|
@@ -42,6 +42,11 @@ public class TickListServer<T> implements TickList<T> {
|
|
|
|
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void b() {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ this.tick();
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public void tick() {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
int i = this.nextTickList.size();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (false) { // CraftBukkit
|
|
|
|
|
|
|
|
@@ -109,15 +114,30 @@ public class TickListServer<T> implements TickList<T> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean b(BlockPosition blockposition, T t0) {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ return this.isPendingTickThisTick(blockposition, t0);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public boolean isPendingTickThisTick(BlockPosition blockposition, T t0) {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
return this.g.contains(new NextTickListEntry<>(blockposition, t0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void a(Stream<NextTickListEntry<T>> stream) {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ this.scheduleAll(stream);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public void scheduleAll(Stream<NextTickListEntry<T>> stream) {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
stream.forEach(this::a);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<NextTickListEntry<T>> a(ChunkCoordIntPair chunkcoordintpair, boolean flag, boolean flag1) {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ return this.getEntriesInChunk(chunkcoordintpair, flag, flag1);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public List<NextTickListEntry<T>> getEntriesInChunk(ChunkCoordIntPair chunkcoordintpair, boolean flag, boolean flag1) {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
int i = (chunkcoordintpair.x << 4) - 2;
|
|
|
|
|
|
|
|
int j = i + 16 + 2;
|
|
|
|
|
|
|
|
int k = (chunkcoordintpair.z << 4) - 2;
|
|
|
|
|
|
|
|
@@ -127,6 +147,11 @@ public class TickListServer<T> implements TickList<T> {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<NextTickListEntry<T>> a(StructureBoundingBox structureboundingbox, boolean flag, boolean flag1) {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ return this.getEntriesInBoundingBox(structureboundingbox, flag, flag1);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public List<NextTickListEntry<T>> getEntriesInBoundingBox(StructureBoundingBox structureboundingbox, boolean flag, boolean flag1) {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
List<NextTickListEntry<T>> list = this.a((List) null, this.nextTickList, structureboundingbox, flag);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (flag && list != null) {
|
|
|
|
|
|
|
|
@@ -166,6 +191,11 @@ public class TickListServer<T> implements TickList<T> {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void a(StructureBoundingBox structureboundingbox, BlockPosition blockposition) {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ this.copy(structureboundingbox, blockposition);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public void copy(StructureBoundingBox structureboundingbox, BlockPosition blockposition) {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
List<NextTickListEntry<T>> list = this.a(structureboundingbox, false, false);
|
|
|
|
|
|
|
|
Iterator iterator = list.iterator();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -183,11 +213,17 @@ public class TickListServer<T> implements TickList<T> {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public NBTTagList a(ChunkCoordIntPair chunkcoordintpair) {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ return this.serialize(chunkcoordintpair);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public NBTTagList serialize(ChunkCoordIntPair chunkcoordintpair) {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
List<NextTickListEntry<T>> list = this.a(chunkcoordintpair, false, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return a(this.b, list, this.f.getTime());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ public static <T> NBTTagList serialize(Function<T, MinecraftKey> function, Iterable<NextTickListEntry<T>> iterable, long i) { return TickListServer.a(function, iterable, i); } // Tuinity - OBFHELPER
|
|
|
|
|
|
|
|
public static <T> NBTTagList a(Function<T, MinecraftKey> function, Iterable<NextTickListEntry<T>> iterable, long i) {
|
|
|
|
|
|
|
|
NBTTagList nbttaglist = new NBTTagList();
|
|
|
|
|
|
|
|
Iterator iterator = iterable.iterator();
|
|
|
|
|
|
|
|
@@ -210,11 +246,21 @@ public class TickListServer<T> implements TickList<T> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean a(BlockPosition blockposition, T t0) {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ return this.isScheduledForTick(blockposition, t0);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public boolean isScheduledForTick(BlockPosition blockposition, T t0) {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
return this.nextTickListHash.contains(new NextTickListEntry<>(blockposition, t0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void a(BlockPosition blockposition, T t0, int i, TickListPriority ticklistpriority) {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ this.schedule(blockposition, t0, i, ticklistpriority);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public void schedule(BlockPosition blockposition, T t0, int i, TickListPriority ticklistpriority) {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
if (!this.a.test(t0)) {
|
|
|
|
|
|
|
|
this.a(new NextTickListEntry<>(blockposition, t0, (long) i + this.f.getTime(), ticklistpriority));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -230,6 +276,11 @@ public class TickListServer<T> implements TickList<T> {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int a() {
|
|
|
|
|
|
|
|
+ // Tuinity start - allow overriding
|
|
|
|
|
|
|
|
+ return this.getTotalScheduledEntries();
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public int getTotalScheduledEntries() {
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
|
|
|
|
return this.nextTickListHash.size();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java
|
|
|
|
index 7a8397815a..0d5b1a0b7b 100644
|
|
|
|
index 7a8397815a..0d5b1a0b7b 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/Ticket.java
|
|
|
|
--- a/src/main/java/net/minecraft/server/Ticket.java
|
|
|
|
@@ -9549,7 +9286,7 @@ index 5117dafbcf..5f69a018d9 100644
|
|
|
|
if (chunk != null) {
|
|
|
|
if (chunk != null) {
|
|
|
|
chunk.a(oclass, axisalignedbb, list, predicate);
|
|
|
|
chunk.a(oclass, axisalignedbb, list, 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 c74b85917a..83ccabe710 100644
|
|
|
|
index 3e5ed2bd4e..08d3806a31 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
|
|
|
|
@@ -55,7 +55,7 @@ public class WorldServer extends World {
|
|
|
|
@@ -55,7 +55,7 @@ public class WorldServer extends World {
|
|
|
|
@@ -9570,11 +9307,10 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
// Paper start - optimise getPlayerByUUID
|
|
|
|
// Paper start - optimise getPlayerByUUID
|
|
|
|
@Nullable
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@@ -170,6 +172,373 @@ public class WorldServer extends World {
|
|
|
|
@@ -177,6 +179,367 @@ public class WorldServer extends World {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Paper end
|
|
|
|
// Paper end - rewrite ticklistserver
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ // Tuinity start
|
|
|
|
+ // Tuinity start
|
|
|
|
+ public final com.tuinity.tuinity.util.EntityList loadedEntities = new com.tuinity.tuinity.util.EntityList();
|
|
|
|
+ public final com.tuinity.tuinity.util.EntityList loadedEntities = new com.tuinity.tuinity.util.EntityList();
|
|
|
|
+ void onChunkLoad(final Chunk chunk) {
|
|
|
|
+ void onChunkLoad(final Chunk chunk) {
|
|
|
|
@@ -9592,11 +9328,6 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
+ this.loadedEntities.remove(entities[i]);
|
|
|
|
+ this.loadedEntities.remove(entities[i]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
+ void onChunkSetTicking(int chunkX, int chunkZ) {
|
|
|
|
|
|
|
|
+ ((com.tuinity.tuinity.server.TuinityTickList)this.nextTickListBlock).onChunkSetTicking(chunkX, chunkZ);
|
|
|
|
|
|
|
|
+ ((com.tuinity.tuinity.server.TuinityTickList)this.nextTickListFluid).onChunkSetTicking(chunkX, chunkZ);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ // Tuinity end
|
|
|
|
+ // Tuinity end
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // Tuinity start
|
|
|
|
+ // Tuinity start
|
|
|
|
@@ -9944,20 +9675,7 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
// Add env and gen to constructor
|
|
|
|
// Add env and gen to constructor
|
|
|
|
public WorldServer(MinecraftServer minecraftserver, Executor executor, WorldNBTStorage worldnbtstorage, WorldData worlddata, DimensionManager dimensionmanager, GameProfilerFiller gameprofilerfiller, WorldLoadListener worldloadlistener, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
|
|
|
|
public WorldServer(MinecraftServer minecraftserver, Executor executor, WorldNBTStorage worldnbtstorage, WorldData worlddata, DimensionManager dimensionmanager, GameProfilerFiller gameprofilerfiller, WorldLoadListener worldloadlistener, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
|
|
|
|
super(worlddata, dimensionmanager, (world, worldprovider) -> {
|
|
|
|
super(worlddata, dimensionmanager, (world, worldprovider) -> {
|
|
|
|
@@ -190,10 +559,10 @@ public class WorldServer extends World {
|
|
|
|
@@ -465,14 +828,13 @@ public class WorldServer extends World {
|
|
|
|
this.pvpMode = minecraftserver.getPVP();
|
|
|
|
|
|
|
|
worlddata.world = this;
|
|
|
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
- this.nextTickListBlock = new TickListServer<>(this, (block) -> {
|
|
|
|
|
|
|
|
+ this.nextTickListBlock = new com.tuinity.tuinity.server.TuinityTickList<>(this, (block) -> { // Tuinity - optimise TickListServer
|
|
|
|
|
|
|
|
return block == null || block.getBlockData().isAir();
|
|
|
|
|
|
|
|
}, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b, "Blocks"); // Paper - Timings
|
|
|
|
|
|
|
|
- this.nextTickListFluid = new TickListServer<>(this, (fluidtype) -> {
|
|
|
|
|
|
|
|
+ this.nextTickListFluid = new com.tuinity.tuinity.server.TuinityTickList<>(this, (fluidtype) -> { // Tuinity - optimise TickListServer
|
|
|
|
|
|
|
|
return fluidtype == null || fluidtype == FluidTypes.EMPTY;
|
|
|
|
|
|
|
|
}, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a, "Fluids"); // Paper - Timings
|
|
|
|
|
|
|
|
this.navigators = Sets.newHashSet();
|
|
|
|
|
|
|
|
@@ -458,14 +827,13 @@ public class WorldServer extends World {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gameprofilerfiller.exitEnter("regular");
|
|
|
|
gameprofilerfiller.exitEnter("regular");
|
|
|
|
this.tickingEntities = true;
|
|
|
|
this.tickingEntities = true;
|
|
|
|
@@ -9974,7 +9692,7 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
Entity entity2 = entity1.getVehicle();
|
|
|
|
Entity entity2 = entity1.getVehicle();
|
|
|
|
|
|
|
|
|
|
|
|
/* CraftBukkit start - We prevent spawning in general, so this butchering is not needed
|
|
|
|
/* CraftBukkit start - We prevent spawning in general, so this butchering is not needed
|
|
|
|
@@ -502,7 +870,7 @@ public class WorldServer extends World {
|
|
|
|
@@ -509,7 +871,7 @@ public class WorldServer extends World {
|
|
|
|
gameprofilerfiller.enter("remove");
|
|
|
|
gameprofilerfiller.enter("remove");
|
|
|
|
if (entity1.dead) {
|
|
|
|
if (entity1.dead) {
|
|
|
|
this.removeEntityFromChunk(entity1);
|
|
|
|
this.removeEntityFromChunk(entity1);
|
|
|
|
@@ -9983,7 +9701,7 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
this.unregisterEntity(entity1);
|
|
|
|
this.unregisterEntity(entity1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -818,6 +1186,10 @@ public class WorldServer extends World {
|
|
|
|
@@ -825,6 +1187,10 @@ public class WorldServer extends World {
|
|
|
|
int k = MathHelper.floor(entity.locZ() / 16.0D);
|
|
|
|
int k = MathHelper.floor(entity.locZ() / 16.0D);
|
|
|
|
|
|
|
|
|
|
|
|
if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) {
|
|
|
|
if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) {
|
|
|
|
@@ -9994,7 +9712,7 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
if (entity.inChunk && this.isChunkLoaded(entity.chunkX, entity.chunkZ)) {
|
|
|
|
if (entity.inChunk && this.isChunkLoaded(entity.chunkX, entity.chunkZ)) {
|
|
|
|
this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY);
|
|
|
|
this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -827,6 +1199,83 @@ public class WorldServer extends World {
|
|
|
|
@@ -834,6 +1200,83 @@ public class WorldServer extends World {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.getChunkAt(i, k).a(entity);
|
|
|
|
this.getChunkAt(i, k).a(entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -10078,7 +9796,7 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.getMethodProfiler().exit();
|
|
|
|
this.getMethodProfiler().exit();
|
|
|
|
@@ -1178,6 +1627,7 @@ public class WorldServer extends World {
|
|
|
|
@@ -1185,6 +1628,7 @@ public class WorldServer extends World {
|
|
|
|
|
|
|
|
|
|
|
|
this.registerEntity(entityplayer);
|
|
|
|
this.registerEntity(entityplayer);
|
|
|
|
this.getChunkProvider().playerChunkMap.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps
|
|
|
|
this.getChunkProvider().playerChunkMap.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps
|
|
|
|
@@ -10086,7 +9804,7 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CraftBukkit start
|
|
|
|
// CraftBukkit start
|
|
|
|
@@ -1360,6 +1810,7 @@ public class WorldServer extends World {
|
|
|
|
@@ -1367,6 +1811,7 @@ public class WorldServer extends World {
|
|
|
|
|
|
|
|
|
|
|
|
this.players.remove(entityplayer);
|
|
|
|
this.players.remove(entityplayer);
|
|
|
|
this.getChunkProvider().playerChunkMap.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps
|
|
|
|
this.getChunkProvider().playerChunkMap.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps
|
|
|
|
@@ -10094,7 +9812,7 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.getScoreboard().a(entity);
|
|
|
|
this.getScoreboard().a(entity);
|
|
|
|
@@ -1372,6 +1823,7 @@ public class WorldServer extends World {
|
|
|
|
@@ -1379,6 +1824,7 @@ public class WorldServer extends World {
|
|
|
|
if (entity instanceof EntityInsentient) {
|
|
|
|
if (entity instanceof EntityInsentient) {
|
|
|
|
this.navigators.remove(((EntityInsentient) entity).getNavigation());
|
|
|
|
this.navigators.remove(((EntityInsentient) entity).getNavigation());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -10102,7 +9820,7 @@ index c74b85917a..83ccabe710 100644
|
|
|
|
new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
|
|
|
|
new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
|
|
|
|
entity.valid = false; // CraftBukkit
|
|
|
|
entity.valid = false; // CraftBukkit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -1428,6 +1880,11 @@ public class WorldServer extends World {
|
|
|
|
@@ -1435,6 +1881,11 @@ public class WorldServer extends World {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Paper end
|
|
|
|
// Paper end
|
|
|
|
entity.shouldBeRemoved = false; // Paper - shouldn't be removed after being re-added
|
|
|
|
entity.shouldBeRemoved = false; // Paper - shouldn't be removed after being re-added
|
|
|
|
|