mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 01:17:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: 49fdb182 Timings changes (#3044)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 0dbe7794dec5145f2eb0cdea358bdd30de37a8aa Mon Sep 17 00:00:00 2001
|
||||
From b723fbb203556bc1025da7a7a88c11475102daa7 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Fri, 14 Dec 2018 21:53:58 -0800
|
||||
Subject: [PATCH] Tuinity Server Patches
|
||||
@@ -4933,7 +4933,7 @@ index 73d1570765..cb2e67d159 100644
|
||||
|
||||
protected b(int i) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index 82168b6ae8..ac18399551 100644
|
||||
index 1dcd0980ec..203719518e 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -126,7 +126,6 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
@@ -5161,10 +5161,10 @@ index 82168b6ae8..ac18399551 100644
|
||||
|
||||
this.world.getMethodProfiler().enter("broadcast");
|
||||
this.world.timings.broadcastChunkUpdates.startTiming(); // Paper - timings
|
||||
@@ -683,10 +758,10 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
@@ -682,10 +757,10 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
this.world.getMethodProfiler().exit();
|
||||
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
|
||||
|
||||
this.world.timings.chunkInhibitedRangeCheck.startTiming();
|
||||
- if (!this.playerChunkMap.isOutsideOfRange(chunkcoordintpair)) {
|
||||
+ if (!this.playerChunkMap.isOutsideOfRange(playerchunk, chunkcoordintpair, false)) { // Tuinity - optimise isOutsideOfRange
|
||||
// Paper end
|
||||
@@ -5174,7 +5174,7 @@ index 82168b6ae8..ac18399551 100644
|
||||
this.world.getMethodProfiler().enter("spawner");
|
||||
this.world.timings.mobSpawn.startTiming(); // Spigot
|
||||
EnumCreatureType[] aenumcreaturetype1 = aenumcreaturetype;
|
||||
@@ -731,9 +806,23 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
@@ -730,9 +805,23 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
|
||||
if (this.world.paperConfig.perPlayerMobSpawns) {
|
||||
int minDiff = Integer.MAX_VALUE;
|
||||
@@ -5199,9 +5199,9 @@ index 82168b6ae8..ac18399551 100644
|
||||
difference = (minDiff == Integer.MAX_VALUE) ? 0 : minDiff;
|
||||
}
|
||||
|
||||
@@ -756,7 +845,22 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
@@ -754,7 +843,22 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
|
||||
}
|
||||
this.world.timings.chunkInhibitedRangeCheck.stopTiming(); // Paper
|
||||
}
|
||||
- });
|
||||
+ }; // Tuinity
|
||||
@@ -9286,7 +9286,7 @@ index 5117dafbcf..5f69a018d9 100644
|
||||
if (chunk != null) {
|
||||
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
|
||||
index 3e5ed2bd4e..08d3806a31 100644
|
||||
index 2de48e7537..ef021bca36 100644
|
||||
--- a/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 {
|
||||
@@ -9692,7 +9692,7 @@ index 3e5ed2bd4e..08d3806a31 100644
|
||||
Entity entity2 = entity1.getVehicle();
|
||||
|
||||
/* CraftBukkit start - We prevent spawning in general, so this butchering is not needed
|
||||
@@ -509,7 +871,7 @@ public class WorldServer extends World {
|
||||
@@ -508,7 +870,7 @@ public class WorldServer extends World {
|
||||
gameprofilerfiller.enter("remove");
|
||||
if (entity1.dead) {
|
||||
this.removeEntityFromChunk(entity1);
|
||||
@@ -9701,7 +9701,7 @@ index 3e5ed2bd4e..08d3806a31 100644
|
||||
this.unregisterEntity(entity1);
|
||||
}
|
||||
|
||||
@@ -825,6 +1187,10 @@ public class WorldServer extends World {
|
||||
@@ -829,6 +1191,10 @@ public class WorldServer extends World {
|
||||
int k = MathHelper.floor(entity.locZ() / 16.0D);
|
||||
|
||||
if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) {
|
||||
@@ -9712,7 +9712,7 @@ index 3e5ed2bd4e..08d3806a31 100644
|
||||
if (entity.inChunk && this.isChunkLoaded(entity.chunkX, entity.chunkZ)) {
|
||||
this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY);
|
||||
}
|
||||
@@ -834,6 +1200,83 @@ public class WorldServer extends World {
|
||||
@@ -838,6 +1204,83 @@ public class WorldServer extends World {
|
||||
} else {
|
||||
this.getChunkAt(i, k).a(entity);
|
||||
}
|
||||
@@ -9796,7 +9796,7 @@ index 3e5ed2bd4e..08d3806a31 100644
|
||||
}
|
||||
|
||||
this.getMethodProfiler().exit();
|
||||
@@ -1185,6 +1628,7 @@ public class WorldServer extends World {
|
||||
@@ -1189,6 +1632,7 @@ public class WorldServer extends World {
|
||||
|
||||
this.registerEntity(entityplayer);
|
||||
this.getChunkProvider().playerChunkMap.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps
|
||||
@@ -9804,7 +9804,7 @@ index 3e5ed2bd4e..08d3806a31 100644
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1367,6 +1811,7 @@ public class WorldServer extends World {
|
||||
@@ -1371,6 +1815,7 @@ public class WorldServer extends World {
|
||||
|
||||
this.players.remove(entityplayer);
|
||||
this.getChunkProvider().playerChunkMap.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps
|
||||
@@ -9812,7 +9812,7 @@ index 3e5ed2bd4e..08d3806a31 100644
|
||||
}
|
||||
|
||||
this.getScoreboard().a(entity);
|
||||
@@ -1379,6 +1824,7 @@ public class WorldServer extends World {
|
||||
@@ -1383,6 +1828,7 @@ public class WorldServer extends World {
|
||||
if (entity instanceof EntityInsentient) {
|
||||
this.navigators.remove(((EntityInsentient) entity).getNavigation());
|
||||
}
|
||||
@@ -9820,7 +9820,7 @@ index 3e5ed2bd4e..08d3806a31 100644
|
||||
new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
|
||||
entity.valid = false; // CraftBukkit
|
||||
}
|
||||
@@ -1435,6 +1881,11 @@ public class WorldServer extends World {
|
||||
@@ -1439,6 +1885,11 @@ public class WorldServer extends World {
|
||||
}
|
||||
// Paper end
|
||||
entity.shouldBeRemoved = false; // Paper - shouldn't be removed after being re-added
|
||||
|
||||
Reference in New Issue
Block a user