3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

Re-Add per player mob spawning

Dieser Commit ist enthalten in:
Spottedleaf 2020-06-26 21:57:36 -07:00
Ursprung 8c0c587472
Commit 654f3e9d3e
136 geänderte Dateien mit 185 neuen und 182 gelöschten Zeilen

Datei anzeigen

@ -617,7 +617,7 @@ index b9fe08301409bc1f0d61a7566c26e720ff720d80..18a806ebbf092b904983691529ce5edf
return this.bf;
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index cdb72b225226083ca45ade798f54989422e5281c..f7e57fd1ce5881c056c104d5a6a9a74e34e3ffc3 100644
index a10006efc52f093196e7d67a3281a87d4c5df19b..ab5413a39147180af2eb33512fc992a5dcbb69bf 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -80,7 +80,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -656,7 +656,7 @@ index cdb72b225226083ca45ade798f54989422e5281c..f7e57fd1ce5881c056c104d5a6a9a74e
private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) {
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 86e906361ed998ba94ff6e1cbe21860a88626c3b..011e017a8121799cd00d3371bb6bb8f237b5b2bf 100644
index 8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc..c5845013a79036704d084cfb903589cb9e8767cd 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -29,6 +29,11 @@ public final class SpawnerCreature {
@ -683,7 +683,7 @@ index 86e906361ed998ba94ff6e1cbe21860a88626c3b..011e017a8121799cd00d3371bb6bb8f2
});
}
}
@@ -120,13 +130,33 @@ public final class SpawnerCreature {
@@ -125,13 +135,33 @@ public final class SpawnerCreature {
continue;
}
@ -718,7 +718,7 @@ index 86e906361ed998ba94ff6e1cbe21860a88626c3b..011e017a8121799cd00d3371bb6bb8f2
}
}
@@ -135,22 +165,34 @@ public final class SpawnerCreature {
@@ -140,22 +170,34 @@ public final class SpawnerCreature {
}
public static void a(EnumCreatureType enumcreaturetype, WorldServer worldserver, Chunk chunk, SpawnerCreature.c spawnercreature_c, SpawnerCreature.a spawnercreature_a) {
@ -755,7 +755,7 @@ index 86e906361ed998ba94ff6e1cbe21860a88626c3b..011e017a8121799cd00d3371bb6bb8f2
int k = 0;
while (k < 3) {
@@ -190,13 +232,13 @@ public final class SpawnerCreature {
@@ -195,13 +237,13 @@ public final class SpawnerCreature {
// Paper start
Boolean doSpawning = a(worldserver, enumcreaturetype, structuremanager, chunkgenerator, biomebase_biomemeta, blockposition_mutableblockposition, d2);
if (doSpawning == null) {
@ -771,7 +771,7 @@ index 86e906361ed998ba94ff6e1cbe21860a88626c3b..011e017a8121799cd00d3371bb6bb8f2
}
entityinsentient.setPositionRotation(d0, (double) i, d1, worldserver.random.nextFloat() * 360.0F, 0.0F);
@@ -204,13 +246,18 @@ public final class SpawnerCreature {
@@ -209,13 +251,18 @@ public final class SpawnerCreature {
groupdataentity = entityinsentient.prepare(worldserver, worldserver.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
// CraftBukkit start
if (worldserver.addEntity(entityinsentient, SpawnReason.NATURAL)) {
@ -793,7 +793,7 @@ index 86e906361ed998ba94ff6e1cbe21860a88626c3b..011e017a8121799cd00d3371bb6bb8f2
}
if (entityinsentient.c(k1)) {
@@ -232,6 +279,7 @@ public final class SpawnerCreature {
@@ -237,6 +284,7 @@ public final class SpawnerCreature {
}
}
@ -801,20 +801,18 @@ index 86e906361ed998ba94ff6e1cbe21860a88626c3b..011e017a8121799cd00d3371bb6bb8f2
}
private static boolean a(WorldServer worldserver, IChunkAccess ichunkaccess, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) {
@@ -471,10 +519,10 @@ public final class SpawnerCreature {
@@ -476,8 +524,8 @@ public final class SpawnerCreature {
public static class d {
- private final int a;
- private final Object2IntOpenHashMap<EnumCreatureType> b;
+ private final int a; final int getSpawnerChunks() { return this.a; } // Paper - OBFHELPER
private final Object2IntOpenHashMap<EnumCreatureType> b;
+ private final Object2IntOpenHashMap<EnumCreatureType> b; final Object2IntMap<EnumCreatureType> getEntityCountsByType() { return this.b; } // Paper - OBFHELPER
private final SpawnerCreatureProbabilities c;
- private final Object2IntMap<EnumCreatureType> d;
+ private final Object2IntMap<EnumCreatureType> d; final Object2IntMap<EnumCreatureType> getEntityCountsByType() { return this.d; } // Paper - OBFHELPER
private final Object2IntMap<EnumCreatureType> d;
@Nullable
private BlockPosition e;
@Nullable
@@ -535,7 +583,7 @@ public final class SpawnerCreature {
@@ -540,7 +588,7 @@ public final class SpawnerCreature {
// CraftBukkit start
private boolean a(EnumCreatureType enumcreaturetype, int limit) {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent consuming the wrong itemstack
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index f74e9ffda092ef4a2e30c316e682af154921b5df..961a383174cd40da079869a2a1f0252c27fff6b4 100644
index eeca12bd7c6e59b872303fda1378a69d03dcf783..d354e9b504b6872f20a9e433522827589bd4778a 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -3068,10 +3068,13 @@ public abstract class EntityLiving extends Entity {

Datei anzeigen

@ -5,12 +5,12 @@ Subject: [PATCH] Generator Settings
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index cf9d980e61be199a34cff98f805e511f9410dd51..547ec8d90425feb6089091a930a49a43bed01e1a 100644
index 3d9a48e56194225cf39e31d13d26ec17afedadaf..a9d7e81ef123a7da7785a4b8dc868a0e256a61d0 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -567,4 +567,9 @@ public class PaperWorldConfig {
}
}
@@ -572,4 +572,9 @@ public class PaperWorldConfig {
private void perPlayerMobSpawns() {
perPlayerMobSpawns = getBoolean("per-player-mob-spawns", false);
}
+
+ public boolean generateFlatBedrock;

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix stuck in sneak when changing worlds (MC-10657)
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 3a3ffe5a544d9f73b0ac512f67629b1169110395..55675fafaaadd3739e51bccce1c66ffab2d2d5c2 100644
index 35aca074e4a0e1202441536f6b21f3731c490cc6..b33041765051f519807081607d2a8f1c75bb1fe7 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1012,6 +1012,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1018,6 +1018,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.lastHealthSent = -1.0F;
this.lastFoodSent = -1;

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add option to disable pillager patrols
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 547ec8d90425feb6089091a930a49a43bed01e1a..886c56fbe90559464439cec6198776cd5b037c74 100644
index a9d7e81ef123a7da7785a4b8dc868a0e256a61d0..f8a617a62e62d088077712bfb66656c28b82a3c5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -572,4 +572,9 @@ public class PaperWorldConfig {
@@ -577,4 +577,9 @@ public class PaperWorldConfig {
private void generatorSettings() {
generateFlatBedrock = getBoolean("generator-settings.flat-bedrock", false);
}

Datei anzeigen

@ -7,7 +7,7 @@ Fixes an AssertionError when setting the player's item in hand to null or a new
Fixes GH-2718
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 961a383174cd40da079869a2a1f0252c27fff6b4..dd7df1795eb0186e256c26684b7d9116de9bc9bf 100644
index d354e9b504b6872f20a9e433522827589bd4778a..12b27c44d77b72fa4a4d42cfe3db8394a47d9c9b 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2040,6 +2040,7 @@ public abstract class EntityLiving extends Entity {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] MC-145656 Fix Follow Range Initial Target
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 886c56fbe90559464439cec6198776cd5b037c74..1a05e5169da4f21a88405cd8a36dec9fc868e059 100644
index f8a617a62e62d088077712bfb66656c28b82a3c5..5c5a79d0ea00c9c4c2e93d524291f48f92e77857 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -577,4 +577,9 @@ public class PaperWorldConfig {
@@ -582,4 +582,9 @@ public class PaperWorldConfig {
private void pillagerSettings() {
disablePillagerPatrols = getBoolean("game-mechanics.disable-pillager-patrols", disablePillagerPatrols);
}

Datei anzeigen

@ -13,10 +13,10 @@ Subject: [PATCH] Optimize Hoppers
* Remove Streams from Item Suck In and restore restore 1.12 AABB checks which is simpler and no voxel allocations (was doing TWO Item Suck ins)
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 1a05e5169da4f21a88405cd8a36dec9fc868e059..3a63ed18c38030b7c0f1e681b9066283879592a1 100644
index 5c5a79d0ea00c9c4c2e93d524291f48f92e77857..4bfe2fb948ee204f8c5a8c316141904a8a6a8b16 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -582,4 +582,13 @@ public class PaperWorldConfig {
@@ -587,4 +587,13 @@ public class PaperWorldConfig {
private void entitiesTargetWithFollowRange() {
entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange);
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] PlayerDeathEvent#shouldDropExperience
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 55675fafaaadd3739e51bccce1c66ffab2d2d5c2..ce3ed590f96312e18d631afee40f3821dad986ae 100644
index b33041765051f519807081607d2a8f1c75bb1fe7..dd78cfd8e9031558a6986c1929da330458d28597 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -685,7 +685,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -691,7 +691,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.eW();
}
// SPIGOT-5478 must be called manually now

Datei anzeigen

@ -7,7 +7,7 @@ When the server is lagging, players will wait longer when eating.
Change to also use a time check instead if it passes.
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index dd7df1795eb0186e256c26684b7d9116de9bc9bf..415cec5f0435967dccd8df258d116b490a84276f 100644
index 12b27c44d77b72fa4a4d42cfe3db8394a47d9c9b..b213a13c18ad483472808f4fe9743f74821a25cd 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -119,7 +119,7 @@ public abstract class EntityLiving extends Entity {

Datei anzeigen

@ -68,7 +68,7 @@ index c94197a50269622e8995685119bac984c45e6833..11d384729326af693a9a679195acbd59
protected EntityCreature(EntityTypes<? extends EntityCreature> entitytypes, World world) {
super(entitytypes, world);
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index dbd7850df45fb9ee550ce33f97bdfe9cf5bfcd34..61323f9b15350b1d227b2f3de67c40846ba7c2f9 100644
index 513c987a56e8d2bda0bda8771285c7c8d5ca88e1..f638b21a3b457323600baeecab4a04ca76d0e813 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -47,7 +47,7 @@ public abstract class EntityInsentient extends EntityLiving {
@ -99,7 +99,7 @@ index dbd7850df45fb9ee550ce33f97bdfe9cf5bfcd34..61323f9b15350b1d227b2f3de67c4084
if (this.isPassenger() && this.getVehicle() instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) this.getVehicle();
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 415cec5f0435967dccd8df258d116b490a84276f..b1cfd633eb5a3911fbfcfb937b5f7ecc346c6122 100644
index b213a13c18ad483472808f4fe9743f74821a25cd..66bca610fbb8afc6f5b4430318c66d29af55fc19 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -97,7 +97,7 @@ public abstract class EntityLiving extends Entity {

Datei anzeigen

@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index a10006efc52f093196e7d67a3281a87d4c5df19b..89d3890ab80da90fea2fb6e0a871bae2ff5f5ef1 100644
index ab5413a39147180af2eb33512fc992a5dcbb69bf..b530316b582390c4c464bb1f3df48597c8bf7569 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1717,6 +1717,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1736,6 +1736,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
int j = entity.getEntityType().getChunkRange() * 16;

Datei anzeigen

@ -7,7 +7,7 @@ bypass the need to get a player chunk, then get the either,
then unwrap it...
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 707db4febac59a4d09d6420ea2add469cf54c2ec..a5325aef96117d569e95ff4a15650d6a1ab8ac49 100644
index 1597b7a882769109f467d81ecbadc45ff6779b7e..67d6facd37462beef49dac311019b1977150d73f 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -447,6 +447,12 @@ public class ChunkProviderServer extends IChunkProvider {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Entity Jump API
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index b1cfd633eb5a3911fbfcfb937b5f7ecc346c6122..58e14a10f5424fefd7c2e1ce644e1712e49eea62 100644
index 66bca610fbb8afc6f5b4430318c66d29af55fc19..e0a4866048276c44079e0b9034c1acea1f0498fa 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2754,8 +2754,10 @@ public abstract class EntityLiving extends Entity {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add option to nerf pigmen from nether portals
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 3a63ed18c38030b7c0f1e681b9066283879592a1..c1f7d7f0db97e1667917a00febabb043cd66dfc8 100644
index 4bfe2fb948ee204f8c5a8c316141904a8a6a8b16..3496f615aa9857aa704767f460b1b166295ccf39 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -591,4 +591,9 @@ public class PaperWorldConfig {
@@ -596,4 +596,9 @@ public class PaperWorldConfig {
disableHopperMoveEvents = getBoolean("hopper.disable-move-event", disableHopperMoveEvents);
log("Hopper Move Item Events: " + (disableHopperMoveEvents ? "disabled" : "enabled"));
}

Datei anzeigen

@ -398,7 +398,7 @@ index d4d5bc19e167a5271f8eb8d010f8a52b23b942df..859e31c63f94bdc7729c6d475990750b
});
private final int[] b = new int[256];
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 620ee43ada7543e21f6c10afec424cff6017f2cd..3681bc9657b2ecbd27bb45153b4e608d077f36dc 100644
index 4207b2c2a1bed03e00d792015c15f32b2eca7085..aecc0fee6924922f1599a99a643c1d2437e22fc6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -106,7 +106,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add option to allow iron golems to spawn in air
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index c1f7d7f0db97e1667917a00febabb043cd66dfc8..143fe59272dda1ecaf9c3b4493e13e8ef0762ee1 100644
index 3496f615aa9857aa704767f460b1b166295ccf39..101a473ff8979b37098fde7ac6ac66c6ed1b0282 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -385,6 +385,11 @@ public class PaperWorldConfig {

Datei anzeigen

@ -8,10 +8,10 @@ This allows you to solve an issue in vanilla behavior where:
* On normal difficulty they will have a 50% of getting infected or dying.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 143fe59272dda1ecaf9c3b4493e13e8ef0762ee1..01bb16e35a7b737c0a8be5e37c22aa756388b268 100644
index 101a473ff8979b37098fde7ac6ac66c6ed1b0282..9e8485679bd36481c2bd2f0c7cfa49892f0e4baf 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -601,4 +601,9 @@ public class PaperWorldConfig {
@@ -606,4 +606,9 @@ public class PaperWorldConfig {
private void nerfNetherPortalPigmen() {
nerfNetherPortalPigmen = getBoolean("game-mechanics.nerf-pigmen-from-nether-portals", nerfNetherPortalPigmen);
}

Datei anzeigen

@ -890,7 +890,7 @@ index 9fb776318c10f393eb6d94e5112c454a7cd246b9..adfeeefbbc307a77738c2cc8d82856cd
return this.b(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ());
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index a5325aef96117d569e95ff4a15650d6a1ab8ac49..db4ac5658844bcdb5a6a68ed74f862d055a5567d 100644
index 67d6facd37462beef49dac311019b1977150d73f..ba9f75bd8f6fe1990d485548f4481bd1762d93af 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -202,6 +202,13 @@ public class ChunkProviderServer extends IChunkProvider {

Datei anzeigen

@ -10,10 +10,10 @@ When not per player it will use the Vanilla mechanic of one delay per
world and the world age for the start day.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 01bb16e35a7b737c0a8be5e37c22aa756388b268..69b3faf28d019fca90734c4d0944ead8fd97ab87 100644
index 9e8485679bd36481c2bd2f0c7cfa49892f0e4baf..2688b3018eaab4e7ba95754164f83065a98e53fc 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -579,10 +579,21 @@ public class PaperWorldConfig {
@@ -584,10 +584,21 @@ public class PaperWorldConfig {
}
public boolean disablePillagerPatrols = false;
@ -36,7 +36,7 @@ index 01bb16e35a7b737c0a8be5e37c22aa756388b268..69b3faf28d019fca90734c4d0944ead8
private void entitiesTargetWithFollowRange() {
entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange);
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index ce3ed590f96312e18d631afee40f3821dad986ae..f39a10a1fee5baf92d661b63c4487140eff244d2 100644
index dd78cfd8e9031558a6986c1929da330458d28597..59f5ef6e14b738a408dc8462ba99605ec1ae82e9 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -81,6 +81,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {

Datei anzeigen

@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 89d3890ab80da90fea2fb6e0a871bae2ff5f5ef1..1379c65d0b07544242d5ee32841b208ace43197f 100644
index b530316b582390c4c464bb1f3df48597c8bf7569..6ac39fc6cafdcbf7883e868ecb58a2ebfad41601 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1424,6 +1424,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1443,6 +1443,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
protected void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot

Datei anzeigen

@ -7,10 +7,10 @@ Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla.
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index f39a10a1fee5baf92d661b63c4487140eff244d2..418f8351f603acf1ceffa38d6010fc692b8f66e7 100644
index 59f5ef6e14b738a408dc8462ba99605ec1ae82e9..52b5c47452a46cd6e61e1dd7c135620e36472c73 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -466,7 +466,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -472,7 +472,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void playerTick() {
try {

Datei anzeigen

@ -7,7 +7,7 @@ This fixes a lot of game state issues where packets were delayed for processing
due to 1.15's new queue but processed while dead.
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 5ef91da9733fd9276e7bd819a11a0548e01b17f0..2db0cfd6c32c58beadc71d4be487776500c1b8a6 100644
index 7916421fe1dd8eadfd1c9bd15c4bbbb7331faca6..22acfe1350eb122b7eaa7209f519e4f4f1469b6c 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -952,7 +952,7 @@ public abstract class EntityHuman extends EntityLiving {

Datei anzeigen

@ -57,10 +57,10 @@ index 0000000000000000000000000000000000000000..f6ff4d8132a95895680f5bc81f8f873e
+ }
+}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index db4ac5658844bcdb5a6a68ed74f862d055a5567d..76084e6dd282da8332bdafbf9a96bcc64827e705 100644
index ba9f75bd8f6fe1990d485548f4481bd1762d93af..e14e8bcf235339c1537a1e0a7702a364ee784c93 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -741,7 +741,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -756,7 +756,7 @@ public class ChunkProviderServer extends IChunkProvider {
entityPlayer.playerNaturallySpawnedEvent.callEvent();
};
// Paper end
@ -83,7 +83,7 @@ index 9615c4d324e42f7f91a7e60b6151c16d20e9c739..a68e4fc411ae84f12b1ca7443fa66f63
List<PlayerChunk> allChunks = new ArrayList<>(visibleChunks.values());
List<EntityPlayer> players = world.players;
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 1379c65d0b07544242d5ee32841b208ace43197f..31f72f0c0f00a62f9e636a9cd0362c7b7a9759b4 100644
index 6ac39fc6cafdcbf7883e868ecb58a2ebfad41601..bb4d54ebee573964cf3026888da108584b12972f 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -56,8 +56,33 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -122,7 +122,7 @@ index 1379c65d0b07544242d5ee32841b208ace43197f..31f72f0c0f00a62f9e636a9cd0362c7b
private final Long2ObjectLinkedOpenHashMap<PlayerChunk> pendingUnload;
final LongSet loadedChunks; // Paper - private -> package
public final WorldServer world;
@@ -129,7 +154,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -130,7 +155,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag);
@ -131,7 +131,7 @@ index 1379c65d0b07544242d5ee32841b208ace43197f..31f72f0c0f00a62f9e636a9cd0362c7b
this.pendingUnload = new Long2ObjectLinkedOpenHashMap();
this.loadedChunks = new LongOpenHashSet();
this.unloadQueue = new LongOpenHashSet();
@@ -203,9 +228,52 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -222,9 +247,52 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return (PlayerChunk) this.updatingChunks.get(i);
}
@ -185,7 +185,7 @@ index 1379c65d0b07544242d5ee32841b208ace43197f..31f72f0c0f00a62f9e636a9cd0362c7b
}
protected IntSupplier c(long i) {
@@ -393,8 +461,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -412,8 +480,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper end
protected void save(boolean flag) {
@ -196,7 +196,7 @@ index 1379c65d0b07544242d5ee32841b208ace43197f..31f72f0c0f00a62f9e636a9cd0362c7b
MutableBoolean mutableboolean = new MutableBoolean();
do {
@@ -422,7 +491,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -441,7 +510,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// this.i(); // Paper - nuke IOWorker
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName());
} else {
@ -205,7 +205,7 @@ index 1379c65d0b07544242d5ee32841b208ace43197f..31f72f0c0f00a62f9e636a9cd0362c7b
IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow(null); // CraftBukkit - decompile error
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
@@ -593,7 +662,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -612,7 +681,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (!this.updatingChunksModified) {
return false;
} else {
@ -227,7 +227,7 @@ index 1379c65d0b07544242d5ee32841b208ace43197f..31f72f0c0f00a62f9e636a9cd0362c7b
this.updatingChunksModified = false;
return true;
}
@@ -1062,12 +1144,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1081,12 +1163,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
protected Iterable<PlayerChunk> f() {

Datei anzeigen

@ -14,10 +14,10 @@ light engine on shutdown...
The queue size only puts a cap on max loss, doesn't solve that problem.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 69b3faf28d019fca90734c4d0944ead8fd97ab87..21940f2034744ea417a43fcebc92b21298753d2d 100644
index 2688b3018eaab4e7ba95754164f83065a98e53fc..e4821d4c23689aaf51b60c66fc1e6bc7a0b02fd5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -617,4 +617,9 @@ public class PaperWorldConfig {
@@ -622,4 +622,9 @@ public class PaperWorldConfig {
private void zombieVillagerInfectionChance() {
zombieVillagerInfectionChance = getDouble("zombie-villager-infection-chance", zombieVillagerInfectionChance);
}

Datei anzeigen

@ -56,7 +56,7 @@ index 8508b3e10e60a4ce36d471b1d3f7ffc836a6ddf7..aad1420dc63c16b558ad1ca34accf8a7
+ }
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 76084e6dd282da8332bdafbf9a96bcc64827e705..638a874a275677ede28953badb387b770c0600d6 100644
index e14e8bcf235339c1537a1e0a7702a364ee784c93..d1f832db33f21f8ba910d2c0c163af78718d298f 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -694,6 +694,7 @@ public class ChunkProviderServer extends IChunkProvider {
@ -75,7 +75,7 @@ index 76084e6dd282da8332bdafbf9a96bcc64827e705..638a874a275677ede28953badb387b77
this.world.timings.doChunkUnload.stopTiming(); // Spigot
this.world.getMethodProfiler().exit();
this.clearCache();
@@ -741,7 +743,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -756,7 +758,7 @@ public class ChunkProviderServer extends IChunkProvider {
entityPlayer.playerNaturallySpawnedEvent.callEvent();
};
// Paper end
@ -84,7 +84,7 @@ index 76084e6dd282da8332bdafbf9a96bcc64827e705..638a874a275677ede28953badb387b77
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
if (optional.isPresent()) {
@@ -765,6 +767,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -780,6 +782,7 @@ public class ChunkProviderServer extends IChunkProvider {
this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
this.world.a(chunk, k);
this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
@ -92,7 +92,7 @@ index 76084e6dd282da8332bdafbf9a96bcc64827e705..638a874a275677ede28953badb387b77
}
}
}
@@ -921,6 +924,41 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -936,6 +939,41 @@ public class ChunkProviderServer extends IChunkProvider {
super.executeTask(runnable);
}

Datei anzeigen

@ -10,10 +10,10 @@ larger than the keep loaded range.
By skipping this, we avoid potential for a large spike on server start.
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 418f8351f603acf1ceffa38d6010fc692b8f66e7..b2a933ff60163527bd19449f8650a86fa144863d 100644
index 52b5c47452a46cd6e61e1dd7c135620e36472c73..62f6e507586560355269b54a6c3921296106a3bc 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -113,7 +113,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -118,7 +118,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.serverStatisticManager = minecraftserver.getPlayerList().getStatisticManager(this);
this.advancementDataPlayer = minecraftserver.getPlayerList().f(this);
this.G = 1.0F;
@ -22,7 +22,7 @@ index 418f8351f603acf1ceffa38d6010fc692b8f66e7..b2a933ff60163527bd19449f8650a86f
this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
@@ -165,6 +165,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -171,6 +171,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
// CraftBukkit end
@ -30,7 +30,7 @@ index 418f8351f603acf1ceffa38d6010fc692b8f66e7..b2a933ff60163527bd19449f8650a86f
private void b(WorldServer worldserver) {
BlockPosition blockposition = worldserver.getSpawn();
@@ -340,7 +341,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -346,7 +347,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
position = Vec3D.a(((WorldServer) world).getSpawn());
}
this.world = world;

Datei anzeigen

@ -261,10 +261,10 @@ index 5bef465bfe90b08524862b13f9e22dcf9e3438cd..57f7dfc6a5316cfec5cce9c60e7b91d9
}
// Spigot End
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index ad4a07283a67ed4db770c59bb5884b9fa3f92b21..295c8e7eeb4fc634aaa2ca788e6540a647755f88 100644
index bb4d54ebee573964cf3026888da108584b12972f..09f94bd242318155dbb46e12224ad3e47eed40cf 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -467,6 +467,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -486,6 +486,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
MutableBoolean mutableboolean = new MutableBoolean();
do {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent opening inventories when frozen
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index b2a933ff60163527bd19449f8650a86fa144863d..0ecc967e149ef988f0451b2202cd01b85debf74c 100644
index 62f6e507586560355269b54a6c3921296106a3bc..bfce9d46816cb80272b1825d322231a941b11b58 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -417,7 +417,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -423,7 +423,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
containerUpdateDelay = world.paperConfig.containerUpdateTickRate;
}
// Paper end
@ -17,7 +17,7 @@ index b2a933ff60163527bd19449f8650a86fa144863d..0ecc967e149ef988f0451b2202cd01b8
this.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper
this.activeContainer = this.defaultContainer;
}
@@ -1272,7 +1272,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1278,7 +1278,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} else {
// CraftBukkit start
this.activeContainer = container;
@ -26,7 +26,7 @@ index b2a933ff60163527bd19449f8650a86fa144863d..0ecc967e149ef988f0451b2202cd01b8
// CraftBukkit end
container.addSlotListener(this);
return OptionalInt.of(this.containerCounter);
@@ -2066,7 +2066,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -2073,7 +2073,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
@Override

Datei anzeigen

@ -7,7 +7,7 @@ Will not run if max entity craming is disabled and
the max collisions per entity is less than or equal to 0
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 58e14a10f5424fefd7c2e1ce644e1712e49eea62..22b033b85f34673928f47a65962d2bb6d34e6976 100644
index e0a4866048276c44079e0b9034c1acea1f0498fa..40ac2b8153dbbb10b732123f95b9c0a3a807e54e 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2820,10 +2820,16 @@ public abstract class EntityLiving extends Entity {

Datei anzeigen

@ -9,7 +9,7 @@ so inline where possible, and avoid the abstraction of the
Either class.
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 638a874a275677ede28953badb387b770c0600d6..e24f3711017aa5194ef7bf4e8d90f150cfb083ff 100644
index d1f832db33f21f8ba910d2c0c163af78718d298f..91755cd7313d87bae85584dff140acbc6467428f 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -618,21 +618,29 @@ public class ChunkProviderServer extends IChunkProvider {

Datei anzeigen

@ -85,7 +85,7 @@ index 0000000000000000000000000000000000000000..b6f4400df3d8ec7e06a996de54f8cabb
+ }
+}
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 2db0cfd6c32c58beadc71d4be487776500c1b8a6..3fa9e7b52b24629c96436fdd46d4e8c28c35f00e 100644
index 22acfe1350eb122b7eaa7209f519e4f4f1469b6c..2cada09ced1660526e9c112c2c8d92bbf9d6ea98 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -36,7 +36,7 @@ public abstract class EntityHuman extends EntityLiving {
@ -98,7 +98,7 @@ index 2db0cfd6c32c58beadc71d4be487776500c1b8a6..3fa9e7b52b24629c96436fdd46d4e8c2
protected static final DataWatcherObject<NBTTagCompound> br = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
protected static final DataWatcherObject<NBTTagCompound> bs = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 0ecc967e149ef988f0451b2202cd01b85debf74c..41ec990baa4a2ca149cd6edd16943a9ac27cde91 100644
index bfce9d46816cb80272b1825d322231a941b11b58..ef35e07fd8b27a66710140c1422f88ad512e774f 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -2,6 +2,7 @@ package net.minecraft.server;
@ -118,7 +118,7 @@ index 0ecc967e149ef988f0451b2202cd01b85debf74c..41ec990baa4a2ca149cd6edd16943a9a
private long ch = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity;
public boolean worldChangeInvuln;
@@ -1676,6 +1677,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1682,6 +1683,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public String locale = null; // CraftBukkit - lowercase // Paper - default to null
public void a(PacketPlayInSettings packetplayinsettings) {

Datei anzeigen

@ -25,10 +25,10 @@ This successfully fixed a reoccurring and highly reproduceable crash
for heightmaps.
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index e24f3711017aa5194ef7bf4e8d90f150cfb083ff..7af4c3e2aaf0775640d51f88b3cf821ba38a950b 100644
index 91755cd7313d87bae85584dff140acbc6467428f..0080a0cbe58d1a81c434ef97659428c8bf1ec290 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -979,6 +979,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -994,6 +994,7 @@ public class ChunkProviderServer extends IChunkProvider {
return super.executeNext() || execChunkTask; // Paper
}
} finally {
@ -37,10 +37,10 @@ index e24f3711017aa5194ef7bf4e8d90f150cfb083ff..7af4c3e2aaf0775640d51f88b3cf821b
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 517d752f96b595ce26092616cb9087e356c194b7..372b4d9ce7325f3d158f8199d1ec0dd2670f57ce 100644
index 09f94bd242318155dbb46e12224ad3e47eed40cf..4ab719930f5b35c0ae221e9345f1e2eda7d9d719 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -132,6 +132,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -133,6 +133,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
};
// CraftBukkit end
@ -49,7 +49,7 @@ index 517d752f96b595ce26092616cb9087e356c194b7..372b4d9ce7325f3d158f8199d1ec0dd2
// Paper start - distance maps
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<EntityPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
@@ -977,7 +979,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -996,7 +998,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return Either.left(chunk);
});
}, (runnable) -> {

Datei anzeigen

@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick
delays anymore.
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 41ec990baa4a2ca149cd6edd16943a9ac27cde91..6f26d468bcb68328a3e0ee7f627dc8f21c04cfa8 100644
index ef35e07fd8b27a66710140c1422f88ad512e774f..56cf64709ae520287f6687fe7c2f55040cc769a1 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -99,6 +99,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -104,6 +104,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public double maxHealthCache;
public boolean joining = true;
public boolean sentListPacket = false;
@ -40,10 +40,10 @@ index 41ec990baa4a2ca149cd6edd16943a9ac27cde91..6f26d468bcb68328a3e0ee7f627dc8f2
// CraftBukkit end
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 372b4d9ce7325f3d158f8199d1ec0dd2670f57ce..ccd11698b13e771cd1d90dc73108b055f4e4f53c 100644
index 4ab719930f5b35c0ae221e9345f1e2eda7d9d719..8de86684dda275585826617b41d6792f233b814c 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1516,6 +1516,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1535,6 +1535,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
.printStackTrace();
return;
}

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Load Chunks for Login Asynchronously
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 7af4c3e2aaf0775640d51f88b3cf821ba38a950b..4c6b056cb1a2040251acc09ef2eb6bfd893a0300 100644
index 0080a0cbe58d1a81c434ef97659428c8bf1ec290..eebd4c50a7324250d3ebe7060739a71af4243f72 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -604,7 +604,7 @@ public class ChunkProviderServer extends IChunkProvider {
@ -31,7 +31,7 @@ index c879e5d9acd400db5b7fdb770e5f8cc419e3bb23..228666eccfb924d2844c911e734eef4b
public void c(Vec3D vec3d) {
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 6f26d468bcb68328a3e0ee7f627dc8f21c04cfa8..f816af5c421c21e183435b3d3907883a0480f6fb 100644
index 56cf64709ae520287f6687fe7c2f55040cc769a1..0a5f784e851414f84e5a94b53f5616531f533109 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -43,6 +43,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -42,7 +42,7 @@ index 6f26d468bcb68328a3e0ee7f627dc8f21c04cfa8..f816af5c421c21e183435b3d3907883a
public final MinecraftServer server;
public final PlayerInteractManager playerInteractManager;
public final Deque<Integer> removeQueue = new ArrayDeque<>(); // Paper
@@ -100,6 +101,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -105,6 +106,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public boolean joining = true;
public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 22b033b85f34673928f47a65962d2bb6d34e6976..14606a12c472e0e58f76023a53a4129536ac5cc4 100644
index 40ac2b8153dbbb10b732123f95b9c0a3a807e54e..7a2140e4b901027997b2884275b35b43fe2175bc 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1825,7 +1825,16 @@ public abstract class EntityLiving extends Entity {

Datei anzeigen

@ -14,10 +14,10 @@ Use an ArrayDeque to store this Queue
We make sure to also implement a pattern that is recursion safe too.
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index d0a5335b6315f3c8f8b431f53ad69a53caf9fd63..3355e2110d98c7ca514a1abf9461f1bb13ab7a30 100644
index 8de86684dda275585826617b41d6792f233b814c..850602a32d371bd030665732b762b4bcbd49e25e 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -111,24 +111,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -112,24 +112,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public final CallbackExecutor callbackExecutor = new CallbackExecutor();
public static final class CallbackExecutor implements java.util.concurrent.Executor, Runnable {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add phantom creative and insomniac controls
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 21940f2034744ea417a43fcebc92b21298753d2d..dfe4baf1973c38e4a443a2b1d6b1eb19140137e1 100644
index e4821d4c23689aaf51b60c66fc1e6bc7a0b02fd5..5785f24b0646f8dbf3fba0bbc3b3e5b93e02f162 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -622,4 +622,11 @@ public class PaperWorldConfig {
@@ -627,4 +627,11 @@ public class PaperWorldConfig {
private void lightQueueSize() {
lightQueueSize = getInt("light-queue-size", lightQueueSize);
}

Datei anzeigen

@ -56,10 +56,10 @@ index 57f7dfc6a5316cfec5cce9c60e7b91d94c505f50..735beaf6fa6e6ccf2137b64a0b5179ad
return i;
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 1009ad80c6cd869c1f2b77b7bc1570907af983cf..43209c7392f675f3b9301f654b53b3fceb9ddacf 100644
index 850602a32d371bd030665732b762b4bcbd49e25e..a7be3f6d2a11c1e1b310f0fcdbe2e485a2113c59 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -144,21 +144,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -145,21 +145,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - distance maps
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<EntityPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
@ -116,10 +116,10 @@ index 1009ad80c6cd869c1f2b77b7bc1570907af983cf..43209c7392f675f3b9301f654b53b3fc
}
// Paper end
@@ -194,6 +228,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.l = supplier;
@@ -196,6 +230,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.m = new VillagePlace(new File(this.w, "poi"), datafixer, flag, this.world); // Paper
this.setViewDistance(i);
this.playerMobDistanceMap = this.world.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper
+ // Paper start - use distance map to optimise entity tracker
+ this.playerEntityTrackerTrackMaps = new com.destroystokyo.paper.util.misc.PlayerAreaMap[TRACKING_RANGE_TYPES.length];
+ this.entityTrackerTrackRanges = new int[TRACKING_RANGE_TYPES.length];
@ -161,8 +161,8 @@ index 1009ad80c6cd869c1f2b77b7bc1570907af983cf..43209c7392f675f3b9301f654b53b3fc
+ // Paper end - use distance map to optimise entity tracker
}
private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) {
@@ -1413,17 +1486,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public void updatePlayerMobTypeMap(Entity entity) {
@@ -1432,17 +1505,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
public void movePlayer(EntityPlayer entityplayer) {
@ -181,7 +181,7 @@ index 1009ad80c6cd869c1f2b77b7bc1570907af983cf..43209c7392f675f3b9301f654b53b3fc
int i = MathHelper.floor(entityplayer.locX()) >> 4;
int j = MathHelper.floor(entityplayer.locZ()) >> 4;
@@ -1539,7 +1602,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1558,7 +1621,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
this.trackedEntities.put(entity.getId(), playerchunkmap_entitytracker);
@ -190,7 +190,7 @@ index 1009ad80c6cd869c1f2b77b7bc1570907af983cf..43209c7392f675f3b9301f654b53b3fc
if (entity instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer) entity;
@@ -1582,7 +1645,37 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1601,7 +1664,37 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
entity.tracker = null; // Paper - We're no longer tracked
}
@ -228,7 +228,7 @@ index 1009ad80c6cd869c1f2b77b7bc1570907af983cf..43209c7392f675f3b9301f654b53b3fc
List<EntityPlayer> list = Lists.newArrayList();
List<EntityPlayer> list1 = this.world.getPlayers();
@@ -1650,23 +1743,31 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1669,23 +1762,31 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PacketDebug.a(this.world, chunk.getPos());
List<Entity> list = Lists.newArrayList();
List<Entity> list1 = Lists.newArrayList();
@ -272,7 +272,7 @@ index 1009ad80c6cd869c1f2b77b7bc1570907af983cf..43209c7392f675f3b9301f654b53b3fc
Iterator iterator;
Entity entity1;
@@ -1704,7 +1805,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1723,7 +1824,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public class EntityTracker {
@ -281,7 +281,7 @@ index 1009ad80c6cd869c1f2b77b7bc1570907af983cf..43209c7392f675f3b9301f654b53b3fc
private final Entity tracker;
private final int trackingDistance;
private SectionPosition e;
@@ -1721,6 +1822,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1740,6 +1841,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.e = SectionPosition.a(entity);
}
@ -324,7 +324,7 @@ index 1009ad80c6cd869c1f2b77b7bc1570907af983cf..43209c7392f675f3b9301f654b53b3fc
public boolean equals(Object object) {
return object instanceof PlayerChunkMap.EntityTracker ? ((PlayerChunkMap.EntityTracker) object).tracker.getId() == this.tracker.getId() : false;
}
@@ -1821,7 +1958,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1840,7 +1977,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
int j = entity.getEntityType().getChunkRange() * 16;
j = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, j); // Paper

Datei anzeigen

@ -77,7 +77,7 @@ index 32d3887e2542c4ebba4a7498167fbe4b497a71ce..7e57a53ec614a2f7d2672edff9d7c0e0
public String c() {
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 4c6b056cb1a2040251acc09ef2eb6bfd893a0300..c265631a2a581a913ab460f816fc70394eb7323f 100644
index eebd4c50a7324250d3ebe7060739a71af4243f72..a6363b73522f9d27534b6e80f4b3789e84316c49 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -728,6 +728,36 @@ public class ChunkProviderServer extends IChunkProvider {
@ -117,7 +117,7 @@ index 4c6b056cb1a2040251acc09ef2eb6bfd893a0300..c265631a2a581a913ab460f816fc7039
this.world.getMethodProfiler().enter("pollingChunks");
int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED);
boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit
@@ -742,15 +772,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -757,15 +787,7 @@ public class ChunkProviderServer extends IChunkProvider {
this.world.getMethodProfiler().exit();
//List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper
//Collections.shuffle(list); // Paper
@ -134,7 +134,7 @@ index 4c6b056cb1a2040251acc09ef2eb6bfd893a0300..c265631a2a581a913ab460f816fc7039
final int[] chunksTicked = {0}; this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
@@ -766,9 +788,9 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -781,9 +803,9 @@ public class ChunkProviderServer extends IChunkProvider {
Chunk chunk = (Chunk) optional1.get();
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
@ -147,10 +147,10 @@ index 4c6b056cb1a2040251acc09ef2eb6bfd893a0300..c265631a2a581a913ab460f816fc7039
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index f816af5c421c21e183435b3d3907883a0480f6fb..8177781a9cbba57097c5873fd917ff5d9954ccf8 100644
index 0a5f784e851414f84e5a94b53f5616531f533109..fb2b64628b974758cace770ce6debe5e88318ae8 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -108,6 +108,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -113,6 +113,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<EntityPlayer> cachedSingleHashSet; // Paper
@ -191,10 +191,10 @@ index 9cb2ff09da0b8832e58eed4d70741853a25c9011..7f660d3c528f5fb4150e4ee8b2991343
// Paper start
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 43209c7392f675f3b9301f654b53b3fceb9ddacf..31ab5510fcaaf9640098d9ab1f56185cec1eb680 100644
index a7be3f6d2a11c1e1b310f0fcdbe2e485a2113c59..026562c72d7e95345d9369c6d6331cf6cedb8f17 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -158,6 +158,17 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -159,6 +159,17 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return MinecraftServer.getServer().applyTrackingRangeScale(vanilla);
}
// Paper end - use distance map to optimise tracker
@ -212,7 +212,7 @@ index 43209c7392f675f3b9301f654b53b3fceb9ddacf..31ab5510fcaaf9640098d9ab1f56185c
void addPlayerToDistanceMaps(EntityPlayer player) {
int chunkX = MCUtil.getChunkCoordinate(player.locX());
@@ -171,6 +182,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -172,6 +183,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
trackMap.add(player, chunkX, chunkZ, Math.min(trackRange, this.getEffectiveViewDistance()));
}
// Paper end - use distance map to optimise entity tracker
@ -222,7 +222,7 @@ index 43209c7392f675f3b9301f654b53b3fceb9ddacf..31ab5510fcaaf9640098d9ab1f56185c
}
void removePlayerFromDistanceMaps(EntityPlayer player) {
@@ -179,6 +193,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -180,6 +194,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.playerEntityTrackerTrackMaps[i].remove(player);
}
// Paper end - use distance map to optimise tracker
@ -233,7 +233,7 @@ index 43209c7392f675f3b9301f654b53b3fceb9ddacf..31ab5510fcaaf9640098d9ab1f56185c
}
void updateMaps(EntityPlayer player) {
@@ -193,6 +211,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -194,6 +212,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
trackMap.update(player, chunkX, chunkZ, Math.min(trackRange, this.getEffectiveViewDistance()));
}
// Paper end - use distance map to optimise entity tracker
@ -243,7 +243,7 @@ index 43209c7392f675f3b9301f654b53b3fceb9ddacf..31ab5510fcaaf9640098d9ab1f56185c
}
// Paper end
@@ -224,7 +245,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -225,7 +246,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.mailboxWorldGen = this.p.a(threadedmailbox, false);
this.mailboxMain = this.p.a(mailbox, false);
this.lightEngine = new LightEngineThreaded(ilightaccess, this, this.world.getDimensionManager().hasSkyLight(), threadedmailbox1, this.p.a(threadedmailbox1, false));
@ -252,7 +252,7 @@ index 43209c7392f675f3b9301f654b53b3fceb9ddacf..31ab5510fcaaf9640098d9ab1f56185c
this.l = supplier;
this.m = new VillagePlace(new File(this.w, "poi"), datafixer, flag, this.world); // Paper
this.setViewDistance(i);
@@ -267,8 +288,41 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -269,6 +290,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.playerEntityTrackerTrackMaps[ordinal] = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets);
}
// Paper end - use distance map to optimise entity tracker
@ -290,11 +290,16 @@ index 43209c7392f675f3b9301f654b53b3fceb9ddacf..31ab5510fcaaf9640098d9ab1f56185c
+ // Paper end - optimise PlayerChunkMap#isOutsideRange
}
public void updatePlayerMobTypeMap(Entity entity) {
@@ -288,6 +341,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return entityPlayer.mobCounts[enumCreatureType.ordinal()];
}
+ private static double getDistanceSquaredFromChunk(ChunkCoordIntPair chunkPos, Entity entity) { return a(chunkPos, entity); } // Paper - OBFHELPER
private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) {
double d0 = (double) (chunkcoordintpair.x * 16 + 8);
double d1 = (double) (chunkcoordintpair.z * 16 + 8);
@@ -447,6 +501,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -466,6 +520,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
} else {
if (playerchunk != null) {
playerchunk.a(j);
@ -302,7 +307,7 @@ index 43209c7392f675f3b9301f654b53b3fceb9ddacf..31ab5510fcaaf9640098d9ab1f56185c
}
if (playerchunk != null) {
@@ -1415,30 +1470,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1434,30 +1489,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return isOutsideOfRange(chunkcoordintpair, false);
}

Datei anzeigen

@ -23,10 +23,10 @@ index c9164dfdb27ddf3709129c8aec54903a1df121ff..e33e889c291d37a821a4fbd40d9aac7b
}));
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index dfe4baf1973c38e4a443a2b1d6b1eb19140137e1..6b1b4780a8553dfd7da32c3e9e76b142122f6a74 100644
index 5785f24b0646f8dbf3fba0bbc3b3e5b93e02f162..0746932a3191669052f15270f5c94efbce0bd0c2 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -629,4 +629,9 @@ public class PaperWorldConfig {
@@ -634,4 +634,9 @@ public class PaperWorldConfig {
phantomIgnoreCreative = getBoolean("phantoms-do-not-spawn-on-creative-players", phantomIgnoreCreative);
phantomOnlyAttackInsomniacs = getBoolean("phantoms-only-attack-insomniacs", phantomOnlyAttackInsomniacs);
}
@ -115,10 +115,10 @@ index 7e57a53ec614a2f7d2672edff9d7c0e0dca42377..c072f61e8c88eac8335acd660d8ff0e2
if (flag1) {
ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> {
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 8177781a9cbba57097c5873fd917ff5d9954ccf8..9f2eb5ea511f7b854ff06e321015a464771c86bc 100644
index fb2b64628b974758cace770ce6debe5e88318ae8..0e3ceb60e503c74fc65b1d08371645ffbb26ef5c 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -110,6 +110,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -115,6 +115,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks
@ -221,7 +221,7 @@ index 7f660d3c528f5fb4150e4ee8b29913436f125b06..40347212ad1bcf857d5b8ddb0ee6a698
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de5757f380 100644
index 026562c72d7e95345d9369c6d6331cf6cedb8f17..fe343f70ce8024c86363637fda8e5c09cc6e60a9 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -95,7 +95,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -233,7 +233,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
public final WorldLoadListener worldLoadListener;
public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER
private final AtomicInteger u;
@@ -169,6 +169,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -170,6 +170,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap; // this map is absent from updateMaps since it's controlled at the start of the chunkproviderserver tick
public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerChunkTickRangeMap;
// Paper end - optimise PlayerChunkMap#isOutsideRange
@ -256,7 +256,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
void addPlayerToDistanceMaps(EntityPlayer player) {
int chunkX = MCUtil.getChunkCoordinate(player.locX());
@@ -185,6 +201,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -186,6 +202,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - optimise PlayerChunkMap#isOutsideRange
this.playerChunkTickRangeMap.add(player, chunkX, chunkZ, ChunkMapDistance.MOB_SPAWN_RANGE);
// Paper end - optimise PlayerChunkMap#isOutsideRange
@ -276,7 +276,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
}
void removePlayerFromDistanceMaps(EntityPlayer player) {
@@ -197,6 +226,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -198,6 +227,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.playerMobSpawnMap.remove(player);
this.playerChunkTickRangeMap.remove(player);
// Paper end - optimise PlayerChunkMap#isOutsideRange
@ -288,7 +288,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
}
void updateMaps(EntityPlayer player) {
@@ -214,6 +248,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -215,6 +249,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - optimise PlayerChunkMap#isOutsideRange
this.playerChunkTickRangeMap.update(player, chunkX, chunkZ, ChunkMapDistance.MOB_SPAWN_RANGE);
// Paper end - optimise PlayerChunkMap#isOutsideRange
@ -308,7 +308,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
}
// Paper end
@@ -320,6 +367,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -322,6 +369,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
});
// Paper end - optimise PlayerChunkMap#isOutsideRange
@ -353,8 +353,8 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
+ // Paper end - no-tick view distance
}
private static double getDistanceSquaredFromChunk(ChunkCoordIntPair chunkPos, Entity entity) { return a(chunkPos, entity); } // Paper - OBFHELPER
@@ -1121,15 +1207,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public void updatePlayerMobTypeMap(Entity entity) {
@@ -1140,15 +1226,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
completablefuture1.thenAcceptAsync((either) -> {
either.mapLeft((chunk) -> {
this.u.getAndIncrement();
@ -372,7 +372,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
});
return completablefuture1;
}
@@ -1224,32 +1306,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1243,32 +1325,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@ -426,7 +426,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
protected void sendChunk(EntityPlayer entityplayer, ChunkCoordIntPair chunkcoordintpair, Packet<?>[] apacket, boolean flag, boolean flag1) {
if (entityplayer.world == this.world) {
@@ -1257,7 +1345,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1276,7 +1364,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PlayerChunk playerchunk = this.getVisibleChunk(chunkcoordintpair.pair());
if (playerchunk != null) {
@ -435,7 +435,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
if (chunk != null) {
this.a(entityplayer, apacket, chunk);
@@ -1518,6 +1606,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1537,6 +1625,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
// Paper end - optimise isOutsideOfRange
@ -443,7 +443,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
private boolean b(EntityPlayer entityplayer) {
return entityplayer.isSpectator() && !this.world.getGameRules().getBoolean(GameRules.SPECTATORS_GENERATE_CHUNKS);
}
@@ -1545,13 +1634,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1564,13 +1653,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps
}
@ -458,7 +458,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
}
@@ -1559,7 +1642,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1578,7 +1661,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
SectionPosition sectionposition = SectionPosition.a((Entity) entityplayer);
entityplayer.a(sectionposition);
@ -467,7 +467,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
return sectionposition;
}
@@ -1604,6 +1687,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1623,6 +1706,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
int k1;
int l1;
@ -475,7 +475,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
if (Math.abs(i1 - i) <= this.viewDistance * 2 && Math.abs(j1 - j) <= this.viewDistance * 2) {
k1 = Math.min(i, i1) - this.viewDistance;
l1 = Math.min(j, j1) - this.viewDistance;
@@ -1641,7 +1725,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1660,7 +1744,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.sendChunk(entityplayer, chunkcoordintpair1, new Packet[2], false, true);
}
}
@ -484,7 +484,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
this.updateMaps(entityplayer); // Paper - distance maps
@@ -1649,11 +1733,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1668,11 +1752,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@Override
public Stream<EntityPlayer> a(ChunkCoordIntPair chunkcoordintpair, boolean flag) {
@ -535,7 +535,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
}
protected void addEntity(Entity entity) {
@@ -1811,6 +1930,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1830,6 +1949,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@ -543,7 +543,7 @@ index 31ab5510fcaaf9640098d9ab1f56185cec1eb680..03e94dbd750ee3181472bb74c3fbc7de
private void a(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) {
if (apacket[0] == null) {
apacket[0] = new PacketPlayOutMapChunk(chunk, 65535, true);
@@ -1996,7 +2116,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -2015,7 +2135,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair());

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen