diff --git a/Spigot-API-Patches/0169-Add-more-Zombie-API.patch b/Spigot-API-Patches/0169-Add-more-Zombie-API.patch index 0e739e66f..596bea2c5 100644 --- a/Spigot-API-Patches/0169-Add-more-Zombie-API.patch +++ b/Spigot-API-Patches/0169-Add-more-Zombie-API.patch @@ -1,18 +1,17 @@ -From 46242a1697a2b7a91f5b564f7fd02ea8d1bbcc02 Mon Sep 17 00:00:00 2001 +From 8fc89f6aa5cd95b3b784cefd12a6e7e4bd4db165 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 Oct 2018 04:29:51 -0500 Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java -index 62923379..a6894903 100644 +index 48034198..615dd990 100644 --- a/src/main/java/org/bukkit/entity/Zombie.java +++ b/src/main/java/org/bukkit/entity/Zombie.java -@@ -48,4 +48,53 @@ public interface Zombie extends Monster { +@@ -79,4 +79,55 @@ public interface Zombie extends Monster { + * @param time new conversion time */ - @Deprecated - public Villager.Profession getVillagerProfession(); -+ + void setConversionTime(int time); + // Paper start + /** + * Check if zombie is drowning @@ -25,7 +24,10 @@ index 62923379..a6894903 100644 + * Make zombie start drowning + * + * @param drownedConversionTime Amount of time until zombie converts from drowning ++ * ++ * @deprecated See {@link #setConversionTime(int)} + */ ++ @Deprecated + void startDrowning(int drownedConversionTime); + + /** @@ -63,5 +65,5 @@ index 62923379..a6894903 100644 + // Paper end } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0002-Paper-config-files.patch b/Spigot-Server-Patches/0002-Paper-config-files.patch index e61a42689..9cd9a27ce 100644 --- a/Spigot-Server-Patches/0002-Paper-config-files.patch +++ b/Spigot-Server-Patches/0002-Paper-config-files.patch @@ -1,4 +1,4 @@ -From fdf3ad1b2a768fbbbcd50d038efff92f144c23b5 Mon Sep 17 00:00:00 2001 +From 1b71f76b3adb5f3ea991080df8180a1473da4e12 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 29 Feb 2016 21:02:09 -0600 Subject: [PATCH] Paper config files @@ -511,7 +511,7 @@ index 000000000..a73865739 + } +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 1f44d8119..73a326684 100644 +index cdfd9a8fb..b5e5c385d 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -192,6 +192,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -531,19 +531,19 @@ index 1f44d8119..73a326684 100644 DedicatedServer.LOGGER.info("Generating keypair"); this.a(MinecraftEncryption.b()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 27a24b00b..08c17d134 100644 +index f04e87c57..c93cab858 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -135,9 +135,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { private static final DataWatcherObject aG = DataWatcher.a(Entity.class, DataWatcherRegistry.i); private static final DataWatcherObject aH = DataWatcher.a(Entity.class, DataWatcherRegistry.i); public boolean inChunk; -- public int ae; -- public int af; -- public int ag; -+ public int ae; public int getChunkX() { return ae; } // Paper - OBFHELPER -+ public int af; public int getChunkY() { return af; } // Paper - OBFHELPER -+ public int ag; public int getChunkZ() { return ag; } // Paper - OBFHELPER +- public int chunkX; +- public int chunkY; +- public int chunkZ; ++ public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER ++ public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER ++ public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER public boolean ak; public boolean impulse; public int portalCooldown; @@ -572,7 +572,7 @@ index 207bad41e..bcdc790ba 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2252fa991..44b381120 100644 +index 673764369..0920ef2d1 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -134,6 +134,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -593,7 +593,7 @@ index 2252fa991..44b381120 100644 this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8ade4244e..b524adc7d 100644 +index aa0dfa4cc..a3c07fbac 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -753,6 +753,7 @@ public final class CraftServer implements Server { @@ -620,7 +620,7 @@ index 8ade4244e..b524adc7d 100644 overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -1973,4 +1976,26 @@ public final class CraftServer implements Server { +@@ -1972,4 +1975,26 @@ public final class CraftServer implements Server { { return spigot; } diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch index 38ca4c1a5..416603bc8 100644 --- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch @@ -1,36 +1,38 @@ -From 1ccbf8a244b37fa3cf0bd7e3843496891d891d3e Mon Sep 17 00:00:00 2001 +From dadb0a624cab08627738eb8b0538dc25bf636f10 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 30 Mar 2016 19:36:20 -0400 Subject: [PATCH] MC Dev fixes diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index a553fb747..4048937c6 100644 +index 25a1edc45..f1ad18511 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java -@@ -99,7 +99,7 @@ public class BaseBlockPosition implements Comparable { +@@ -98,8 +98,4 @@ public class BaseBlockPosition implements Comparable { + return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); } - // $FF: synthetic method +- // $FF: synthetic method - public int compareTo(Object object) { -+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix - return this.l((BaseBlockPosition)object); - } +- return this.compareTo((BaseBlockPosition)object); +- } } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7f8802b2e..6ffc53514 100644 +index 66c38df1f..50e29464b 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -179,7 +179,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -178,10 +178,6 @@ public class BlockPosition extends BaseBlockPosition { + } } - // $FF: synthetic method +- // $FF: synthetic method - protected Object computeNext() { -+ protected BlockPosition computeNext() { // Paper - decompile fix - return this.a(); - } +- return this.computeNext(); +- } }; -@@ -209,8 +209,11 @@ public class BlockPosition extends BaseBlockPosition { + }; + } +@@ -209,8 +205,11 @@ public class BlockPosition extends BaseBlockPosition { if (this.g.b < l) { ++this.g.b; } else if (this.g.c < i1) { @@ -42,15 +44,71 @@ index 7f8802b2e..6ffc53514 100644 ++this.g.d; } -@@ -219,7 +222,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -218,18 +217,10 @@ public class BlockPosition extends BaseBlockPosition { + } } - // $FF: synthetic method +- // $FF: synthetic method - protected Object computeNext() { -+ protected BlockPosition.MutableBlockPosition computeNext() { // Paper - decompile fix - return this.a(); - } +- return this.computeNext(); +- } }; + }; + } + +- // $FF: synthetic method +- public BaseBlockPosition d(BaseBlockPosition baseblockposition) { +- return this.d(baseblockposition); +- } + + public static class MutableBlockPosition extends BlockPosition { + protected int b; +@@ -314,10 +305,6 @@ public class BlockPosition extends BaseBlockPosition { + return new BlockPosition(this); + } + +- // $FF: synthetic method +- public BaseBlockPosition d(BaseBlockPosition baseblockposition) { +- return super.d(baseblockposition); +- } + } + + public static final class b extends BlockPosition.MutableBlockPosition implements AutoCloseable { +@@ -389,34 +376,5 @@ public class BlockPosition extends BaseBlockPosition { + } + } + +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition d(int i, int j, int k) { +- return this.d(i, j, k); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) { +- return this.c(enumdirection, i); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection) { +- return this.c(enumdirection); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition g(BaseBlockPosition baseblockposition) { +- return this.g(baseblockposition); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) { +- return this.c(d0, d1, d2); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition c(int i, int j, int k) { +- return this.c(i, j, k); +- } + } + } diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java index 3bd0c56d4..304e47bf2 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -139,7 +197,7 @@ index 8bfa218a6..e2e60d3ed 100644 arraylist.add(definedstructure$a); diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index 5c2d50f97..fd6df39f1 100644 +index 6695f8d77..e1ea8da88 100644 --- a/src/main/java/net/minecraft/server/EnchantmentManager.java +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java @@ -51,7 +51,7 @@ public class EnchantmentManager { @@ -200,76 +258,101 @@ index 04cff50cb..e746a6a0d 100644 EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX, this.locY, this.locZ); entityareaeffectcloud.setSource(this.shooter); entityareaeffectcloud.setParticle(Particles.j); +diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java +index 4dee04581..9c48bb3c9 100644 +--- a/src/main/java/net/minecraft/server/EntityLlama.java ++++ b/src/main/java/net/minecraft/server/EntityLlama.java +@@ -371,11 +371,6 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + public void s(boolean var1) { + } + +- // $FF: synthetic method +- public EntityAgeable createChild(EntityAgeable entityageable) { +- return this.createChild(entityageable); +- } +- + static class a extends PathfinderGoalNearestAttackableTarget { + public a(EntityLlama entityllama) { + super(entityllama, EntityWolf.class, 16, false, true, (Predicate)null); diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 38c85f4ab..c0853f0fc 100644 +index 23ca6fc50..44c91ba26 100644 --- a/src/main/java/net/minecraft/server/EnumDirection.java +++ b/src/main/java/net/minecraft/server/EnumDirection.java -@@ -233,7 +233,7 @@ public enum EnumDirection implements INamable { +@@ -232,10 +232,6 @@ public enum EnumDirection implements INamable { + return d0; } - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return super.a((EnumDirection)object); - } +- return super.test((EnumDirection)object); +- } }, -@@ -247,7 +247,7 @@ public enum EnumDirection implements INamable { + Y("y") { + public int a(int var1, int i, int var3) { +@@ -246,10 +242,6 @@ public enum EnumDirection implements INamable { + return d0; } - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return super.a((EnumDirection)object); - } +- return super.test((EnumDirection)object); +- } }, -@@ -261,7 +261,7 @@ public enum EnumDirection implements INamable { + Z("z") { + public int a(int var1, int var2, int i) { +@@ -260,10 +252,6 @@ public enum EnumDirection implements INamable { + return d0; } - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return super.a((EnumDirection)object); - } +- return super.test((EnumDirection)object); +- } }; -@@ -316,7 +316,7 @@ public enum EnumDirection implements INamable { + + private static final Map d = (Map)Arrays.stream(values()).collect(Collectors.toMap(EnumDirection.EnumAxis::a, (enumdirection$enumaxis) -> { +@@ -315,10 +303,6 @@ public enum EnumDirection implements INamable { + public abstract double a(double var1, double var3, double var5); - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return this.a((EnumDirection)object); - } +- return this.test((EnumDirection)object); +- } } -@@ -367,7 +367,7 @@ public enum EnumDirection implements INamable { + + public static enum EnumAxisDirection { +@@ -366,9 +350,5 @@ public enum EnumDirection implements INamable { + return Iterators.forArray(this.c); } - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return this.a((EnumDirection)object); - } +- return this.test((EnumDirection)object); +- } } + } diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java -index 3f5d6c323..286c1b14f 100644 +index 0e0571a6c..8fc45c697 100644 --- a/src/main/java/net/minecraft/server/IChatBaseComponent.java +++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java -@@ -390,12 +390,12 @@ public interface IChatBaseComponent extends Message, Iterable { @@ -350,21 +433,8 @@ index 86881a22d..81ff1fd69 100644 byte[] abyte = new byte[this.data.length]; System.arraycopy(this.data, 0, abyte, 0, this.data.length); -diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java -index 40f6179cd..ebc44ec9e 100644 ---- a/src/main/java/net/minecraft/server/NBTTagIntArray.java -+++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java -@@ -132,7 +132,7 @@ public class NBTTagIntArray extends NBTList { - return this.a(i); - } - -- public NBTBase clone() { -+ public NBTTagIntArray clone() { // Paper - decompile fix - return this.c(); - } - } diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index 24a66f95a..2e7c96056 100644 +index 8e6cce15f..1b72df8cd 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java @@ -12,7 +12,7 @@ import org.apache.logging.log4j.Logger; @@ -376,32 +446,56 @@ index 24a66f95a..2e7c96056 100644 private byte type = 0; public NBTTagList() { -@@ -286,6 +286,7 @@ public class NBTTagList extends NBTList { - return this.c(); +@@ -281,11 +281,7 @@ public class NBTTagList extends NBTList { + return this.type; } +- // $FF: synthetic method +- public NBTBase clone() { +- return this.clone(); +- } +- + /* // Paper start - Decompile fix // $FF: synthetic method public Object remove(int i) { return this.remove(i); -@@ -305,4 +306,5 @@ public class NBTTagList extends NBTList { +@@ -305,4 +301,5 @@ public class NBTTagList extends NBTList { public boolean add(Object object) { return this.add((NBTBase)object); } + */ // Paper end - Decompile fix } diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java -index 113e8780a..8e312c761 100644 +index a717ad95f..ff7e20dfc 100644 --- a/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java -@@ -49,7 +49,7 @@ public class PacketEncoder extends MessageToByteEncoder> { +@@ -48,8 +48,4 @@ public class PacketEncoder extends MessageToByteEncoder> { + } } - // $FF: synthetic method +- // $FF: synthetic method - protected void encode(ChannelHandlerContext channelhandlercontext, Object object, ByteBuf bytebuf) throws Exception { -+ protected void encode(ChannelHandlerContext channelhandlercontext, Packet object, ByteBuf bytebuf) throws Exception { // Paper - decompiler fix - this.a(channelhandlercontext, (Packet)object, bytebuf); +- this.encode(channelhandlercontext, (Packet)object, bytebuf); +- } + } +diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java +index 8bc7c0ccd..faaad0f41 100644 +--- a/src/main/java/net/minecraft/server/ProtoChunk.java ++++ b/src/main/java/net/minecraft/server/ProtoChunk.java +@@ -483,14 +483,4 @@ public class ProtoChunk implements IChunkAccess { + public void b(boolean flag) { + this.u = flag; } +- +- // $FF: synthetic method +- public TickList l() { +- return this.l(); +- } +- +- // $FF: synthetic method +- public TickList k() { +- return this.k(); +- } } diff --git a/src/main/java/net/minecraft/server/Registry.java b/src/main/java/net/minecraft/server/Registry.java index 5be9f0ff2..9efec49d6 100644 @@ -444,67 +538,93 @@ index 03c603362..d03ac0e70 100644 this.b = (K[])(new Object[i]); this.c = new int[i]; diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index 7b8a8064b..615aa2cd0 100644 +index 364dadfbd..c338d09bf 100644 --- a/src/main/java/net/minecraft/server/ServerPing.java +++ b/src/main/java/net/minecraft/server/ServerPing.java -@@ -101,12 +101,12 @@ public class ServerPing { +@@ -100,15 +100,6 @@ public class ServerPing { + return jsonobject; } - // $FF: synthetic method +- // $FF: synthetic method - public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(ServerPing object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix - return this.a((ServerPing)object, type, jsonserializationcontext); - } - - // $FF: synthetic method +- return this.serialize((ServerPing)object, type, jsonserializationcontext); +- } +- +- // $FF: synthetic method - public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public ServerPing deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); +- return this.deserialize(jsonelement, type, jsondeserializationcontext); +- } + } + + public static class ServerData { +@@ -144,15 +135,6 @@ public class ServerPing { + return jsonobject; + } + +- // $FF: synthetic method +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { +- return this.serialize((ServerPing.ServerData)object, type, jsonserializationcontext); +- } +- +- // $FF: synthetic method +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { +- return this.deserialize(jsonelement, type, jsondeserializationcontext); +- } } } -@@ -145,12 +145,12 @@ public class ServerPing { + +@@ -228,15 +210,6 @@ public class ServerPing { + return jsonobject; } - // $FF: synthetic method +- // $FF: synthetic method - public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(ServerPing.ServerData object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix - return this.a((ServerPing.ServerData)object, type, jsonserializationcontext); - } - - // $FF: synthetic method +- return this.serialize((ServerPing.ServerPingPlayerSample)object, type, jsonserializationcontext); +- } +- +- // $FF: synthetic method - public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public ServerPing.ServerData deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); - } - } -@@ -229,12 +229,12 @@ public class ServerPing { - } - - // $FF: synthetic method -- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(ServerPing.ServerPingPlayerSample object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix - return this.a((ServerPing.ServerPingPlayerSample)object, type, jsonserializationcontext); - } - - // $FF: synthetic method -- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public ServerPing.ServerPingPlayerSample deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); - } +- return this.deserialize(jsonelement, type, jsondeserializationcontext); +- } } + } + } diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java -index ef9d8e06f..0c9910d9a 100644 +index 475bf35fa..78234cbdd 100644 --- a/src/main/java/net/minecraft/server/ShapeDetector.java +++ b/src/main/java/net/minecraft/server/ShapeDetector.java -@@ -107,7 +107,7 @@ public class ShapeDetector { +@@ -106,10 +106,6 @@ public class ShapeDetector { + return new ShapeDetectorBlock(this.a, blockposition, this.b); } - // $FF: synthetic method +- // $FF: synthetic method - public Object load(Object object) throws Exception { -+ public ShapeDetectorBlock load(BlockPosition object) throws Exception {// Paper - Decompile fix - return this.a((BlockPosition)object); - } +- return this.load((BlockPosition)object); +- } } + + public static class ShapeDetectorCollection { +diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java +index c1bbacfc1..f0a826cd1 100644 +--- a/src/main/java/net/minecraft/server/WorldPersistentData.java ++++ b/src/main/java/net/minecraft/server/WorldPersistentData.java +@@ -7,6 +7,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; + import it.unimi.dsi.fastutil.objects.ObjectIterator; + import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry; + import java.io.DataInputStream; ++import java.io.DataOutput; + import java.io.DataOutputStream; + import java.io.File; + import java.io.FileInputStream; +@@ -98,7 +99,7 @@ public class WorldPersistentData { + } + + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(file1)); +- NBTCompressedStreamTools.a(nbttagcompound, dataoutputstream); ++ NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); // Paper - decompile fix + dataoutputstream.close(); + } + } catch (Exception exception) { -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch index 9c7f1903e..d50019df4 100644 --- a/Spigot-Server-Patches/0004-MC-Utils.patch +++ b/Spigot-Server-Patches/0004-MC-Utils.patch @@ -1,11 +1,11 @@ -From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 +From 6fa007b705e027301b61812c60b75dab498a177b Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:55:47 -0400 Subject: [PATCH] MC Utils diff --git a/src/main/java/net/minecraft/server/AttributeInstance.java b/src/main/java/net/minecraft/server/AttributeInstance.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 1c1a6a37a..0929e0189 100644 --- a/src/main/java/net/minecraft/server/AttributeInstance.java +++ b/src/main/java/net/minecraft/server/AttributeInstance.java @@ -20,8 +20,10 @@ public interface AttributeInstance { @@ -20,7 +20,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 void b(UUID var1); diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 50e29464b..880ce16b1 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -9,7 +9,7 @@ import org.apache.logging.log4j.Logger; @@ -40,7 +40,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public BlockPosition a(int ix, int jx, int kx) { return ix == 0 && jx == 0 && kx == 0 ? this : new BlockPosition(this.getX() + ix, this.getY() + jx, this.getZ() + kx); } -@@ -186,6 +187,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -182,6 +183,7 @@ public class BlockPosition extends BaseBlockPosition { }; } @@ -48,7 +48,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public BlockPosition h() { return this; } -@@ -282,6 +284,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -270,6 +272,7 @@ public class BlockPosition extends BaseBlockPosition { return this.d; } @@ -56,7 +56,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public BlockPosition.MutableBlockPosition c(int i, int j, int k) { this.b = i; this.c = j; -@@ -289,6 +292,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -277,6 +280,7 @@ public class BlockPosition extends BaseBlockPosition { return this; } @@ -65,10 +65,10 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return this.c(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 773a8c52d..5dd08018c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -27,7 +27,7 @@ import com.google.common.collect.Lists; // CraftBukkit +@@ -32,7 +32,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent; public class Chunk implements IChunkAccess { private static final Logger d = LogManager.getLogger(); @@ -77,7 +77,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 private final ChunkSection[] sections; private final BiomeBase[] f; private final boolean[] g; -@@ -700,6 +700,7 @@ public class Chunk implements IChunkAccess { +@@ -705,6 +705,7 @@ public class Chunk implements IChunkAccess { return this.a(blockposition, Chunk.EnumTileEntityState.CHECK); } @@ -86,7 +86,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 744762b8b..d9608121b 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java @@ -23,6 +23,8 @@ public class ChunkCoordIntPair { @@ -99,7 +99,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return (long)i & 4294967295L | ((long)j & 4294967295L) << 32; } diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 3919c1fba..772382144 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java @@ -16,7 +16,7 @@ import org.apache.logging.log4j.Logger; @@ -112,7 +112,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 private final IChunkLoader e; private final IAsyncTaskHandler f; diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 95ca5f6d8..0dc948a37 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -54,6 +54,7 @@ public class DataBits { @@ -124,7 +124,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return this.a; } diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 7f905b1e0..fa5b9262b 100644 --- a/src/main/java/net/minecraft/server/DataPalette.java +++ b/src/main/java/net/minecraft/server/DataPalette.java @@ -3,10 +3,11 @@ package net.minecraft.server; @@ -142,7 +142,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 void b(PacketDataSerializer var1); diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 304e47bf2..6e7454b13 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -7,7 +7,7 @@ import java.util.function.Function; @@ -184,7 +184,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 this.b(); packetdataserializer.writeByte(this.i); diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 372afbe94..20b7c2c6d 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -6,6 +6,7 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -196,7 +196,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 private float b; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 550c7a355..b039ff1b5 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -124,6 +124,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -208,7 +208,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // CraftBukkit start - fire event setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 341af9c16..14c481220 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -122,6 +122,7 @@ public abstract class EntityLiving extends Entity { @@ -220,7 +220,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 @Override public float getBukkitYaw() { diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index c9e596367..70830bbf4 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -1,11 +1,14 @@ @@ -239,7 +239,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return SoundCategory.HOSTILE; } diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index bcdc790ba..339abdc01 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -3,6 +3,7 @@ package net.minecraft.server; @@ -290,7 +290,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // Paper end } diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index ac081d230..faae6d09d 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -26,6 +26,7 @@ import org.bukkit.TreeType; @@ -321,7 +321,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java new file mode 100644 -index 7ac07ac07ac0..7ac07ac07ac0 +index 000000000..c97e116aa --- /dev/null +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +1,316 @@ @@ -642,7 +642,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 + } +} diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 447b56323..db4e4b859 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java @@ -23,7 +23,7 @@ import org.apache.logging.log4j.Logger; @@ -687,18 +687,18 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index db52ffad4..d5bbc5f8e 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -44,7 +44,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { return new DefaultEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Client IO #%d").setDaemon(true).build()); }); private final EnumProtocolDirection h; -- private final Queue i = Queues.newConcurrentLinkedQueue(); -+ private final Queue i = Queues.newConcurrentLinkedQueue(); private final Queue getPacketQueue() { return this.i; } // Paper - OBFHELPER +- private final Queue packetQueue = Queues.newConcurrentLinkedQueue(); ++ private final Queue packetQueue = Queues.newConcurrentLinkedQueue(); private final Queue getPacketQueue() { return this.packetQueue; } // Paper - OBFHELPER private final ReentrantReadWriteLock j = new ReentrantReadWriteLock(); public Channel channel; - // Spigot Start // PAIL + public SocketAddress socketAddress; @@ -168,6 +168,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } @@ -715,7 +715,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 private void o() { if (this.channel != null && this.channel.isOpen()) { this.j.readLock().lock(); -@@ -338,9 +340,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -334,9 +336,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> { static class QueuedPacket { @@ -728,7 +728,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public QueuedPacket(Packet packet, @Nullable GenericFutureListener> genericfuturelistener) { this.a = packet; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 7582151ae..d05f1e02c 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf { @@ -740,7 +740,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 for (int j = 1; j < 5; ++j) { if ((i & -1 << j * 7) == 0) { diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index ff7e20dfc..3448f6c53 100644 --- a/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java @@ -38,6 +38,7 @@ public class PacketEncoder extends MessageToByteEncoder> { @@ -752,7 +752,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 throw new SkipEncodeException(throwable); } else { diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 12d6c99cf..af382815f 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -11,7 +11,7 @@ public class PacketPlayOutMapChunk implements Packet { @@ -773,24 +773,24 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 int j = 0; ChunkSection[] achunksection = chunk.getSections(); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index bbc8c0007..2b6c797ce 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -68,9 +68,9 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private final MinecraftServer minecraftServer; public EntityPlayer player; private int e; -- private long f; -- private boolean g; +- private long lastKeepAlive; +- private boolean awaitingKeepAlive; - private long h; -+ private long f; private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER -+ private boolean g; private void setPendingPing(boolean isPending) { this.g = isPending;}; private boolean isPendingPing() { return this.g;}; // Paper - OBFHELPER ++ private long lastKeepAlive; private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER ++ private boolean awaitingKeepAlive; private void setPendingPing(boolean isPending) { this.awaitingKeepAlive = isPending;}; private boolean isPendingPing() { return this.awaitingKeepAlive;}; // Paper - OBFHELPER + private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER // CraftBukkit start - multithreaded fields private volatile int chatThrottle; private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 8fce3b022..58ac6eafc 100644 --- a/src/main/java/net/minecraft/server/PotionUtil.java +++ b/src/main/java/net/minecraft/server/PotionUtil.java @@ -103,6 +103,7 @@ public class PotionUtil { @@ -802,7 +802,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry); if (potionregistry == Potions.EMPTY) { diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index a21006290..6c6f006f3 100644 --- a/src/main/java/net/minecraft/server/RegistryBlockID.java +++ b/src/main/java/net/minecraft/server/RegistryBlockID.java @@ -54,6 +54,7 @@ public class RegistryBlockID implements Registry { @@ -814,7 +814,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return this.b.size(); } diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 25d4907b3..1f6de76a7 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java @@ -34,8 +34,8 @@ public class SystemUtils { @@ -828,20 +828,15 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } public static String a(String s, @Nullable MinecraftKey minecraftkey) { -@@ -43,11 +43,11 @@ public class SystemUtils { +@@ -47,7 +47,7 @@ public class SystemUtils { } - public static long b() { -- return c() / 1000000L; -+ return System.nanoTime() / 1000000L; // Paper - } - - public static long c() { + public static long getMonotonicNanos() { - return a.getAsLong(); + return System.nanoTime(); // Paper } - public static long d() { + public static long getTimeMillis() { @@ -109,7 +109,7 @@ public class SystemUtils { futuretask.run(); return (V)futuretask.get(); @@ -861,5 +856,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 static enum IdentityHashingStrategy implements Strategy { -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index 610fcccca..a8b940612 100644 --- a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -1,4 +1,4 @@ -From 02e9001365c48007078e30a3e7566cecc2a53414 Mon Sep 17 00:00:00 2001 +From 89c7eb82c66a25dc178e94900fe26e498351762e Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 02:10:36 -0400 Subject: [PATCH] Store reference to current Chunk for Entity and Block @@ -8,10 +8,10 @@ This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 4870a4bb5..085d3d3e8 100644 +index 5dd08018c..d1d8c3be6 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -32,7 +32,7 @@ public class Chunk implements IChunkAccess { +@@ -37,7 +37,7 @@ public class Chunk implements IChunkAccess { private final BiomeBase[] f; private final boolean[] g; private final Map h; @@ -20,7 +20,7 @@ index 4870a4bb5..085d3d3e8 100644 public final World world; public final Map heightMap; public final int locX; -@@ -62,7 +62,30 @@ public class Chunk implements IChunkAccess { +@@ -67,7 +67,30 @@ public class Chunk implements IChunkAccess { // CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking private int neighbors = 0x1 << 12; public long chunkKey; @@ -51,7 +51,7 @@ index 4870a4bb5..085d3d3e8 100644 public boolean areNeighborsLoaded(final int radius) { switch (radius) { case 2: -@@ -93,7 +116,7 @@ public class Chunk implements IChunkAccess { +@@ -98,7 +121,7 @@ public class Chunk implements IChunkAccess { this.g = new boolean[256]; this.h = Maps.newHashMap(); this.heightMap = Maps.newEnumMap(HeightMap.Type.class); @@ -60,9 +60,9 @@ index 4870a4bb5..085d3d3e8 100644 this.p = Maps.newHashMap(); this.q = Maps.newHashMap(); this.r = new ShortList[16]; -@@ -653,6 +676,9 @@ public class Chunk implements IChunkAccess { - entity.af = k; - entity.ag = this.locZ; +@@ -658,6 +681,9 @@ public class Chunk implements IChunkAccess { + entity.chunkY = k; + entity.chunkZ = this.locZ; this.entitySlices[k].add(entity); + // Paper start + entity.setCurrentChunk(this); @@ -70,7 +70,7 @@ index 4870a4bb5..085d3d3e8 100644 } public void a(HeightMap.Type heightmap_type, long[] along) { -@@ -671,8 +697,12 @@ public class Chunk implements IChunkAccess { +@@ -676,8 +702,12 @@ public class Chunk implements IChunkAccess { if (i >= this.entitySlices.length) { i = this.entitySlices.length - 1; } @@ -85,7 +85,7 @@ index 4870a4bb5..085d3d3e8 100644 } public boolean c(BlockPosition blockposition) { -@@ -873,6 +903,7 @@ public class Chunk implements IChunkAccess { +@@ -886,6 +916,7 @@ public class Chunk implements IChunkAccess { } } // Spigot End @@ -94,7 +94,7 @@ index 4870a4bb5..085d3d3e8 100644 // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 3e5c2d8e7..fde9d4d51 100644 +index a6eb8ab6c..50176b97b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -134,7 +134,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -103,9 +103,9 @@ index 3e5c2d8e7..fde9d4d51 100644 private static final DataWatcherObject aH = DataWatcher.a(Entity.class, DataWatcherRegistry.i); - public boolean inChunk; + public boolean inChunk; public boolean isAddedToChunk() { return inChunk; } // Paper - OBFHELPER - public int ae; public int getChunkX() { return ae; } // Paper - OBFHELPER - public int af; public int getChunkY() { return af; } // Paper - OBFHELPER - public int ag; public int getChunkZ() { return ag; } // Paper - OBFHELPER + public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER + public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER + public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER @@ -1762,6 +1762,39 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } @@ -192,5 +192,5 @@ index 2c57a4f03..153efb9b9 100644 /** * Order is *EXTREMELY* important -- keep it right! =D -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch b/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch index 1b620b0d3..647fd7841 100644 --- a/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch +++ b/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch @@ -1,4 +1,4 @@ -From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 +From a00c2b358e7f0ce360d28c8e803026470f3ee940 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 02:13:59 -0400 Subject: [PATCH] Store counts for each Entity/Block Entity Type @@ -6,10 +6,10 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type Opens door for future patches to optimize performance diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index d1d8c3be6..4d04fdda7 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -63,15 +63,19 @@ public class Chunk implements IChunkAccess { +@@ -68,15 +68,19 @@ public class Chunk implements IChunkAccess { private int neighbors = 0x1 << 12; public long chunkKey; // Paper start @@ -29,7 +29,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } return replaced; } -@@ -81,6 +85,7 @@ public class Chunk implements IChunkAccess { +@@ -86,6 +90,7 @@ public class Chunk implements IChunkAccess { TileEntity removed = super.remove(key); if (removed != null) { removed.setCurrentChunk(null); @@ -37,7 +37,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } return removed; } -@@ -678,6 +683,7 @@ public class Chunk implements IChunkAccess { +@@ -683,6 +688,7 @@ public class Chunk implements IChunkAccess { this.entitySlices[k].add(entity); // Paper start entity.setCurrentChunk(this); @@ -45,7 +45,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // Paper end } -@@ -702,6 +708,7 @@ public class Chunk implements IChunkAccess { +@@ -707,6 +713,7 @@ public class Chunk implements IChunkAccess { return; } entity.setCurrentChunk(null); @@ -54,5 +54,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch index 360cc4967..d34df9f7f 100644 --- a/Spigot-Server-Patches/0009-Timings-v2.patch +++ b/Spigot-Server-Patches/0009-Timings-v2.patch @@ -1,4 +1,4 @@ -From 2589f04f992b46251d9c0317f588987a451be50a Mon Sep 17 00:00:00 2001 +From 87fd657aa5de36c8b09b9d2463708b818665f008 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Mar 2016 04:00:11 -0600 Subject: [PATCH] Timings v2 @@ -253,7 +253,7 @@ index 000000000..145cb274b + } +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 87a7b6980..2f17e5219 100644 +index 255b8bed0..fe148495b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -14,11 +14,14 @@ import java.util.concurrent.TimeUnit; @@ -297,7 +297,7 @@ index 87a7b6980..2f17e5219 100644 + } } diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index b9645c669..fb7688e9e 100644 +index a30b21ad2..83b1ef0fc 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -23,6 +23,15 @@ public class Block implements IMaterial { @@ -317,10 +317,10 @@ index b9645c669..fb7688e9e 100644 private final float frictionFactor; protected final BlockStateList blockStateList; diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 6675bc5cc..f929ce02e 100644 +index 4d04fdda7..9970a58ed 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -842,6 +842,7 @@ public class Chunk implements IChunkAccess { +@@ -855,6 +855,7 @@ public class Chunk implements IChunkAccess { server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(this.bukkitChunk, this.needsDecoration)); if (this.needsDecoration) { @@ -328,7 +328,7 @@ index 6675bc5cc..f929ce02e 100644 BlockSand.instaFall = true; java.util.Random random = new java.util.Random(); random.setSeed(world.getSeed()); -@@ -862,6 +863,7 @@ public class Chunk implements IChunkAccess { +@@ -875,6 +876,7 @@ public class Chunk implements IChunkAccess { } BlockSand.instaFall = false; server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk)); @@ -337,13 +337,13 @@ index 6675bc5cc..f929ce02e 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index f0d926256..ca18901df 100644 +index df2711a5f..732c8793e 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -14,6 +14,7 @@ public class ChunkMap extends Long2ObjectOpenHashMap { } - public Chunk a(long i, Chunk chunk) { + public Chunk put(long i, Chunk chunk) { + chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper Chunk chunk1 = (Chunk) super.put(i, chunk); ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i); @@ -398,7 +398,7 @@ index b859a5b9e..60abc5f28 100644 this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot } catch (IOException ioexception) { diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 3bf55a054..179769323 100644 +index 1b8c28096..62a63dfa8 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -1,5 +1,6 @@ @@ -433,11 +433,11 @@ index 3bf55a054..179769323 100644 - world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot - world.timings.syncChunkLoadTileTicksTimer.startTiming(); // Spigot - if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.J() instanceof TickListServer) { - ((TickListServer) world.J()).a(nbttagcompound.getList("TileTicks", 10)); + if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.getBlockTickList() instanceof TickListServer) { + ((TickListServer) world.getBlockTickList()).a(nbttagcompound.getList("TileTicks", 10)); @@ -719,7 +716,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.I() instanceof TickListServer) { - ((TickListServer) world.I()).a(nbttagcompound.getList("LiquidTicks", 10)); + if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.getFluidTickList() instanceof TickListServer) { + ((TickListServer) world.getFluidTickList()).a(nbttagcompound.getList("LiquidTicks", 10)); } - world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot + world.timings.chunkLoadLevelTimer.stopTiming(); // Spigot @@ -472,7 +472,7 @@ index cc9e8465c..1bd3a0f77 100644 return this.b; } diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java -index 15ab4f0e4..1004e084c 100644 +index b8a626dd4..323b2e6dc 100644 --- a/src/main/java/net/minecraft/server/CustomFunctionData.java +++ b/src/main/java/net/minecraft/server/CustomFunctionData.java @@ -109,7 +109,7 @@ public class CustomFunctionData implements ITickable, IResourcePackListener { @@ -485,7 +485,7 @@ index 15ab4f0e4..1004e084c 100644 int j = 0; CustomFunction.c[] acustomfunction_c = customfunction.b(); diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 73a326684..a575ff529 100644 +index b5e5c385d..7f4c76669 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -29,7 +29,7 @@ import org.apache.logging.log4j.Level; @@ -500,7 +500,7 @@ index 73a326684..a575ff529 100644 @@ -454,7 +454,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } - public void aU() { + public void handleCommandQueue() { - SpigotTimings.serverCommandTimer.startTiming(); // Spigot + MinecraftTimings.serverCommandTimer.startTiming(); // Spigot while (!this.serverCommandQueue.isEmpty()) { @@ -538,7 +538,7 @@ index 73a326684..a575ff529 100644 return waitable.get(); } catch (java.util.concurrent.ExecutionException e) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index f05a9ebab..8b1e0448b 100644 +index 50176b97b..f960db23d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender; @@ -570,14 +570,14 @@ index f05a9ebab..8b1e0448b 100644 this.recalcPosition(); @@ -887,7 +887,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.world.methodProfiler.e(); + this.world.methodProfiler.exit(); } - org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot } protected float ab() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 2a1e3c801..7f95652bd 100644 +index 14c481220..92a55bdf6 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -32,7 +32,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -602,7 +602,7 @@ index 2a1e3c801..7f95652bd 100644 } - SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot - this.k(); + this.movementTick(); - SpigotTimings.timerEntityTickRest.startTiming(); // Spigot double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; @@ -619,19 +619,19 @@ index 2a1e3c801..7f95652bd 100644 @@ -2243,7 +2238,6 @@ public abstract class EntityLiving extends Entity { } - this.world.methodProfiler.a("ai"); + this.world.methodProfiler.enter("ai"); - SpigotTimings.timerEntityAI.startTiming(); // Spigot if (this.isFrozen()) { this.bg = false; this.bh = 0.0F; @@ -2254,7 +2248,6 @@ public abstract class EntityLiving extends Entity { this.doTick(); - this.world.methodProfiler.e(); + this.world.methodProfiler.exit(); } - SpigotTimings.timerEntityAI.stopTiming(); // Spigot - this.world.methodProfiler.e(); - this.world.methodProfiler.a("jump"); + this.world.methodProfiler.exit(); + this.world.methodProfiler.enter("jump"); @@ -2279,9 +2272,7 @@ public abstract class EntityLiving extends Entity { this.n(); AxisAlignedBB axisalignedbb = this.getBoundingBox(); @@ -639,8 +639,8 @@ index 2a1e3c801..7f95652bd 100644 - SpigotTimings.timerEntityAIMove.startTiming(); // Spigot this.a(this.bh, this.bi, this.bj); - SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot - this.world.methodProfiler.e(); - this.world.methodProfiler.a("push"); + this.world.methodProfiler.exit(); + this.world.methodProfiler.enter("push"); if (this.bw > 0) { @@ -2289,9 +2280,7 @@ public abstract class EntityLiving extends Entity { this.a(axisalignedbb, this.getBoundingBox()); @@ -649,11 +649,11 @@ index 2a1e3c801..7f95652bd 100644 - SpigotTimings.timerEntityAICollision.startTiming(); // Spigot this.cN(); - SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot - this.world.methodProfiler.e(); + this.world.methodProfiler.exit(); } diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java -index ae31935c4..70c9b1f50 100644 +index 22db1fad1..d7f33bd53 100644 --- a/src/main/java/net/minecraft/server/EntityTracker.java +++ b/src/main/java/net/minecraft/server/EntityTracker.java @@ -168,7 +168,7 @@ public class EntityTracker { @@ -684,7 +684,7 @@ index ae31935c4..70c9b1f50 100644 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 04c5c1796..b99ed185f 100644 +index 37211c33a..97690499f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1,5 +1,6 @@ @@ -719,26 +719,26 @@ index 04c5c1796..b99ed185f 100644 - SpigotTimings.serverTickTimer.startTiming(); // Spigot + co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot - long i = SystemUtils.c(); + long i = SystemUtils.getMonotonicNanos(); @@ -848,7 +850,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit - SpigotTimings.worldSaveTimer.startTiming(); // Spigot - this.methodProfiler.a("save"); - this.s.savePlayers(); + this.methodProfiler.enter("save"); + this.playerList.savePlayers(); // Spigot Start @@ -863,7 +864,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // this.saveChunks(true); // Spigot End - this.methodProfiler.e(); + this.methodProfiler.exit(); - SpigotTimings.worldSaveTimer.stopTiming(); // Spigot } - this.methodProfiler.a("snooper"); + this.methodProfiler.enter("snooper"); @@ -884,14 +884,14 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.methodProfiler.e(); + this.methodProfiler.exit(); org.spigotmc.WatchdogThread.tick(); // Spigot this.slackActivityAccountant.tickEnded(l); // Spigot - SpigotTimings.serverTickTimer.stopTiming(); // Spigot @@ -753,7 +753,7 @@ index 04c5c1796..b99ed185f 100644 - SpigotTimings.schedulerTimer.stopTiming(); // Spigot + MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Paper + MinecraftTimings.minecraftSchedulerTimer.startTiming(); // Paper - this.methodProfiler.a("jobs"); + this.methodProfiler.enter("jobs"); FutureTask futuretask; @@ -899,26 +899,27 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -762,13 +762,13 @@ index 04c5c1796..b99ed185f 100644 } + MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper - this.methodProfiler.c("commandFunctions"); + this.methodProfiler.exitEnter("commandFunctions"); - SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot + MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot - this.getFunctionData().Y_(); + this.getFunctionData().tick(); - SpigotTimings.commandFunctionsTimer.stopTiming(); // Spigot + MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot - this.methodProfiler.c("levels"); + this.methodProfiler.exitEnter("levels"); // CraftBukkit start // Run tasks that are waiting on processing @@ -802,42 +802,42 @@ index 04c5c1796..b99ed185f 100644 long i; @@ -985,29 +986,27 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.methodProfiler.e(); - this.methodProfiler.a("tracker"); + this.methodProfiler.exit(); + this.methodProfiler.enter("tracker"); - worldserver.timings.tracker.startTiming(); // Spigot worldserver.getTracker().updatePlayers(); - worldserver.timings.tracker.stopTiming(); // Spigot - this.methodProfiler.e(); - this.methodProfiler.e(); + this.methodProfiler.exit(); + this.methodProfiler.exit(); } } - this.methodProfiler.c("connection"); + this.methodProfiler.exitEnter("connection"); - SpigotTimings.connectionTimer.startTiming(); // Spigot + MinecraftTimings.connectionTimer.startTiming(); // Spigot this.getServerConnection().c(); - SpigotTimings.connectionTimer.stopTiming(); // Spigot + MinecraftTimings.connectionTimer.stopTiming(); // Spigot - this.methodProfiler.c("players"); + this.methodProfiler.exitEnter("players"); - SpigotTimings.playerListTimer.startTiming(); // Spigot + MinecraftTimings.playerListTimer.startTiming(); // Spigot - this.s.tick(); + this.playerList.tick(); - SpigotTimings.playerListTimer.stopTiming(); // Spigot + MinecraftTimings.playerListTimer.stopTiming(); // Spigot - this.methodProfiler.c("tickables"); + this.methodProfiler.exitEnter("tickables"); - SpigotTimings.tickablesTimer.startTiming(); // Spigot + MinecraftTimings.tickablesTimer.startTiming(); // Spigot for (int j = 0; j < this.k.size(); ++j) { - ((ITickable) this.k.get(j)).Y_(); + ((ITickable) this.k.get(j)).tick(); } - SpigotTimings.tickablesTimer.stopTiming(); // Spigot + MinecraftTimings.tickablesTimer.stopTiming(); // Spigot - this.methodProfiler.e(); + this.methodProfiler.exit(); } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 384f4f45b..1dfdc5d70 100644 +index ceac52fe5..29e24940f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -1,5 +1,6 @@ @@ -847,7 +847,7 @@ index 384f4f45b..1dfdc5d70 100644 import com.google.common.collect.AbstractIterator; import com.google.common.collect.ComparisonChain; import com.google.common.collect.Lists; -@@ -90,6 +91,7 @@ public class PlayerChunkMap { +@@ -86,6 +87,7 @@ public class PlayerChunkMap { int j; if (i - this.k > 8000L) { @@ -855,7 +855,7 @@ index 384f4f45b..1dfdc5d70 100644 this.k = i; for (j = 0; j < this.i.size(); ++j) { -@@ -97,9 +99,11 @@ public class PlayerChunkMap { +@@ -93,9 +95,11 @@ public class PlayerChunkMap { playerchunk.d(); playerchunk.c(); } @@ -867,7 +867,7 @@ index 384f4f45b..1dfdc5d70 100644 Iterator iterator = this.f.iterator(); while (iterator.hasNext()) { -@@ -108,25 +112,31 @@ public class PlayerChunkMap { +@@ -104,25 +108,31 @@ public class PlayerChunkMap { } this.f.clear(); @@ -899,7 +899,7 @@ index 384f4f45b..1dfdc5d70 100644 // Spigot start org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; activityAccountant.startActivity(0.5); -@@ -158,10 +168,12 @@ public class PlayerChunkMap { +@@ -154,10 +164,12 @@ public class PlayerChunkMap { } activityAccountant.endActivity(); // Spigot @@ -912,7 +912,7 @@ index 384f4f45b..1dfdc5d70 100644 Iterator iterator2 = this.g.iterator(); while (iterator2.hasNext()) { -@@ -175,14 +187,17 @@ public class PlayerChunkMap { +@@ -171,14 +183,17 @@ public class PlayerChunkMap { } } } @@ -924,14 +924,14 @@ index 384f4f45b..1dfdc5d70 100644 WorldProvider worldprovider = this.world.worldProvider; if (!worldprovider.canRespawn()) { - this.world.getChunkProviderServer().b(); + this.world.getChunkProvider().b(); } + } // Paper timing } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 539e6d3c9..67c993795 100644 +index 2b6c797ce..0a887789a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -59,6 +59,7 @@ import org.bukkit.inventory.CraftingInventory; @@ -945,7 +945,7 @@ index 539e6d3c9..67c993795 100644 @@ -136,7 +137,6 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { // CraftBukkit end - public void Y_() { + public void tick() { - org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.startTiming(); // Spigot this.syncPosition(); this.player.playerTick(); @@ -1007,7 +1007,7 @@ index 616797dc6..3a5daf670 100644 throw CancelledPacketHandleException.INSTANCE; } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 39f149a81..597ad7d40 100644 +index 9db7d7e30..aef650774 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1,5 +1,6 @@ @@ -1031,7 +1031,7 @@ index 39f149a81..597ad7d40 100644 public WhiteList getWhitelist() { diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java -index a07895935..ee5c2421b 100644 +index 0d0b4d873..774134103 100644 --- a/src/main/java/net/minecraft/server/TickListServer.java +++ b/src/main/java/net/minecraft/server/TickListServer.java @@ -24,13 +24,19 @@ public class TickListServer implements TickList { @@ -1058,7 +1058,7 @@ index a07895935..ee5c2421b 100644 @@ -49,7 +55,7 @@ public class TickListServer implements TickList { } - this.f.methodProfiler.a("cleaning"); + this.f.methodProfiler.enter("cleaning"); - + timingCleanup.startTiming(); // Paper NextTickListEntry nextticklistentry; // CraftBukkit - decompile error @@ -1070,15 +1070,15 @@ index a07895935..ee5c2421b 100644 } + timingCleanup.stopTiming(); // Paper - this.f.methodProfiler.e(); - this.f.methodProfiler.a("ticking"); + this.f.methodProfiler.exit(); + this.f.methodProfiler.enter("ticking"); + timingTicking.startTiming(); // Paper Iterator iterator = this.g.iterator(); while (iterator.hasNext()) { @@ -89,6 +97,7 @@ public class TickListServer implements TickList { - this.f.methodProfiler.e(); + this.f.methodProfiler.exit(); this.g.clear(); + timingTicking.stopTiming(); // Paper } @@ -1105,7 +1105,7 @@ index c69209497..68ac014aa 100644 private final TileEntityTypes e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER protected World world; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 44b381120..119e1facc 100644 +index 0920ef2d1..230517907 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1,5 +1,6 @@ @@ -1148,23 +1148,23 @@ index 44b381120..119e1facc 100644 this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } -@@ -1130,6 +1131,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1080,6 +1081,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } - this.methodProfiler.c("remove"); + this.methodProfiler.exitEnter("remove"); + timings.entityRemoval.startTiming(); // Paper this.entityList.removeAll(this.g); int j; -@@ -1150,6 +1152,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1100,6 +1102,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.g.clear(); this.p_(); + timings.entityRemoval.stopTiming(); // Paper - this.methodProfiler.c("regular"); + this.methodProfiler.exitEnter("regular"); CrashReport crashreport1; -@@ -1159,6 +1162,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1109,6 +1112,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc timings.entityTick.startTiming(); // Spigot guardEntityList = true; // Spigot // CraftBukkit start - Use field for loop variable @@ -1172,8 +1172,8 @@ index 44b381120..119e1facc 100644 int entitiesThisCycle = 0; if (tickPosition < 0) tickPosition = 0; for (entityLimiter.initTick(); -@@ -1180,10 +1184,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.methodProfiler.a("tick"); +@@ -1130,10 +1134,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + this.methodProfiler.enter("tick"); if (!entity.dead && !(entity instanceof EntityPlayer)) { try { - SpigotTimings.tickEntityTimer.startTiming(); // Spigot @@ -1186,15 +1186,15 @@ index 44b381120..119e1facc 100644 crashreport1 = CrashReport.a(throwable1, "Ticking entity"); crashreportsystemdetails1 = crashreport1.a("Entity being ticked"); entity.appendEntityCrashDetails(crashreportsystemdetails1); -@@ -1308,6 +1313,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1258,6 +1263,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } timings.tileEntityPending.stopTiming(); // Spigot + co.aikar.timings.TimingHistory.tileEntityTicks += this.tileEntityListTick.size(); // Paper - this.methodProfiler.e(); - this.methodProfiler.e(); + this.methodProfiler.exit(); + this.methodProfiler.exit(); } -@@ -1366,7 +1372,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1316,7 +1322,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } // CraftBukkit end @@ -1202,7 +1202,7 @@ index 44b381120..119e1facc 100644 entity.N = entity.locX; entity.O = entity.locY; entity.P = entity.locZ; -@@ -1374,6 +1379,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1324,6 +1329,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.lastPitch = entity.pitch; if (flag && entity.inChunk) { ++entity.ticksLived; @@ -1210,7 +1210,7 @@ index 44b381120..119e1facc 100644 if (entity.isPassenger()) { entity.aH(); } else { -@@ -1437,8 +1443,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1387,8 +1393,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } } @@ -1220,7 +1220,7 @@ index 44b381120..119e1facc 100644 public boolean a(@Nullable Entity entity, VoxelShape voxelshape) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ee68983f6..435c54da1 100644 +index 23c80f80a..2450421d4 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -1,5 +1,6 @@ @@ -1251,39 +1251,38 @@ index ee68983f6..435c54da1 100644 @@ -297,13 +298,13 @@ public class WorldServer extends World implements IAsyncTaskHandler { timings.doChunkUnload.stopTiming(); // Spigot - this.methodProfiler.c("tickPending"); + this.methodProfiler.exitEnter("tickPending"); - timings.doTickPending.startTiming(); // Spigot + timings.scheduledBlocks.startTiming(); // Paper this.q(); - timings.doTickPending.stopTiming(); // Spigot + timings.scheduledBlocks.stopTiming(); // Paper - this.methodProfiler.c("tickBlocks"); + this.methodProfiler.exitEnter("tickBlocks"); - timings.doTickTiles.startTiming(); // Spigot + timings.chunkTicks.startTiming(); // Paper this.n_(); - timings.doTickTiles.stopTiming(); // Spigot + timings.chunkTicks.stopTiming(); // Paper - this.methodProfiler.c("chunkMap"); + this.methodProfiler.exitEnter("chunkMap"); timings.doChunkMap.startTiming(); // Spigot this.manager.flush(); -@@ -532,7 +533,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - } +@@ -533,6 +534,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } -- this.methodProfiler.c("tickBlocks"); + this.methodProfiler.exitEnter("tickBlocks"); + timings.chunkTicksBlocks.startTiming(); // Paper if (i > 0) { ChunkSection[] achunksection = chunk.getSections(); int i1 = achunksection.length; -@@ -564,6 +565,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -564,6 +566,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } } } + timings.chunkTicksBlocks.stopTiming(); // Paper } - this.methodProfiler.e(); -@@ -869,6 +871,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + this.methodProfiler.exit(); +@@ -869,6 +872,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (chunkproviderserver.d()) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit @@ -1291,7 +1290,7 @@ index ee68983f6..435c54da1 100644 if (iprogressupdate != null) { iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0])); } -@@ -878,7 +881,9 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -878,7 +882,9 @@ public class WorldServer extends World implements IAsyncTaskHandler { iprogressupdate.c(new ChatMessage("menu.savingChunks", new Object[0])); } @@ -1301,7 +1300,7 @@ index ee68983f6..435c54da1 100644 // CraftBukkit - ArrayList -> Collection java.util.Collection arraylist = chunkproviderserver.a(); Iterator iterator = arraylist.iterator(); -@@ -890,7 +895,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -890,7 +896,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { chunkproviderserver.unload(chunk); } } @@ -1310,7 +1309,7 @@ index ee68983f6..435c54da1 100644 } } -@@ -903,6 +908,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -903,6 +909,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } protected void a() throws ExceptionWorldConflict { @@ -1318,7 +1317,7 @@ index ee68983f6..435c54da1 100644 this.checkSession(); Iterator iterator = this.server.getWorlds().iterator(); -@@ -932,6 +938,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -932,6 +939,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.worldData.c(this.server.getBossBattleCustomData().c()); this.dataManager.saveWorldData(this.worldData, this.server.getPlayerList().t()); this.h().a(); @@ -1327,10 +1326,10 @@ index ee68983f6..435c54da1 100644 // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b524adc7d..9efd620f2 100644 +index a3c07fbac..da57751f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1946,12 +1946,31 @@ public final class CraftServer implements Server { +@@ -1945,12 +1945,31 @@ public final class CraftServer implements Server { private final Spigot spigot = new Spigot() { @@ -1819,5 +1818,5 @@ index c1071c92e..a99c0cea0 100644 } } -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch b/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch index c5707ac85..7b8a7364a 100644 --- a/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch @@ -1,11 +1,11 @@ -From 7d4ea3d0550820a18c9c4795eca59b6ee33a8997 Mon Sep 17 00:00:00 2001 +From bde91baa8fe7c3bd031f0cff6c602a672a50e71a Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Tue, 1 Mar 2016 14:47:52 -0600 Subject: [PATCH] Player affects spawning API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 7e151439c..0aae80a7f 100644 +index 05360531c..1aec6d7c3 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -71,6 +71,9 @@ public abstract class EntityHuman extends EntityLiving { @@ -19,7 +19,7 @@ index 7e151439c..0aae80a7f 100644 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 8f4319c80..cf73a6d1f 100644 +index ef3c94221..ac250182b 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -619,7 +619,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -58,7 +58,7 @@ index afe039905..ff564508f 100644 j = MathHelper.floor(entityhuman.locZ / 16.0D); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e1e931406..c378df796 100644 +index b116239f2..73c47c517 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -34,6 +34,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData; @@ -69,7 +69,7 @@ index e1e931406..c378df796 100644 import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -@@ -2439,7 +2440,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2389,7 +2390,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); @@ -103,5 +103,5 @@ index b5afd5d1c..47da00948 100644 @Override public void updateCommands() { -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch b/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch index 04bbb98d7..c31f66ac8 100644 --- a/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch +++ b/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch @@ -1,14 +1,14 @@ -From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 +From 729ed20118acbca8d55fbfb71d3d02ef0a27314b Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 1 Mar 2016 15:08:03 -0600 Subject: [PATCH] Remove invalid mob spawner tile entities diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 9970a58ed..da2548603 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -793,6 +793,10 @@ public class Chunk implements IChunkAccess { +@@ -798,6 +798,10 @@ public class Chunk implements IChunkAccess { tileentity.z(); this.tileEntities.put(blockposition.h(), tileentity); // CraftBukkit start @@ -20,5 +20,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ() + " (" + getType(blockposition) + ") where there was no entity tile!"); -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch index f7d29e136..a98ac0488 100644 --- a/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch @@ -1,4 +1,4 @@ -From 3721085914d0c1292ff6633d59f969ed1b4f2177 Mon Sep 17 00:00:00 2001 +From fd0cba99aee112db7620e0860c08f2c65c982ee4 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 Mar 2016 23:09:29 -0600 Subject: [PATCH] Further improve server tick loop @@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8a6589d95..9df2296dd 100644 +index ffda9d793..4acb908ec 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -146,7 +146,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -36,8 +36,8 @@ index 8a6589d95..9df2296dd 100644 @@ -689,7 +689,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } - private boolean aT() { -- return SystemUtils.b() < this.aa; + private boolean canSleepForTick() { +- return SystemUtils.getMonotonicMillis() < this.nextTick; + return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own } @@ -157,14 +157,14 @@ index 8a6589d95..9df2296dd 100644 - MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit + //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time - this.a(this::aT); - this.aa += 50L; + this.a(this::canSleepForTick); + this.nextTick += 50L; // Spigot end diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 29b016e17..cf1db412e 100644 +index ed0221f0d..212e3cd4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1943,6 +1943,17 @@ public final class CraftServer implements Server { +@@ -1942,6 +1942,17 @@ public final class CraftServer implements Server { return CraftMagicNumbers.INSTANCE; } @@ -224,5 +224,5 @@ index be2e31dea..6d21c3269 100644 return ( ( tps > 18.0 ) ? ChatColor.GREEN : ( tps > 16.0 ) ? ChatColor.YELLOW : ChatColor.RED ).toString() + ( ( tps > 20.0 ) ? "*" : "" ) + Math.min( Math.round( tps * 100.0 ) / 100.0, 20.0 ); -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0023-Entity-Origin-API.patch b/Spigot-Server-Patches/0023-Entity-Origin-API.patch index b024938db..c3c1d25ff 100644 --- a/Spigot-Server-Patches/0023-Entity-Origin-API.patch +++ b/Spigot-Server-Patches/0023-Entity-Origin-API.patch @@ -1,11 +1,11 @@ -From 1deac4fb35880f7543e83f0bcf642d40608f9137 Mon Sep 17 00:00:00 2001 +From f1f93c9e37b210e625b5881a7fe266309283a08b Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 1 Mar 2016 23:45:08 -0600 Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 792240f2e..65ba3fe66 100644 +index 7c2a8c5c8..cc6ae6634 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -162,6 +162,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -51,7 +51,7 @@ index 792240f2e..65ba3fe66 100644 NBTTagList nbttaglist = new NBTTagList(); double[] adouble1 = adouble; diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 25960cff2..1fb912eb0 100644 +index dc173e14f..596ac18a7 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -249,6 +249,14 @@ public class EntityFallingBlock extends Entity { @@ -70,7 +70,7 @@ index 25960cff2..1fb912eb0 100644 public void a(boolean flag) { diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 5ceb3f206..87f3205f8 100644 +index 5dc52b6b8..2c28633c4 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -109,6 +109,14 @@ public class EntityTNTPrimed extends Entity { @@ -89,7 +89,7 @@ index 5ceb3f206..87f3205f8 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index 769d599c5..e37da10e0 100644 +index 1b72df8cd..ae8be435c 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java @@ -174,6 +174,7 @@ public class NBTTagList extends NBTList { @@ -101,10 +101,10 @@ index 769d599c5..e37da10e0 100644 if (i >= 0 && i < this.list.size()) { NBTBase nbtbase = (NBTBase)this.list.get(i); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 739e19bb1..21c9bb325 100644 +index 73c47c517..ab74b1add 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -968,6 +968,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -918,6 +918,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int j = MathHelper.floor(entity.locZ / 16.0D); boolean flag = entity.attachedToPlayer; @@ -135,5 +135,5 @@ index 153efb9b9..df7c77e9a 100644 + // Paper end } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0024-Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/0024-Prevent-tile-entity-and-entity-crashes.patch index 7955c0094..0f046614e 100644 --- a/Spigot-Server-Patches/0024-Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/0024-Prevent-tile-entity-and-entity-crashes.patch @@ -1,11 +1,11 @@ -From 79a3b07620008e12ad07d2489dea841eb1314a44 Mon Sep 17 00:00:00 2001 +From 207ee34b2e3af0d3f6ac16d639cccc9857bc16cf Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 Mar 2016 23:52:34 -0600 Subject: [PATCH] Prevent tile entity and entity crashes diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 68ac014aab..c5212417c6 100644 +index 68ac014aa..c5212417c 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -178,7 +178,12 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -23,10 +23,10 @@ index 68ac014aab..c5212417c6 100644 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8984949ff5..4afa16fb8a 100644 +index ab74b1add..5d5a9f0bb 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1197,10 +1197,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1147,10 +1147,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.tickTimer.stopTiming(); // Paper } catch (Throwable throwable1) { entity.tickTimer.stopTiming(); @@ -43,9 +43,9 @@ index 8984949ff5..4afa16fb8a 100644 } } -@@ -1263,10 +1265,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - ((ITickable) tileentity).Y_(); - this.methodProfiler.e(); +@@ -1213,10 +1215,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + ((ITickable) tileentity).tick(); + this.methodProfiler.exit(); } catch (Throwable throwable2) { - crashreport1 = CrashReport.a(throwable2, "Ticking block entity"); - crashreportsystemdetails1 = crashreport1.a("Block entity being ticked"); @@ -62,5 +62,5 @@ index 8984949ff5..4afa16fb8a 100644 // Spigot start finally { -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0025-Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/0025-Configurable-top-of-nether-void-damage.patch index fee0181cb..11d2436cb 100644 --- a/Spigot-Server-Patches/0025-Configurable-top-of-nether-void-damage.patch +++ b/Spigot-Server-Patches/0025-Configurable-top-of-nether-void-damage.patch @@ -1,4 +1,4 @@ -From 1967a1ab38d312568ab657d7099d270cab87cb9f Mon Sep 17 00:00:00 2001 +From 65611361ad1379efabc6de8576ae3282f808ff3b Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 23:58:50 -0600 Subject: [PATCH] Configurable top of nether void damage @@ -20,7 +20,7 @@ index 1ed58f4bb..39d565db1 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c7db9db95..12fe12e04 100644 +index cc6ae6634..99716419e 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -463,9 +463,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -40,7 +40,7 @@ index c7db9db95..12fe12e04 100644 if (!this.world.isClientSide) { this.setFlag(0, this.fireTicks > 0); @@ -475,6 +481,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.world.methodProfiler.e(); + this.world.methodProfiler.exit(); } + // Paper start @@ -63,7 +63,7 @@ index c7db9db95..12fe12e04 100644 this.die(); } diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index 5bee194fa..b52bc659e 100644 +index a2f334968..e741c7f83 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java @@ -195,9 +195,15 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT @@ -83,5 +83,5 @@ index 5bee194fa..b52bc659e 100644 int i; -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0028-Lighting-Queue.patch b/Spigot-Server-Patches/0028-Lighting-Queue.patch index ecb531257..f63983b17 100644 --- a/Spigot-Server-Patches/0028-Lighting-Queue.patch +++ b/Spigot-Server-Patches/0028-Lighting-Queue.patch @@ -1,4 +1,4 @@ -From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 +From 3e0df901f487044ce2782c682f66e627e9411eb3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 2 Mar 2016 00:52:31 -0600 Subject: [PATCH] Lighting Queue @@ -6,7 +6,7 @@ Subject: [PATCH] Lighting Queue This provides option to queue lighting updates to ensure they do not cause the server lag diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 145cb274b..eff9dcf54 100644 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -50,6 +50,8 @@ public class WorldTimingsHandler { @@ -28,7 +28,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public static Timing getTickList(WorldServer worldserver, String timingsType) { diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index fe148495b..cc69ff3a4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -191,6 +191,13 @@ public class PaperConfig { @@ -46,7 +46,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 boolean timings = getBoolean("timings.enabled", true); boolean verboseTimings = getBoolean("timings.verbose", true); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 39d565db1..8f6f0288b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -130,4 +130,12 @@ public class PaperWorldConfig { @@ -63,10 +63,10 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index da2548603..87ec4d1a2 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -90,6 +90,7 @@ public class Chunk implements IChunkAccess { +@@ -95,6 +95,7 @@ public class Chunk implements IChunkAccess { return removed; } } @@ -74,16 +74,16 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // Paper end public boolean areNeighborsLoaded(final int radius) { switch (radius) { -@@ -280,7 +281,7 @@ public class Chunk implements IChunkAccess { +@@ -285,7 +286,7 @@ public class Chunk implements IChunkAccess { private void g(boolean flag) { - this.world.methodProfiler.a("recheckGaps"); + this.world.methodProfiler.enter("recheckGaps"); - if (this.world.areChunksLoaded(new BlockPosition(this.locX * 16 + 8, 0, this.locZ * 16 + 8), 16)) { + if (this.areNeighborsLoaded(1)) { // Paper for (int i = 0; i < 16; ++i) { for (int j = 0; j < 16; ++j) { if (this.g[i + j * 16]) { -@@ -331,7 +332,7 @@ public class Chunk implements IChunkAccess { +@@ -336,7 +337,7 @@ public class Chunk implements IChunkAccess { } private void a(int i, int j, int k, int l) { @@ -92,7 +92,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 for (int i1 = k; i1 < l; ++i1) { this.world.c(EnumSkyBlock.SKY, new BlockPosition(i, i1, j)); } -@@ -531,6 +532,7 @@ public class Chunk implements IChunkAccess { +@@ -536,6 +537,7 @@ public class Chunk implements IChunkAccess { if (flag1) { this.initLighting(); } else { @@ -100,7 +100,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 int i1 = iblockdata.b(this.world, blockposition); int j1 = iblockdata1.b(this.world, blockposition); -@@ -538,6 +540,7 @@ public class Chunk implements IChunkAccess { +@@ -543,6 +545,7 @@ public class Chunk implements IChunkAccess { if (i1 != j1 && (i1 < j1 || this.getBrightness(EnumSkyBlock.SKY, blockposition) > 0 || this.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 0)) { this.c(i, k); } @@ -108,7 +108,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } TileEntity tileentity; -@@ -1348,6 +1351,16 @@ public class Chunk implements IChunkAccess { +@@ -1361,6 +1364,16 @@ public class Chunk implements IChunkAccess { return this.D == 8; } @@ -126,7 +126,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 IMMEDIATE, QUEUED, CHECK; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 60abc5f28..6a9b9fa2a 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -314,6 +314,7 @@ public class ChunkProviderServer implements IChunkProvider { @@ -138,21 +138,21 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // Update neighbor counts for (int x = -2; x < 3; x++) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 4acb908ec..194f8441e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -894,7 +894,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati protected void a(BooleanSupplier booleansupplier) { co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot -- long i = SystemUtils.c(); -+ long i = SystemUtils.c(); long startTime = i; // Paper +- long i = SystemUtils.getMonotonicNanos(); ++ long i = SystemUtils.getMonotonicNanos(); long startTime = i; // Paper ++this.ticks; if (this.S) { @@ -952,6 +952,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.methodProfiler.e(); - this.methodProfiler.e(); + this.methodProfiler.exit(); + this.methodProfiler.exit(); org.spigotmc.WatchdogThread.tick(); // Spigot + PaperLightingQueue.processQueue(startTime); // Paper this.slackActivityAccountant.tickEnded(l); // Spigot @@ -160,7 +160,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } diff --git a/src/main/java/net/minecraft/server/PaperLightingQueue.java b/src/main/java/net/minecraft/server/PaperLightingQueue.java new file mode 100644 -index 7ac07ac07ac0..7ac07ac07ac0 +index 000000000..9783f3a0d --- /dev/null +++ b/src/main/java/net/minecraft/server/PaperLightingQueue.java @@ -0,0 +1,98 @@ @@ -189,7 +189,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 + continue; + } + -+ ObjectCollection loadedChunks = ((WorldServer) world).getChunkProviderServer().chunks.values(); ++ ObjectCollection loadedChunks = ((WorldServer) world).getChunkProvider().chunks.values(); + for (Chunk chunk : loadedChunks.toArray(new Chunk[0])) { + if (chunk.lightingQueue.processQueue(startTime, maxTickTime)) { + break START; @@ -263,18 +263,18 @@ index 7ac07ac07ac0..7ac07ac07ac0 + } +} diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 5d5a9f0bb..69f55d0dd 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -335,7 +335,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (iblockdata2.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata2.e() != iblockdata1.e()) { - this.methodProfiler.a("checkLight"); + this.methodProfiler.enter("checkLight"); - this.r(blockposition); + chunk.runOrQueueLightUpdate(() -> this.r(blockposition)); // Paper - Queue light update - this.methodProfiler.e(); + this.methodProfiler.exit(); } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0029-Configurable-end-credits.patch b/Spigot-Server-Patches/0029-Configurable-end-credits.patch index a55f59408..23e798511 100644 --- a/Spigot-Server-Patches/0029-Configurable-end-credits.patch +++ b/Spigot-Server-Patches/0029-Configurable-end-credits.patch @@ -1,11 +1,11 @@ -From 41ab545f015675893214f7a9d3649abbc8b78963 Mon Sep 17 00:00:00 2001 +From 218a1980882ca92ea3578f3ad4d3a34804dbda7e Mon Sep 17 00:00:00 2001 From: DoctorDark Date: Wed, 16 Mar 2016 02:21:39 -0500 Subject: [PATCH] Configurable end credits diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 8f6f0288be..5aee23dceb 100644 +index 8f6f0288b..5aee23dce 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -138,4 +138,10 @@ public class PaperWorldConfig { @@ -20,16 +20,16 @@ index 8f6f0288be..5aee23dceb 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e0215bcdb8..cdf89cfed3 100644 +index d0d93b1eb..2804bfc0a 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -61,7 +61,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - private long cu = SystemUtils.b(); - private Entity cv; + private long cu = SystemUtils.getMonotonicMillis(); + private Entity spectatedEntity; public boolean worldChangeInvuln; - private boolean cx; + private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER - private final RecipeBookServer cy; + private final RecipeBookServer recipeBook; private Vec3D cz; private int cA; @@ -649,6 +649,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -41,5 +41,5 @@ index e0215bcdb8..cdf89cfed3 100644 this.cx = true; } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0030-Fix-lag-from-explosions-processing-dead-entities.patch b/Spigot-Server-Patches/0030-Fix-lag-from-explosions-processing-dead-entities.patch index b97490c87..3797fdf6c 100644 --- a/Spigot-Server-Patches/0030-Fix-lag-from-explosions-processing-dead-entities.patch +++ b/Spigot-Server-Patches/0030-Fix-lag-from-explosions-processing-dead-entities.patch @@ -1,11 +1,11 @@ -From 7f8761e0c24cca4d01e02ea972fa5696fc3174a1 Mon Sep 17 00:00:00 2001 +From b45b30d876512ac7815531b094830438c30de107 Mon Sep 17 00:00:00 2001 From: Iceee Date: Wed, 2 Mar 2016 01:39:52 -0600 Subject: [PATCH] Fix lag from explosions processing dead entities diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index e5ba6eddd..c7d11cf62 100644 +index d564aaf60..92e3a49e2 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -111,7 +111,14 @@ public class Explosion { @@ -25,7 +25,7 @@ index e5ba6eddd..c7d11cf62 100644 for (int l1 = 0; l1 < list.size(); ++l1) { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index 30f8ec519..b1d05220b 100644 +index 2e2fb85cf..7b7fd6b9b 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -13,6 +13,7 @@ public final class IEntitySelector { @@ -36,16 +36,16 @@ index 30f8ec519..b1d05220b 100644 public static final Predicate e = (entity) -> { return !(entity instanceof EntityHuman) || !((EntityHuman)entity).isSpectator() && !((EntityHuman)entity).u(); }; -@@ -96,8 +97,7 @@ public final class IEntitySelector { +@@ -96,9 +97,5 @@ public final class IEntitySelector { } } - // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable Entity object) { // Paper - decompile error - return this.a((Entity)object); - } +- return this.test((Entity)object); +- } } + } -- -2.18.0 +2.20.0 diff --git a/Spigot-Server-Patches/0031-Optimize-explosions.patch b/Spigot-Server-Patches/0031-Optimize-explosions.patch index 8fc66873e..979f90f26 100644 --- a/Spigot-Server-Patches/0031-Optimize-explosions.patch +++ b/Spigot-Server-Patches/0031-Optimize-explosions.patch @@ -1,4 +1,4 @@ -From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 +From bbbcb6b95ae225470a3f41c3cd0e6fe294587320 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 2 Mar 2016 11:59:48 -0600 Subject: [PATCH] Optimize explosions @@ -10,7 +10,7 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 5aee23dce..2ec3d9355 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -144,4 +144,10 @@ public class PaperWorldConfig { @@ -25,7 +25,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 + } } diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 92e3a49e2..10c415b37 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -137,7 +137,7 @@ public class Explosion { @@ -124,19 +124,19 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 194f8441e..eef8d2b5a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1059,6 +1059,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati worldserver.getTracker().updatePlayers(); - this.methodProfiler.e(); - this.methodProfiler.e(); + this.methodProfiler.exit(); + this.methodProfiler.exit(); + worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 69f55d0dd..00880d54f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -24,6 +24,7 @@ import org.apache.logging.log4j.Logger; @@ -156,5 +156,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public CraftWorld getWorld() { return this.world; -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0032-Add-player-view-distance-API.patch b/Spigot-Server-Patches/0032-Add-player-view-distance-API.patch index 0bfbb32cc..b9fb19b26 100644 --- a/Spigot-Server-Patches/0032-Add-player-view-distance-API.patch +++ b/Spigot-Server-Patches/0032-Add-player-view-distance-API.patch @@ -1,11 +1,11 @@ -From baf90d1a6d61697bf6b0d2ad89a714ef689d5ef1 Mon Sep 17 00:00:00 2001 +From 0fc496b449eaf0a6b9cb98c8ab8d345e297a35a6 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 2 Mar 2016 14:35:27 -0600 Subject: [PATCH] Add player view distance API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 6b58f632bd..d245502286 100644 +index 1aec6d7c3..1185769ca 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -74,6 +74,15 @@ public abstract class EntityHuman extends EntityLiving { @@ -25,7 +25,7 @@ index 6b58f632bd..d245502286 100644 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java -index 70c9b1f50c..0ea6392284 100644 +index d7f33bd53..63e22bd9a 100644 --- a/src/main/java/net/minecraft/server/EntityTracker.java +++ b/src/main/java/net/minecraft/server/EntityTracker.java @@ -200,6 +200,7 @@ public class EntityTracker { @@ -37,7 +37,7 @@ index 70c9b1f50c..0ea6392284 100644 Iterator iterator = this.c.iterator(); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 8478a81f5c..5dbd493f41 100644 +index 6a622f72e..4272d2036 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -435,7 +435,7 @@ public class EntityTrackerEntry { @@ -50,7 +50,7 @@ index 8478a81f5c..5dbd493f41 100644 return d0 >= (double) (-i) && d0 <= (double) i && d1 >= (double) (-i) && d1 <= (double) i && this.tracker.a(entityplayer); } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 12a8fec29a..7ca85a56ca 100644 +index 29e24940f..653031af4 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -35,7 +35,7 @@ public class PlayerChunkMap { @@ -62,7 +62,7 @@ index 12a8fec29a..7ca85a56ca 100644 private long k; private boolean l = true; private boolean m = true; -@@ -265,8 +265,11 @@ public class PlayerChunkMap { +@@ -261,8 +261,11 @@ public class PlayerChunkMap { // CraftBukkit start - Load nearby chunks first List chunkList = new LinkedList(); @@ -76,7 +76,7 @@ index 12a8fec29a..7ca85a56ca 100644 chunkList.add(new ChunkCoordIntPair(k, l)); } } -@@ -285,8 +288,11 @@ public class PlayerChunkMap { +@@ -281,8 +284,11 @@ public class PlayerChunkMap { int i = (int) entityplayer.d >> 4; int j = (int) entityplayer.e >> 4; @@ -90,7 +90,7 @@ index 12a8fec29a..7ca85a56ca 100644 PlayerChunk playerchunk = this.getChunk(k, l); if (playerchunk != null) { -@@ -316,7 +322,8 @@ public class PlayerChunkMap { +@@ -312,7 +318,8 @@ public class PlayerChunkMap { if (d2 >= 64.0D) { int k = (int) entityplayer.d >> 4; int l = (int) entityplayer.e >> 4; @@ -100,7 +100,7 @@ index 12a8fec29a..7ca85a56ca 100644 int j1 = i - k; int k1 = j - l; -@@ -360,6 +367,8 @@ public class PlayerChunkMap { +@@ -356,6 +363,8 @@ public class PlayerChunkMap { return playerchunk != null && playerchunk.d(entityplayer) && playerchunk.e(); } @@ -109,7 +109,7 @@ index 12a8fec29a..7ca85a56ca 100644 public void a(int i) { i = MathHelper.clamp(i, 3, 32); if (i != this.j) { -@@ -369,36 +378,55 @@ public class PlayerChunkMap { +@@ -365,36 +374,55 @@ public class PlayerChunkMap { while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer) iterator.next(); @@ -187,7 +187,7 @@ index 12a8fec29a..7ca85a56ca 100644 private void e() { this.l = true; -@@ -477,4 +505,32 @@ public class PlayerChunkMap { +@@ -473,4 +501,32 @@ public class PlayerChunkMap { } } // CraftBukkit end @@ -221,7 +221,7 @@ index 12a8fec29a..7ca85a56ca 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 601d4c62d4..b919226bbf 100644 +index ff564508f..4233b94a1 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -44,7 +44,7 @@ public final class SpawnerCreature { @@ -234,7 +234,7 @@ index 601d4c62d4..b919226bbf 100644 for (int i1 = -b0; i1 <= b0; ++i1) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6635f1a4a3..d2ff18cf77 100644 +index 6635f1a4a..d2ff18cf7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1646,6 +1646,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -255,7 +255,7 @@ index 6635f1a4a3..d2ff18cf77 100644 @Override diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index a95f93eb76..09df00e94b 100644 +index a95f93eb7..09df00e94 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -108,13 +108,13 @@ public class ActivationRange @@ -276,5 +276,5 @@ index a95f93eb76..09df00e94b 100644 animalBB = player.getBoundingBox().grow( animalActivationRange, 256, animalActivationRange ); monsterBB = player.getBoundingBox().grow( monsterActivationRange, 256, monsterActivationRange ); -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0035-Disable-ice-and-snow.patch b/Spigot-Server-Patches/0035-Disable-ice-and-snow.patch index 26bac46b6..c9b0495e6 100644 --- a/Spigot-Server-Patches/0035-Disable-ice-and-snow.patch +++ b/Spigot-Server-Patches/0035-Disable-ice-and-snow.patch @@ -1,11 +1,11 @@ -From 4da0d767e1e909a98ed9e0714241d187b9d0af61 Mon Sep 17 00:00:00 2001 +From 728e0827b06ae5a4180b22c7e2163d580c1632a6 Mon Sep 17 00:00:00 2001 From: Sudzzy Date: Wed, 2 Mar 2016 14:57:24 -0600 Subject: [PATCH] Disable ice and snow diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 13253f6e9c..cde9c11f4d 100644 +index 13253f6e9..cde9c11f4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -160,4 +160,9 @@ public class PaperWorldConfig { @@ -19,18 +19,18 @@ index 13253f6e9c..cde9c11f4d 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f39ce330f6..2341ce3f93 100644 +index 73e9ff1b3..2558a20f6 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -513,7 +513,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } - this.methodProfiler.c("iceandsnow"); + this.methodProfiler.exitEnter("iceandsnow"); - if (this.random.nextInt(16) == 0) { + if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow this.m = this.m * 3 + 1013904223; l = this.m >> 2; blockposition = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15))); -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch b/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch index be32f743f..97f61ce09 100644 --- a/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch +++ b/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch @@ -1,14 +1,14 @@ -From 933080a0dc72a443ce3fac4cd03ae8a737e66e81 Mon Sep 17 00:00:00 2001 +From 792f2e79ad0dd0e0c558ef3924a1dd34120a2901 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 2 Mar 2016 23:45:17 -0600 Subject: [PATCH] Disable spigot tick limiters diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9a7da83b82..4a457e3302 100644 +index 00880d54f..214adec9b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1174,10 +1174,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1124,10 +1124,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit start - Use field for loop variable co.aikar.timings.TimingHistory.entityTicks += this.entityList.size(); // Paper int entitiesThisCycle = 0; @@ -23,7 +23,7 @@ index 9a7da83b82..4a457e3302 100644 tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0; entity = (Entity) this.entityList.get(this.tickPosition); // CraftBukkit end -@@ -1241,9 +1241,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1191,9 +1191,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // Spigot start // Iterator iterator = this.tileEntityListTick.iterator(); int tilesThisCycle = 0; @@ -35,5 +35,5 @@ index 9a7da83b82..4a457e3302 100644 TileEntity tileentity = (TileEntity) this.tileEntityListTick.get(tileTickPosition); // Spigot start -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0047-Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/0047-Avoid-hopper-searches-if-there-are-no-items.patch index 9ecc54964..cbfcb4a66 100644 --- a/Spigot-Server-Patches/0047-Avoid-hopper-searches-if-there-are-no-items.patch +++ b/Spigot-Server-Patches/0047-Avoid-hopper-searches-if-there-are-no-items.patch @@ -1,4 +1,4 @@ -From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 +From 5abf081ee514bf133173e6b77aede9134606ec6f Mon Sep 17 00:00:00 2001 From: CullanP Date: Thu, 3 Mar 2016 02:13:38 -0600 Subject: [PATCH] Avoid hopper searches if there are no items @@ -14,10 +14,10 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear Combined, this adds up a lot. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 87ec4d1a2..c5d562dca 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -91,6 +91,10 @@ public class Chunk implements IChunkAccess { +@@ -96,6 +96,10 @@ public class Chunk implements IChunkAccess { } } final PaperLightingQueue.LightingQueue lightingQueue = new PaperLightingQueue.LightingQueue(this); @@ -28,8 +28,8 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // Paper end public boolean areNeighborsLoaded(final int radius) { switch (radius) { -@@ -685,6 +689,11 @@ public class Chunk implements IChunkAccess { - entity.ag = this.locZ; +@@ -690,6 +694,11 @@ public class Chunk implements IChunkAccess { + entity.chunkZ = this.locZ; this.entitySlices[k].add(entity); // Paper start + if (entity instanceof EntityItem) { @@ -40,7 +40,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 entity.setCurrentChunk(this); entityCounts.increment(entity.getMinecraftKeyString()); // Paper end -@@ -710,6 +719,11 @@ public class Chunk implements IChunkAccess { +@@ -715,6 +724,11 @@ public class Chunk implements IChunkAccess { if (!this.entitySlices[i].remove(entity)) { return; } @@ -52,7 +52,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 entity.setCurrentChunk(null); entityCounts.decrement(entity.getMinecraftKeyString()); // Paper end -@@ -949,6 +963,15 @@ public class Chunk implements IChunkAccess { +@@ -962,6 +976,15 @@ public class Chunk implements IChunkAccess { if (!this.entitySlices[k].isEmpty()) { Iterator iterator = this.entitySlices[k].iterator(); @@ -68,7 +68,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 while (iterator.hasNext()) { Entity entity1 = (Entity) iterator.next(); -@@ -985,7 +1008,18 @@ public class Chunk implements IChunkAccess { +@@ -998,7 +1021,18 @@ public class Chunk implements IChunkAccess { i = MathHelper.clamp(i, 0, this.entitySlices.length - 1); j = MathHelper.clamp(j, 0, this.entitySlices.length - 1); @@ -88,7 +88,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 7b7fd6b9b..eb08a1caa 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -10,6 +10,7 @@ public final class IEntitySelector { @@ -100,5 +100,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return entity instanceof IInventory && entity.isAlive(); }; -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0048-Expose-server-CommandMap.patch b/Spigot-Server-Patches/0048-Expose-server-CommandMap.patch index 7ec2da037..57ad33e18 100644 --- a/Spigot-Server-Patches/0048-Expose-server-CommandMap.patch +++ b/Spigot-Server-Patches/0048-Expose-server-CommandMap.patch @@ -1,14 +1,14 @@ -From 95dbbc6f6a22b1e3d43ab82d83945f79b59dcf01 Mon Sep 17 00:00:00 2001 +From 361868edfeb629c5a507c7d2db5ddcb2266f4774 Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 3 Mar 2016 02:15:57 -0600 Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2bc16fb1a..cd17cdcf3 100644 +index 6700ce84c..71bd5bc71 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1641,6 +1641,7 @@ public final class CraftServer implements Server { +@@ -1640,6 +1640,7 @@ public final class CraftServer implements Server { return helpMap; } @@ -17,5 +17,5 @@ index 2bc16fb1a..cd17cdcf3 100644 return commandMap; } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0052-Change-implementation-of-tile-entity-removal-list.patch b/Spigot-Server-Patches/0052-Change-implementation-of-tile-entity-removal-list.patch index acbbd2924..2ba364fae 100644 --- a/Spigot-Server-Patches/0052-Change-implementation-of-tile-entity-removal-list.patch +++ b/Spigot-Server-Patches/0052-Change-implementation-of-tile-entity-removal-list.patch @@ -1,11 +1,11 @@ -From 2eeade3b60ffa9d2da91ae718e6c0ec98986f926 Mon Sep 17 00:00:00 2001 +From 1739a3d8040f80e9389d2113e3e83337d8e52e90 Mon Sep 17 00:00:00 2001 From: Joseph Hirschfeld Date: Thu, 3 Mar 2016 02:39:54 -0600 Subject: [PATCH] Change implementation of (tile)entity removal list diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 352a7f25a7..65e84b666f 100644 +index 214adec9b..a9239ee7b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -73,11 +73,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -22,7 +22,7 @@ index 352a7f25a7..65e84b666f 100644 public final List players = Lists.newArrayList(); public final List k = Lists.newArrayList(); protected final IntHashMap entitiesById = new IntHashMap(); -@@ -1145,20 +1145,20 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1095,20 +1095,20 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.entityList.removeAll(this.g); int j; @@ -33,9 +33,9 @@ index 352a7f25a7..65e84b666f 100644 - for (i = 0; i < this.g.size(); ++i) { - entity = (Entity) this.g.get(i); -- int k = entity.ae; +- int k = entity.chunkX; - -- j = entity.ag; +- j = entity.chunkZ; - if (entity.inChunk && this.isChunkLoaded(k, j, true)) { - this.getChunkAt(k, j).b(entity); + if (e.inChunk && this.isChunkLoaded(k, j, true)) { @@ -53,5 +53,5 @@ index 352a7f25a7..65e84b666f 100644 this.g.clear(); this.p_(); -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0056-Add-exception-reporting-event.patch b/Spigot-Server-Patches/0056-Add-exception-reporting-event.patch index e9e32a7dc..6a3b9e37f 100644 --- a/Spigot-Server-Patches/0056-Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/0056-Add-exception-reporting-event.patch @@ -1,4 +1,4 @@ -From 36694c1b91770ae842431bb2a55017f2e932a4b1 Mon Sep 17 00:00:00 2001 +From d59504f70dfb71a27f3bee67630007337fc29f74 Mon Sep 17 00:00:00 2001 From: Joseph Hirschfeld Date: Thu, 3 Mar 2016 03:15:41 -0600 Subject: [PATCH] Add exception reporting event @@ -49,7 +49,7 @@ index 000000000..f699ce18c + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index bc7ffbf8a..64342f54c 100644 +index c5d562dca..37bea8dbe 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -1,5 +1,6 @@ @@ -59,7 +59,7 @@ index bc7ffbf8a..64342f54c 100644 import com.google.common.collect.Maps; import com.google.common.collect.Queues; import com.google.common.collect.Sets; -@@ -420,6 +421,7 @@ public class Chunk implements IChunkAccess { +@@ -425,6 +426,7 @@ public class Chunk implements IChunkAccess { return this.getBlockData(i, j, k).b(this.world, new BlockPosition(i, j, k)); } @@ -67,7 +67,7 @@ index bc7ffbf8a..64342f54c 100644 public IBlockData getType(BlockPosition blockposition) { return this.getBlockData(blockposition.getX(), blockposition.getY(), blockposition.getZ()); } -@@ -815,10 +817,15 @@ public class Chunk implements IChunkAccess { +@@ -820,10 +822,15 @@ public class Chunk implements IChunkAccess { this.tileEntities.remove(blockposition); // Paper end } else { @@ -119,7 +119,7 @@ index 6a9b9fa2a..557aa5180 100644 } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index 399eb231d..6a59e798d 100644 +index 95120be5d..5977d3b48 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -1,5 +1,6 @@ @@ -146,7 +146,7 @@ index 399eb231d..6a59e798d 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index f991fddf7..e888c9bdb 100644 +index 66fe6ff86..06417b9ec 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -1,5 +1,6 @@ @@ -165,7 +165,7 @@ index f991fddf7..e888c9bdb 100644 } @@ -221,6 +223,7 @@ public class RegionFile { - this.b(i, j, (int)(SystemUtils.d() / 1000L)); + this.b(i, j, (int)(SystemUtils.getTimeMillis() / 1000L)); } catch (IOException ioexception) { ioexception.printStackTrace(); + ServerInternalException.reportInternalException(ioexception); // Paper @@ -173,7 +173,7 @@ index f991fddf7..e888c9bdb 100644 } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index d18921271..e5115863e 100644 +index c5ca89691..e507a996f 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -1,5 +1,6 @@ @@ -240,7 +240,7 @@ index e649d662a..560edb523 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 3ecddf0fd..20ab0d420 100644 +index a9239ee7b..0e70a3d68 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1,6 +1,8 @@ @@ -252,7 +252,7 @@ index 3ecddf0fd..20ab0d420 100644 import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; import it.unimi.dsi.fastutil.longs.LongSet; -@@ -1200,8 +1202,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1150,8 +1152,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } catch (Throwable throwable1) { entity.tickTimer.stopTiming(); // Paper start - Prevent tile entity and entity crashes @@ -264,8 +264,8 @@ index 3ecddf0fd..20ab0d420 100644 entity.dead = true; continue; // Paper end -@@ -1266,8 +1270,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.methodProfiler.e(); +@@ -1216,8 +1220,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + this.methodProfiler.exit(); } catch (Throwable throwable2) { // Paper start - Prevent tile entity and entity crashes - System.err.println("TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()); @@ -277,16 +277,16 @@ index 3ecddf0fd..20ab0d420 100644 this.tileEntityListTick.remove(tileTickPosition--); continue; diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java -index b21f7073f..882b8fe4f 100644 +index f0a826cd1..2dee02669 100644 --- a/src/main/java/net/minecraft/server/WorldPersistentData.java +++ b/src/main/java/net/minecraft/server/WorldPersistentData.java -@@ -138,6 +138,7 @@ public class WorldPersistentData { - - nbttagcompound = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound1, j, i); - } catch (Throwable throwable1) { -+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable1); // Paper - throwable = throwable1; - throw throwable1; +@@ -121,6 +121,7 @@ public class WorldPersistentData { + int j = nbttagcompound.hasKeyOfType("DataVersion", 99) ? nbttagcompound.getInt("DataVersion") : 1343; + nbttagcompound1 = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound, j, i); + } catch (Throwable throwable2) { ++ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable2); // Paper + throwable = throwable2; + throw throwable2; } finally { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index 311c4f5ca..e76882b8e 100644 @@ -335,5 +335,5 @@ index 311c4f5ca..e76882b8e 100644 // (async tasks must live with race-conditions if they attempt to cancel between these few lines of code) } -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0058-Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/0058-Disable-Scoreboards-for-non-players-by-default.patch index 3bbdbf425..1f4fd36ef 100644 --- a/Spigot-Server-Patches/0058-Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/0058-Disable-Scoreboards-for-non-players-by-default.patch @@ -1,4 +1,4 @@ -From 8db6f7dff5c3f970e46f8f6bb6005c7067e235e0 Mon Sep 17 00:00:00 2001 +From f2a8776578335496dd9595b3d6a735ca6a52d675 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 8 Mar 2016 23:25:45 -0500 Subject: [PATCH] Disable Scoreboards for non players by default @@ -11,7 +11,7 @@ So avoid looking up scoreboards and short circuit to the "not on a team" logic which is most likely to be true. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 50837d767f..898068a817 100644 +index 50837d767..898068a81 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -195,4 +195,9 @@ public class PaperWorldConfig { @@ -25,19 +25,19 @@ index 50837d767f..898068a817 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6b413833da..43ceb2fb18 100644 +index 99716419e..caeb5eae0 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2247,6 +2247,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @Nullable - public ScoreboardTeamBase be() { + public ScoreboardTeamBase getScoreboardTeam() { + if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper return this.world.getScoreboard().getPlayerTeam(this.getName()); } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 961da5bf97..91baaa5062 100644 +index da105b41c..6f8ac61d8 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -538,6 +538,7 @@ public abstract class EntityLiving extends Entity { @@ -49,5 +49,5 @@ index 961da5bf97..91baaa5062 100644 if (!flag) { -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0062-Chunk-Save-Reattempt.patch b/Spigot-Server-Patches/0062-Chunk-Save-Reattempt.patch index 1d2d50d44..4edcb8c33 100644 --- a/Spigot-Server-Patches/0062-Chunk-Save-Reattempt.patch +++ b/Spigot-Server-Patches/0062-Chunk-Save-Reattempt.patch @@ -1,4 +1,4 @@ -From 8b104aaf5b009efc9c04ac1839443575da074737 Mon Sep 17 00:00:00 2001 +From b8e76a39e5eaeb73e676e879ffd8650dc68ee57c Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 4 Mar 2013 23:46:10 -0500 Subject: [PATCH] Chunk Save Reattempt @@ -6,12 +6,12 @@ Subject: [PATCH] Chunk Save Reattempt We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks. diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index e888c9bdba..f4405be395 100644 +index 06417b9ec..e1c0921ea 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -222,8 +222,7 @@ public class RegionFile { - this.b(i, j, (int)(SystemUtils.d() / 1000L)); + this.b(i, j, (int)(SystemUtils.getTimeMillis() / 1000L)); } catch (IOException ioexception) { - ioexception.printStackTrace(); - ServerInternalException.reportInternalException(ioexception); // Paper @@ -20,7 +20,7 @@ index e888c9bdba..f4405be395 100644 } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index e5115863ec..2217adf99c 100644 +index e507a996f..5dbd1d517 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -95,11 +95,29 @@ public class RegionFileCache { @@ -54,5 +54,5 @@ index e5115863ec..2217adf99c 100644 public static synchronized boolean chunkExists(File file, int i, int j) { -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0064-Allow-Reloading-of-Custom-Permissions.patch b/Spigot-Server-Patches/0064-Allow-Reloading-of-Custom-Permissions.patch index 86af9471d..11718b2d0 100644 --- a/Spigot-Server-Patches/0064-Allow-Reloading-of-Custom-Permissions.patch +++ b/Spigot-Server-Patches/0064-Allow-Reloading-of-Custom-Permissions.patch @@ -1,4 +1,4 @@ -From 65d546877bed1fdc70d0ffaaa8f616be16e01236 Mon Sep 17 00:00:00 2001 +From f3c64acdb1626e3c83b9b962dd648cc43426b85a Mon Sep 17 00:00:00 2001 From: William Date: Fri, 18 Mar 2016 03:30:17 -0400 Subject: [PATCH] Allow Reloading of Custom Permissions @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bbd8969db..90177b72c 100644 +index bcd8ba4ad..70c3cde24 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2053,5 +2053,23 @@ public final class CraftServer implements Server { +@@ -2052,5 +2052,23 @@ public final class CraftServer implements Server { return false; } } @@ -34,5 +34,5 @@ index bbd8969db..90177b72c 100644 // Paper end } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0069-Add-World-Util-Methods.patch b/Spigot-Server-Patches/0069-Add-World-Util-Methods.patch index e4f78cdc6..2a36f6d72 100644 --- a/Spigot-Server-Patches/0069-Add-World-Util-Methods.patch +++ b/Spigot-Server-Patches/0069-Add-World-Util-Methods.patch @@ -1,4 +1,4 @@ -From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 +From e69350a0263767ab2332db30c6fa93cddbf4237d Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Mar 2016 20:16:03 -0400 Subject: [PATCH] Add World Util Methods @@ -6,10 +6,10 @@ Subject: [PATCH] Add World Util Methods Methods that can be used for other patches to help improve logic. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 37bea8dbe..eca041265 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -633,6 +633,7 @@ public class Chunk implements IChunkAccess { +@@ -638,6 +638,7 @@ public class Chunk implements IChunkAccess { } } @@ -18,7 +18,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return this.a(blockposition, i, this.world.o().g()); } diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index f5c56de0c..9b972e65d 100644 --- a/src/main/java/net/minecraft/server/IWorldReader.java +++ b/src/main/java/net/minecraft/server/IWorldReader.java @@ -35,6 +35,22 @@ public interface IWorldReader extends IBlockAccess { @@ -54,7 +54,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 }; Stream stream = StreamSupport.stream(BlockPosition.MutableBlockPosition.b(i, k, i1, j - 1, l - 1, j1 - 1).spliterator(), false).map((blockposition$mutableblockposition) -> { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 0e70a3d68..4093d3486 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -84,7 +84,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -151,5 +151,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4); } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0074-Catch-Async-PlayerChunkMap-operations.patch b/Spigot-Server-Patches/0074-Catch-Async-PlayerChunkMap-operations.patch index 7dacf8a90..18a7f4ff1 100644 --- a/Spigot-Server-Patches/0074-Catch-Async-PlayerChunkMap-operations.patch +++ b/Spigot-Server-Patches/0074-Catch-Async-PlayerChunkMap-operations.patch @@ -1,14 +1,14 @@ -From 5f489d6f0d19763383fc223b8f8b1a0b3743ccf7 Mon Sep 17 00:00:00 2001 +From a344b3a7f2aa1b2bc16b50743b31c011f4b3c996 Mon Sep 17 00:00:00 2001 From: Daniel Ennis Date: Sun, 20 Mar 2016 15:22:42 -0400 Subject: [PATCH] Catch Async PlayerChunkMap operations diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index fb593529e1..a69d510dd1 100644 +index 653031af4..3d17ad646 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -442,10 +442,12 @@ public class PlayerChunkMap { +@@ -438,10 +438,12 @@ public class PlayerChunkMap { } public void a(PlayerChunk playerchunk) { @@ -22,5 +22,5 @@ index fb593529e1..a69d510dd1 100644 long i = d(chunkcoordintpair.x, chunkcoordintpair.z); -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0078-Optimize-Chunk-Access.patch b/Spigot-Server-Patches/0078-Optimize-Chunk-Access.patch index 9784cbfff..0bf911513 100644 --- a/Spigot-Server-Patches/0078-Optimize-Chunk-Access.patch +++ b/Spigot-Server-Patches/0078-Optimize-Chunk-Access.patch @@ -1,4 +1,4 @@ -From 9d894a3b3e3aee3b5cdd072ead5de268498b1191 Mon Sep 17 00:00:00 2001 +From f5810f944e68391b4e1b8c35968b89a54f6ee177 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 27 Aug 2015 01:15:02 -0400 Subject: [PATCH] Optimize Chunk Access @@ -9,12 +9,12 @@ getChunkAt is called for the same chunk multiple times in a row, often from getT Optimize this look up by using a Last Access cache. diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index ca18901df..2ebb2d834 100644 +index 732c8793e..8b3738c8f 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -15,6 +15,7 @@ public class ChunkMap extends Long2ObjectOpenHashMap { - public Chunk a(long i, Chunk chunk) { + public Chunk put(long i, Chunk chunk) { chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper + lastChunkByPos = chunk; // Paper Chunk chunk1 = (Chunk) super.put(i, chunk); @@ -68,8 +68,8 @@ index ca18901df..2ebb2d834 100644 + } + // Paper end - public Chunk a(Object object) { - return this.a((Long) object); + public Chunk remove(Object object) { + return this.remove((Long) object); diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index 557aa5180..1d08ec37f 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -121,5 +121,5 @@ index 557aa5180..1d08ec37f 100644 } } -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0080-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/0080-Optimize-isValidLocation-getType-and-getBlockData-fo.patch index 6d4ebb68d..d3c7a4c59 100644 --- a/Spigot-Server-Patches/0080-Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/Spigot-Server-Patches/0080-Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -1,4 +1,4 @@ -From 04b7649ebd2cec65cac90240083f2bd66eaba5ef Mon Sep 17 00:00:00 2001 +From f8874981d7f1f44b2420f499c41ecadd99903172 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Mar 2016 02:07:55 -0600 Subject: [PATCH] Optimize isValidLocation, getType and getBlockData for inling @@ -12,7 +12,7 @@ Replace all calls to the new place to the unnecessary forward. Optimize getType and getBlockData to manually inline and optimize the calls diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index 4048937c6..680764b34 100644 +index f1ad18511..339e2da6b 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -9,6 +9,14 @@ public class BaseBlockPosition implements Comparable { @@ -31,10 +31,10 @@ index 4048937c6..680764b34 100644 public BaseBlockPosition(int i, int j, int k) { this.a = i; diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 5c5f19b4b..d81e2dc1c 100644 +index 880ce16b1..c9019260b 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -240,6 +240,16 @@ public class BlockPosition extends BaseBlockPosition { +@@ -228,6 +228,16 @@ public class BlockPosition extends BaseBlockPosition { protected int b; protected int c; protected int d; @@ -52,10 +52,10 @@ index 5c5f19b4b..d81e2dc1c 100644 public MutableBlockPosition() { this(0, 0, 0); diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 101d5bb01..6a23b1ec2 100644 +index eca041265..66520842d 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -421,12 +421,24 @@ public class Chunk implements IChunkAccess { +@@ -426,12 +426,24 @@ public class Chunk implements IChunkAccess { return this.getBlockData(i, j, k).b(this.world, new BlockPosition(i, j, k)); } @@ -97,7 +97,7 @@ index 274c44948..7e4c79a1c 100644 private NibbleArray skyLight; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index befb3e23f..3bfb9397d 100644 +index 4093d3486..e109016b7 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -263,11 +263,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -173,7 +173,7 @@ index befb3e23f..3bfb9397d 100644 return FluidTypes.a.i(); } else { Chunk chunk = this.getChunkAtWorldCoords(blockposition); -@@ -1816,7 +1816,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1766,7 +1766,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public Map capturedTileEntities = Maps.newHashMap(); @Nullable public TileEntity getTileEntity(BlockPosition blockposition) { @@ -182,7 +182,7 @@ index befb3e23f..3bfb9397d 100644 return null; } else { // CraftBukkit start -@@ -1857,7 +1857,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1807,7 +1807,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { @@ -191,7 +191,7 @@ index befb3e23f..3bfb9397d 100644 if (tileentity != null && !tileentity.x()) { // CraftBukkit start if (captureBlockStates) { -@@ -1918,7 +1918,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1868,7 +1868,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public boolean p(BlockPosition blockposition) { @@ -201,5 +201,5 @@ index befb3e23f..3bfb9397d 100644 } else { Chunk chunk = this.chunkProvider.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4, false, false); -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0082-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch b/Spigot-Server-Patches/0082-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch index 91f74199e..4ac9f4fcc 100644 --- a/Spigot-Server-Patches/0082-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch +++ b/Spigot-Server-Patches/0082-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch @@ -1,4 +1,4 @@ -From a0af0ad881fb9d995344062b85a00144cef634db Mon Sep 17 00:00:00 2001 +From 370c7181c7102186b298dd9d2427d8e7280bdd78 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 19:55:45 -0400 Subject: [PATCH] Option to disable BlockPhysicsEvent for Redstone @@ -11,7 +11,7 @@ Defaulting this to false will provide substantial performance improvement by saving millions of event calls on redstone heavy servers. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0faef7cf28..deb4ec2543 100644 +index 0faef7cf2..deb4ec254 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -228,4 +228,9 @@ public class PaperWorldConfig { @@ -25,7 +25,7 @@ index 0faef7cf28..deb4ec2543 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index cad60e4f8b..22f0673743 100644 +index e109016b7..e614ac33a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -620,7 +620,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -38,7 +38,7 @@ index cad60e4f8b..22f0673743 100644 this.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a7cc053dc8..c5201697d5 100644 +index e98ba11dc..b5983957b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -37,6 +37,7 @@ import org.bukkit.event.weather.LightningStrikeEvent; @@ -49,7 +49,7 @@ index a7cc053dc8..c5201697d5 100644 private final MinecraftServer server; public EntityTracker tracker; private final PlayerChunkMap manager; -@@ -676,6 +677,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -677,6 +678,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { IBlockData iblockdata = this.getType(nextticklistentry.a); if (iblockdata.getBlock() == nextticklistentry.a()) { @@ -58,5 +58,5 @@ index a7cc053dc8..c5201697d5 100644 } -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0083-Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-Server-Patches/0083-Entity-AddTo-RemoveFrom-World-Events.patch index 4aac9eeab..bf61dfa42 100644 --- a/Spigot-Server-Patches/0083-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-Server-Patches/0083-Entity-AddTo-RemoveFrom-World-Events.patch @@ -1,14 +1,14 @@ -From d3b16edfb2a1998d0165e0c286da1ba9673eafe9 Mon Sep 17 00:00:00 2001 +From 89e7bbd243d48746d5df915a32901d9b035976c1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:32:58 -0400 Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 22f0673743..207f53a9c3 100644 +index e614ac33a..608f72f0f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1082,6 +1082,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1032,6 +1032,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } entity.valid = true; // CraftBukkit @@ -16,7 +16,7 @@ index 22f0673743..207f53a9c3 100644 } protected void c(Entity entity) { -@@ -1089,6 +1090,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1039,6 +1040,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc ((IWorldAccess) this.v.get(i)).b(entity); } @@ -25,5 +25,5 @@ index 22f0673743..207f53a9c3 100644 } -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0084-Configurable-Chunk-Inhabited-Time.patch b/Spigot-Server-Patches/0084-Configurable-Chunk-Inhabited-Time.patch index 09fd2abf9..bf711f1b1 100644 --- a/Spigot-Server-Patches/0084-Configurable-Chunk-Inhabited-Time.patch +++ b/Spigot-Server-Patches/0084-Configurable-Chunk-Inhabited-Time.patch @@ -1,4 +1,4 @@ -From d558b28c05f4837bd5a31c256e92822f4e8959f4 Mon Sep 17 00:00:00 2001 +From 298486afbcd90b8d75fff4514bc9c296c088508e Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:46:14 -0400 Subject: [PATCH] Configurable Chunk Inhabited Time @@ -30,10 +30,10 @@ index deb4ec254..d2559f7c4 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 6a23b1ec2..d065d88f7 100644 +index 66520842d..f470eba29 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -1277,7 +1277,7 @@ public class Chunk implements IChunkAccess { +@@ -1290,7 +1290,7 @@ public class Chunk implements IChunkAccess { } public long m() { diff --git a/Spigot-Server-Patches/0085-EntityPathfindEvent.patch b/Spigot-Server-Patches/0085-EntityPathfindEvent.patch index 8d32a185b..d40eb80f4 100644 --- a/Spigot-Server-Patches/0085-EntityPathfindEvent.patch +++ b/Spigot-Server-Patches/0085-EntityPathfindEvent.patch @@ -1,4 +1,4 @@ -From 662cf614a03e90feb9aaad1d22300aee82391b4c Mon Sep 17 00:00:00 2001 +From 614a925bc91281a04de5af8f6da7fa8b725046eb Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 21:22:26 -0400 Subject: [PATCH] EntityPathfindEvent @@ -6,7 +6,7 @@ Subject: [PATCH] EntityPathfindEvent Fires when an Entity decides to start moving to a location. diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 5d6f726d05..a8b070ed32 100644 +index 0600fe23a..53f1c25d2 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -3,7 +3,7 @@ package net.minecraft.server; @@ -25,7 +25,7 @@ index 5d6f726d05..a8b070ed32 100644 + if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper this.q = blockposition; float fx = this.j(); - this.b.methodProfiler.a("pathfind"); + this.b.methodProfiler.enter("pathfind"); @@ -95,6 +96,7 @@ public abstract class NavigationAbstract { if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { return this.c; @@ -33,7 +33,7 @@ index 5d6f726d05..a8b070ed32 100644 + if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper this.q = blockposition; float fx = this.j(); - this.b.methodProfiler.a("pathfind"); + this.b.methodProfiler.enter("pathfind"); -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0087-Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/0087-Sanitise-RegionFileCache-and-make-configurable.patch index c8628562f..16df9e1f7 100644 --- a/Spigot-Server-Patches/0087-Sanitise-RegionFileCache-and-make-configurable.patch +++ b/Spigot-Server-Patches/0087-Sanitise-RegionFileCache-and-make-configurable.patch @@ -1,4 +1,4 @@ -From a4d11307f56bfb8d5f7559315844f5cbc64b6ae4 Mon Sep 17 00:00:00 2001 +From f66ef986b6349909793d94ae5f6087a3eb8302c0 Mon Sep 17 00:00:00 2001 From: Antony Riley Date: Tue, 29 Mar 2016 08:22:55 +0300 Subject: [PATCH] Sanitise RegionFileCache and make configurable. @@ -11,7 +11,7 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap). The maximum size of the RegionFileCache is also made configurable. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index dccd00127..b4dba7247 100644 +index 492df2c8e..0778f53e2 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -228,4 +228,9 @@ public class PaperConfig { @@ -25,7 +25,7 @@ index dccd00127..b4dba7247 100644 + } } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 2217adf99..c0ab543b9 100644 +index 5dbd1d517..964996976 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -9,10 +9,12 @@ import java.io.IOException; @@ -37,19 +37,17 @@ index 2217adf99..c0ab543b9 100644 public class RegionFileCache { -- public static final Map a = Maps.newHashMap(); // Spigot - private -> public -+ public static final Map a = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Spigot - private -> public, Paper - HashMap -> LinkedHashMap +- public static final Map cache = Maps.newHashMap(); ++ public static final Map cache = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Paper - HashMap -> LinkedHashMap public static synchronized RegionFile a(File file, int i, int j) { File file1 = new File(file, "region"); -@@ -26,8 +28,8 @@ public class RegionFileCache { - file1.mkdirs(); +@@ -27,7 +29,7 @@ public class RegionFileCache { } -- if (RegionFileCache.a.size() >= 256) { + if (RegionFileCache.cache.size() >= 256) { - a(); -+ if (RegionFileCache.a.size() >= PaperConfig.regionFileCacheSize) { // Paper -+ trimCache(); // Paper ++ trimCache(); } RegionFile regionfile1 = new RegionFile(file2); @@ -59,11 +57,11 @@ index 2217adf99..c0ab543b9 100644 + // Paper Start + private static synchronized void trimCache() { -+ Iterator> itr = RegionFileCache.a.entrySet().iterator(); -+ int count = RegionFileCache.a.size() - PaperConfig.regionFileCacheSize; ++ Iterator> itr = RegionFileCache.cache.entrySet().iterator(); ++ int count = RegionFileCache.cache.size() - PaperConfig.regionFileCacheSize; + while (count-- >= 0 && itr.hasNext()) { + try { -+ itr.next().getValue().c(); ++ itr.next().getValue().close(); + } catch (IOException ioexception) { + ioexception.printStackTrace(); + ServerInternalException.reportInternalException(ioexception); @@ -74,8 +72,8 @@ index 2217adf99..c0ab543b9 100644 + // Paper End + public static synchronized void a() { - Iterator iterator = RegionFileCache.a.values().iterator(); + Iterator iterator = RegionFileCache.cache.values().iterator(); -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0089-Do-not-load-chunks-for-Pathfinding.patch b/Spigot-Server-Patches/0089-Do-not-load-chunks-for-Pathfinding.patch index 01b4e1f9d..1f2a5c172 100644 --- a/Spigot-Server-Patches/0089-Do-not-load-chunks-for-Pathfinding.patch +++ b/Spigot-Server-Patches/0089-Do-not-load-chunks-for-Pathfinding.patch @@ -1,11 +1,11 @@ -From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 +From 371d310b56332215506709abf6289ee0529dbb57 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 31 Mar 2016 19:17:58 -0400 Subject: [PATCH] Do not load chunks for Pathfinding diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 546c79cd8..25caf7ef9 100644 --- a/src/main/java/net/minecraft/server/ChunkCache.java +++ b/src/main/java/net/minecraft/server/ChunkCache.java @@ -21,7 +21,7 @@ public class ChunkCache implements IIBlockAccess { @@ -18,7 +18,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 53f1c25d2..26156d6cf 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -21,13 +21,15 @@ public abstract class NavigationAbstract { @@ -47,7 +47,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 if (this.m) { this.l(); diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index a12fdceac..1881dea66 100644 --- a/src/main/java/net/minecraft/server/Pathfinder.java +++ b/src/main/java/net/minecraft/server/Pathfinder.java @@ -8,7 +8,7 @@ public class Pathfinder { @@ -60,7 +60,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public Pathfinder(PathfinderAbstract pathfinderabstract) { this.d = pathfinderabstract; diff --git a/src/main/java/net/minecraft/server/PathfinderAbstract.java b/src/main/java/net/minecraft/server/PathfinderAbstract.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index ba7fe359f..671628014 100644 --- a/src/main/java/net/minecraft/server/PathfinderAbstract.java +++ b/src/main/java/net/minecraft/server/PathfinderAbstract.java @@ -3,6 +3,7 @@ package net.minecraft.server; @@ -80,7 +80,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 this.c.c(); this.d = MathHelper.d(entityinsentient.width + 1.0F); diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 2e82c7c48..34b29652b 100644 --- a/src/main/java/net/minecraft/server/PathfinderNormal.java +++ b/src/main/java/net/minecraft/server/PathfinderNormal.java @@ -47,7 +47,7 @@ public class PathfinderNormal extends PathfinderAbstract { @@ -115,9 +115,9 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 for(int l = -1; l <= 1; ++l) { for(int i1 = -1; i1 <= 1; ++i1) { if (l != 0 || i1 != 0) { -- Block block = iblockaccess.getType(blockposition$b.f(l + i, jx, i1 + k)).getBlock(); +- Block block = iblockaccess.getType(blockposition$b.c(l + i, jx, i1 + k)).getBlock(); - if (block == Blocks.CACTUS) { -+ Block block = world.getBlockIfLoaded(blockposition$b.f(l + i, jx, i1 + k)); // Paper ++ Block block = world.getBlockIfLoaded(blockposition$b.c(l + i, jx, i1 + k)); // Paper + if (block == null) pathtype = PathType.BLOCKED; // Paper + else if (block == Blocks.CACTUS) { // Paper pathtype = PathType.DANGER_CACTUS; @@ -134,5 +134,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 Material material = iblockdata.getMaterial(); if (iblockdata.isAir()) { -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0094-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/0094-Configurable-Keep-Spawn-Loaded-range-per-world.patch index 58cca1ace..d0ca3713f 100644 --- a/Spigot-Server-Patches/0094-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/Spigot-Server-Patches/0094-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -1,4 +1,4 @@ -From d6e138e030d90d72795ada5cf94cb506af0ef6ad Mon Sep 17 00:00:00 2001 +From 7b96e2cf79f6c8f5fd688ae20700b1398670593b Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 13 Sep 2014 23:14:43 -0400 Subject: [PATCH] Configurable Keep Spawn Loaded range per world @@ -21,7 +21,7 @@ index 058cd8cc8..276dd98fd 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 051608e38..7793626b5 100644 +index eef8d2b5a..cc98b745b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -490,13 +490,21 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -42,7 +42,7 @@ index 051608e38..7793626b5 100644 + int expected = arraylist.size(); // Paper + - CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> { + CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> { set.add(chunk.getPos()); + if (set.size() < expected && set.size() % 25 == 0) this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper }); @@ -63,10 +63,10 @@ index 051608e38..7793626b5 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 481a462f8..e64a95ece 100644 +index ceb4102af..02a62d6d7 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -2902,8 +2902,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2852,8 +2852,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int k = i * 16 + 8 - blockposition.getX(); int l = j * 16 + 8 - blockposition.getZ(); boolean flag = true; @@ -78,7 +78,7 @@ index 481a462f8..e64a95ece 100644 public LongSet ag() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 082e86963..b89c5f4ab 100644 +index acd54067e..c655d51ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1004,7 +1004,7 @@ public final class CraftServer implements Server { @@ -91,7 +91,7 @@ index 082e86963..b89c5f4ab 100644 for (int j = -short1; j <= short1; j += 16) { for (int k = -short1; k <= short1; k += 16) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a784bf6f6..24e504c27 100644 +index 1676fcc85..b19eef1b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1404,8 +1404,9 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0096-Don-t-spam-reload-spawn-chunks-in-nether-end.patch b/Spigot-Server-Patches/0096-Don-t-spam-reload-spawn-chunks-in-nether-end.patch index 193bdfd54..09a795ea2 100644 --- a/Spigot-Server-Patches/0096-Don-t-spam-reload-spawn-chunks-in-nether-end.patch +++ b/Spigot-Server-Patches/0096-Don-t-spam-reload-spawn-chunks-in-nether-end.patch @@ -1,14 +1,14 @@ -From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 +From c964f427b9758437f1cbbce042795818e8243b52 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Apr 2016 19:42:22 -0400 Subject: [PATCH] Don't spam reload spawn chunks in nether/end diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 64482393d..1a1b40ac0 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -2898,6 +2898,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2848,6 +2848,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return this.K; } @@ -17,7 +17,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 BlockPosition blockposition = this.getSpawn(); int k = i * 16 + 8 - blockposition.getX(); diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index bd9c76ee8..ef5c7b1f6 100644 --- a/src/main/java/net/minecraft/server/WorldProvider.java +++ b/src/main/java/net/minecraft/server/WorldProvider.java @@ -72,7 +72,7 @@ public abstract class WorldProvider { @@ -30,5 +30,5 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 protected abstract void m(); -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0098-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/Spigot-Server-Patches/0098-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch index e7e70f06e..d17071161 100644 --- a/Spigot-Server-Patches/0098-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ b/Spigot-Server-Patches/0098-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -1,4 +1,4 @@ -From 77c47f231d1a936f15d3dc8863d9e3362d0ca76d Mon Sep 17 00:00:00 2001 +From 33a493b42f79a4adbdd4afe6806bdeea1e52322a Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 6 Apr 2016 01:04:23 -0500 Subject: [PATCH] Option to use vanilla per-world scoreboard coloring on names @@ -25,20 +25,8 @@ index 276dd98fd..973ea8bca 100644 + useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false); + } } -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 734ee9d8e..e60e8e8fe 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2259,6 +2259,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return this.getFlag(5); - } - -+ @Nullable public ScoreboardTeamBase getTeam() { return this.be(); } // Paper - OBFHELPER - @Nullable - public ScoreboardTeamBase be() { - if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index dc2c143c8..5c7a88ec8 100644 +index 8a65072fe..d162bd3d8 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1631,7 +1631,16 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -49,7 +37,7 @@ index dc2c143c8..5c7a88ec8 100644 + // Paper Start - (Meh) Support for vanilla world scoreboard name coloring + String displayName = event.getPlayer().getDisplayName(); + if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) { -+ IChatBaseComponent nameFromTeam = ScoreboardTeam.a(this.player.getTeam(),((CraftPlayer) player).getHandle().getDisplayName()); ++ IChatBaseComponent nameFromTeam = ScoreboardTeam.a(this.player.getScoreboardTeam(),((CraftPlayer) player).getHandle().getDisplayName()); + // Explicitly add a RESET here, vanilla uses components for this now... + displayName = CraftChatMessage.fromComponent(nameFromTeam, EnumChatFormat.WHITE) + org.bukkit.ChatColor.RESET; + } @@ -60,7 +48,7 @@ index dc2c143c8..5c7a88ec8 100644 if (((LazyPlayerSet) event.getRecipients()).isLazy()) { for (Object recipient : minecraftServer.getPlayerList().players) { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 8c10a0da1..2cb5869ae 100644 +index 80f595fea..7edca4284 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -177,7 +177,7 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0100-Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/0100-Remove-unused-World-Tile-Entity-List.patch index 48241e3b7..6532cef28 100644 --- a/Spigot-Server-Patches/0100-Remove-unused-World-Tile-Entity-List.patch +++ b/Spigot-Server-Patches/0100-Remove-unused-World-Tile-Entity-List.patch @@ -1,4 +1,4 @@ -From 84c22db34d740ea9f31baf1a34e55da2991b00dc Mon Sep 17 00:00:00 2001 +From 7a77bcce394c3b98f9b3df7972bad53d5bbc3520 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 13 Apr 2016 00:25:28 -0400 Subject: [PATCH] Remove unused World Tile Entity List @@ -6,7 +6,7 @@ Subject: [PATCH] Remove unused World Tile Entity List Massive hit to performance and it is completely unnecessary. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 796ce3103a..261ae87fb8 100644 +index 1a1b40ac0..9c5f520f1 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -76,7 +76,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -18,7 +18,7 @@ index 796ce3103a..261ae87fb8 100644 public final List tileEntityListTick = Lists.newArrayList(); private final List c = Lists.newArrayList(); private final Set tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper -@@ -1318,7 +1318,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1268,7 +1268,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { this.tileEntityListTick.removeAll(this.tileEntityListUnload); @@ -27,7 +27,7 @@ index 796ce3103a..261ae87fb8 100644 this.tileEntityListUnload.clear(); } -@@ -1371,7 +1371,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1321,7 +1321,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (tileentity.x()) { tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); @@ -36,7 +36,7 @@ index 796ce3103a..261ae87fb8 100644 if (this.isLoaded(tileentity.getPosition())) { this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition()); } -@@ -1401,7 +1401,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1351,7 +1351,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); // CraftBukkit start // From above, don't screw this up - SPIGOT-1746 @@ -45,7 +45,7 @@ index 796ce3103a..261ae87fb8 100644 this.a(tileentity1); } // CraftBukkit end -@@ -1421,9 +1421,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1371,9 +1371,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc protected void p_() {} public boolean a(TileEntity tileentity) { @@ -57,7 +57,7 @@ index 796ce3103a..261ae87fb8 100644 this.tileEntityListTick.add(tileentity); } -@@ -1904,7 +1904,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1854,7 +1854,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } else { if (tileentity != null) { this.c.remove(tileentity); @@ -67,5 +67,5 @@ index 796ce3103a..261ae87fb8 100644 } -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0102-Configurable-Player-Collision.patch b/Spigot-Server-Patches/0102-Configurable-Player-Collision.patch index b28b253bb..84d6d8e2e 100644 --- a/Spigot-Server-Patches/0102-Configurable-Player-Collision.patch +++ b/Spigot-Server-Patches/0102-Configurable-Player-Collision.patch @@ -1,11 +1,11 @@ -From deefbc94ab507f4a70b73a4006ece70e4e9c657f Mon Sep 17 00:00:00 2001 +From 559f0719ff1b69a0decfbbc543cf13fcc2c79654 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 13 Apr 2016 02:10:49 -0400 Subject: [PATCH] Configurable Player Collision diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index b4dba7247..1d32b93c8 100644 +index 0778f53e2..30fcf4a72 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -233,4 +233,9 @@ public class PaperConfig { @@ -19,7 +19,7 @@ index b4dba7247..1d32b93c8 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7793626b5..bdd2c4b85 100644 +index cc98b745b..d146cc79c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -425,6 +425,19 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -56,7 +56,7 @@ index f7a9b9d88..7befd80cf 100644 packetdataserializer.a(this.c); packetdataserializer.a(this.d); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 2cb5869ae..143c7c1be 100644 +index 7edca4284..3e4ca288d 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -74,6 +74,7 @@ public abstract class PlayerList { @@ -74,7 +74,7 @@ index 2cb5869ae..143c7c1be 100644 + // Paper start - Add to collideRule team if needed + final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam collideRuleTeam = scoreboard.getTeam(collideRuleTeamName); -+ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getTeam() == null) { ++ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getScoreboardTeam() == null) { + scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeam); + } + // Paper end @@ -89,7 +89,7 @@ index 2cb5869ae..143c7c1be 100644 + if (this.collideRuleTeamName != null) { + final Scoreboard scoreBoard = this.server.getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName); -+ if (entityplayer.getTeam() == team && team != null) { ++ if (entityplayer.getScoreboardTeam() == team && team != null) { + scoreBoard.removePlayerFromTeam(entityplayer.getName(), team); + } + } @@ -114,5 +114,5 @@ index 2cb5869ae..143c7c1be 100644 // CraftBukkit start -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0103-Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-Server-Patches/0103-Add-handshake-event-to-allow-plugins-to-handle-clien.patch index 35dab4751..2d97013da 100644 --- a/Spigot-Server-Patches/0103-Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ b/Spigot-Server-Patches/0103-Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -1,4 +1,4 @@ -From 619d038b64d2fe9203cb69d5b3229cd4f628c8ff Mon Sep 17 00:00:00 2001 +From 59e670ac6abffe4d2f20f05ebd612da5f8b2a403 Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 13 Apr 2016 20:21:38 -0700 Subject: [PATCH] Add handshake event to allow plugins to handle client @@ -6,7 +6,7 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index 72d841af06..6aabdc2974 100644 +index 8f2289f4e..93ca93b64 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -72,8 +72,33 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -29,7 +29,7 @@ index 72d841af06..6aabdc2974 100644 + } + + packethandshakinginsetprotocol.hostname = event.getServerHostname(); -+ this.b.l = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort()); ++ this.b.socketAddress = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort()); + this.b.spoofedUUID = event.getUniqueId(); + this.b.spoofedProfile = gson.fromJson(event.getPropertiesJson(), com.mojang.authlib.properties.Property[].class); + handledByEvent = true; // Hooray, we did it! @@ -45,5 +45,5 @@ index 72d841af06..6aabdc2974 100644 if ( split.length == 3 || split.length == 4 ) { packethandshakinginsetprotocol.hostname = split[0]; -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0108-Add-ability-to-configure-frosted_ice-properties.patch b/Spigot-Server-Patches/0108-Add-ability-to-configure-frosted_ice-properties.patch index f535c8a81..ab9cda84a 100644 --- a/Spigot-Server-Patches/0108-Add-ability-to-configure-frosted_ice-properties.patch +++ b/Spigot-Server-Patches/0108-Add-ability-to-configure-frosted_ice-properties.patch @@ -1,4 +1,4 @@ -From 7972a6a1c23e96a84c0e78c20c5fac7732a33d1f Mon Sep 17 00:00:00 2001 +From 93c2696ec51341f0375fb4fda21b81e890bc49e4 Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 21 Apr 2016 23:51:55 -0700 Subject: [PATCH] Add ability to configure frosted_ice properties @@ -24,7 +24,7 @@ index 973ea8bca..7c7d5595a 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index af6c744ad..7bea86f52 100644 +index 1100073f3..598621fbb 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java @@ -11,19 +11,20 @@ public class BlockIceFrost extends BlockIce { @@ -35,18 +35,18 @@ index af6c744ad..7bea86f52 100644 if ((random.nextInt(3) == 0 || this.a(world, blockposition, 4)) && world.getLightLevel(blockposition) > 11 - iblockdata.get(a) - iblockdata.b(world, blockposition) && this.c(iblockdata, world, blockposition)) { try (BlockPosition.b blockposition$b = BlockPosition.b.r()) { for(EnumDirection enumdirection : EnumDirection.values()) { - blockposition$b.j(blockposition).d(enumdirection); + blockposition$b.g(blockposition).c(enumdirection); IBlockData iblockdata1 = world.getType(blockposition$b); if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition$b)) { -- world.J().a(blockposition$b, this, MathHelper.nextInt(random, 20, 40)); -+ world.J().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay +- world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, 20, 40)); ++ world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay } } } } else { -- world.J().a(blockposition, this, MathHelper.nextInt(random, 20, 40)); -+ world.J().a(blockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay +- world.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, 20, 40)); ++ world.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay } } diff --git a/Spigot-Server-Patches/0110-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/Spigot-Server-Patches/0110-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index 6986f6883..84b637da6 100644 --- a/Spigot-Server-Patches/0110-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/Spigot-Server-Patches/0110-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -1,4 +1,4 @@ -From d415127904d0188d028f30b361d7f5312c5532ca Mon Sep 17 00:00:00 2001 +From 84144ea1b943d26fa00db7f33b51c5172d234a11 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 29 Apr 2016 20:02:00 -0400 Subject: [PATCH] Improve Maps (in item frames) performance and bug fixes @@ -13,7 +13,7 @@ custom renderers are in use, defaulting to the much simpler Vanilla system. Additionally, numerous issues to player position tracking on maps has been fixed. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index d245502286..816854dc2f 100644 +index 1185769ca..443a089d8 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -618,6 +618,12 @@ public abstract class EntityHuman extends EntityLiving { @@ -30,7 +30,7 @@ index d245502286..816854dc2f 100644 ItemStack itemstack1 = this.a(entityitem); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index c5bfe6630d..4f2d7db378 100644 +index 08d923563..6d9c80489 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -97,7 +97,7 @@ public class EntityTrackerEntry { @@ -43,10 +43,10 @@ index c5bfe6630d..4f2d7db378 100644 ItemStack itemstack = entityitemframe.getItem(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 264dc740cb..8aa4138a2e 100644 +index 9c5f520f1..5d7370029 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1122,6 +1122,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1072,6 +1072,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc { if ( iter.next().trackee == entity ) { @@ -55,7 +55,7 @@ index 264dc740cb..8aa4138a2e 100644 } } diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java -index bf7963b421..338d753500 100644 +index 5c09085a6..a819d6037 100644 --- a/src/main/java/net/minecraft/server/WorldMap.java +++ b/src/main/java/net/minecraft/server/WorldMap.java @@ -30,6 +30,7 @@ public class WorldMap extends PersistentBase { @@ -88,7 +88,7 @@ index bf7963b421..338d753500 100644 + public void updateSeenPlayers(EntityHuman entityhuman, ItemStack itemstack) { a(entityhuman, itemstack); } // Paper - OBFHELPER public void a(EntityHuman entityhuman, ItemStack itemstack) { - if (!this.j.containsKey(entityhuman)) { + if (!this.humans.containsKey(entityhuman)) { WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman); @@ -404,6 +408,21 @@ public class WorldMap extends PersistentBase { @@ -127,7 +127,7 @@ index bf7963b421..338d753500 100644 for ( org.bukkit.map.MapCursor cursor : render.cursors) { diff --git a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java -index 256a131781..5768cd512e 100644 +index 256a13178..5768cd512 100644 --- a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java +++ b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java @@ -5,7 +5,7 @@ import org.bukkit.map.MapCursor; @@ -140,5 +140,5 @@ index 256a131781..5768cd512e 100644 public RenderData() { -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0115-Activation-Range-Improvements.patch b/Spigot-Server-Patches/0115-Activation-Range-Improvements.patch index cc17fbc17..495397d25 100644 --- a/Spigot-Server-Patches/0115-Activation-Range-Improvements.patch +++ b/Spigot-Server-Patches/0115-Activation-Range-Improvements.patch @@ -1,4 +1,4 @@ -From 138ea64830ff2fd0adfdd094500fea47c1e30852 Mon Sep 17 00:00:00 2001 +From fdd7766d19df64b696d939e214b6a03c3e1757ab Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 13 May 2016 01:38:06 -0400 Subject: [PATCH] Activation Range Improvements @@ -10,10 +10,10 @@ Fixes and adds new Immunities to improve gameplay behavior Adds water Mobs to activation range config and nerfs fish diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index d81e2dc1c5..7bd51b3578 100644 +index c9019260b..e980e31fc 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -327,6 +327,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -315,6 +315,7 @@ public class BlockPosition extends BaseBlockPosition { this.c = i; } @@ -22,7 +22,7 @@ index d81e2dc1c5..7bd51b3578 100644 return new BlockPosition(this); } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e7f9e490bf..68ceee5f08 100644 +index 69645d517..9682b0a01 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -575,6 +575,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -34,7 +34,7 @@ index e7f9e490bf..68ceee5f08 100644 if (i != this.aM) { diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index 20b7c2c6dc..d659c57dbe 100644 +index 20b7c2c6d..d659c57db 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -7,6 +7,7 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -46,7 +46,7 @@ index 20b7c2c6dc..d659c57dbe 100644 private float b; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index c87304d477..41a4962e94 100644 +index ac250182b..06bb8cf1f 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -104,6 +104,17 @@ public abstract class EntityInsentient extends EntityLiving { @@ -68,7 +68,7 @@ index c87304d477..41a4962e94 100644 return this.moveController; } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 334580a8b7..b2b575d0e8 100644 +index 95af2d529..162de836e 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -74,7 +74,7 @@ public abstract class EntityLiving extends Entity { @@ -77,11 +77,11 @@ index 334580a8b7..b2b575d0e8 100644 public EntityHuman killer; - protected int lastDamageByPlayerTime; + public int lastDamageByPlayerTime; // Paper - public - protected boolean aX; + protected boolean killed; protected int ticksFarFromPlayer; protected float aZ; diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index c66d8b68f0..774e4d6414 100644 +index 9c48bb3c9..22cea8552 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java @@ -340,6 +340,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn @@ -93,7 +93,7 @@ index c66d8b68f0..774e4d6414 100644 return this.bQ != null; } diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java -index acc099e955..339c78eec9 100644 +index acc099e95..339c78eec 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoal.java +++ b/src/main/java/net/minecraft/server/PathfinderGoal.java @@ -20,7 +20,9 @@ public abstract class PathfinderGoal { @@ -107,7 +107,7 @@ index acc099e955..339c78eec9 100644 public void e() { } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java -index 9a75cb63ba..cf10605aaa 100644 +index 9a75cb63b..cf10605aa 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java @@ -1,12 +1,12 @@ @@ -148,7 +148,7 @@ index 9a75cb63ba..cf10605aaa 100644 } } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -index be3a3c82ee..1404b629d5 100644 +index ae21eb84d..8f35f71f8 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java @@ -10,10 +10,10 @@ import org.apache.logging.log4j.Logger; @@ -187,7 +187,7 @@ index be3a3c82ee..1404b629d5 100644 Iterator iterator = this.b.iterator(); diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 09df00e94b..d08ef3fe10 100644 +index 09df00e94..d08ef3fe1 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -2,6 +2,8 @@ package org.spigotmc; @@ -385,7 +385,7 @@ index 09df00e94b..d08ef3fe10 100644 { isActive = false; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 87bc8e2d9c..06d84a0b66 100644 +index 87bc8e2d9..06d84a0b6 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -144,12 +144,14 @@ public class SpigotWorldConfig @@ -404,5 +404,5 @@ index 87bc8e2d9c..06d84a0b66 100644 log( "Entity Activation Range: An " + animalActivationRange + " / Mo " + monsterActivationRange + " / Mi " + miscActivationRange + " / Tiv " + tickInactiveVillagers ); } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0116-Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/0116-Optimize-UserCache-Thread-Safe.patch index 05864f16a..3a138fc6a 100644 --- a/Spigot-Server-Patches/0116-Optimize-UserCache-Thread-Safe.patch +++ b/Spigot-Server-Patches/0116-Optimize-UserCache-Thread-Safe.patch @@ -1,4 +1,4 @@ -From 69dc8f855cc02a3f1b8016a9accd29960e48b796 Mon Sep 17 00:00:00 2001 +From d128b3896e20ff9f497284c2686617631ea0f874 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 16 May 2016 20:47:41 -0400 Subject: [PATCH] Optimize UserCache / Thread Safe @@ -10,7 +10,7 @@ Additionally, move Saving of the User cache to be done async, incase the user never changed the default setting for Spigot's save on stop only. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index eb6ada935f..04d8c108b4 100644 +index 1c09dded9..edf72fbec 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -691,7 +691,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -23,7 +23,7 @@ index eb6ada935f..04d8c108b4 100644 // Spigot end } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 0e168ad349..f8b7d695c6 100644 +index d1197b959..51c2c5dd7 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java @@ -109,7 +109,7 @@ public class UserCache { @@ -37,7 +37,7 @@ index 0e168ad349..f8b7d695c6 100644 if (date == null) { @@ -122,8 +122,9 @@ public class UserCache { - UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date, null); + UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date); // CraftBukkit - decompile error - if (this.e.containsKey(uuid)) { + //if (this.e.containsKey(uuid)) { // Paper @@ -98,5 +98,5 @@ index 0e168ad349..f8b7d695c6 100644 } -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0118-Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/0118-Optional-TNT-doesn-t-move-in-water.patch index eb5e9f345..f4a1b87cf 100644 --- a/Spigot-Server-Patches/0118-Optional-TNT-doesn-t-move-in-water.patch +++ b/Spigot-Server-Patches/0118-Optional-TNT-doesn-t-move-in-water.patch @@ -1,4 +1,4 @@ -From 709e2779fa366bca564304e1fdd83b6940a387cf Mon Sep 17 00:00:00 2001 +From b53f5958e3068cd2af5506553515162a3b4d96d9 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 22 May 2016 20:20:55 -0500 Subject: [PATCH] Optional TNT doesn't move in water @@ -32,7 +32,7 @@ index 00f0451ef..42d951554 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index be1c800c9..c065b2728 100644 +index 9682b0a01..876ae1639 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1173,6 +1173,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -48,7 +48,7 @@ index be1c800c9..c065b2728 100644 return this.isInWater() || this.q(); } -@@ -2725,6 +2731,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2724,6 +2730,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean bw() { diff --git a/Spigot-Server-Patches/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch b/Spigot-Server-Patches/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch index 2fe6410f9..f4bb5a7a6 100644 --- a/Spigot-Server-Patches/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch +++ b/Spigot-Server-Patches/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch @@ -1,4 +1,4 @@ -From cf990aab8061ae3fb5211f0765056a0c0cb18e85 Mon Sep 17 00:00:00 2001 +From 3e1acb4e8c061bfd5ad065665b8466a8d1cbdcd9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 18 Jun 2016 23:22:12 -0400 Subject: [PATCH] Delay Chunk Unloads based on Player Movement @@ -43,10 +43,10 @@ index 42d951554..d8f258105 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index d065d88f7..2a9bfd7af 100644 +index f470eba29..86bdd6e7f 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -36,6 +36,7 @@ public class Chunk implements IChunkAccess { +@@ -41,6 +41,7 @@ public class Chunk implements IChunkAccess { private boolean i;public boolean isLoaded() { return i; } // Paper - OBFHELPER public final World world; public final Map heightMap; @@ -55,7 +55,7 @@ index d065d88f7..2a9bfd7af 100644 public final int locZ; private boolean l; diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index 2ebb2d834..e14ae2b42 100644 +index 8b3738c8f..2021c0d02 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -48,6 +48,15 @@ public class ChunkMap extends Long2ObjectOpenHashMap { @@ -67,7 +67,7 @@ index 2ebb2d834..e14ae2b42 100644 + if (chunk.world.paperConfig.delayChunkUnloadsBy > 0) { + chunk.scheduledForUnload = System.currentTimeMillis(); + } else { -+ ((WorldServer) chunk.world).getChunkProviderServer().unload(chunk); ++ ((WorldServer) chunk.world).getChunkProvider().unload(chunk); + } + } + // Paper end @@ -99,17 +99,17 @@ index 1d08ec37f..516a583a8 100644 this.chunkScheduler.a(booleansupplier); } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index c7ea17e25..7cb1327a8 100644 +index 1d672eaa1..5497a458d 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -33,8 +33,22 @@ public class PlayerChunk { - public void run() { - loadInProgress = false; - PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true); -+ markChunkUsed(); // Paper - delay chunk unloads - } - }; -+ // Paper start - delay chunk unloads +@@ -26,8 +26,23 @@ public class PlayerChunk { + ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider(); + chunkproviderserver.a(ix, j); + this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false); ++ markChunkUsed(); // Paper - delay chunk unloads + } + ++ // Paper start + private void markChunkUsed() { + if (chunk == null) { + return; @@ -122,55 +122,48 @@ index c7ea17e25..7cb1327a8 100644 + } + private boolean chunkHasPlayers = false; + // Paper end - // CraftBukkit end - - public PlayerChunk(PlayerChunkMap playerchunkmap, int i, int j) { -@@ -44,6 +58,7 @@ public class PlayerChunk { - - chunkproviderserver.a(i, j); - this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); -+ markChunkUsed(); // Paper - delay chunk unloads - } - ++ public ChunkCoordIntPair a() { -@@ -56,6 +71,8 @@ public class PlayerChunk { + return this.location; + } +@@ -38,6 +53,8 @@ public class PlayerChunk { } else { - if (this.c.isEmpty()) { + if (this.players.isEmpty()) { this.i = this.playerChunkMap.getWorld().getTime(); + chunkHasPlayers = true; // Paper - delay chunk unloads + markChunkUsed(); // Paper - delay chunk unloads } - this.c.add(entityplayer); -@@ -74,6 +91,8 @@ public class PlayerChunk { + this.players.add(entityplayer); +@@ -56,6 +73,8 @@ public class PlayerChunk { - this.c.remove(entityplayer); - if (this.c.isEmpty()) { + this.players.remove(entityplayer); + if (this.players.isEmpty()) { + chunkHasPlayers = false; // Paper - delay chunk unloads + markChunkUsed(); // Paper - delay chunk unloads this.playerChunkMap.b(this); } -@@ -85,6 +104,7 @@ public class PlayerChunk { +@@ -67,6 +86,7 @@ public class PlayerChunk { return true; } else { - this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag); + this.chunk = this.playerChunkMap.getWorld().getChunkProvider().getChunkAt(this.location.x, this.location.z, true, flag); + markChunkUsed(); // Paper - delay chunk unloads return this.chunk != null; } } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index b8d8fc779..e5605c309 100644 +index 3d17ad646..c3ac66d35 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -460,7 +460,13 @@ public class PlayerChunkMap { +@@ -456,7 +456,13 @@ public class PlayerChunkMap { Chunk chunk = playerchunk.f(); if (chunk != null) { -- this.getWorld().getChunkProviderServer().unload(chunk); +- this.getWorld().getChunkProvider().unload(chunk); + // Paper start - delay chunk unloads + if (world.paperConfig.delayChunkUnloadsBy <= 0) { -+ this.getWorld().getChunkProviderServer().unload(chunk); ++ this.getWorld().getChunkProvider().unload(chunk); + } else { + chunk.scheduledForUnload = System.currentTimeMillis(); + } @@ -179,10 +172,10 @@ index b8d8fc779..e5605c309 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 49432f2eb..288152775 100644 +index 5d7370029..6f672aa22 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1342,7 +1342,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1292,7 +1292,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (!tileentity.x() && tileentity.hasWorld()) { BlockPosition blockposition = tileentity.getPosition(); @@ -198,11 +191,11 @@ index 49432f2eb..288152775 100644 this.methodProfiler.a(() -> { return String.valueOf(TileEntityTypes.a(tileentity.C())); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 24e504c27..f0e974dff 100644 +index b19eef1b1..f1320f5ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1757,7 +1757,7 @@ public class CraftWorld implements World { - ChunkProviderServer cps = world.getChunkProviderServer(); + ChunkProviderServer cps = world.getChunkProvider(); for (net.minecraft.server.Chunk chunk : cps.chunks.values()) { // If in use, skip it - if (isChunkInUse(chunk.locX, chunk.locZ)) { diff --git a/Spigot-Server-Patches/0124-Fix-Double-World-Add-issues.patch b/Spigot-Server-Patches/0124-Fix-Double-World-Add-issues.patch index 5a8f9536f..3740a49fa 100644 --- a/Spigot-Server-Patches/0124-Fix-Double-World-Add-issues.patch +++ b/Spigot-Server-Patches/0124-Fix-Double-World-Add-issues.patch @@ -1,4 +1,4 @@ -From af3d6d625bbb57168b75bd1995f4135cf107c94e Mon Sep 17 00:00:00 2001 +From af2828a58a4f89566cc230a26042e7811491def3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 21 Jun 2016 22:54:34 -0400 Subject: [PATCH] Fix Double World Add issues @@ -8,7 +8,7 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added. Also add debug if something else tries to, and abort before world gets bad state diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 4a0f3989e6..695044b1b1 100644 +index 3b39b5472..6093ae408 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -1052,7 +1052,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -21,17 +21,17 @@ index 4a0f3989e6..695044b1b1 100644 Iterator iterator = entity.bP().iterator(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d31101861c..a81c7dfa2e 100644 +index 6f672aa22..0d04b14cf 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -993,6 +993,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -992,6 +992,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot - if (entity == null) return false; + if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper - - org.bukkit.event.Cancellable event = null; - if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer)) { + if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { + return false; + } -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0129-Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/0129-Add-setting-for-proxy-online-mode-status.patch index 28ca9c1bf..da3b1b0a9 100644 --- a/Spigot-Server-Patches/0129-Add-setting-for-proxy-online-mode-status.patch +++ b/Spigot-Server-Patches/0129-Add-setting-for-proxy-online-mode-status.patch @@ -1,11 +1,11 @@ -From 07cc2951361cee1c499c68b7bbc79328f27da88d Mon Sep 17 00:00:00 2001 +From d0b00a2f0cdb9e94da1f1942cf8b9a9b4ec403da Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Fri, 5 Aug 2016 01:03:08 +0200 Subject: [PATCH] Add setting for proxy online mode status diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index c4d12c315..1c1ef2dc2 100644 +index e10055b7d..2ae623e7d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -22,6 +22,7 @@ import org.bukkit.configuration.InvalidConfigurationException; @@ -31,7 +31,7 @@ index c4d12c315..1c1ef2dc2 100644 + } } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index 58d971cf2..658f7be0d 100644 +index 5977d3b48..c3f3ae03a 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -60,7 +60,8 @@ public class NameReferencingFileConverter { @@ -45,10 +45,10 @@ index 58d971cf2..658f7be0d 100644 } else { String[] astring1 = astring; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b79f75bb0..b9eaaae29 100644 +index c655d51ac..f90b708e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1411,7 +1411,8 @@ public final class CraftServer implements Server { +@@ -1410,7 +1410,8 @@ public final class CraftServer implements Server { // Spigot Start GameProfile profile = null; // Only fetch an online UUID in online mode @@ -59,5 +59,5 @@ index b79f75bb0..b9eaaae29 100644 profile = console.getUserCache().getProfile( name ); } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0135-Auto-Save-Improvements.patch b/Spigot-Server-Patches/0135-Auto-Save-Improvements.patch index 329e2deb5..c21e3fc25 100644 --- a/Spigot-Server-Patches/0135-Auto-Save-Improvements.patch +++ b/Spigot-Server-Patches/0135-Auto-Save-Improvements.patch @@ -1,4 +1,4 @@ -From cf6a10fd06d8de714535f84169f67871c80f0f6f Mon Sep 17 00:00:00 2001 +From 64fefafc70b954dc364db2d05e3d7cf101ed823c Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 19 Sep 2016 23:16:39 -0400 Subject: [PATCH] Auto Save Improvements @@ -64,10 +64,10 @@ index d8f258105..47bfb5b62 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 2a9bfd7af..2af8a582b 100644 +index 86bdd6e7f..1a8317256 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -49,9 +49,9 @@ public class Chunk implements IChunkAccess { +@@ -54,9 +54,9 @@ public class Chunk implements IChunkAccess { private final TickList s; private final TickList t; private boolean u; @@ -79,7 +79,7 @@ index 2a9bfd7af..2af8a582b 100644 private int y; private long z; private int A; -@@ -1059,11 +1059,11 @@ public class Chunk implements IChunkAccess { +@@ -1072,11 +1072,11 @@ public class Chunk implements IChunkAccess { if (this.v && this.world.getTime() != this.lastSaved || this.x) { return true; } @@ -109,7 +109,7 @@ index 516a583a8..27bed54d2 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3e4c80e0f..8506fad6f 100644 +index 77c23884f..52dc6d83b 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -37,6 +37,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -121,7 +121,7 @@ index 3e4c80e0f..8506fad6f 100644 public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index bdf4aed1a..acdfb0e1e 100644 +index edf72fbec..dacb372a5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -148,6 +148,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -137,8 +137,8 @@ index bdf4aed1a..acdfb0e1e 100644 } - if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit - this.methodProfiler.a("save"); -- this.s.savePlayers(); + this.methodProfiler.enter("save"); +- this.playerList.savePlayers(); + + serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper + int playerSaveInterval = com.destroystokyo.paper.PaperConfig.playerAutoSaveRate; @@ -146,7 +146,7 @@ index bdf4aed1a..acdfb0e1e 100644 + playerSaveInterval = autosavePeriod; + } + if (playerSaveInterval > 0) { // CraftBukkit // Paper -+ this.s.savePlayers(playerSaveInterval); ++ this.playerList.savePlayers(playerSaveInterval); // Spigot Start + } // Paper - Incremental Auto Saving + @@ -161,14 +161,14 @@ index bdf4aed1a..acdfb0e1e 100644 server.playerCommandState = false; // this.saveChunks(true); // Spigot End - this.methodProfiler.e(); + this.methodProfiler.exit(); - } + //} // Paper - Incremental Auto Saving - this.methodProfiler.a("snooper"); - if (getSnooperEnabled() && !this.i.d() && this.ticks > 100) { // Spigot + this.methodProfiler.enter("snooper"); + if (getSnooperEnabled() && !this.snooper.d() && this.ticks > 100) { // Spigot diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 143c7c1be..1259ec9d6 100644 +index 3e4ca288d..e28485f18 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -342,6 +342,7 @@ public abstract class PlayerList { @@ -207,11 +207,11 @@ index 143c7c1be..1259ec9d6 100644 public WhiteList getWhitelist() { return this.whitelist; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b37b284a5..6a5a7d1e0 100644 +index b5983957b..7a765cb7b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -872,8 +872,9 @@ public class WorldServer extends World implements IAsyncTaskHandler { - ChunkProviderServer chunkproviderserver = this.getChunkProviderServer(); +@@ -873,8 +873,9 @@ public class WorldServer extends World implements IAsyncTaskHandler { + ChunkProviderServer chunkproviderserver = this.getChunkProvider(); if (chunkproviderserver.d()) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit @@ -221,7 +221,7 @@ index b37b284a5..6a5a7d1e0 100644 if (iprogressupdate != null) { iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0])); } -@@ -882,6 +883,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -883,6 +884,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (iprogressupdate != null) { iprogressupdate.c(new ChatMessage("menu.savingChunks", new Object[0])); } diff --git a/Spigot-Server-Patches/0136-Chunk-registration-fixes.patch b/Spigot-Server-Patches/0136-Chunk-registration-fixes.patch index 192db2a90..b2f5bbf99 100644 --- a/Spigot-Server-Patches/0136-Chunk-registration-fixes.patch +++ b/Spigot-Server-Patches/0136-Chunk-registration-fixes.patch @@ -1,4 +1,4 @@ -From afbbf90dcb52b0a550cbeec5b56d0c5a793e0b9f Mon Sep 17 00:00:00 2001 +From 95cbe99b8731468c68949457a58ff6d966608555 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 21 Sep 2016 22:54:28 -0400 Subject: [PATCH] Chunk registration fixes @@ -8,10 +8,10 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr Keep them consistent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a81c7dfa2e..3740cdf95d 100644 +index 0d04b14cf..b17a8d60c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1522,7 +1522,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1472,7 +1472,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } i = MathHelper.floor(entity.locX / 16.0D); @@ -19,7 +19,7 @@ index a81c7dfa2e..3740cdf95d 100644 + j = Math.min(15, Math.max(0, MathHelper.floor(entity.locY / 16.0D))); // Paper - stay consistent with chunk add/remove behavior int k = MathHelper.floor(entity.locZ / 16.0D); - if (!entity.inChunk || entity.ae != i || entity.af != j || entity.ag != k) { + if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) { -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0139-Disable-Vanilla-Chunk-GC.patch b/Spigot-Server-Patches/0139-Disable-Vanilla-Chunk-GC.patch index 9cfb06cfe..98dd91235 100644 --- a/Spigot-Server-Patches/0139-Disable-Vanilla-Chunk-GC.patch +++ b/Spigot-Server-Patches/0139-Disable-Vanilla-Chunk-GC.patch @@ -1,4 +1,4 @@ -From b03a6b29d9398f78e843a25695269c8e774173e7 Mon Sep 17 00:00:00 2001 +From bc73991ca431d8103066de1681288a381527e1f5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 26 Sep 2016 01:51:30 -0400 Subject: [PATCH] Disable Vanilla Chunk GC @@ -6,10 +6,10 @@ Subject: [PATCH] Disable Vanilla Chunk GC Bukkit has its own system for this. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ca2e027cda..f9b4f314ce 100644 +index 7a765cb7b..a8675b8c6 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -889,6 +889,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -890,6 +890,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { chunkproviderserver.a(flag); timings.worldSaveChunks.stopTiming(); // Paper // CraftBukkit - ArrayList -> Collection @@ -17,7 +17,7 @@ index ca2e027cda..f9b4f314ce 100644 java.util.Collection arraylist = chunkproviderserver.a(); Iterator iterator = arraylist.iterator(); -@@ -898,7 +899,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -899,7 +900,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (chunk != null && !this.manager.a(chunk.locX, chunk.locZ)) { chunkproviderserver.unload(chunk); } @@ -28,5 +28,5 @@ index ca2e027cda..f9b4f314ce 100644 } } -- -2.19.0 +2.20.0 diff --git a/Spigot-Server-Patches/0140-Option-to-remove-corrupt-tile-entities.patch b/Spigot-Server-Patches/0140-Option-to-remove-corrupt-tile-entities.patch index fa324321b..017ab1b68 100644 --- a/Spigot-Server-Patches/0140-Option-to-remove-corrupt-tile-entities.patch +++ b/Spigot-Server-Patches/0140-Option-to-remove-corrupt-tile-entities.patch @@ -1,4 +1,4 @@ -From e3ae689d96b38bcb31c49ce06e4347fd2c9729f8 Mon Sep 17 00:00:00 2001 +From 2c00cec203c7d519a368124a199e4f9719315956 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 5 Oct 2016 16:27:36 -0500 Subject: [PATCH] Option to remove corrupt tile entities @@ -19,10 +19,10 @@ index 47bfb5b62..e8417cb2e 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 2af8a582b..9430bccf6 100644 +index 1a8317256..9d3234c1c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -839,6 +839,12 @@ public class Chunk implements IChunkAccess { +@@ -844,6 +844,12 @@ public class Chunk implements IChunkAccess { "Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); e.printStackTrace(); ServerInternalException.reportInternalException(e); @@ -35,7 +35,7 @@ index 2af8a582b..9430bccf6 100644 // Paper end // CraftBukkit end } -@@ -848,6 +854,7 @@ public class Chunk implements IChunkAccess { +@@ -853,6 +859,7 @@ public class Chunk implements IChunkAccess { this.h.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound); } diff --git a/Spigot-Server-Patches/0141-Add-EntityZapEvent.patch b/Spigot-Server-Patches/0141-Add-EntityZapEvent.patch index cd3a4909f..81549dcf3 100644 --- a/Spigot-Server-Patches/0141-Add-EntityZapEvent.patch +++ b/Spigot-Server-Patches/0141-Add-EntityZapEvent.patch @@ -1,11 +1,11 @@ -From 14abdd7d5d7c4103a998ea90262f60619d9704b6 Mon Sep 17 00:00:00 2001 +From 76212749b31aa78325f5a0500a66dc67830d247b Mon Sep 17 00:00:00 2001 From: AlphaBlend Date: Sun, 16 Oct 2016 23:19:30 -0700 Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index d299e1efb..30306256a 100644 +index 7ef67350a..9dc2d8be2 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -163,6 +163,12 @@ public class EntityPig extends EntityAnimal { @@ -22,7 +22,7 @@ index d299e1efb..30306256a 100644 if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) { return; diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 36ca76bc8..928c5eb41 100644 +index d2572b3e1..ddf170180 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -607,6 +607,12 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -39,10 +39,10 @@ index 36ca76bc8..928c5eb41 100644 entitywitch.prepare(this.world.getDamageScaler(new BlockPosition(entitywitch)), (GroupDataEntity) null, (NBTTagCompound) null); entitywitch.setNoAI(this.isNoAI()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index c2b24f99f..1b82f22f8 100644 +index 35992c4ba..075e6f04e 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -793,6 +793,14 @@ public class CraftEventFactory { +@@ -851,6 +851,14 @@ public class CraftEventFactory { return event; } @@ -58,5 +58,5 @@ index c2b24f99f..1b82f22f8 100644 HorseJumpEvent event = new HorseJumpEvent((AbstractHorse) horse.getBukkitEntity(), power); horse.getBukkitEntity().getServer().getPluginManager().callEvent(event); -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0143-Prevent-Auto-Save-if-Save-Queue-is-full.patch b/Spigot-Server-Patches/0143-Prevent-Auto-Save-if-Save-Queue-is-full.patch index 0420fe053..980920171 100644 --- a/Spigot-Server-Patches/0143-Prevent-Auto-Save-if-Save-Queue-is-full.patch +++ b/Spigot-Server-Patches/0143-Prevent-Auto-Save-if-Save-Queue-is-full.patch @@ -1,4 +1,4 @@ -From dccb48aa541237c662412c1137a14a650a5ad852 Mon Sep 17 00:00:00 2001 +From 7849382101c9a10a3078ff6801ebf66b81d8bb1d Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Nov 2016 21:52:22 -0400 Subject: [PATCH] Prevent Auto Save if Save Queue is full @@ -23,7 +23,7 @@ index e8417cb2e..de59f4ce0 100644 private void removeCorruptTEs() { removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false); diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 27bed54d2..917f57ced 100644 +index 27bed54d2..9990cdbcd 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -236,6 +236,13 @@ public class ChunkProviderServer implements IChunkProvider { @@ -31,7 +31,7 @@ index 27bed54d2..917f57ced 100644 ObjectIterator objectiterator = this.chunks.values().iterator(); + // Paper start -+ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; ++ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProvider().chunkLoader; + final int queueSize = chunkLoader.getQueueSize(); + if (!flag && queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ + return false; @@ -41,7 +41,7 @@ index 27bed54d2..917f57ced 100644 Chunk chunk = (Chunk) objectiterator.next(); diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 8fe4c6fec..a2c3c066b 100644 +index 6093ae408..f17869d4d 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -152,6 +152,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { diff --git a/Spigot-Server-Patches/0144-Chunk-Save-Stats-Debug-Option.patch b/Spigot-Server-Patches/0144-Chunk-Save-Stats-Debug-Option.patch index 672824cc5..23e6f58ca 100644 --- a/Spigot-Server-Patches/0144-Chunk-Save-Stats-Debug-Option.patch +++ b/Spigot-Server-Patches/0144-Chunk-Save-Stats-Debug-Option.patch @@ -1,4 +1,4 @@ -From bc5c56a6e6768f7b9d7f179a61db83e6d8fe92e9 Mon Sep 17 00:00:00 2001 +From 4e6ed39f4a404bdd8ed37ebb72c38d80ce475e6b Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 4 Nov 2016 02:12:10 -0400 Subject: [PATCH] Chunk Save Stats Debug Option @@ -8,7 +8,7 @@ Adds a command line flag to enable stats on how chunk saves are processing. Stats on current queue, how many was processed and how many were queued. diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 917f57ced..570ddc1a8 100644 +index 9990cdbcd..b1c4eb4ae 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -30,6 +30,11 @@ public class ChunkProviderServer implements IChunkProvider { @@ -25,7 +25,7 @@ index 917f57ced..570ddc1a8 100644 private final ChunkTaskScheduler chunkScheduler; @@ -239,6 +244,29 @@ public class ChunkProviderServer implements IChunkProvider { // Paper start - final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; + final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProvider().chunkLoader; final int queueSize = chunkLoader.getQueueSize(); + + final long now = System.currentTimeMillis(); @@ -54,7 +54,7 @@ index 917f57ced..570ddc1a8 100644 return false; } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index a2c3c066b..34ddf655e 100644 +index f17869d4d..8eecdbd33 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -152,7 +152,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -89,5 +89,5 @@ index a2c3c066b..34ddf655e 100644 if (nbttagcompound == null) { return true; -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0147-Optimise-removeQueue.patch b/Spigot-Server-Patches/0147-Optimise-removeQueue.patch index 6d2998375..c41df7e0e 100644 --- a/Spigot-Server-Patches/0147-Optimise-removeQueue.patch +++ b/Spigot-Server-Patches/0147-Optimise-removeQueue.patch @@ -1,11 +1,11 @@ -From 803f81d368bb8d45ff60a0aa77348076e2689c96 Mon Sep 17 00:00:00 2001 +From 8dc52859943820f03a34c21f12b64d68fe78f325 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Fri, 25 Nov 2016 13:22:40 +0000 Subject: [PATCH] Optimise removeQueue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 9929e2a73..c2957ad2e 100644 +index 13c538043..c07332e1b 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -5,8 +5,10 @@ import com.mojang.authlib.GameProfile; @@ -53,8 +53,8 @@ index 9929e2a73..c2957ad2e 100644 } @@ -1138,7 +1147,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.lastHealthSent = -1.0F; - this.co = -1; - // this.cy.a((RecipeBook) entityplayer.cy); // CraftBukkit + this.lastFoodSent = -1; + // this.recipeBook.a((RecipeBook) entityplayer.recipeBook); // CraftBukkit - this.removeQueue.addAll(entityplayer.removeQueue); + // Paper start - Optimize remove queue - vanilla copies player objects, but CB doesn't. This method currently only + // Applies to the same player, so we need to not duplicate our removal queue. The rest of this method does "resetting" @@ -68,5 +68,5 @@ index 9929e2a73..c2957ad2e 100644 this.cC = entityplayer.cC; this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft()); -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0148-Allow-Reloading-of-Command-Aliases.patch b/Spigot-Server-Patches/0148-Allow-Reloading-of-Command-Aliases.patch index be78b6933..0b15fa0a9 100644 --- a/Spigot-Server-Patches/0148-Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-Server-Patches/0148-Allow-Reloading-of-Command-Aliases.patch @@ -1,4 +1,4 @@ -From b4bda32113b7f996ab8b0a5eb55e905e41a7255e Mon Sep 17 00:00:00 2001 +From e786640212faf8e4bf9c96095614435bc3b948aa Mon Sep 17 00:00:00 2001 From: willies952002 Date: Mon, 28 Nov 2016 10:21:52 -0500 Subject: [PATCH] Allow Reloading of Command Aliases @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b9eaaae29..67dd3b908 100644 +index f90b708e4..84c0a14ec 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2082,5 +2082,24 @@ public final class CraftServer implements Server { +@@ -2081,5 +2081,24 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); } @@ -35,5 +35,5 @@ index b9eaaae29..67dd3b908 100644 // Paper end } -- -2.19.1 +2.20.0 diff --git a/Spigot-Server-Patches/0149-Add-source-to-PlayerExpChangeEvent.patch b/Spigot-Server-Patches/0149-Add-source-to-PlayerExpChangeEvent.patch index f63814012..de8093cdf 100644 --- a/Spigot-Server-Patches/0149-Add-source-to-PlayerExpChangeEvent.patch +++ b/Spigot-Server-Patches/0149-Add-source-to-PlayerExpChangeEvent.patch @@ -1,11 +1,11 @@ -From 5199cfb3cc6ae5904332802d378e78a5232d55bc Mon Sep 17 00:00:00 2001 +From 143891fea19188753b3a7a416f54d988c8b97571 Mon Sep 17 00:00:00 2001 From: AlphaBlend Date: Thu, 8 Sep 2016 08:48:33 -0700 Subject: [PATCH] Add source to PlayerExpChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index e0a38b32a..2f6fd88ca 100644 +index 808d1a120..3030dd9c3 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -185,7 +185,7 @@ public class EntityExperienceOrb extends Entity { @@ -18,7 +18,7 @@ index e0a38b32a..2f6fd88ca 100644 this.die(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 1b82f22f8..af61d99bc 100644 +index 075e6f04e..2a06cbf85 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -51,6 +51,7 @@ import org.bukkit.entity.Player; @@ -29,7 +29,7 @@ index 1b82f22f8..af61d99bc 100644 import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.Event.Result; -@@ -762,6 +763,17 @@ public class CraftEventFactory { +@@ -820,6 +821,17 @@ public class CraftEventFactory { return event; } @@ -48,5 +48,5 @@ index 1b82f22f8..af61d99bc 100644 return handleBlockGrowEvent(world, pos, block, 3); } -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0152-Add-ProjectileCollideEvent.patch b/Spigot-Server-Patches/0152-Add-ProjectileCollideEvent.patch index 4c4bab643..58d50f35d 100644 --- a/Spigot-Server-Patches/0152-Add-ProjectileCollideEvent.patch +++ b/Spigot-Server-Patches/0152-Add-ProjectileCollideEvent.patch @@ -1,4 +1,4 @@ -From 4118aa7da5c0587b51d452f6207adf199501380a Mon Sep 17 00:00:00 2001 +From 12c01d5926cc5657e82bc0e57258c7536bbec558 Mon Sep 17 00:00:00 2001 From: Techcable Date: Fri, 16 Dec 2016 21:25:39 -0600 Subject: [PATCH] Add ProjectileCollideEvent @@ -46,7 +46,7 @@ index 3e3619d79..58cc4824c 100644 this.a(movingobjectposition); diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index ddd77583c..84a9375db 100644 +index cffb40efb..45a326779 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -245,6 +245,16 @@ public class EntityFishingHook extends Entity { @@ -87,10 +87,10 @@ index 11638221b..431afaf2f 100644 if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.getBlockPosition()).getBlock() == Blocks.NETHER_PORTAL) { this.e(movingobjectposition.getBlockPosition()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index af61d99bc..8d12155c3 100644 +index 2a06cbf85..464c5cfc9 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -897,6 +897,16 @@ public class CraftEventFactory { +@@ -955,6 +955,16 @@ public class CraftEventFactory { return CraftItemStack.asNMSCopy(bitem); } @@ -108,5 +108,5 @@ index af61d99bc..8d12155c3 100644 Projectile bukkitEntity = (Projectile) entity.getBukkitEntity(); ProjectileLaunchEvent event = new ProjectileLaunchEvent(bukkitEntity); -- -2.19.2 +2.20.0 diff --git a/Spigot-Server-Patches/0155-Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/0155-Configurable-Cartographer-Treasure-Maps.patch index 8d35bd9ff..f6b5057f1 100644 --- a/Spigot-Server-Patches/0155-Configurable-Cartographer-Treasure-Maps.patch +++ b/Spigot-Server-Patches/0155-Configurable-Cartographer-Treasure-Maps.patch @@ -1,4 +1,4 @@ -From 1665f677863e3e0b9ea1969ebeeba47a08f635bc Mon Sep 17 00:00:00 2001 +From 6cb25c00886119aea4b3cdbf46592df12c48a429 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 20 Dec 2016 15:26:27 -0500 Subject: [PATCH] Configurable Cartographer Treasure Maps @@ -28,10 +28,10 @@ index 03b7410f5..5c50c62e5 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 928c5eb41..ac81a8d76 100644 +index ddf170180..bd799d0c6 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -757,6 +757,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { +@@ -753,6 +753,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { public void a(IMerchant imerchant, MerchantRecipeList merchantrecipelist, Random random) { int i = this.a.a(random); World world = imerchant.getWorld(); diff --git a/Spigot-Server-Patches/0163-Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/0163-Provide-E-TE-Chunk-count-stat-methods.patch index 8a16c7867..721e579f6 100644 --- a/Spigot-Server-Patches/0163-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-Server-Patches/0163-Provide-E-TE-Chunk-count-stat-methods.patch @@ -1,4 +1,4 @@ -From 5a5b6bd59f789ea63dab28946a3bb4f88293a24f Mon Sep 17 00:00:00 2001 +From a6c308143cb36a05f085bbd4391087888252dcc7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 15:24:46 -0500 Subject: [PATCH] Provide E/TE/Chunk count stat methods @@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f0e974dff..bcfe4c1da 100644 +index f1320f5ac..f1a162420 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -87,6 +87,29 @@ public class CraftWorld implements World { @@ -30,7 +30,7 @@ index f0e974dff..bcfe4c1da 100644 + return world.tileEntityListTick.size(); + } + public int getChunkCount() { -+ return world.getChunkProviderServer().chunks.size(); ++ return world.getChunkProvider().chunks.size(); + } + public int getPlayerCount() { + return world.players.size(); diff --git a/Spigot-Server-Patches/0165-Enforce-Sync-Chunk-Unloads.patch b/Spigot-Server-Patches/0165-Enforce-Sync-Chunk-Unloads.patch index 8dad36aec..20fadd292 100644 --- a/Spigot-Server-Patches/0165-Enforce-Sync-Chunk-Unloads.patch +++ b/Spigot-Server-Patches/0165-Enforce-Sync-Chunk-Unloads.patch @@ -1,4 +1,4 @@ -From c199e596d1cda4b002a08669e4352b0ecba893eb Mon Sep 17 00:00:00 2001 +From 80a09c12e7bb5c9b00b203446bb1a453a33271e1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 16:06:44 -0500 Subject: [PATCH] Enforce Sync Chunk Unloads @@ -7,7 +7,7 @@ Unloading Chunks async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index bcfe4c1da..3a30349f4 100644 +index f1a162420..5d0e81731 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -235,6 +235,7 @@ public class CraftWorld implements World { @@ -15,13 +15,13 @@ index bcfe4c1da..3a30349f4 100644 private boolean unloadChunk0(int x, int z, boolean save) { + Boolean result = MCUtil.ensureMain("Unload Chunk", () -> { // Paper - Ensure never async - net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z, false, false); + net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false, false); if (chunk == null) { return true; @@ -242,6 +243,7 @@ public class CraftWorld implements World { // If chunk had previously been queued to save, must do save to avoid loss of that data - return world.getChunkProviderServer().unloadChunk(chunk, chunk.mustSave || save); + return world.getChunkProvider().unloadChunk(chunk, chunk.mustSave || save); + }); return result != null ? result : false; // Paper - Ensure never async } diff --git a/Spigot-Server-Patches/0174-Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/0174-Properly-handle-async-calls-to-restart-the-server.patch index 88cbe7bec..888a96614 100644 --- a/Spigot-Server-Patches/0174-Properly-handle-async-calls-to-restart-the-server.patch +++ b/Spigot-Server-Patches/0174-Properly-handle-async-calls-to-restart-the-server.patch @@ -1,4 +1,4 @@ -From 43480f765c8ce2abba530e068f7d17448fe4b92a Mon Sep 17 00:00:00 2001 +From 8186e73d20a64b9dd3d508260bd6a88e60eea217 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 12 May 2017 23:34:11 -0500 Subject: [PATCH] Properly handle async calls to restart the server @@ -30,23 +30,23 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index acdfb0e1e..a1a574023 100644 +index dacb372a5..fd405281b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -90,6 +90,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati public final Map worldServer = Maps.newIdentityHashMap(); - private PlayerList s; + private PlayerList playerList; private boolean isRunning = true; + private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart private boolean isStopped; private int ticks; protected final Proxy c; @@ -659,7 +660,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - if (this.s != null) { + if (this.playerList != null) { MinecraftServer.LOGGER.info("Saving players"); - this.s.savePlayers(); -- this.s.u(); -+ this.s.u(isRestarting); // Paper + this.playerList.savePlayers(); +- this.playerList.u(); ++ this.playerList.u(isRestarting); // Paper try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets } @@ -65,10 +65,10 @@ index acdfb0e1e..a1a574023 100644 } + // Paper end - private boolean aT() { + private boolean canSleepForTick() { return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index b10ac733f..3f96443eb 100644 +index 320c378e0..d8ed44fe2 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1333,10 +1333,15 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0177-Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-Server-Patches/0177-Add-configuration-option-to-prevent-player-names-fro.patch index b5e040616..37ddc27a8 100644 --- a/Spigot-Server-Patches/0177-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-Server-Patches/0177-Add-configuration-option-to-prevent-player-names-fro.patch @@ -1,4 +1,4 @@ -From 1d4727137de48e632ae85472704bb0cf5b165115 Mon Sep 17 00:00:00 2001 +From 765c04d1f89da22dc10a35695e836e105509f5a6 Mon Sep 17 00:00:00 2001 From: kashike Date: Fri, 9 Jun 2017 07:24:34 -0700 Subject: [PATCH] Add configuration option to prevent player names from being @@ -20,10 +20,10 @@ index 9f8b43d2a..3f59e060b 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 5ec283f5d..ba702591a 100644 +index 84c0a14ec..457dec91a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2101,5 +2101,10 @@ public final class CraftServer implements Server { +@@ -2100,5 +2100,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/Spigot-Server-Patches/0178-Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/0178-Use-TerminalConsoleAppender-for-console-improvements.patch index a03a24775..f5c988077 100644 --- a/Spigot-Server-Patches/0178-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/0178-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -1,4 +1,4 @@ -From eeaa1bd05811d93b423295ef79a28377e7af0b8d Mon Sep 17 00:00:00 2001 +From a84c70f87100764523afaf2f93bffcfdfdaad1f9 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 9 Jun 2017 19:03:43 +0200 Subject: [PATCH] Use TerminalConsoleAppender for console improvements @@ -143,7 +143,7 @@ index 000000000..685deaa0e + +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index a575ff529..908127630 100644 +index 7f4c76669..1007641d5 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -79,6 +79,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -185,7 +185,7 @@ index a575ff529..908127630 100644 System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a1a574023..ce1805062 100644 +index fd405281b..9c95661a7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -61,7 +61,6 @@ import org.apache.commons.lang3.Validate; @@ -243,7 +243,7 @@ index a1a574023..ce1805062 100644 public KeyPair E() { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 3f96443eb..fb9b0835b 100644 +index d8ed44fe2..e7bae58fa 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -78,8 +78,7 @@ public abstract class PlayerList { @@ -257,7 +257,7 @@ index 3f96443eb..fb9b0835b 100644 this.k = new GameProfileBanList(PlayerList.a); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ba702591a..97fa98d2c 100644 +index 457dec91a..4a9af9ac1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -144,8 +144,8 @@ import java.nio.ByteBuffer; @@ -270,7 +270,7 @@ index ba702591a..97fa98d2c 100644 import org.bukkit.NamespacedKey; import org.bukkit.block.data.BlockData; import org.bukkit.craftbukkit.block.data.CraftBlockData; -@@ -1153,9 +1153,13 @@ public final class CraftServer implements Server { +@@ -1152,9 +1152,13 @@ public final class CraftServer implements Server { return logger; } diff --git a/Spigot-Server-Patches/0179-provide-a-configurable-option-to-disable-creeper-lin.patch b/Spigot-Server-Patches/0179-provide-a-configurable-option-to-disable-creeper-lin.patch index 096d1bce8..f40ee740a 100644 --- a/Spigot-Server-Patches/0179-provide-a-configurable-option-to-disable-creeper-lin.patch +++ b/Spigot-Server-Patches/0179-provide-a-configurable-option-to-disable-creeper-lin.patch @@ -1,4 +1,4 @@ -From 71d83d49a94f00f87c916b14071cc7e2d0ed53c1 Mon Sep 17 00:00:00 2001 +From 7748db61002280fe5cce27a6c3a1a26e0cb288f0 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 11 Jun 2017 21:01:18 +0100 Subject: [PATCH] provide a configurable option to disable creeper lingering @@ -21,11 +21,11 @@ index aefb0ce97..af31030dc 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index d03c2f4ae..64a5fefad 100644 +index b080fc792..fb76dc18b 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -214,7 +214,7 @@ public class EntityCreeper extends EntityMonster { - private void dF() { + private void createEffectCloud() { Collection collection = this.getEffects(); - if (!collection.isEmpty()) { diff --git a/Spigot-Server-Patches/0184-Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/0184-Basic-PlayerProfile-API.patch index f86b2e1af..d0955b836 100644 --- a/Spigot-Server-Patches/0184-Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/0184-Basic-PlayerProfile-API.patch @@ -1,4 +1,4 @@ -From 3fdf826658a104dd664d8178cecd9f402e5cd17d Mon Sep 17 00:00:00 2001 +From 220ba34511680c2cfa4eb0b7be73def8b83ef78a Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 15 Jan 2018 22:11:48 -0500 Subject: [PATCH] Basic PlayerProfile API @@ -429,7 +429,7 @@ index e1af5c488..0ef5ad116 100644 * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ce1805062..34ba382a4 100644 +index 9c95661a7..906bd973d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1189,7 +1189,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -450,7 +450,7 @@ index ce1805062..34ba382a4 100644 return this.V; } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index a47a51a41..4c476f757 100644 +index 7d9edb9a6..355875a98 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java @@ -44,7 +44,7 @@ public class UserCache { @@ -486,7 +486,7 @@ index a47a51a41..4c476f757 100644 private UserCacheEntry(GameProfile gameprofile, Date date) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 873170864..72da1fe81 100644 +index e08da05d4..b5d0886df 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -162,6 +162,10 @@ import org.bukkit.event.server.ServerLoadEvent; @@ -500,7 +500,7 @@ index 873170864..72da1fe81 100644 public final class CraftServer implements Server { private final String serverName = "Paper"; // Paper private final String serverVersion; -@@ -2117,5 +2121,21 @@ public final class CraftServer implements Server { +@@ -2116,5 +2120,21 @@ public final class CraftServer implements Server { public boolean suggestPlayerNamesWhenNullTabCompletions() { return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; } diff --git a/Spigot-Server-Patches/0187-Block-player-logins-during-server-shutdown.patch b/Spigot-Server-Patches/0187-Block-player-logins-during-server-shutdown.patch index a68ffad63..5c5cf0fde 100644 --- a/Spigot-Server-Patches/0187-Block-player-logins-during-server-shutdown.patch +++ b/Spigot-Server-Patches/0187-Block-player-logins-during-server-shutdown.patch @@ -1,17 +1,17 @@ -From 912a05f471cf950cf051635db0bc1a1dc4836711 Mon Sep 17 00:00:00 2001 +From c69d35dbafb176fa11f092431c37e66d8824d2b1 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 2 Jul 2017 21:35:56 -0500 Subject: [PATCH] Block player logins during server shutdown diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index bb08200e7..90d1096e5 100644 +index 9f6b73d80..af5c699fe 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -50,6 +50,12 @@ public class LoginListener implements PacketLoginInListener, ITickable { } - public void Y_() { + public void tick() { + // Paper start - Do not allow logins while the server is shutting down + if (!MinecraftServer.getServer().isRunning()) { + this.disconnect(new ChatMessage(org.spigotmc.SpigotConfig.restartMessage)); diff --git a/Spigot-Server-Patches/0194-GH-806-Respect-saving-disabled-before-unloading-all-.patch b/Spigot-Server-Patches/0194-GH-806-Respect-saving-disabled-before-unloading-all-.patch index e2f2b087f..99261cb67 100644 --- a/Spigot-Server-Patches/0194-GH-806-Respect-saving-disabled-before-unloading-all-.patch +++ b/Spigot-Server-Patches/0194-GH-806-Respect-saving-disabled-before-unloading-all-.patch @@ -1,4 +1,4 @@ -From 0cdc623700a1b50c3acea53bb5dafa30c1d4b9ae Mon Sep 17 00:00:00 2001 +From 7e329c1d9bf4348638bc615cbfcc9a1bae32453a Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 27 Jul 2017 00:06:43 -0400 Subject: [PATCH] GH-806: Respect saving disabled before unloading all chunks @@ -9,16 +9,16 @@ This behavior causes a save to occur even though saving was supposed to be turne It's triggered when Hell/End worlds are empty of players. diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index e5605c309..9d971a9c5 100644 +index c3ac66d35..5935bae58 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -194,7 +194,7 @@ public class PlayerChunkMap { +@@ -190,7 +190,7 @@ public class PlayerChunkMap { try (Timing ignored = world.timings.doChunkMapUnloadChunks.startTiming()) { // Paper WorldProvider worldprovider = this.world.worldProvider; - if (!worldprovider.canRespawn()) { + if (!worldprovider.canRespawn() && !this.world.savingDisabled) { // Paper - respect saving disabled setting - this.world.getChunkProviderServer().b(); + this.world.getChunkProvider().b(); } } // Paper timing -- diff --git a/Spigot-Server-Patches/0199-Fix-MC-117075-TE-Unload-Lag-Spike.patch b/Spigot-Server-Patches/0199-Fix-MC-117075-TE-Unload-Lag-Spike.patch index 3622c5ccd..a21500af1 100644 --- a/Spigot-Server-Patches/0199-Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/Spigot-Server-Patches/0199-Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -1,15 +1,15 @@ -From c5f69b14314ce7cd684e89b68e01fd1eb66e7de1 Mon Sep 17 00:00:00 2001 +From 0297f85dc1ab08552c0c9e13f9e018b2a7810bc9 Mon Sep 17 00:00:00 2001 From: mezz Date: Wed, 9 Aug 2017 17:51:22 -0500 Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c92df00e8..44ed34174 100644 +index 65973edfc..cb62af425 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1323,7 +1323,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.methodProfiler.c("blockEntities"); +@@ -1273,7 +1273,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + this.methodProfiler.exitEnter("blockEntities"); timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { - this.tileEntityListTick.removeAll(this.tileEntityListUnload); diff --git a/Spigot-Server-Patches/0207-handle-PacketPlayInKeepAlive-async.patch b/Spigot-Server-Patches/0207-handle-PacketPlayInKeepAlive-async.patch index 1fa05ef26..b0eb0381a 100644 --- a/Spigot-Server-Patches/0207-handle-PacketPlayInKeepAlive-async.patch +++ b/Spigot-Server-Patches/0207-handle-PacketPlayInKeepAlive-async.patch @@ -1,4 +1,4 @@ -From 2b86a7eb79d741932c7ca5359af1ac0dd3cd00d9 Mon Sep 17 00:00:00 2001 +From f71671bbb061fadb6bc835be690aec6bb587835b Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 5 Oct 2017 01:54:07 +0100 Subject: [PATCH] handle PacketPlayInKeepAlive async @@ -15,7 +15,7 @@ also adding some additional logging in order to help work out what is causing random disconnections for clients. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 00751a9d9..587f00286 100644 +index 5076b9627..fb63496a0 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2470,14 +2470,18 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -24,11 +24,11 @@ index 00751a9d9..587f00286 100644 public void a(PacketPlayInKeepAlive packetplayinkeepalive) { - PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, this.player.getWorldServer()); // CraftBukkit + //PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, this.player.getWorldServer()); // CraftBukkit // Paper - This shouldn't be on the main thread - if (this.g && packetplayinkeepalive.b() == this.h) { - int i = (int) (SystemUtils.b() - this.f); + if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) { + int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive); this.player.ping = (this.player.ping * 3 + i) / 4; - this.g = false; + this.awaitingKeepAlive = false; } else if (!this.player.getDisplayName().getString().equals(this.minecraftServer.G())) { - this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); + // Paper start - This needs to be handled on the main thread for plugins diff --git a/Spigot-Server-Patches/0209-revert-serverside-behavior-of-keepalives.patch b/Spigot-Server-Patches/0209-revert-serverside-behavior-of-keepalives.patch index 0ce355f85..fc0d85ef1 100644 --- a/Spigot-Server-Patches/0209-revert-serverside-behavior-of-keepalives.patch +++ b/Spigot-Server-Patches/0209-revert-serverside-behavior-of-keepalives.patch @@ -1,4 +1,4 @@ -From 68c17de42dd9181bf40c9da2053c577a5896e86b Mon Sep 17 00:00:00 2001 +From 4f61d9e0c6247790014a1d359cdf9c132a199dde Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 15 Oct 2017 00:29:07 +0100 Subject: [PATCH] revert serverside behavior of keepalives @@ -17,16 +17,16 @@ from networking or during connections flood of chunk packets on slower clients, at the cost of dead connections being kept open for longer. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 587f00286..870b59ce1 100644 +index fb63496a0..921e1ec9e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -71,7 +71,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private final MinecraftServer minecraftServer; public EntityPlayer player; private int e; -- private long f; private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER -+ private long f = SystemUtils.b(); private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER - set ping to delay initial - private boolean g; private void setPendingPing(boolean isPending) { this.g = isPending;}; private boolean isPendingPing() { return this.g;}; // Paper - OBFHELPER +- private long lastKeepAlive; private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER ++ private long lastKeepAlive = SystemUtils.getMonotonicMillis(); private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER + private boolean awaitingKeepAlive; private void setPendingPing(boolean isPending) { this.awaitingKeepAlive = isPending;}; private boolean isPendingPing() { return this.awaitingKeepAlive;}; // Paper - OBFHELPER private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER // CraftBukkit start - multithreaded fields @@ -102,6 +102,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -40,14 +40,14 @@ index 587f00286..870b59ce1 100644 @@ -180,18 +181,26 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } - this.minecraftServer.methodProfiler.a("keepAlive"); -- long i = SystemUtils.b(); + this.minecraftServer.methodProfiler.enter("keepAlive"); +- long i = SystemUtils.getMonotonicMillis(); - -- if (i - this.f >= 25000L) { // CraftBukkit -- if (this.g) { +- if (i - this.lastKeepAlive >= 25000L) { // CraftBukkit +- if (this.awaitingKeepAlive) { + // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings + // This should effectively place the keepalive handling back to "as it was" before 1.12.2 -+ long currentTime = SystemUtils.b(); ++ long currentTime = SystemUtils.getMonotonicMillis(); + long elapsedTime = currentTime - this.getLastPing(); + + if (this.isPendingPing()) { @@ -55,8 +55,8 @@ index 587f00286..870b59ce1 100644 + PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); - } else { -- this.g = true; -- this.f = i; +- this.awaitingKeepAlive = true; +- this.lastKeepAlive = i; - this.h = i; - this.sendPacket(new PacketPlayOutKeepAlive(this.h)); + } @@ -71,7 +71,7 @@ index 587f00286..870b59ce1 100644 } + // Paper end - this.minecraftServer.methodProfiler.e(); + this.minecraftServer.methodProfiler.exit(); // CraftBukkit start -- 2.20.0 diff --git a/Spigot-Server-Patches/0212-Option-for-maximum-exp-value-when-merging-orbs.patch b/Spigot-Server-Patches/0212-Option-for-maximum-exp-value-when-merging-orbs.patch index a6523a381..40682dcc4 100644 --- a/Spigot-Server-Patches/0212-Option-for-maximum-exp-value-when-merging-orbs.patch +++ b/Spigot-Server-Patches/0212-Option-for-maximum-exp-value-when-merging-orbs.patch @@ -1,4 +1,4 @@ -From db27a9af2843c90224bd268bdc1ace22fcca28e0 Mon Sep 17 00:00:00 2001 +From 74eddc1deef9efd69230110de71d669ff4e975ce Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 10 Nov 2017 23:03:12 -0500 Subject: [PATCH] Option for maximum exp value when merging orbs @@ -19,20 +19,20 @@ index af31030dc..b6764c7ec 100644 + log("Experience Merge Max Value: " + expMergeMaxValue); + } } -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c1ede0651..15e07ce84 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1032,16 +1032,32 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +index 464c5cfc9..14df8e80b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -390,16 +390,32 @@ public class CraftEventFactory { EntityExperienceOrb xp = (EntityExperienceOrb) entity; - double radius = spigotConfig.expMerge; + double radius = world.spigotConfig.expMerge; if (radius > 0) { + // Paper start - Maximum exp value when merging - Whole section has been tweaked, see comments for specifics -+ final int maxValue = paperConfig.expMergeMaxValue; -+ final boolean mergeUnconditionally = paperConfig.expMergeMaxValue <= 0; ++ final int maxValue = world.paperConfig.expMergeMaxValue; ++ final boolean mergeUnconditionally = world.paperConfig.expMergeMaxValue <= 0; + if (mergeUnconditionally || xp.value < maxValue) { // Paper - Skip iteration if unnecessary + - List entities = this.getEntities(entity, entity.getBoundingBox().grow(radius, radius, radius)); + List entities = world.getEntities(entity, entity.getBoundingBox().grow(radius, radius, radius)); for (Entity e : entities) { if (e instanceof EntityExperienceOrb) { EntityExperienceOrb loopItem = (EntityExperienceOrb) e; diff --git a/Spigot-Server-Patches/0217-AsyncTabCompleteEvent.patch b/Spigot-Server-Patches/0217-AsyncTabCompleteEvent.patch index 2178b5aae..85d5e63da 100644 --- a/Spigot-Server-Patches/0217-AsyncTabCompleteEvent.patch +++ b/Spigot-Server-Patches/0217-AsyncTabCompleteEvent.patch @@ -1,4 +1,4 @@ -From 5c19fb1b13f0e281aaf374a427335215bf77b770 Mon Sep 17 00:00:00 2001 +From 329d98d1c8a9fa4db98a61786037815ef3d5cde5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 26 Nov 2017 13:19:58 -0500 Subject: [PATCH] AsyncTabCompleteEvent @@ -14,7 +14,7 @@ completion, such as offline players. Also adds isCommand and getLocation to the sync TabCompleteEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 870b59ce1..371513042 100644 +index 921e1ec9e..f74e642b8 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -508,10 +508,10 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -68,10 +68,10 @@ index 870b59ce1..371513042 100644 public void a(PacketPlayInSetCommandBlock packetplayinsetcommandblock) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 72da1fe81..07364554a 100644 +index b5d0886df..054d3f3dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1722,7 +1722,7 @@ public final class CraftServer implements Server { +@@ -1721,7 +1721,7 @@ public final class CraftServer implements Server { offers = tabCompleteChat(player, message); } diff --git a/Spigot-Server-Patches/0219-PlayerPickupExperienceEvent.patch b/Spigot-Server-Patches/0219-PlayerPickupExperienceEvent.patch index 42672a90f..c81de3c09 100644 --- a/Spigot-Server-Patches/0219-PlayerPickupExperienceEvent.patch +++ b/Spigot-Server-Patches/0219-PlayerPickupExperienceEvent.patch @@ -1,4 +1,4 @@ -From ebc7081b58b5d456f4bc6346d65e20b3319ac661 Mon Sep 17 00:00:00 2001 +From 3f450566e42f24fc2cde31b2926431ec18137028 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 22:02:53 -0500 Subject: [PATCH] PlayerPickupExperienceEvent @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerPickupExperienceEvent Allows plugins to cancel a player picking up an experience orb diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index dfd6230b2..73205b2f7 100644 +index 404a222b4..4bcae2c21 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -218,7 +218,7 @@ public class EntityExperienceOrb extends Entity { @@ -17,7 +17,7 @@ index dfd6230b2..73205b2f7 100644 + if (this.c == 0 && entityhuman.bJ == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper entityhuman.bJ = 2; entityhuman.receive(this, 1); - ItemStack itemstack = EnchantmentManager.b(Enchantments.G, (EntityLiving) entityhuman); + ItemStack itemstack = EnchantmentManager.b(Enchantments.MENDING, (EntityLiving) entityhuman); -- 2.20.0 diff --git a/Spigot-Server-Patches/0220-ExperienceOrbMergeEvent.patch b/Spigot-Server-Patches/0220-ExperienceOrbMergeEvent.patch index a1ea80302..14a38560a 100644 --- a/Spigot-Server-Patches/0220-ExperienceOrbMergeEvent.patch +++ b/Spigot-Server-Patches/0220-ExperienceOrbMergeEvent.patch @@ -1,4 +1,4 @@ -From e7daf06af73e4ae7aec0982e034bd1ef4d35718f Mon Sep 17 00:00:00 2001 +From 057183312e4a71d698e6238a1d15ed5674587de7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 22:57:26 -0500 Subject: [PATCH] ExperienceOrbMergeEvent @@ -7,16 +7,16 @@ Fired when the server is about to merge 2 experience orbs Plugins can cancel this if they want to ensure experience orbs do not lose important metadata such as spawn reason, or conditionally move data from source to target. -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2ddc3f050..a14518ba6 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1042,7 +1042,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +index 14df8e80b..9578e9d2e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -400,7 +400,7 @@ public class CraftEventFactory { if (e instanceof EntityExperienceOrb) { EntityExperienceOrb loopItem = (EntityExperienceOrb) e; // Paper start - if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue)) { -+ if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue) && new com.destroystokyo.paper.event.entity.ExperienceOrbMergeEvent((org.bukkit.entity.ExperienceOrb) entity.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) loopItem.getBukkitEntity()).callEvent()) { ++ if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue) && new com.destroystokyo.paper.event.entity.ExperienceOrbMergeEvent((org.bukkit.entity.ExperienceOrb) entity.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) loopItem.getBukkitEntity()).callEvent()) { // Paper long newTotal = (long)xp.value + (long)loopItem.value; if ((int) newTotal < 0) continue; // Overflow if (maxValue > 0 && newTotal > (long)maxValue) { diff --git a/Spigot-Server-Patches/0221-Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/0221-Ability-to-apply-mending-to-XP-API.patch index 5828e8d52..031cd1d3d 100644 --- a/Spigot-Server-Patches/0221-Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-Server-Patches/0221-Ability-to-apply-mending-to-XP-API.patch @@ -1,4 +1,4 @@ -From 362bcce7edac6cda9d4b8f998e760386a1a41ed6 Mon Sep 17 00:00:00 2001 +From f4958d9d4612617fd65171cd018b29a9000af5fd Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 20 Dec 2017 17:36:49 -0500 Subject: [PATCH] Ability to apply mending to XP API @@ -10,32 +10,19 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index fd6df39f1..f03aef2fe 100644 +index e1ea8da88..f1921e151 100644 --- a/src/main/java/net/minecraft/server/EnchantmentManager.java +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java @@ -223,6 +223,7 @@ public class EnchantmentManager { - return getEnchantmentLevel(Enchantments.F, itemstack) > 0; + return getEnchantmentLevel(Enchantments.CHANNELING, itemstack) > 0; } + public static ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { return b(enchantment, entityliving); } // Paper - OBFHELPER public static ItemStack b(Enchantment enchantment, EntityLiving entityliving) { List list = enchantment.a(entityliving);// Paper - decompile fix if (list.isEmpty()) { -diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java -index 8cfb38b82..44b2d428b 100644 ---- a/src/main/java/net/minecraft/server/Enchantments.java -+++ b/src/main/java/net/minecraft/server/Enchantments.java -@@ -35,7 +35,7 @@ public class Enchantments { - public static final Enchantment D = a("impaling"); - public static final Enchantment E = a("riptide"); - public static final Enchantment F = a("channeling"); -- public static final Enchantment G = a("mending"); -+ public static final Enchantment G = a("mending");public static final Enchantment MENDING = G; // Paper - OBFHELPER - public static final Enchantment H = a("vanishing_curse"); - - @Nullable diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 73205b2f7..69d4dc9ab 100644 +index 4bcae2c21..09d85764b 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -246,10 +246,12 @@ public class EntityExperienceOrb extends Entity { diff --git a/Spigot-Server-Patches/0222-Configurable-Chunks-Sends-per-Tick-setting.patch b/Spigot-Server-Patches/0222-Configurable-Chunks-Sends-per-Tick-setting.patch index 49ca26dd4..e320c226c 100644 --- a/Spigot-Server-Patches/0222-Configurable-Chunks-Sends-per-Tick-setting.patch +++ b/Spigot-Server-Patches/0222-Configurable-Chunks-Sends-per-Tick-setting.patch @@ -1,4 +1,4 @@ -From 7dfa55ecb28018b9084160369d510a4384ed4495 Mon Sep 17 00:00:00 2001 +From 4cbdcadcd9ba0fee0c8d637e33a81ef921f4568c Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 1 Jan 2018 15:41:59 -0500 Subject: [PATCH] Configurable Chunks Sends per Tick setting @@ -26,10 +26,10 @@ index b6764c7ec..29cb718fb 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 9d971a9c5..a696be750 100644 +index 5935bae58..b1ece38b2 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -172,7 +172,7 @@ public class PlayerChunkMap { +@@ -168,7 +168,7 @@ public class PlayerChunkMap { } if (!this.g.isEmpty()) { diff --git a/Spigot-Server-Patches/0223-Configurable-Max-Chunk-Gens-per-Tick.patch b/Spigot-Server-Patches/0223-Configurable-Max-Chunk-Gens-per-Tick.patch index 8383bab80..a9cf55ed1 100644 --- a/Spigot-Server-Patches/0223-Configurable-Max-Chunk-Gens-per-Tick.patch +++ b/Spigot-Server-Patches/0223-Configurable-Max-Chunk-Gens-per-Tick.patch @@ -1,4 +1,4 @@ -From f8f4c08e6822205bb69f8318ba136fab257a2f2d Mon Sep 17 00:00:00 2001 +From 38f954aac3cbf55ef4c2ab8a91559775e2dcc5c0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 1 Jan 2018 16:10:24 -0500 Subject: [PATCH] Configurable Max Chunk Gens per Tick @@ -33,30 +33,30 @@ index 29cb718fb..695bdf2e6 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 7cb1327a8..4383abccd 100644 +index 5497a458d..db43a8a9a 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -28,6 +28,7 @@ public class PlayerChunk { - // CraftBukkit start - add fields - // You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse - // All may seem good at first, but there's deeper issues if you play for a bit +@@ -19,6 +19,7 @@ public class PlayerChunk { + private int h; + private long i; + private boolean done; + boolean chunkExists; // Paper - private boolean loadInProgress = false; - private Runnable loadedRunnable = new Runnable() { - public void run() { -@@ -58,6 +59,7 @@ public class PlayerChunk { - chunkproviderserver.a(i, j); - this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); -+ this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper + public PlayerChunk(PlayerChunkMap playerchunkmap, int ix, int j) { + this.playerChunkMap = playerchunkmap; +@@ -26,6 +27,7 @@ public class PlayerChunk { + ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider(); + chunkproviderserver.a(ix, j); + this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false); ++ this.chunkExists = this.chunk != null || org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), ix, j); // Paper markChunkUsed(); // Paper - delay chunk unloads } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index a696be750..39e5b2484 100644 +index b1ece38b2..27343174d 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -140,6 +140,7 @@ public class PlayerChunkMap { +@@ -136,6 +136,7 @@ public class PlayerChunkMap { // Spigot start org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; activityAccountant.startActivity(0.5); @@ -64,7 +64,7 @@ index a696be750..39e5b2484 100644 // Spigot end Iterator iterator1 = this.h.iterator(); -@@ -149,6 +150,11 @@ public class PlayerChunkMap { +@@ -145,6 +146,11 @@ public class PlayerChunkMap { if (playerchunk1.f() == null) { boolean flag = playerchunk1.a(PlayerChunkMap.b); diff --git a/Spigot-Server-Patches/0235-Prevent-Frosted-Ice-from-loading-holding-chunks.patch b/Spigot-Server-Patches/0235-Prevent-Frosted-Ice-from-loading-holding-chunks.patch index ab24e05ed..5686f1817 100644 --- a/Spigot-Server-Patches/0235-Prevent-Frosted-Ice-from-loading-holding-chunks.patch +++ b/Spigot-Server-Patches/0235-Prevent-Frosted-Ice-from-loading-holding-chunks.patch @@ -1,27 +1,27 @@ -From 8e13d0697e68b74c47b0cfd20d0567fc8872a24b Mon Sep 17 00:00:00 2001 +From f6be9923bfdf606012746f71fbb32ffb06ddc952 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 10 Mar 2018 16:33:15 -0500 Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index 7bea86f52..ea3a6f2fb 100644 +index 598621fbb..5c5b3a531 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java @@ -16,7 +16,8 @@ public class BlockIceFrost extends BlockIce { try (BlockPosition.b blockposition$b = BlockPosition.b.r()) { for(EnumDirection enumdirection : EnumDirection.values()) { - blockposition$b.j(blockposition).d(enumdirection); + blockposition$b.g(blockposition).c(enumdirection); - IBlockData iblockdata1 = world.getType(blockposition$b); + IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition$b); // Paper - don't load chunks + if (iblockdata1 == null) continue; // Paper if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition$b)) { - world.J().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay + world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay } @@ -53,7 +54,7 @@ public class BlockIceFrost extends BlockIce { try (BlockPosition.b blockposition$b = BlockPosition.b.r()) { for(EnumDirection enumdirection : EnumDirection.values()) { - blockposition$b.j(blockposition).d(enumdirection); + blockposition$b.g(blockposition).c(enumdirection); - if (iblockaccess.getType(blockposition$b).getBlock() == this) { + if (((World) iblockaccess).getBlockIfLoaded(blockposition$b) == this) { // Paper - don't load chunks ++j; diff --git a/Spigot-Server-Patches/0237-Implement-extended-PaperServerListPingEvent.patch b/Spigot-Server-Patches/0237-Implement-extended-PaperServerListPingEvent.patch index 59c74ae46..6b28250e4 100644 --- a/Spigot-Server-Patches/0237-Implement-extended-PaperServerListPingEvent.patch +++ b/Spigot-Server-Patches/0237-Implement-extended-PaperServerListPingEvent.patch @@ -1,4 +1,4 @@ -From b38db1bcd7c796e5a1a6737d4710400d52e0bad6 Mon Sep 17 00:00:00 2001 +From 3e4d2f1027bb17badd21e471bbe0f2ad900a24bf Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 15:56:26 +0200 Subject: [PATCH] Implement extended PaperServerListPingEvent @@ -177,7 +177,7 @@ index 000000000..26e3031d2 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 34ba382a4..c3efb5e1b 100644 +index 906bd973d..9b823d4ca 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1,6 +1,7 @@ @@ -191,25 +191,12 @@ index 34ba382a4..c3efb5e1b 100644 @@ -943,7 +944,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati if (i - this.Y >= 5000000000L) { this.Y = i; - this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.z(), this.y())); -- GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), 12)]; -+ GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), org.spigotmc.SpigotConfig.playerSample)]; // Paper - int j = MathHelper.nextInt(this.n, 0, this.y() - agameprofile.length); + this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.getMaxPlayers(), this.getPlayerCount())); +- GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)]; ++ GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper + int j = MathHelper.nextInt(this.n, 0, this.getPlayerCount() - agameprofile.length); for (int k = 0; k < agameprofile.length; ++k) { -@@ -1300,10 +1301,12 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - return "1.13.2"; - } - -+ public int getPlayerCount() { return y(); } // Paper - OBFHELPER - public int y() { - return this.s.getPlayerCount(); - } - -+ public int getMaxPlayers() { return z(); } // Paper - OBFHELPER - public int z() { - return this.s.getMaxPlayers(); - } diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java index c9edd289a..8aa121e2f 100644 --- a/src/main/java/net/minecraft/server/PacketStatusListener.java @@ -234,7 +221,7 @@ index c9edd289a..8aa121e2f 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index 615aa2cd0..408aad098 100644 +index c338d09bf..087f5fe0d 100644 --- a/src/main/java/net/minecraft/server/ServerPing.java +++ b/src/main/java/net/minecraft/server/ServerPing.java @@ -29,6 +29,7 @@ public class ServerPing { @@ -245,7 +232,7 @@ index 615aa2cd0..408aad098 100644 public ServerPing.ServerPingPlayerSample b() { return this.b; } -@@ -174,10 +175,12 @@ public class ServerPing { +@@ -156,10 +157,12 @@ public class ServerPing { return this.b; } diff --git a/Spigot-Server-Patches/0243-getPlayerUniqueId-API.patch b/Spigot-Server-Patches/0243-getPlayerUniqueId-API.patch index e6ac51bda..0d7ffcab7 100644 --- a/Spigot-Server-Patches/0243-getPlayerUniqueId-API.patch +++ b/Spigot-Server-Patches/0243-getPlayerUniqueId-API.patch @@ -1,4 +1,4 @@ -From 46b48a06dd052ec7025966dfe111049bf74710d0 Mon Sep 17 00:00:00 2001 +From a1af634f52b58bd1a460581e0281001fef1c06ab Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 22 Mar 2018 01:40:24 -0400 Subject: [PATCH] getPlayerUniqueId API @@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 07364554a..71d1929c1 100644 +index 054d3f3dc..ec197ef51 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1415,6 +1415,26 @@ public final class CraftServer implements Server { +@@ -1414,6 +1414,26 @@ public final class CraftServer implements Server { return recipients.size(); } diff --git a/Spigot-Server-Patches/0245-Make-legacy-ping-handler-more-reliable.patch b/Spigot-Server-Patches/0245-Make-legacy-ping-handler-more-reliable.patch index 8e79e6030..ce5ee6f8c 100644 --- a/Spigot-Server-Patches/0245-Make-legacy-ping-handler-more-reliable.patch +++ b/Spigot-Server-Patches/0245-Make-legacy-ping-handler-more-reliable.patch @@ -1,4 +1,4 @@ -From 5adc07529bf386d144cafa53eb41c66b1c2cea8b Mon Sep 17 00:00:00 2001 +From 70c73da3afa8adfbe7458fea7e5e4e41554f7d8c Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 18:22:50 +0200 Subject: [PATCH] Make legacy ping handler more reliable @@ -28,21 +28,21 @@ respond to the request. [2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13 diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index 5691d0aea..aafca9c9c 100644 +index cb2b9c368..976888b66 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java -@@ -13,6 +13,7 @@ import org.apache.logging.log4j.Logger; - public class LegacyPingHandler extends ChannelInboundHandlerAdapter { +@@ -14,6 +14,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + private static final Logger a = LogManager.getLogger(); private final ServerConnection b; + private ByteBuf buf; // Paper public LegacyPingHandler(ServerConnection serverconnection) { this.b = serverconnection; -@@ -20,6 +21,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - +@@ -22,6 +23,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { public void channelRead(ChannelHandlerContext channelhandlercontext, Object object) throws Exception { - ByteBuf bytebuf = (ByteBuf)object; + ByteBuf bytebuf = (ByteBuf) object; + + // Paper start - Make legacy ping handler more reliable + if (this.buf != null) { + try { @@ -56,26 +56,26 @@ index 5691d0aea..aafca9c9c 100644 bytebuf.markReaderIndex(); boolean flag = true; -@@ -44,6 +55,10 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - this.a(channelhandlercontext, this.a(s)); - break; - default: -+ // Paper start - Replace with improved version below -+ if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return; -+ readLegacy1_6(channelhandlercontext, bytebuf); -+ /* - boolean flag1 = bytebuf.readUnsignedByte() == 1; - flag1 = flag1 & bytebuf.readUnsignedByte() == 250; - flag1 = flag1 & "MC|PingHost".equals(new String(bytebuf.readBytes(bytebuf.readShort() * 2).array(), StandardCharsets.UTF_16BE)); -@@ -65,6 +80,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - } finally { - bytebuf1.release(); - } -+ */ // Paper end- end commenting out - } +@@ -52,6 +63,10 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + this.a(channelhandlercontext, this.a(s)); + break; + default: ++ // Paper start - Replace with improved version below ++ if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return; ++ readLegacy1_6(channelhandlercontext, bytebuf); ++ /* + boolean flag1 = bytebuf.readUnsignedByte() == 1; - bytebuf.release(); -@@ -84,6 +100,90 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + flag1 &= bytebuf.readUnsignedByte() == 250; +@@ -75,6 +90,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + } finally { + bytebuf1.release(); + } ++ */ // Paper end - Replace with improved version below + } + + bytebuf.release(); +@@ -92,6 +108,90 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { } diff --git a/Spigot-Server-Patches/0246-Call-PaperServerListPingEvent-for-legacy-pings.patch b/Spigot-Server-Patches/0246-Call-PaperServerListPingEvent-for-legacy-pings.patch index 13e5b75e0..506a290e3 100644 --- a/Spigot-Server-Patches/0246-Call-PaperServerListPingEvent-for-legacy-pings.patch +++ b/Spigot-Server-Patches/0246-Call-PaperServerListPingEvent-for-legacy-pings.patch @@ -1,4 +1,4 @@ -From 9a84ca1c9a75d3682f99f6f80938b597eb82b470 Mon Sep 17 00:00:00 2001 +From 6dee247ee43798b736446d22975f00d91b2ab921 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 19:30:51 +0200 Subject: [PATCH] Call PaperServerListPingEvent for legacy pings @@ -84,54 +84,56 @@ index 000000000..74c012fd4 + +} diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index aafca9c9c..860076fc2 100644 +index 976888b66..48e7ae2d5 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java -@@ -9,6 +9,7 @@ import java.net.InetSocketAddress; - import java.nio.charset.StandardCharsets; - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; -+import com.destroystokyo.paper.network.PaperLegacyStatusClient; // Paper +@@ -1,5 +1,7 @@ + package net.minecraft.server; - public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - private static final Logger a = LogManager.getLogger(); -@@ -39,10 +40,18 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - InetSocketAddress inetsocketaddress = (InetSocketAddress)channelhandlercontext.channel().remoteAddress(); - MinecraftServer minecraftserver = this.b.d(); - int i = bytebuf.readableBytes(); -+ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper - switch(i) { - case 0: - a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); -- String s2 = String.format("%s\u00a7%d\u00a7%d", minecraftserver.getMotd(), minecraftserver.y(), minecraftserver.z()); -+ // Paper start - Call PaperServerListPingEvent and use results -+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null); -+ if (event == null) { -+ channelhandlercontext.close(); -+ break; -+ } -+ String s2 = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers()); -+ // Paper end - this.a(channelhandlercontext, this.a(s2)); - break; - case 1: -@@ -51,7 +60,14 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - } ++import com.destroystokyo.paper.network.PaperLegacyStatusClient; ++ + import io.netty.buffer.ByteBuf; + import io.netty.buffer.Unpooled; + import io.netty.channel.ChannelFutureListener; +@@ -45,12 +47,19 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + MinecraftServer minecraftserver = this.b.d(); + int i = bytebuf.readableBytes(); + String s; +- org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit ++ //org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit // Paper ++ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper - a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); -- String s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), minecraftserver.getMotd(), minecraftserver.y(), minecraftserver.z()); -+ // Paper start - Call PaperServerListPingEvent and use results -+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null); -+ if (event == null) { -+ channelhandlercontext.close(); -+ break; -+ } -+ String s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(), PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers()); -+ // Paper end - this.a(channelhandlercontext, this.a(s)); - break; - default: -@@ -161,8 +177,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + switch (i) { + case 0: + LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); +- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit ++ // Paper start - Call PaperServerListPingEvent and use results ++ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null); ++ if (event == null) { ++ channelhandlercontext.close(); ++ break; ++ } ++ s = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers()); + this.a(channelhandlercontext, this.a(s)); + break; + case 1: +@@ -59,7 +68,14 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + } + + LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); +- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit ++ // Paper start - Call PaperServerListPingEvent and use results ++ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 127, null); // Paper ++ if (event == null) { ++ channelhandlercontext.close(); ++ break; ++ } ++ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { event.getProtocolVersion(), minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit ++ // Paper end + this.a(channelhandlercontext, this.a(s)); + break; + default: +@@ -169,8 +185,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { a.debug("Ping: (1.6) from {}", ctx.channel().remoteAddress()); @@ -146,7 +148,7 @@ index aafca9c9c..860076fc2 100644 + } + + String response = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(), -+ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers()); ++ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers()); this.a(ctx, this.a(response)); } diff --git a/Spigot-Server-Patches/0255-Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-Server-Patches/0255-Expand-World.spawnParticle-API-and-add-Builder.patch index 511e3b481..5f26d1a31 100644 --- a/Spigot-Server-Patches/0255-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-Server-Patches/0255-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -1,4 +1,4 @@ -From 76953fecb2b9aa243ac7b71bd8a42a804b28e07b Mon Sep 17 00:00:00 2001 +From 76463a17eba739e541025e77eeabee94f11eff0a Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 15 Aug 2017 22:29:12 -0400 Subject: [PATCH] Expand World.spawnParticle API and add Builder @@ -10,10 +10,10 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b80315bc5..a30d92ce7 100644 +index 5f386ff04..55e45dbb1 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1206,12 +1206,17 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1207,12 +1207,17 @@ public class WorldServer extends World implements IAsyncTaskHandler { } public int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { @@ -34,7 +34,7 @@ index b80315bc5..a30d92ce7 100644 if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e1c09452b..84bde3ef2 100644 +index 8c4b7aee6..c844c4579 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1746,11 +1746,17 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0264-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch b/Spigot-Server-Patches/0264-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch index e9152827f..3a281e5af 100644 --- a/Spigot-Server-Patches/0264-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch +++ b/Spigot-Server-Patches/0264-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch @@ -1,4 +1,4 @@ -From 660e2b2f1862b7cdbc2c98c8a012a979a93edf9f Mon Sep 17 00:00:00 2001 +From 89460708a2e3800f898082e23a95f44de51a2995 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 10 Jun 2018 01:18:49 -0400 Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event @@ -6,7 +6,7 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event Otherwise the creeper infinite explodes diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 64a5fefad..569248abb 100644 +index fb76dc18b..73d9d3b2c 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -12,7 +12,7 @@ public class EntityCreeper extends EntityMonster { @@ -19,7 +19,7 @@ index 64a5fefad..569248abb 100644 private int fuseTicks; public int maxFuseTicks = 30; @@ -205,6 +205,7 @@ public class EntityCreeper extends EntityMonster { - this.dF(); + this.createEffectCloud(); } else { fuseTicks = 0; + this.datawatcher.set(isIgnitedDW, Boolean.valueOf(false)); // Paper diff --git a/Spigot-Server-Patches/0265-Properly-remove-entities-on-dimension-teleport.patch b/Spigot-Server-Patches/0265-Properly-remove-entities-on-dimension-teleport.patch index c3aad5e11..e66e9a984 100644 --- a/Spigot-Server-Patches/0265-Properly-remove-entities-on-dimension-teleport.patch +++ b/Spigot-Server-Patches/0265-Properly-remove-entities-on-dimension-teleport.patch @@ -1,4 +1,4 @@ -From 7ffeeb46285513123a676adfd4f812b5c9282d16 Mon Sep 17 00:00:00 2001 +From 50aa3a863c329e3f0fb655a6414d40eb6ed6845f Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 10 Jun 2018 20:04:42 -0400 Subject: [PATCH] Properly remove entities on dimension teleport @@ -22,23 +22,23 @@ requirement, but plugins (such as my own) use this method to trigger a "reload" of the entity on the client. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 07a64966e..5600223d9 100644 +index 7c558c355..d033969cd 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2595,7 +2595,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2594,7 +2594,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end */ - this.world.kill(this); + this.world.removeEntity(this); // Paper - Fully remove entity, can't have dupes in the UUID map this.dead = false; - this.world.methodProfiler.a("reposition"); + this.world.methodProfiler.enter("reposition"); /* CraftBukkit start - Handled in calculateTarget diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a30d92ce7..83109177d 100644 +index 55e45dbb1..91850fded 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1020,6 +1020,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1021,6 +1021,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } protected void c(Entity entity) { diff --git a/Spigot-Server-Patches/0278-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch b/Spigot-Server-Patches/0278-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch index 0ea2dac9c..9ed80ce91 100644 --- a/Spigot-Server-Patches/0278-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch +++ b/Spigot-Server-Patches/0278-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch @@ -1,4 +1,4 @@ -From 405ca5db1a06b1eb62ef401c25629edcba54ac59 Mon Sep 17 00:00:00 2001 +From cac46f6bb9e69438928374d87044a6fdf8c38f3d Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Sat, 30 Jun 2018 05:45:39 +0200 Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the @@ -6,10 +6,10 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 3f17fbd37..dfedd4c30 100644 +index 7061075b5..0dd52f859 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -921,7 +921,7 @@ public class CraftEventFactory { +@@ -995,7 +995,7 @@ public class CraftEventFactory { hitBlock = entity.getBukkitEntity().getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); } diff --git a/Spigot-Server-Patches/0281-InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/0281-InventoryCloseEvent-Reason-API.patch index f2c5a9e8c..a9a0959c5 100644 --- a/Spigot-Server-Patches/0281-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/0281-InventoryCloseEvent-Reason-API.patch @@ -1,4 +1,4 @@ -From 1d69bda1bb0ad97f6b6883bf69578383d490c36a Mon Sep 17 00:00:00 2001 +From 3ef70ba8a64895af46384d4159caccdf87796247 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 3 Jul 2018 21:56:23 -0400 Subject: [PATCH] InventoryCloseEvent Reason API @@ -7,10 +7,10 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 9430bccf6..aedf31a07 100644 +index 9d3234c1c..9b88a4190 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -931,7 +931,7 @@ public class Chunk implements IChunkAccess { +@@ -944,7 +944,7 @@ public class Chunk implements IChunkAccess { { if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity ) { @@ -19,7 +19,7 @@ index 9430bccf6..aedf31a07 100644 } } } -@@ -956,7 +956,7 @@ public class Chunk implements IChunkAccess { +@@ -969,7 +969,7 @@ public class Chunk implements IChunkAccess { { if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity ) { @@ -29,7 +29,7 @@ index 9430bccf6..aedf31a07 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 2bab2ab92..20a46e2af 100644 +index 82e85a035..752848323 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -161,7 +161,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -56,7 +56,7 @@ index 2bab2ab92..20a46e2af 100644 this.activeContainer = this.defaultContainer; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index a615d7867..6933d8876 100644 +index 5bd65ddbb..bf842a0a9 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -347,7 +347,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -110,7 +110,7 @@ index a615d7867..6933d8876 100644 this.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 871dea68f..30d5c1734 100644 +index 159a30e0e..a66f8ab2c 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2019,7 +2019,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -123,7 +123,7 @@ index 871dea68f..30d5c1734 100644 this.player.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 64a86b699..e6ee5042c 100644 +index 08bbd86d1..6311c9f87 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -423,7 +423,7 @@ public abstract class PlayerList { @@ -168,10 +168,10 @@ index 8699cc72f..0f1d700c7 100644 // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index dfedd4c30..b220895c2 100644 +index 0dd52f859..dcd628104 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1011,8 +1011,19 @@ public class CraftEventFactory { +@@ -1085,8 +1085,19 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0282-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/0282-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index 544b3a226..ceb46eba6 100644 --- a/Spigot-Server-Patches/0282-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/0282-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -1,4 +1,4 @@ -From 5c0bebf72e955ea07f0ade815cdfbaf6e028e720 Mon Sep 17 00:00:00 2001 +From 4e1aa38e484da825d02fb5435097c2516e3ea234 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 03:39:51 -0400 Subject: [PATCH] Avoid Chunk Lookups for Entity/TileEntity Current Chunk @@ -10,22 +10,22 @@ to the object directly on the Entity/TileEntity object we can directly grab. Use that local value instead to reduce lookups in many hot places. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index aedf31a07..8ff542c88 100644 +index 9b88a4190..6c9d7df20 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -719,6 +719,7 @@ public class Chunk implements IChunkAccess { +@@ -724,6 +724,7 @@ public class Chunk implements IChunkAccess { ((HeightMap) this.heightMap.get(heightmap_type)).a(along); } + public void removeEntity(Entity entity) { b(entity); } // Paper - OBFHELPER public void b(Entity entity) { - this.a(entity, entity.af); + this.a(entity, entity.chunkY); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a14518ba6..980f373b1 100644 +index 0ca1816cb..7711b2eff 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1258,12 +1258,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1192,12 +1192,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int j; // Paper start - Set based removal lists for (Entity e : this.g) { @@ -42,14 +42,14 @@ index a14518ba6..980f373b1 100644 } for (Entity e : this.g) { -@@ -1324,12 +1327,17 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.methodProfiler.e(); - this.methodProfiler.a("remove"); +@@ -1258,12 +1261,17 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + this.methodProfiler.exit(); + this.methodProfiler.enter("remove"); if (entity.dead) { + // Paper start + /* - j = entity.ae; - int l = entity.ag; + j = entity.chunkX; + int l = entity.chunkZ; if (entity.inChunk && this.isChunkLoaded(j, l, true)) { this.getChunkAt(j, l).b(entity); @@ -61,7 +61,7 @@ index a14518ba6..980f373b1 100644 guardEntityList = false; // Spigot this.entityList.remove(this.tickPosition--); // CraftBukkit - Use field for loop variable -@@ -1374,7 +1382,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1308,7 +1316,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc BlockPosition blockposition = tileentity.getPosition(); // Paper start - Skip ticking in chunks scheduled for unload @@ -70,7 +70,7 @@ index a14518ba6..980f373b1 100644 boolean shouldTick = chunk != null; if(this.paperConfig.skipEntityTickingInChunksScheduledForUnload) shouldTick = shouldTick && chunk.scheduledForUnload == null; -@@ -1410,8 +1418,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1344,8 +1352,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); //this.tileEntityList.remove(tileentity); // Paper - remove unused list diff --git a/Spigot-Server-Patches/0287-Re-add-vanilla-entity-warnings-for-duplicates.patch b/Spigot-Server-Patches/0287-Re-add-vanilla-entity-warnings-for-duplicates.patch index cb7e40443..afdd5c89c 100644 --- a/Spigot-Server-Patches/0287-Re-add-vanilla-entity-warnings-for-duplicates.patch +++ b/Spigot-Server-Patches/0287-Re-add-vanilla-entity-warnings-for-duplicates.patch @@ -1,4 +1,4 @@ -From 8c69389cc19ab38e56bd06e965cdd5e2d7a9937c Mon Sep 17 00:00:00 2001 +From fe3396599073a4dd6b3f69921d54017523938b5c Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 19 Jul 2018 01:08:05 -0400 Subject: [PATCH] Re-add vanilla entity warnings for duplicates @@ -8,10 +8,10 @@ These are a critical sign that somethin went wrong, and you've lost some data... We should kind of know about these things you know. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 83109177d..a07077397 100644 +index 91850fded..45851cd0c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -986,7 +986,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -987,7 +987,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.g.remove(entity1); } else { if (!(entity instanceof EntityHuman)) { diff --git a/Spigot-Server-Patches/0291-add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/0291-add-more-information-to-Entity.toString.patch index ca7c97abb..f5fa5198c 100644 --- a/Spigot-Server-Patches/0291-add-more-information-to-Entity.toString.patch +++ b/Spigot-Server-Patches/0291-add-more-information-to-Entity.toString.patch @@ -1,4 +1,4 @@ -From feb89c43a9cc4398764516124c5bb289e15bddb3 Mon Sep 17 00:00:00 2001 +From c0d4e8c4a2cdc7120103013c003c1c0e9de279f1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 19 Jul 2018 01:13:28 -0400 Subject: [PATCH] add more information to Entity.toString() @@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString() UUID, ticks lived, valid, dead diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 5600223d9..173712659 100644 +index d033969cd..9f1610326 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2498,7 +2498,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2497,7 +2497,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public String toString() { diff --git a/Spigot-Server-Patches/0292-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/0292-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index c20a98f26..1f9d5df8a 100644 --- a/Spigot-Server-Patches/0292-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/0292-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -1,4 +1,4 @@ -From b0f35b7948542c90faf5e855470bc0ac36a49eca Mon Sep 17 00:00:00 2001 +From f94015c93adb20a5fc3b30b9b1ca3dcf3064159f Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 08:25:40 -0400 Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues @@ -6,7 +6,7 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Add -Ddebug.entities=true to your JVM flags to gain more information diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 173712659..a402f71a9 100644 +index 9f1610326..1581edc4a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -73,6 +73,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -18,7 +18,7 @@ index 173712659..a402f71a9 100644 if (bukkitEntity == null) { bukkitEntity = CraftEntity.getEntity(world.getServer(), this); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 980f373b1..29c3a24f2 100644 +index 7711b2eff..67ef109a5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -115,6 +115,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -30,7 +30,7 @@ index 980f373b1..29c3a24f2 100644 public boolean captureBlockStates = false; public boolean captureTreeGeneration = false; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a07077397..0bb903aab 100644 +index 45851cd0c..f37e85eb0 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -55,6 +55,9 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -43,7 +43,7 @@ index a07077397..0bb903aab 100644 // Add env and gen to constructor public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, PersistentCollection persistentcollection, WorldData worlddata, DimensionManager dimensionmanager, MethodProfiler methodprofiler, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { -@@ -974,7 +977,12 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -975,7 +978,12 @@ public class WorldServer extends World implements IAsyncTaskHandler { private boolean j(Entity entity) { if (entity.dead) { @@ -57,7 +57,7 @@ index a07077397..0bb903aab 100644 return false; } else { UUID uuid = entity.getUniqueID(); -@@ -986,8 +994,15 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -987,8 +995,15 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.g.remove(entity1); } else { if (!(entity instanceof EntityHuman)) { @@ -75,7 +75,7 @@ index a07077397..0bb903aab 100644 return false; } -@@ -1004,7 +1019,25 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1005,7 +1020,25 @@ public class WorldServer extends World implements IAsyncTaskHandler { protected void b(Entity entity) { super.b(entity); this.entitiesById.a(entity.getId(), entity); diff --git a/Spigot-Server-Patches/0296-Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/0296-Duplicate-UUID-Resolve-Option.patch index 3ca45f51e..224efed5b 100644 --- a/Spigot-Server-Patches/0296-Duplicate-UUID-Resolve-Option.patch +++ b/Spigot-Server-Patches/0296-Duplicate-UUID-Resolve-Option.patch @@ -1,4 +1,4 @@ -From 04c998bf22d871ead237bc6be5e12cd676965219 Mon Sep 17 00:00:00 2001 +From 3d3653b83b8c5299747f3636891adf061080ac5e Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 14:27:34 -0400 Subject: [PATCH] Duplicate UUID Resolve Option @@ -81,7 +81,7 @@ index 92acfa6fb..05509e4fd 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 8ff542c88..bb76f56da 100644 +index 6c9d7df20..55cb7b88e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -1,5 +1,10 @@ @@ -95,7 +95,7 @@ index 8ff542c88..bb76f56da 100644 import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.collect.Maps; import com.google.common.collect.Queues; -@@ -37,6 +42,7 @@ public class Chunk implements IChunkAccess { +@@ -42,6 +47,7 @@ public class Chunk implements IChunkAccess { public final World world; public final Map heightMap; public Long scheduledForUnload; // Paper - delay chunk unloads @@ -103,7 +103,7 @@ index 8ff542c88..bb76f56da 100644 public final int locX; public final int locZ; private boolean l; -@@ -687,6 +693,7 @@ public class Chunk implements IChunkAccess { +@@ -692,6 +698,7 @@ public class Chunk implements IChunkAccess { if (i != this.locX || j != this.locZ) { Chunk.d.warn("Wrong location! ({}, {}) should be ({}, {}), {}", i, j, this.locX, this.locZ, entity); entity.die(); @@ -111,10 +111,10 @@ index 8ff542c88..bb76f56da 100644 } int k = MathHelper.floor(entity.locY / 16.0D); -@@ -875,6 +882,50 @@ public class Chunk implements IChunkAccess { - +@@ -881,6 +888,50 @@ public class Chunk implements IChunkAccess { for (int j = 0; j < i; ++j) { - List entityslice = aentityslice[j]; // Spigot + // CraftBukkit start + List entityslice = aentityslice[j]; // Spigot + // Paper start + DuplicateUUIDMode mode = world.paperConfig.duplicateUUIDMode; + if (mode == DuplicateUUIDMode.WARN || mode == DuplicateUUIDMode.DELETE || mode == DuplicateUUIDMode.SAFE_REGEN) { @@ -160,13 +160,13 @@ index 8ff542c88..bb76f56da 100644 + } + // Paper end + List toRemove = new LinkedList<>(); this.world.a(entityslice.stream().filter((entity) -> { - return !(entity instanceof EntityHuman); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a402f71a9..6c427e9aa 100644 +index 1581edc4a..07cd5aa28 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2723,6 +2723,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2722,6 +2722,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke }); } @@ -175,7 +175,7 @@ index a402f71a9..6c427e9aa 100644 this.uniqueID = uuid; this.au = this.uniqueID.toString(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 29c3a24f2..5557e9409 100644 +index 67ef109a5..66d2026d0 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -75,7 +75,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -188,7 +188,7 @@ index 29c3a24f2..5557e9409 100644 public final List tileEntityListTick = Lists.newArrayList(); private final List c = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0bb903aab..572c54c9c 100644 +index f37e85eb0..af9cdd9dc 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -41,7 +41,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -200,7 +200,7 @@ index 0bb903aab..572c54c9c 100644 public boolean savingDisabled; private boolean J; private int emptyTime; -@@ -994,7 +994,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -995,7 +995,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.g.remove(entity1); } else { if (!(entity instanceof EntityHuman)) { @@ -209,7 +209,7 @@ index 0bb903aab..572c54c9c 100644 WorldServer.a.error("Keeping entity {} that already exists with UUID {}", entity1, uuid.toString()); // CraftBukkit // Paper WorldServer.a.error("Deleting duplicate entity {}", entity); // Paper -@@ -1025,7 +1025,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1026,7 +1026,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } Entity old = this.entitiesByUUID.put(entity.getUniqueID(), entity); diff --git a/Spigot-Server-Patches/0297-Speedup-BlockPos-by-fixing-inlining.patch b/Spigot-Server-Patches/0297-Speedup-BlockPos-by-fixing-inlining.patch index 168b4934e..7980a86d7 100644 --- a/Spigot-Server-Patches/0297-Speedup-BlockPos-by-fixing-inlining.patch +++ b/Spigot-Server-Patches/0297-Speedup-BlockPos-by-fixing-inlining.patch @@ -1,4 +1,4 @@ -From 06bd33e6e6962babee025681cf18fbf3b17b52f0 Mon Sep 17 00:00:00 2001 +From c7b1bc2d0b88a3154270b0502c355c2cf10a15a3 Mon Sep 17 00:00:00 2001 From: Techcable Date: Wed, 30 Nov 2016 20:56:58 -0600 Subject: [PATCH] Speedup BlockPos by fixing inlining @@ -21,7 +21,7 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt They had 'callq' (invoke) instead of 'mov' (get from memory) instructions. diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index 680764b34..25334377a 100644 +index 339e2da6b..8dbb4864e 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -6,22 +6,22 @@ import javax.annotation.concurrent.Immutable; @@ -80,10 +80,10 @@ index 680764b34..25334377a 100644 public BaseBlockPosition d(BaseBlockPosition baseblockposition1) { return new BaseBlockPosition(this.getY() * baseblockposition1.getZ() - this.getZ() * baseblockposition1.getY(), this.getZ() * baseblockposition1.getX() - this.getX() * baseblockposition1.getZ(), this.getX() * baseblockposition1.getY() - this.getY() * baseblockposition1.getX()); diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7bd51b357..9ce3cd9c9 100644 +index e980e31fc..ae162f615 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -205,18 +205,20 @@ public class BlockPosition extends BaseBlockPosition { +@@ -201,18 +201,20 @@ public class BlockPosition extends BaseBlockPosition { if (this.g == null) { this.g = new BlockPosition.MutableBlockPosition(ix, jx, kx); return this.g; @@ -114,8 +114,8 @@ index 7bd51b357..9ce3cd9c9 100644 } return this.g; -@@ -237,10 +239,12 @@ public class BlockPosition extends BaseBlockPosition { - } +@@ -225,10 +227,12 @@ public class BlockPosition extends BaseBlockPosition { + public static class MutableBlockPosition extends BlockPosition { + // Paper start - comment out @@ -128,7 +128,7 @@ index 7bd51b357..9ce3cd9c9 100644 @Override public boolean isValidLocation() { return b >= -30000000 && d >= -30000000 && b < 30000000 && d < 30000000 && c >= 0 && c < 256; -@@ -249,6 +253,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -237,6 +241,7 @@ public class BlockPosition extends BaseBlockPosition { public boolean isInvalidYLocation() { return c < 0 || c >= 256; } @@ -136,7 +136,7 @@ index 7bd51b357..9ce3cd9c9 100644 // Paper end public MutableBlockPosition() { -@@ -260,10 +265,13 @@ public class BlockPosition extends BaseBlockPosition { +@@ -248,10 +253,13 @@ public class BlockPosition extends BaseBlockPosition { } public MutableBlockPosition(int i, int j, int k) { @@ -152,7 +152,7 @@ index 7bd51b357..9ce3cd9c9 100644 } public BlockPosition a(double d0, double d1, double d2) { -@@ -282,6 +290,8 @@ public class BlockPosition extends BaseBlockPosition { +@@ -270,6 +278,8 @@ public class BlockPosition extends BaseBlockPosition { return super.a(enumblockrotation).h(); } @@ -161,7 +161,7 @@ index 7bd51b357..9ce3cd9c9 100644 public int getX() { return this.b; } -@@ -292,13 +302,16 @@ public class BlockPosition extends BaseBlockPosition { +@@ -280,13 +290,16 @@ public class BlockPosition extends BaseBlockPosition { public int getZ() { return this.d; @@ -182,7 +182,7 @@ index 7bd51b357..9ce3cd9c9 100644 return this; } -@@ -316,15 +329,15 @@ public class BlockPosition extends BaseBlockPosition { +@@ -304,15 +317,15 @@ public class BlockPosition extends BaseBlockPosition { } public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) { diff --git a/Spigot-Server-Patches/0300-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/0300-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 5bd0a7f5b..12ffd1055 100644 --- a/Spigot-Server-Patches/0300-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/0300-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -1,4 +1,4 @@ -From 741f77317ff07a0e73ecfc5474f9c4f75c0e3b59 Mon Sep 17 00:00:00 2001 +From 0e020af7c41d390ecfeef912bca874a9384f938f Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Mon, 23 Jul 2018 12:57:39 +0200 Subject: [PATCH] Option to prevent armor stands from doing entity lookups @@ -21,10 +21,10 @@ index 05509e4fd..4059c7a72 100644 private void maxEntityCollision() { maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 5557e9409..7f23a8e2e 100644 +index 66d2026d0..858cc1b97 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1613,6 +1613,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1547,6 +1547,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } diff --git a/Spigot-Server-Patches/0301-Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/0301-Vanished-players-don-t-have-rights.patch index 722929ee8..a2e7d8764 100644 --- a/Spigot-Server-Patches/0301-Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/0301-Vanished-players-don-t-have-rights.patch @@ -1,11 +1,11 @@ -From be9b89578e5f5dac27f077804e41ee406100c1e4 Mon Sep 17 00:00:00 2001 +From e5678439f8c0fd79df801804cf2caafe0bd58575 Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Mon, 23 Jul 2018 14:22:26 +0200 Subject: [PATCH] Vanished players don't have rights diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6c427e9aa..f13fa7fff 100644 +index 07cd5aa28..fe0590dea 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -94,7 +94,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -44,10 +44,10 @@ index c6ec1a782..6c61718b2 100644 if (this.isEmpty()) { throw new UnsupportedOperationException("No bounds for empty shape."); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7f23a8e2e..811311e9e 100644 +index 858cc1b97..78e85aacf 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1595,6 +1595,37 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1529,6 +1529,37 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } @@ -86,10 +86,10 @@ index 7f23a8e2e..811311e9e 100644 if (voxelshape.isEmpty()) { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index b220895c2..672c32858 100644 +index dcd628104..41b05f231 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -902,6 +902,14 @@ public class CraftEventFactory { +@@ -976,6 +976,14 @@ public class CraftEventFactory { Projectile projectile = (Projectile) entity.getBukkitEntity(); org.bukkit.entity.Entity collided = position.entity.getBukkitEntity(); com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = new com.destroystokyo.paper.event.entity.ProjectileCollideEvent(projectile, collided); diff --git a/Spigot-Server-Patches/0302-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch b/Spigot-Server-Patches/0302-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch index 979bd09cc..95921dc68 100644 --- a/Spigot-Server-Patches/0302-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch +++ b/Spigot-Server-Patches/0302-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch @@ -1,4 +1,4 @@ -From 490ae02b8037545eb9c1984738af7d8f07bf788c Mon Sep 17 00:00:00 2001 +From 3256f4669f790f59a0308f9dba3aea4436da54bd Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 23 Jul 2018 22:18:31 -0400 Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it @@ -6,18 +6,18 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index bb76f56da..382e46adb 100644 +index 55cb7b88e..f7990fbdb 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -712,6 +712,7 @@ public class Chunk implements IChunkAccess { - entity.ag = this.locZ; +@@ -717,6 +717,7 @@ public class Chunk implements IChunkAccess { + entity.chunkZ = this.locZ; this.entitySlices[k].add(entity); // Paper start + this.markDirty(); if (entity instanceof EntityItem) { itemCounts[k]++; } else if (entity instanceof IInventory) { -@@ -743,6 +744,7 @@ public class Chunk implements IChunkAccess { +@@ -748,6 +749,7 @@ public class Chunk implements IChunkAccess { if (!this.entitySlices[i].remove(entity)) { return; } diff --git a/Spigot-Server-Patches/0303-Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/0303-Add-some-Debug-to-Chunk-Entity-slices.patch index 16e4be23a..402370f68 100644 --- a/Spigot-Server-Patches/0303-Add-some-Debug-to-Chunk-Entity-slices.patch +++ b/Spigot-Server-Patches/0303-Add-some-Debug-to-Chunk-Entity-slices.patch @@ -1,4 +1,4 @@ -From e8a7d574452142fd04be78da0bd9161b3170be8c Mon Sep 17 00:00:00 2001 +From 158100d122f5fd7e1c280aed126c53675bcc0a3a Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 23 Jul 2018 22:44:23 -0400 Subject: [PATCH] Add some Debug to Chunk Entity slices @@ -9,13 +9,13 @@ This should hopefully avoid duplicate entities ever being created if the entity was to end up in 2 different chunk slices diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 382e46adb..a62d7196b 100644 +index f7990fbdb..4f01140e7 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -710,8 +710,34 @@ public class Chunk implements IChunkAccess { - entity.ae = this.locX; - entity.af = k; - entity.ag = this.locZ; +@@ -715,8 +715,34 @@ public class Chunk implements IChunkAccess { + entity.chunkX = this.locX; + entity.chunkY = k; + entity.chunkZ = this.locZ; - this.entitySlices[k].add(entity); + // Paper start @@ -48,7 +48,7 @@ index 382e46adb..a62d7196b 100644 this.markDirty(); if (entity instanceof EntityItem) { itemCounts[k]++; -@@ -741,9 +767,13 @@ public class Chunk implements IChunkAccess { +@@ -746,9 +772,13 @@ public class Chunk implements IChunkAccess { i = this.entitySlices.length - 1; } // Paper start @@ -64,7 +64,7 @@ index 382e46adb..a62d7196b 100644 this.markDirty(); if (entity instanceof EntityItem) { itemCounts[i]--; -@@ -1016,6 +1046,7 @@ public class Chunk implements IChunkAccess { +@@ -1029,6 +1059,7 @@ public class Chunk implements IChunkAccess { } // Spigot End entity.setCurrentChunk(null); // Paper @@ -73,7 +73,7 @@ index 382e46adb..a62d7196b 100644 // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index f13fa7fff..715ab15e3 100644 +index fe0590dea..469dce5df 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -64,6 +64,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0309-Always-process-chunk-removal-in-removeEntity.patch b/Spigot-Server-Patches/0309-Always-process-chunk-removal-in-removeEntity.patch index 57d0c306e..334ad2e32 100644 --- a/Spigot-Server-Patches/0309-Always-process-chunk-removal-in-removeEntity.patch +++ b/Spigot-Server-Patches/0309-Always-process-chunk-removal-in-removeEntity.patch @@ -1,4 +1,4 @@ -From a25472bc5e97fb4bc871d21cc6f3068f9cab0489 Mon Sep 17 00:00:00 2001 +From 878acd1cb814ad0b38a0d3c210dd5b388d8ec459 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 28 Jul 2018 12:09:20 -0400 Subject: [PATCH] Always process chunk removal in removeEntity @@ -8,19 +8,19 @@ which can keep them in the chunk when they shouldnt be if done during entity ticking. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 811311e9e..1d7188b2e 100644 +index 78e85aacf..f5f1452b7 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1173,7 +1173,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1107,7 +1107,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.everyoneSleeping(); } - if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking + // if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking // Paper - move down - int i = entity.ae; - int j = entity.ag; + int i = entity.chunkX; + int j = entity.chunkZ; -@@ -1181,6 +1181,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1115,6 +1115,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.getChunkAt(i, j).b(entity); } diff --git a/Spigot-Server-Patches/0310-Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/0310-Ignore-Dead-Entities-in-entityList-iteration.patch index 2cab9a564..a46386bc6 100644 --- a/Spigot-Server-Patches/0310-Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/0310-Ignore-Dead-Entities-in-entityList-iteration.patch @@ -1,4 +1,4 @@ -From b338f62ebd5fc9c46087d7b3e36001fab13ff023 Mon Sep 17 00:00:00 2001 +From 1ed451ce0e318248640bc5651acab3af82aace6a Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 28 Jul 2018 12:18:27 -0400 Subject: [PATCH] Ignore Dead Entities in entityList iteration @@ -23,7 +23,7 @@ index 56700fc59..9b9c8361e 100644 MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 715ab15e3..df23b5c4f 100644 +index 469dce5df..f1abcadcc 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -123,6 +123,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -35,10 +35,10 @@ index 715ab15e3..df23b5c4f 100644 public float length; public float J; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1d7188b2e..ccdb1ba01 100644 +index f5f1452b7..762ae7366 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1112,6 +1112,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1046,6 +1046,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } entity.valid = true; // CraftBukkit @@ -46,7 +46,7 @@ index 1d7188b2e..ccdb1ba01 100644 new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid } -@@ -1180,6 +1181,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1114,6 +1115,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (entity.inChunk && this.isChunkLoaded(i, j, true)) { this.getChunkAt(i, j).b(entity); } @@ -54,7 +54,7 @@ index 1d7188b2e..ccdb1ba01 100644 if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking // Paper - always remove from current chunk above // CraftBukkit start - Decrement loop variable field if we've already ticked this entity -@@ -2390,6 +2392,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2324,6 +2326,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -62,7 +62,7 @@ index 1d7188b2e..ccdb1ba01 100644 if (oclass.isAssignableFrom(entity.getClass()) && predicate.test((T) entity)) { arraylist.add(entity); -@@ -2476,6 +2479,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2410,6 +2413,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -71,7 +71,7 @@ index 1d7188b2e..ccdb1ba01 100644 if (entity instanceof EntityInsentient) { EntityInsentient entityinsentient = (EntityInsentient) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a05320c90..2acd8a4b3 100644 +index a41716fd4..20fb157fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -619,6 +619,7 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0311-Provide-option-to-use-a-versioned-world-folder-for-t.patch b/Spigot-Server-Patches/0311-Provide-option-to-use-a-versioned-world-folder-for-t.patch index 645957ca8..25397d16d 100644 --- a/Spigot-Server-Patches/0311-Provide-option-to-use-a-versioned-world-folder-for-t.patch +++ b/Spigot-Server-Patches/0311-Provide-option-to-use-a-versioned-world-folder-for-t.patch @@ -1,4 +1,4 @@ -From 84ce6cd9900e5bedc702311da69bfcfdffd1a3ec Mon Sep 17 00:00:00 2001 +From 276442b97bb4fff3381cb42d9c0edfda338dd59b Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 29 Jul 2018 15:48:50 -0400 Subject: [PATCH] Provide option to use a versioned world folder for testing @@ -59,7 +59,7 @@ index 48b0a742a..f0b87972d 100644 + } } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 7c77d384b..f734b85e0 100644 +index a2d65c6df..41a7103ef 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -59,8 +59,55 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -139,7 +139,7 @@ index 7c77d384b..f734b85e0 100644 if (nbttagcompound != null) { diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 15666325e..3501b87f7 100644 +index d07222239..8c8b7cbab 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -76,6 +76,13 @@ public class RegionFileCache { @@ -151,13 +151,13 @@ index 15666325e..3501b87f7 100644 + return new File(file1, "r." + (i >> 5) + "." + (j >> 5) + ".mca"); + } + public static synchronized boolean hasRegionFile(File file, int i, int j) { -+ return RegionFileCache.a.containsKey(getRegionFileName(file, i, j)); ++ return RegionFileCache.cache.containsKey(getRegionFileName(file, i, j)); + } // Paper End public static synchronized void a() { diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index ab085788a..c84e6acdb 100644 +index 577ba1b5f..31119ba69 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -32,6 +32,58 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { diff --git a/Spigot-Server-Patches/0315-World-EntityHuman-Lookup-Optimizations.patch b/Spigot-Server-Patches/0315-World-EntityHuman-Lookup-Optimizations.patch index 0822dba1d..34bec873b 100644 --- a/Spigot-Server-Patches/0315-World-EntityHuman-Lookup-Optimizations.patch +++ b/Spigot-Server-Patches/0315-World-EntityHuman-Lookup-Optimizations.patch @@ -1,11 +1,11 @@ -From 05042904dc0fb028c53a89f5274ded92483d81fa Mon Sep 17 00:00:00 2001 +From ff7290686a5717b69809c1b5ad3a73c0b78ac56d Mon Sep 17 00:00:00 2001 From: willies952002 Date: Mon, 30 Jul 2018 02:42:49 -0400 Subject: [PATCH] World EntityHuman Lookup Optimizations diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ccdb1ba01..12379f755 100644 +index 762ae7366..5e61826f6 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -81,6 +81,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -16,7 +16,7 @@ index ccdb1ba01..12379f755 100644 public final List k = Lists.newArrayList(); protected final IntHashMap entitiesById = new IntHashMap(); private final long F = 16777215L; -@@ -1096,6 +1097,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1030,6 +1031,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc EntityHuman entityhuman = (EntityHuman) entity; this.players.add(entityhuman); @@ -25,15 +25,15 @@ index ccdb1ba01..12379f755 100644 this.everyoneSleeping(); } -@@ -1138,6 +1141,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1072,6 +1075,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.die(); if (entity instanceof EntityHuman) { this.players.remove(entity); + this.playersByName.remove(entity.getName()); // Paper - World EntityHuman Lookup Optimizations // Spigot start - for ( WorldPersistentData worldData : worldMaps.a.values() ) + for ( WorldPersistentData worldData : worldMaps.worldMap.values() ) { -@@ -1171,6 +1175,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1105,6 +1109,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.die(); if (entity instanceof EntityHuman) { this.players.remove(entity); @@ -41,7 +41,7 @@ index ccdb1ba01..12379f755 100644 this.everyoneSleeping(); } -@@ -2741,6 +2746,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2675,6 +2680,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @Nullable public EntityHuman a(String s) { @@ -50,7 +50,7 @@ index ccdb1ba01..12379f755 100644 for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -@@ -2750,10 +2757,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2684,10 +2691,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } return null; @@ -66,7 +66,7 @@ index ccdb1ba01..12379f755 100644 for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -@@ -2763,6 +2775,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2697,6 +2709,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } return null; diff --git a/Spigot-Server-Patches/0317-Break-up-and-make-tab-spam-limits-configurable.patch b/Spigot-Server-Patches/0317-Break-up-and-make-tab-spam-limits-configurable.patch index 7b96e5b64..9476aed18 100644 --- a/Spigot-Server-Patches/0317-Break-up-and-make-tab-spam-limits-configurable.patch +++ b/Spigot-Server-Patches/0317-Break-up-and-make-tab-spam-limits-configurable.patch @@ -1,4 +1,4 @@ -From 1b8368109e47aca2e43eaade5e565c5cf7b2af2a Mon Sep 17 00:00:00 2001 +From a6dfbe7df018ab757f1530a220ce2e6783bf0825 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 29 Jul 2018 05:02:15 +0100 Subject: [PATCH] Break up and make tab spam limits configurable @@ -45,7 +45,7 @@ index f0b87972d..a92914576 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e204dbe21..8e436c7f4 100644 +index 16d8a56b1..f2f977fff 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -77,6 +77,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -57,7 +57,7 @@ index e204dbe21..8e436c7f4 100644 private int j; private final IntHashMap k = new IntHashMap(); @@ -205,6 +206,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - this.minecraftServer.methodProfiler.e(); + this.minecraftServer.methodProfiler.exit(); // CraftBukkit start for (int spam; (spam = this.chatThrottle) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1); ) ; + if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable diff --git a/Spigot-Server-Patches/0318-Make-portal-teleportation-adjustment-math-more-accur.patch b/Spigot-Server-Patches/0318-Make-portal-teleportation-adjustment-math-more-accur.patch index 73d86f58c..d6f2656c2 100644 --- a/Spigot-Server-Patches/0318-Make-portal-teleportation-adjustment-math-more-accur.patch +++ b/Spigot-Server-Patches/0318-Make-portal-teleportation-adjustment-math-more-accur.patch @@ -1,11 +1,11 @@ -From 91c66cede1fe69afa655668cb7a6323884bea06f Mon Sep 17 00:00:00 2001 +From d7b5f8d2bb11e9fd2f230fd0e1c2f9c8d6ad15b5 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 31 Jul 2018 19:32:57 -0500 Subject: [PATCH] Make portal teleportation adjustment math more accurate diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index c0853f0fc..7aa940672 100644 +index 44c91ba26..c6933c1a3 100644 --- a/src/main/java/net/minecraft/server/EnumDirection.java +++ b/src/main/java/net/minecraft/server/EnumDirection.java @@ -95,6 +95,7 @@ public enum EnumDirection implements INamable { @@ -24,7 +24,7 @@ index c0853f0fc..7aa940672 100644 public EnumDirection e() { switch(this) { case NORTH: -@@ -333,6 +335,7 @@ public enum EnumDirection implements INamable { +@@ -317,6 +319,7 @@ public enum EnumDirection implements INamable { this.d = s1; } @@ -45,7 +45,7 @@ index d53d0c242..49fba0979 100644 if (d0 < d1) { return d1; diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index 7e858bab4..eba6eaf37 100644 +index a24bd02d5..d30a8a6bd 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -208,11 +208,27 @@ public class PortalTravelAgent { @@ -79,10 +79,10 @@ index 7e858bab4..eba6eaf37 100644 float f1 = 0.0F; float f2 = 0.0F; diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java -index 0c9910d9a..446cdb86d 100644 +index 78234cbdd..daeb3f83e 100644 --- a/src/main/java/net/minecraft/server/ShapeDetector.java +++ b/src/main/java/net/minecraft/server/ShapeDetector.java -@@ -143,6 +143,7 @@ public class ShapeDetector { +@@ -139,6 +139,7 @@ public class ShapeDetector { return this.c; } diff --git a/Spigot-Server-Patches/0321-Entity-add-to-world-fixes.patch b/Spigot-Server-Patches/0321-Entity-add-to-world-fixes.patch index 2bb972079..d7d3b33c3 100644 --- a/Spigot-Server-Patches/0321-Entity-add-to-world-fixes.patch +++ b/Spigot-Server-Patches/0321-Entity-add-to-world-fixes.patch @@ -1,4 +1,4 @@ -From ce0e1b9fb596f82f91df77559fe845022517da42 Mon Sep 17 00:00:00 2001 +From f91d23d40efa6bb6385549a9dd7a69a2c42fceed Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 3 Aug 2018 22:47:46 -0400 Subject: [PATCH] Entity add to world fixes @@ -14,38 +14,44 @@ Fix this by differing entity add to world for all entities at the same time the original entity is dead, overwrite it as the logic does for unloaod queued entities. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index a62d7196b..836aea6c3 100644 +index 4f01140e7..57e35564a 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -911,6 +911,7 @@ public class Chunk implements IChunkAccess { +@@ -916,6 +916,7 @@ public class Chunk implements IChunkAccess { this.world.a(this.tileEntities.values()); List[] aentityslice = this.entitySlices; // Spigot int i = aentityslice.length; + List toAdd = new java.util.ArrayList<>(32); // Paper for (int j = 0; j < i; ++j) { - List entityslice = aentityslice[j]; // Spigot -@@ -957,12 +958,11 @@ public class Chunk implements IChunkAccess { - thisChunk.put(entity.uniqueID, entity); + // CraftBukkit start +@@ -964,18 +965,11 @@ public class Chunk implements IChunkAccess { } } -- // Paper end - + // Paper end +- +- List toRemove = new LinkedList<>(); - this.world.a(entityslice.stream().filter((entity) -> { +- if (!CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { +- toRemove.add(entity); +- return false; +- } - return !(entity instanceof EntityHuman); - })); -+ toAdd.addAll(entityslice); -+ // Paper end +- entityslice.removeAll(toRemove); + // CraftBukkit end } -+ this.world.addChunkEntities(toAdd.stream().filter((entity) -> !(entity instanceof EntityHuman || entity.valid))); // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) ++ this.world.addChunkEntities(toAdd.stream() // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) ++ .filter((entity) -> CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) // Paper - Inline into stream ++ .filter((entity) -> !(entity instanceof EntityHuman || entity.valid))); // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) // CraftBukkit start org.bukkit.Server server = this.world.getServer(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 12379f755..72e74c59f 100644 +index 5e61826f6..bd6f64e52 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1103,6 +1103,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1037,6 +1037,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } this.getChunkAt(i, j).a(entity); @@ -53,7 +59,7 @@ index 12379f755..72e74c59f 100644 this.entityList.add(entity); this.b(entity); return true; -@@ -2508,9 +2509,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2442,9 +2443,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return j; } @@ -68,10 +74,10 @@ index 12379f755..72e74c59f 100644 this.b(entity); }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 572c54c9c..0545336b4 100644 +index af9cdd9dc..10630ac96 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -990,7 +990,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -991,7 +991,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (this.entitiesByUUID.containsKey(uuid)) { Entity entity1 = (Entity) this.entitiesByUUID.get(uuid); diff --git a/Spigot-Server-Patches/0327-Use-a-Queue-for-Queueing-Commands.patch b/Spigot-Server-Patches/0327-Use-a-Queue-for-Queueing-Commands.patch index 4f0f4b24a..a4d252172 100644 --- a/Spigot-Server-Patches/0327-Use-a-Queue-for-Queueing-Commands.patch +++ b/Spigot-Server-Patches/0327-Use-a-Queue-for-Queueing-Commands.patch @@ -1,4 +1,4 @@ -From 011f8d6f3dc4eab9b49a1a9729f0825a35f2b2a4 Mon Sep 17 00:00:00 2001 +From dc45760127f4d33da97e363e0c74d48fa9e3baa5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 12 Aug 2018 02:33:39 -0400 Subject: [PATCH] Use a Queue for Queueing Commands @@ -6,21 +6,21 @@ Subject: [PATCH] Use a Queue for Queueing Commands Lists are bad as Queues mmmkay. diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 3dc7e2a89..5fb914f54 100644 +index 1b3ca24d9..2c79c5333 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -39,7 +39,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer private static final Logger LOGGER = LogManager.getLogger(); private static final Pattern h = Pattern.compile("^[a-fA-F0-9]{40}$"); -- private final List serverCommandQueue = Collections.synchronizedList(Lists.newArrayList()); // CraftBukkit - fix decompile error -+ private final java.util.Queue serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue<>(); // Paper - use a proper queue +- private final List serverCommandQueue = Collections.synchronizedList(Lists.newArrayList()); ++ private final java.util.Queue serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue(); // Paper - use a proper queue private RemoteStatusListener j; public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this); private RemoteControlListener l; @@ -468,8 +468,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - public void aU() { + public void handleCommandQueue() { MinecraftTimings.serverCommandTimer.startTiming(); // Spigot - while (!this.serverCommandQueue.isEmpty()) { - ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); diff --git a/Spigot-Server-Patches/0331-Send-nearby-packets-from-world-player-list-not-serve.patch b/Spigot-Server-Patches/0331-Send-nearby-packets-from-world-player-list-not-serve.patch index 365247724..d781ee015 100644 --- a/Spigot-Server-Patches/0331-Send-nearby-packets-from-world-player-list-not-serve.patch +++ b/Spigot-Server-Patches/0331-Send-nearby-packets-from-world-player-list-not-serve.patch @@ -1,11 +1,11 @@ -From ae03b8f1c592a7ede7a1fd3f36ccc0f922635bcd Mon Sep 17 00:00:00 2001 +From d6c60139c223c8e820175315c42194e44755aff6 Mon Sep 17 00:00:00 2001 From: Mystiflow Date: Fri, 6 Jul 2018 13:21:30 +0100 Subject: [PATCH] Send nearby packets from world player list not server list diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index e6ee5042c..a3794b5c6 100644 +index 6311c9f87..50c91d12c 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1202,8 +1202,25 @@ public abstract class PlayerList { @@ -46,7 +46,7 @@ index e6ee5042c..a3794b5c6 100644 double d5 = d1 - entityplayer.locY; double d6 = d2 - entityplayer.locZ; diff --git a/src/main/java/net/minecraft/server/WorldManager.java b/src/main/java/net/minecraft/server/WorldManager.java -index e26405d34..23f390c22 100644 +index b4225b58e..0ba0eb661 100644 --- a/src/main/java/net/minecraft/server/WorldManager.java +++ b/src/main/java/net/minecraft/server/WorldManager.java @@ -35,8 +35,8 @@ public class WorldManager implements IWorldAccess { @@ -95,10 +95,10 @@ index e26405d34..23f390c22 100644 if (entityplayer != null && entityplayer.world == this.world && entityplayer.getId() != i) { double d0 = (double) blockposition.getX() - entityplayer.locX; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0545336b4..bab0c0e0f 100644 +index 10630ac96..b355c3f53 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1087,7 +1087,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1088,7 +1088,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } // CraftBukkit end if (super.strikeLightning(entity)) { @@ -107,7 +107,7 @@ index 0545336b4..bab0c0e0f 100644 return true; } else { return false; -@@ -1147,8 +1147,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1148,8 +1148,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { BlockActionData blockactiondata = (BlockActionData) this.d.removeFirst(); if (this.a(blockactiondata)) { @@ -119,7 +119,7 @@ index 0545336b4..bab0c0e0f 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 2acd8a4b3..4237e5e3c 100644 +index 20fb157fa..e61dc2c26 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1621,7 +1621,7 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0332-Cache-World-Entity-Type-counts.patch b/Spigot-Server-Patches/0332-Cache-World-Entity-Type-counts.patch index e5e4bb21d..749ca82dd 100644 --- a/Spigot-Server-Patches/0332-Cache-World-Entity-Type-counts.patch +++ b/Spigot-Server-Patches/0332-Cache-World-Entity-Type-counts.patch @@ -1,4 +1,4 @@ -From be64c5365e10e2f876dde3700ae8f637022bf5a9 Mon Sep 17 00:00:00 2001 +From a329f9c94e70c3ec8bd7d30e6366fcb70cf6ad29 Mon Sep 17 00:00:00 2001 From: Colin Godsey Date: Wed, 8 Aug 2018 10:10:06 -0600 Subject: [PATCH] Cache World Entity Type counts @@ -133,7 +133,7 @@ index 000000000..a10a5bc13 + } +} diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b284524be..80d384dfe 100644 +index e9543c06c..c083b2dd3 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -124,6 +124,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -171,7 +171,7 @@ index 72cd9ba58..35205561b 100644 if (l1 <= k) { BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 72e74c59f..e8891d078 100644 +index bd6f64e52..67a903a62 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -50,7 +50,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -201,7 +201,7 @@ index 72e74c59f..e8891d078 100644 public static boolean haveWeSilencedAPhysicsCrash; public static String blockLocation; private org.spigotmc.TickLimiter entityLimiter; -@@ -1188,6 +1190,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1122,6 +1124,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.getChunkAt(i, j).b(entity); } entity.shouldBeRemoved = true; // Paper diff --git a/Spigot-Server-Patches/0334-Optimize-Hoppers.patch b/Spigot-Server-Patches/0334-Optimize-Hoppers.patch index 35a327afe..858dea5d0 100644 --- a/Spigot-Server-Patches/0334-Optimize-Hoppers.patch +++ b/Spigot-Server-Patches/0334-Optimize-Hoppers.patch @@ -1,4 +1,4 @@ -From 67b546a9be501634109a7f3caca372e306466951 Mon Sep 17 00:00:00 2001 +From 705f90c7c280551734be5b98060ccac275b8ad1e Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 27 Apr 2016 22:09:52 -0400 Subject: [PATCH] Optimize Hoppers @@ -31,7 +31,7 @@ index 10efe6b3d..6feea98b6 100644 private void disableSprintInterruptionOnAttack() { disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 36c8644e2..eea6d9419 100644 +index 7afcac499..cf1ca505f 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -459,8 +459,9 @@ public final class ItemStack { @@ -47,7 +47,7 @@ index 36c8644e2..eea6d9419 100644 itemstack.d(this.B()); if (this.tag != null) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ca72e6ad1..49a06f395 100644 +index 928dbf032..aaefb98c0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1050,7 +1050,8 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -57,7 +57,7 @@ index ca72e6ad1..49a06f395 100644 - WorldServer worldserver = (WorldServer) iterator.next(); + WorldServer worldserver = (WorldServer) iterator.next(); + TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - i = SystemUtils.c(); + i = SystemUtils.getMonotonicNanos(); if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit this.methodProfiler.a(() -> { diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java @@ -81,7 +81,7 @@ index 29fe031d8..d67fd92d9 100644 this.world.b(this.position, this); if (!this.f.isAir()) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index 4bb650fa3..cdc576058 100644 +index 15e4a37fb..5291c1836 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -190,6 +190,154 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi diff --git a/Spigot-Server-Patches/0339-Anti-Xray.patch b/Spigot-Server-Patches/0339-Anti-Xray.patch index 97b8b05e3..a15f5dc40 100644 --- a/Spigot-Server-Patches/0339-Anti-Xray.patch +++ b/Spigot-Server-Patches/0339-Anti-Xray.patch @@ -1,4 +1,4 @@ -From ddbf245c3681e18daf8334ae47737991977435df Mon Sep 17 00:00:00 2001 +From 07ee56ca64a98224dc9b972ba71fd113a7964298 Mon Sep 17 00:00:00 2001 From: stonar96 Date: Mon, 20 Aug 2018 03:03:58 +0200 Subject: [PATCH] Anti-Xray @@ -1049,10 +1049,10 @@ index 000000000..37093419c + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 836aea6c3..44d59d253 100644 +index 57e35564a..890715ff8 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -535,7 +535,7 @@ public class Chunk implements IChunkAccess { +@@ -540,7 +540,7 @@ public class Chunk implements IChunkAccess { return null; } @@ -1061,7 +1061,7 @@ index 836aea6c3..44d59d253 100644 this.sections[j >> 4] = chunksection; flag1 = j >= l; } -@@ -635,7 +635,7 @@ public class Chunk implements IChunkAccess { +@@ -640,7 +640,7 @@ public class Chunk implements IChunkAccess { return; } @@ -1071,7 +1071,7 @@ index 836aea6c3..44d59d253 100644 this.initLighting(); } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index f734b85e0..26a3f28cb 100644 +index 41a7103ef..c12db3cfa 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -859,7 +859,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -1271,7 +1271,7 @@ index 6e7454b13..71a3636be 100644 int jx = along.length * 64 / 4096; if (this.h == this.b) { diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index f8facddb4..b2afec5e4 100644 +index e75b1a76e..e5cc77c6d 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -158,8 +158,8 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -1296,15 +1296,15 @@ index f8facddb4..b2afec5e4 100644 + private boolean o() { // void -> boolean if (this.channel != null && this.channel.isOpen()) { - this.j.readLock().lock(); -+ if (this.i.isEmpty()) { // return if the packet queue is empty so that the write lock by Anti-Xray doesn't affect the vanilla performance at all ++ if (this.packetQueue.isEmpty()) { // return if the packet queue is empty so that the write lock by Anti-Xray doesn't affect the vanilla performance at all + return true; + } + + this.j.writeLock().lock(); // readLock -> writeLock (because of race condition between peek and poll) try { - while (!this.i.isEmpty()) { -- NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.i.poll(); + while (!this.packetQueue.isEmpty()) { +- NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.packetQueue.poll(); - - this.b(networkmanager_queuedpacket.a, networkmanager_queuedpacket.b); + NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.getPacketQueue().peek(); // poll -> peek @@ -1418,10 +1418,10 @@ index 22a262bb6..40ec398ee 100644 if (flag) { packetdataserializer.writeBytes(chunksection.getSkyLightArray().asBytes()); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 4383abccd..068d203c8 100644 +index db43a8a9a..b58683e6f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -118,6 +118,8 @@ public class PlayerChunk { +@@ -100,6 +100,8 @@ public class PlayerChunk { return false; } else if (!this.chunk.isReady()) { return false; @@ -1430,24 +1430,24 @@ index 4383abccd..068d203c8 100644 } else { this.dirtyCount = 0; this.h = 0; -@@ -140,6 +142,7 @@ public class PlayerChunk { +@@ -119,6 +121,7 @@ public class PlayerChunk { public void sendChunk(EntityPlayer entityplayer) { if (this.done) { + this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, '\uffff', true); // Paper - Anti-Xray - Load nearby chunks if necessary - entityplayer.playerConnection.sendPacket(new PacketPlayOutMapChunk(this.chunk, '\uffff')); + entityplayer.playerConnection.sendPacket(new PacketPlayOutMapChunk(this.chunk, 65535)); this.playerChunkMap.getWorld().getTracker().a(entityplayer, this.chunk); } -@@ -204,6 +207,9 @@ public class PlayerChunk { +@@ -177,6 +180,9 @@ public class PlayerChunk { this.a(this.playerChunkMap.getWorld().getTileEntity(blockposition)); } } else if (this.dirtyCount == 64) { + // Paper - Anti-Xray - Loading chunks here could cause a ConcurrentModificationException #1104 + // Paper - Anti-Xray - TODO: Check if this is still the case for 1.13 + //this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, this.h, true); // Paper - Anti-Xray - Load nearby chunks if necessary - this.a((Packet) (new PacketPlayOutMapChunk(this.chunk, this.h))); + this.a(new PacketPlayOutMapChunk(this.chunk, this.h)); } else { - this.a((Packet) (new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, this.chunk))); + this.a(new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, this.chunk)); diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java index 23223e89d..23fc4d8e1 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -1462,7 +1462,7 @@ index 23223e89d..23fc4d8e1 100644 public void a(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index b88d41d67..025160679 100644 +index faaad0f41..9fd966dfb 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -40,12 +40,24 @@ public class ProtoChunk implements IChunkAccess { @@ -1510,7 +1510,7 @@ index b88d41d67..025160679 100644 if (enumskyblock == EnumSkyBlock.SKY) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 0d401bf1d..de591d912 100644 +index 780c0a7e8..67b20c056 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1,6 +1,8 @@ diff --git a/Spigot-Server-Patches/0340-Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/0340-Configurable-speed-for-water-flowing-over-lava.patch index a88502457..9174b4808 100644 --- a/Spigot-Server-Patches/0340-Configurable-speed-for-water-flowing-over-lava.patch +++ b/Spigot-Server-Patches/0340-Configurable-speed-for-water-flowing-over-lava.patch @@ -1,4 +1,4 @@ -From 8790643aad0bcc298befe7e6d4dd20e0cd350550 Mon Sep 17 00:00:00 2001 +From cdce634bc0876103132df5788b9d09960f316e78 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 8 Aug 2018 16:33:21 -0600 Subject: [PATCH] Configurable speed for water flowing over lava @@ -22,15 +22,15 @@ index 2220a18d9..94c544714 100644 SAFE_REGEN, DELETE, NOTHING, WARN } diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java -index 56f26da41..ddf2fc67e 100644 +index 80a49900e..f0d5316b6 100644 --- a/src/main/java/net/minecraft/server/BlockFluids.java +++ b/src/main/java/net/minecraft/server/BlockFluids.java @@ -78,11 +78,27 @@ public class BlockFluids extends Block implements IFluidSource { public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1) { if (this.a(world, blockposition, iblockdata)) { -- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); -+ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper +- world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); ++ world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper } } @@ -53,13 +53,13 @@ index 56f26da41..ddf2fc67e 100644 + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { if (iblockdata.s().d() || iblockdata1.s().d()) { - generatoraccess.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess)); + generatoraccess.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess)); @@ -93,7 +109,7 @@ public class BlockFluids extends Block implements IFluidSource { public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (this.a(world, blockposition, iblockdata)) { -- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); -+ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper +- world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); ++ world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper } } diff --git a/Spigot-Server-Patches/0342-Add-PhantomPreSpawnEvent.patch b/Spigot-Server-Patches/0342-Add-PhantomPreSpawnEvent.patch index d498373a3..20ce229b4 100644 --- a/Spigot-Server-Patches/0342-Add-PhantomPreSpawnEvent.patch +++ b/Spigot-Server-Patches/0342-Add-PhantomPreSpawnEvent.patch @@ -1,14 +1,14 @@ -From 804faee018140f31944962c6ce2def0b7d022217 Mon Sep 17 00:00:00 2001 +From 098c9c8a1cdf3c068ef8b0d531424ea86cf75396 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 25 Aug 2018 19:56:51 -0500 Subject: [PATCH] Add PhantomPreSpawnEvent diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index 3c5785733..8332d5cc8 100644 +index 60cb6f583..7a48719c9 100644 --- a/src/main/java/net/minecraft/server/EntityPhantom.java +++ b/src/main/java/net/minecraft/server/EntityPhantom.java -@@ -128,6 +128,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -129,6 +129,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { } this.setSize(nbttagcompound.getInt("Size")); @@ -20,7 +20,7 @@ index 3c5785733..8332d5cc8 100644 } public void b(NBTTagCompound nbttagcompound) { -@@ -136,6 +141,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -137,6 +142,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { nbttagcompound.setInt("AY", this.c.getY()); nbttagcompound.setInt("AZ", this.c.getZ()); nbttagcompound.setInt("Size", this.getSize()); @@ -32,7 +32,7 @@ index 3c5785733..8332d5cc8 100644 } public SoundCategory bV() { -@@ -171,6 +181,14 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -172,6 +182,14 @@ public class EntityPhantom extends EntityFlying implements IMonster { return true; } diff --git a/Spigot-Server-Patches/0346-Optimize-getChunkIfLoaded-type-calls.patch b/Spigot-Server-Patches/0346-Optimize-getChunkIfLoaded-type-calls.patch index db64f853d..677042d5d 100644 --- a/Spigot-Server-Patches/0346-Optimize-getChunkIfLoaded-type-calls.patch +++ b/Spigot-Server-Patches/0346-Optimize-getChunkIfLoaded-type-calls.patch @@ -1,4 +1,4 @@ -From a65b2191f811de67e4135aab6277ab1bf7c0edc7 Mon Sep 17 00:00:00 2001 +From 541d969c8eddf2af96f71344d64bbc79044b3cf3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 29 Aug 2018 21:59:22 -0400 Subject: [PATCH] Optimize getChunkIfLoaded type calls @@ -10,7 +10,7 @@ Will improve inlining across many hot methods. Improve getBrightness to not do double chunk map lookups. diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 3854464e8..dcc6e9762 100644 +index 5462962c0..b9f8a86aa 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -380,7 +380,7 @@ public class ChunkProviderServer implements IChunkProvider { @@ -23,7 +23,7 @@ index 3854464e8..dcc6e9762 100644 neighbor.setNeighborUnloaded(-x, -z); chunk.setNeighborUnloaded(x, z); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index de591d912..5fe4734e3 100644 +index 67b20c056..b1c181a50 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -166,7 +166,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -45,7 +45,7 @@ index de591d912..5fe4734e3 100644 } public void a(EnumSkyBlock enumskyblock, BlockPosition blockposition, int i) { -@@ -2031,7 +2032,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1965,7 +1966,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (blockposition.isInvalidYLocation()) { // Paper return false; } else { @@ -55,23 +55,23 @@ index de591d912..5fe4734e3 100644 return chunk != null && !chunk.isEmpty(); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index d5936eb19..4b8b66352 100644 +index d42827d87..91404cc5a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -217,7 +217,7 @@ public class CraftWorld implements World { return false; } -- net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z, false, false); +- net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false, false); + net.minecraft.server.Chunk chunk = world.getChunkIfLoaded(x, z); // Paper - optimize ifLaoded if (chunk != null) { - world.getChunkProviderServer().unload(chunk); + world.getChunkProvider().unload(chunk); } @@ -236,7 +236,7 @@ public class CraftWorld implements World { private boolean unloadChunk0(int x, int z, boolean save) { Boolean result = MCUtil.ensureMain("Unload Chunk", () -> { // Paper - Ensure never async -- net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z, false, false); +- net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false, false); + net.minecraft.server.Chunk chunk = world.getChunkIfLoaded(x, z); // Paper - optimize ifLoaded if (chunk == null) { return true; diff --git a/Spigot-Server-Patches/0349-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/Spigot-Server-Patches/0349-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch index 080eeb71b..51a1a42a2 100644 --- a/Spigot-Server-Patches/0349-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch +++ b/Spigot-Server-Patches/0349-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch @@ -1,4 +1,4 @@ -From 05bfada94ff2d7a9b2468669575eb8cb1324e9fc Mon Sep 17 00:00:00 2001 +From c0ad8f019795210006f83af5d1f3c74791775fb6 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 2 Sep 2018 19:34:33 -0700 Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted @@ -6,15 +6,15 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4b8b66352..7e6a7b0e9 100644 +index 91404cc5a..5552b64fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -295,7 +295,7 @@ public class CraftWorld implements World { public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp( "chunk load"); // Spigot chunkLoadCount++; -- return world.getChunkProviderServer().getChunkAt(x, z, true, generate) != null; -+ return world.getChunkProviderServer().getChunkAt(x, z, true, generate || isChunkGenerated(x, z)) != null; // Paper +- return world.getChunkProvider().getChunkAt(x, z, true, generate) != null; ++ return world.getChunkProvider().getChunkAt(x, z, true, generate || isChunkGenerated(x, z)) != null; // Paper } public boolean isChunkLoaded(Chunk chunk) { diff --git a/Spigot-Server-Patches/0352-MC-2025-Save-and-load-entity-AABB-to-prevent-wobble.patch b/Spigot-Server-Patches/0352-MC-2025-Save-and-load-entity-AABB-to-prevent-wobble.patch index a2820e64f..0bf6408fe 100644 --- a/Spigot-Server-Patches/0352-MC-2025-Save-and-load-entity-AABB-to-prevent-wobble.patch +++ b/Spigot-Server-Patches/0352-MC-2025-Save-and-load-entity-AABB-to-prevent-wobble.patch @@ -1,4 +1,4 @@ -From ebf59a4f1ec27da1e3bc0ce92be22070045778b9 Mon Sep 17 00:00:00 2001 +From abf5f03149f8ea5ee8be57f03f1f7244ca23cc36 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 4 Sep 2018 19:07:57 -0400 Subject: [PATCH] MC-2025: Save and load entity AABB to prevent wobble @@ -46,7 +46,7 @@ index bf538684a..19819b134 100644 public AxisAlignedBB(double d0, double d1, double d2, double d3, double d4, double d5) { this.minX = Math.min(d0, d3); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 80d384dfe..da0e9b0a3 100644 +index c083b2dd3..67ea54987 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1659,6 +1659,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -79,7 +79,7 @@ index 80d384dfe..da0e9b0a3 100644 // CraftBukkit start if (this instanceof EntityLiving) { -@@ -2817,6 +2833,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2816,6 +2832,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.boundingBox; } diff --git a/Spigot-Server-Patches/0353-Improve-death-events.patch b/Spigot-Server-Patches/0353-Improve-death-events.patch index b6afa732f..a943852c8 100644 --- a/Spigot-Server-Patches/0353-Improve-death-events.patch +++ b/Spigot-Server-Patches/0353-Improve-death-events.patch @@ -1,4 +1,4 @@ -From 96a7cd354c1a98e255bc42cb30ed417744295115 Mon Sep 17 00:00:00 2001 +From a0af07c2443bbee969d899a4c31cff5d1ae6a097 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Tue, 21 Aug 2018 01:39:35 +0100 Subject: [PATCH] Improve death events @@ -27,7 +27,7 @@ index 9a74601b0..6e60d15cc 100644 int i = this.f ? 300 : 100; if (this.g && (!this.b.isAlive() || this.b.ticksLived - this.c > i)) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index da0e9b0a3..ab8490ff9 100644 +index 67ea54987..7fc56cadc 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1539,6 +1539,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -38,7 +38,7 @@ index da0e9b0a3..ab8490ff9 100644 public void a(Entity entity, int i, DamageSource damagesource) { if (entity instanceof EntityPlayer) { CriterionTriggers.c.a((EntityPlayer) entity, this, damagesource); -@@ -2408,6 +2409,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2407,6 +2408,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.fallDistance = 0.0F; } @@ -46,7 +46,7 @@ index da0e9b0a3..ab8490ff9 100644 public void b(EntityLiving entityliving) {} protected boolean i(double d0, double d1, double d2) { -@@ -3073,6 +3075,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3072,6 +3074,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return EnumPistonReaction.NORMAL; } @@ -69,15 +69,15 @@ index c5bddb1da..0a9666541 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 5ea5d4b78..46a4e37a2 100644 +index 3ef68fec7..716f0e67f 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -76,14 +76,14 @@ public abstract class EntityLiving extends Entity { public float aU; public EntityHuman killer; public int lastDamageByPlayerTime; // Paper - public -- protected boolean aX; -+ protected boolean aX; protected void setDying(boolean dying) { this.aX = dying; } protected boolean isDying() { return this.aX; } // Paper - OBFHELPER +- protected boolean killed; ++ protected boolean killed; protected void setDying(boolean dying) { this.killed = dying; } protected boolean isDying() { return this.killed; } // Paper - OBFHELPER protected int ticksFarFromPlayer; protected float aZ; protected float ba; @@ -138,9 +138,8 @@ index 5ea5d4b78..46a4e37a2 100644 + // entity.b(this); + //} -- this.aX = true; + this.killed = true; - this.getCombatTracker().g(); -+ this.aX = true; // Paper - Always set at start, unset later if cancelled - GH-1432 + //this.getCombatTracker().g(); + + org.bukkit.event.entity.EntityDeathEvent deathEvent = null; @@ -207,7 +206,7 @@ index 5ea5d4b78..46a4e37a2 100644 return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 6933d8876..d429e552e 100644 +index bf842a0a9..b5d48e7bf 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -75,6 +75,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -306,10 +305,10 @@ index 8be0a47ba..f56ef6f71 100644 public void injectScaledMaxHealth(Collection collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index cd6ae3b8e..4a0a456a0 100644 +index c6cd2f3be..f87d2bed7 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -508,9 +508,16 @@ public class CraftEventFactory { +@@ -582,9 +582,16 @@ public class CraftEventFactory { public static EntityDeathEvent callEntityDeathEvent(EntityLiving victim, List drops) { CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity(); EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward()); @@ -326,7 +325,7 @@ index cd6ae3b8e..4a0a456a0 100644 victim.expToDrop = event.getDroppedExp(); for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { -@@ -526,8 +533,15 @@ public class CraftEventFactory { +@@ -600,8 +607,15 @@ public class CraftEventFactory { CraftPlayer entity = victim.getBukkitEntity(); PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage); event.setKeepInventory(keepInventory); @@ -342,7 +341,7 @@ index cd6ae3b8e..4a0a456a0 100644 victim.keepLevel = event.getKeepLevel(); victim.newLevel = event.getNewLevel(); -@@ -548,6 +562,31 @@ public class CraftEventFactory { +@@ -622,6 +636,31 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0361-Optimize-and-Fix-ExpiringMap-Issues.patch b/Spigot-Server-Patches/0361-Optimize-and-Fix-ExpiringMap-Issues.patch index 9a21dc642..a1545e670 100644 --- a/Spigot-Server-Patches/0361-Optimize-and-Fix-ExpiringMap-Issues.patch +++ b/Spigot-Server-Patches/0361-Optimize-and-Fix-ExpiringMap-Issues.patch @@ -1,4 +1,4 @@ -From 22c997ec6fc5edb318f4522db1d5edd32cda4262 Mon Sep 17 00:00:00 2001 +From 55b59db2a3d24f7f3c8990389b6282f01cbe0a7c Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 16 Sep 2018 00:00:16 -0400 Subject: [PATCH] Optimize and Fix ExpiringMap Issues @@ -14,7 +14,7 @@ manipulation, and instead to run clean once per tick per active expiring map. diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -index c8c1444e8..6723343b8 100644 +index 39a548881..37ea37de5 100644 --- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java @@ -143,13 +143,13 @@ public abstract class ChunkGeneratorAbstract implem @@ -34,17 +34,17 @@ index c8c1444e8..6723343b8 100644 } diff --git a/src/main/java/net/minecraft/server/ExpiringMap.java b/src/main/java/net/minecraft/server/ExpiringMap.java -index ae5a2077e..795e73542 100644 +index 9c0518d67..84a6dcb40 100644 --- a/src/main/java/net/minecraft/server/ExpiringMap.java +++ b/src/main/java/net/minecraft/server/ExpiringMap.java -@@ -2,94 +2,200 @@ package net.minecraft.server; +@@ -2,94 +2,201 @@ package net.minecraft.server; import it.unimi.dsi.fastutil.longs.Long2LongLinkedOpenHashMap; import it.unimi.dsi.fastutil.longs.Long2LongMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectMaps; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; -import it.unimi.dsi.fastutil.longs.Long2LongMap.Entry; --import it.unimi.dsi.fastutil.objects.ObjectCollection; + import it.unimi.dsi.fastutil.objects.ObjectCollection; import it.unimi.dsi.fastutil.objects.ObjectIterator; import java.util.Map; +import java.util.function.BiFunction; @@ -68,7 +68,7 @@ index ae5a2077e..795e73542 100644 + // Paper start + private void setAccess(long i) { a(i); } // Paper - OBFHELPER private void a(long i) { -- long j = SystemUtils.b(); +- long j = SystemUtils.getMonotonicMillis(); + synchronized (this.sync) { + long j = System.currentTimeMillis(); // Paper + this.ttl.put(i, j); @@ -89,7 +89,7 @@ index ae5a2077e..795e73542 100644 } - public void cleanup() { -- long j = SystemUtils.b(); +- long j = SystemUtils.getMonotonicMillis(); - ObjectIterator objectiterator = this.b.long2LongEntrySet().iterator(); // CraftBukkit - decompile error + @Override + public T putIfAbsent(long l, T t) { @@ -275,7 +275,7 @@ index ae5a2077e..795e73542 100644 - // CraftBukkit start - @Override - public T computeIfAbsent(long l, LongFunction lf) { -- this.b.put(l, SystemUtils.b()); +- this.b.put(l, SystemUtils.getMonotonicMillis()); - return super.computeIfAbsent(l, lf); - } - @@ -287,7 +287,7 @@ index ae5a2077e..795e73542 100644 - // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 49a06f395..9b2703fd2 100644 +index aaefb98c0..0bc1c887a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -155,6 +155,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -299,7 +299,7 @@ index 49a06f395..9b2703fd2 100644 // Spigot start public static final int TPS = 20; @@ -999,6 +1000,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.methodProfiler.e(); + this.methodProfiler.exit(); org.spigotmc.WatchdogThread.tick(); // Spigot PaperLightingQueue.processQueue(startTime); // Paper + expiringMaps.removeIf(ExpiringMap::clean); // Paper @@ -307,7 +307,7 @@ index 49a06f395..9b2703fd2 100644 co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index 9c2adb235..04e29f58c 100644 +index 4cca65666..9c917370a 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -144,7 +144,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator Date: Mon, 17 Sep 2018 23:37:31 -0400 Subject: [PATCH] Optimize Server World Map @@ -217,7 +217,7 @@ index 000000000..af9e4455c + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ef49fc258..c73a61d94 100644 +index 175198818..63b5cdd41 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -87,7 +87,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -226,7 +226,7 @@ index ef49fc258..c73a61d94 100644 private int q = -1; - public final Map worldServer = Maps.newIdentityHashMap(); + public final Map worldServer = new com.destroystokyo.paper.PaperWorldMap(); // Paper - private PlayerList s; + private PlayerList playerList; private boolean isRunning = true; private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart @@ -550,7 +550,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati diff --git a/Spigot-Server-Patches/0369-Async-Chunk-Loading-and-Generation.patch b/Spigot-Server-Patches/0369-Async-Chunk-Loading-and-Generation.patch index 79ec4cb6d..5a0824706 100644 --- a/Spigot-Server-Patches/0369-Async-Chunk-Loading-and-Generation.patch +++ b/Spigot-Server-Patches/0369-Async-Chunk-Loading-and-Generation.patch @@ -1,4 +1,4 @@ -From d36d1367dd5f8207585ac03adcb92d936482125c Mon Sep 17 00:00:00 2001 +From 21be7e16c4e783411306ef1992f7b39a1f13e04d Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 16:55:04 -0400 Subject: [PATCH] Async Chunk Loading and Generation @@ -458,10 +458,10 @@ index 000000000..8f18c2869 + +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 44d59d253..0bd975b6d 100644 +index 890715ff8..654cf763b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -184,6 +184,7 @@ public class Chunk implements IChunkAccess { +@@ -189,6 +189,7 @@ public class Chunk implements IChunkAccess { for (k = 0; k < this.sections.length; ++k) { this.sections[k] = protochunk.getSections()[k]; @@ -470,13 +470,13 @@ index 44d59d253..0bd975b6d 100644 Iterator iterator = protochunk.s().iterator(); diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index e14ae2b42..1662e4eba 100644 +index 2021c0d02..154ab09e0 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -14,9 +14,17 @@ public class ChunkMap extends Long2ObjectOpenHashMap { } - public Chunk a(long i, Chunk chunk) { + public Chunk put(long i, Chunk chunk) { + org.spigotmc.AsyncCatcher.catchOp("Async Chunk put"); // Paper chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper lastChunkByPos = chunk; // Paper @@ -507,12 +507,12 @@ index e14ae2b42..1662e4eba 100644 @@ -64,11 +76,19 @@ public class ChunkMap extends Long2ObjectOpenHashMap { } - public Chunk a(Long olong, Chunk chunk) { -- return this.a(olong, chunk); -+ return MCUtil.ensureMain("Chunk Put", () -> this.a(olong.longValue(), chunk)); // Paper + public Chunk put(Long olong, Chunk chunk) { +- return this.put(olong, chunk); ++ return MCUtil.ensureMain("Chunk Put", () -> this.put(olong.longValue(), chunk)); // Paper } - public Chunk a(long i) { + public Chunk remove(long i) { - Chunk chunk = (Chunk) super.remove(i); + // Paper start + org.spigotmc.AsyncCatcher.catchOp("Async Chunk remove"); @@ -555,28 +555,14 @@ index e14ae2b42..1662e4eba 100644 } // Paper end - public Chunk a(Object object) { -- return this.a((Long) object); -+ return MCUtil.ensureMain("Chunk Remove", () -> this.a(((Long) object).longValue())); // Paper + public Chunk remove(Object object) { +- return this.remove((Long) object); ++ return MCUtil.ensureMain("Chunk Remove", () -> this.remove(((Long) object).longValue())); // Paper } public void putAll(Map map) { -@@ -114,11 +142,11 @@ public class ChunkMap extends Long2ObjectOpenHashMap { - - // CraftBukkit start - decompile errors - public Chunk remove(long i) { -- return this.a(i); -+ return MCUtil.ensureMain("Chunk Remove", () -> this.a(i)); // Paper - } - - public Chunk put(long i, Chunk object) { -- return this.a(i, (Chunk) object); -+ return MCUtil.ensureMain("Chunk Put", () -> this.a(i, (Chunk) object)); // Paper - } - - public Chunk remove(Object object) { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index dcc6e9762..87a1bddd0 100644 +index b9f8a86aa..4fe173cfb 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -35,12 +35,12 @@ public class ChunkProviderServer implements IChunkProvider { @@ -726,7 +712,7 @@ index dcc6e9762..87a1bddd0 100644 } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 26a3f28cb..5ce57a6d4 100644 +index c12db3cfa..6cacacb0b 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -120,7 +120,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -944,7 +930,7 @@ index 271dc41d4..bd15534c2 100644 private final MinecraftServer d; private final java.nio.file.Path e; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 522af3d53..ee878191a 100644 +index ef5a21505..93171edb4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -209,7 +209,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -982,7 +968,7 @@ index 49fba0979..9ad646f8d 100644 fx = fx % 360.0F; if (fx >= 180.0F) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c73a61d94..17ae26cb8 100644 +index 63b5cdd41..32aee07d1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -503,6 +503,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -998,7 +984,7 @@ index c73a61d94..17ae26cb8 100644 BlockPosition blockposition = worldserver.getSpawn(); - ArrayList arraylist = Lists.newArrayList(); -+ List arraylist = worldserver.getChunkProviderServer().getSpiralOutChunks(blockposition, worldserver.paperConfig.keepLoadedRange >> 4); // Paper ++ List arraylist = worldserver.getChunkProvider().getSpiralOutChunks(blockposition, worldserver.paperConfig.keepLoadedRange >> 4); // Paper Set set = Sets.newConcurrentHashSet(); - // Paper start @@ -1014,8 +1000,8 @@ index c73a61d94..17ae26cb8 100644 int expected = arraylist.size(); // Paper -- CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> { -+ CompletableFuture completablefuture = worldserver.getChunkProviderServer().loadAllChunks(arraylist, (chunk) -> { // Paper +- CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> { ++ CompletableFuture completablefuture = worldserver.getChunkProvider().loadAllChunks((Iterable) arraylist, (chunk) -> { // Paper set.add(chunk.getPos()); - if (set.size() < expected && set.size() % 25 == 0) this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper + if (waitForChunks && (set.size() == expected || (set.size() < expected && set.size() % (set.size() / 10) == 0))) { @@ -1061,14 +1047,14 @@ index c73a61d94..17ae26cb8 100644 + PaperAsyncChunkProvider.processMainThreadQueue(this); // Paper MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper - this.methodProfiler.c("commandFunctions"); + this.methodProfiler.exitEnter("commandFunctions"); @@ -1053,6 +1052,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // CraftBukkit - dropTickTime for (Iterator iterator = this.getWorlds().iterator(); iterator.hasNext();) { WorldServer worldserver = (WorldServer) iterator.next(); + PaperAsyncChunkProvider.processMainThreadQueue(worldserver); // Paper TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - i = SystemUtils.c(); + i = SystemUtils.getMonotonicNanos(); if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit diff --git a/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java b/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java new file mode 100644 @@ -1732,20 +1718,15 @@ index 000000000..e9a38f9d9 + +} diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 068d203c8..cbff0d946 100644 +index b58683e6f..e61538b3c 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -29,16 +29,59 @@ public class PlayerChunk { - // You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse - // All may seem good at first, but there's deeper issues if you play for a bit +@@ -20,19 +20,69 @@ public class PlayerChunk { + private long i; + private boolean done; boolean chunkExists; // Paper -- private boolean loadInProgress = false; -- private Runnable loadedRunnable = new Runnable() { -- public void run() { -- loadInProgress = false; -- PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true); -+ PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest; + // Paper start ++ PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest; + private java.util.function.Consumer chunkLoadedConsumer = chunk -> { + chunkRequest = null; + PlayerChunk pChunk = PlayerChunk.this; @@ -1766,18 +1747,17 @@ index 068d203c8..cbff0d946 100644 + } + + markedHigh = true; -+ playerChunkMap.getWorld().getChunkProviderServer().bumpPriority(location); ++ playerChunkMap.getWorld().getChunkProvider().bumpPriority(location); + if (chunkRequest == null) { + requestChunkIfNeeded(PlayerChunkMap.CAN_GEN_CHUNKS.test(player)); + } + } + private void requestChunkIfNeeded(boolean flag) { + if (chunkRequest == null) { -+ chunkRequest = this.playerChunkMap.getWorld().getChunkProviderServer().requestChunk(this.location.x, this.location.z, flag, markedHigh, chunkLoadedConsumer); ++ chunkRequest = this.playerChunkMap.getWorld().getChunkProvider().requestChunk(this.location.x, this.location.z, flag, markedHigh, chunkLoadedConsumer); + this.chunk = chunkRequest.getChunk(); // Paper) - markChunkUsed(); // Paper - delay chunk unloads - } -- }; ++ markChunkUsed(); // Paper - delay chunk unloads ++ } + } + private double getDistance(EntityPlayer player, int inFront) { + final float yaw = MathHelper.normalizeYaw(player.yaw); @@ -1791,8 +1771,20 @@ index 068d203c8..cbff0d946 100644 + final double z = location.z - ((int)Math.floor(blockZ) >> 4); + return Math.sqrt((x * x) + (z * z)); + } -+ // Paper end - // Paper start - delay chunk unloads + + public PlayerChunk(PlayerChunkMap playerchunkmap, int ix, int j) { + this.playerChunkMap = playerchunkmap; + this.location = new ChunkCoordIntPair(ix, j); + ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider(); + chunkproviderserver.a(ix, j); +- this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false); +- this.chunkExists = this.chunk != null || org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), ix, j); // Paper ++ this.chunk = chunkproviderserver.getChunkAt(ix, j, false, false); // Paper ++ this.chunkExists = this.chunk != null || chunkproviderserver.chunkGoingToExists(ix, j); // Paper + markChunkUsed(); // Paper - delay chunk unloads + } + + // Paper start private void markChunkUsed() { + if (!chunkHasPlayers && chunkRequest != null) { + chunkRequest.cancel(); @@ -1801,19 +1793,8 @@ index 068d203c8..cbff0d946 100644 if (chunk == null) { return; } -@@ -58,8 +101,8 @@ public class PlayerChunk { - ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProviderServer(); - - chunkproviderserver.a(i, j); -- this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); -- this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper -+ this.chunk = chunkproviderserver.getChunkAt(i, j, false, false); // Paper -+ this.chunkExists = this.chunk != null || chunkproviderserver.chunkGoingToExists(i, j); // Paper - markChunkUsed(); // Paper - delay chunk unloads - } - -@@ -80,7 +123,7 @@ public class PlayerChunk { - this.c.add(entityplayer); +@@ -62,7 +112,7 @@ public class PlayerChunk { + this.players.add(entityplayer); if (this.done) { this.sendChunk(entityplayer); - } @@ -1821,11 +1802,11 @@ index 068d203c8..cbff0d946 100644 } } -@@ -105,8 +148,9 @@ public class PlayerChunk { +@@ -87,8 +137,9 @@ public class PlayerChunk { if (this.chunk != null) { return true; } else { -- this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag); +- this.chunk = this.playerChunkMap.getWorld().getChunkProvider().getChunkAt(this.location.x, this.location.z, true, flag); - markChunkUsed(); // Paper - delay chunk unloads + // Paper start - async chunks + requestChunkIfNeeded(flag); @@ -1834,7 +1815,7 @@ index 068d203c8..cbff0d946 100644 } } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 39e5b2484..a92557fd2 100644 +index 27343174d..77b36ff89 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -27,10 +27,10 @@ public class PlayerChunkMap { @@ -1850,7 +1831,7 @@ index 39e5b2484..a92557fd2 100644 private final Set f = Sets.newHashSet(); private final List g = Lists.newLinkedList(); private final List h = Lists.newLinkedList(); -@@ -349,7 +349,13 @@ public class PlayerChunkMap { +@@ -345,7 +345,13 @@ public class PlayerChunkMap { if (playerchunk != null) { playerchunk.b(entityplayer); } @@ -1864,7 +1845,7 @@ index 39e5b2484..a92557fd2 100644 } } -@@ -360,7 +366,11 @@ public class PlayerChunkMap { +@@ -356,7 +362,11 @@ public class PlayerChunkMap { // CraftBukkit start - send nearest chunks first Collections.sort(chunksToLoad, new ChunkCoordComparator(entityplayer)); for (ChunkCoordIntPair pair : chunksToLoad) { @@ -1877,7 +1858,7 @@ index 39e5b2484..a92557fd2 100644 } // CraftBukkit end } -@@ -432,6 +442,15 @@ public class PlayerChunkMap { +@@ -428,6 +438,15 @@ public class PlayerChunkMap { } } } @@ -1894,7 +1875,7 @@ index 39e5b2484..a92557fd2 100644 private void e() { diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java -index 38f3afb48..ddd7b91a9 100644 +index d0b3e43c0..eb7f03898 100644 --- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java @@ -35,7 +35,7 @@ public class RegionLimitedWorldAccess implements GeneratorAccess { @@ -1962,7 +1943,7 @@ index d868149d1..0d45d933e 100644 } } diff --git a/src/main/java/net/minecraft/server/StructurePiece.java b/src/main/java/net/minecraft/server/StructurePiece.java -index d444eb30f..d8c96b5c3 100644 +index 510543db4..ce9e5d4e0 100644 --- a/src/main/java/net/minecraft/server/StructurePiece.java +++ b/src/main/java/net/minecraft/server/StructurePiece.java @@ -14,7 +14,7 @@ public abstract class StructurePiece { @@ -2038,7 +2019,7 @@ index 1926c902a..1117e4ae2 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index eabf50e24..f8afa6f72 100644 +index 72bb3f862..d736ac63d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -46,7 +46,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; @@ -2132,8 +2113,8 @@ index eabf50e24..f8afa6f72 100644 + } + // Paper end org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot - if (entity == null) return false; if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper + if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java index fa99fe014..4f49786aa 100644 --- a/src/main/java/net/minecraft/server/WorldGenStronghold.java @@ -2282,10 +2263,10 @@ index fa99fe014..4f49786aa 100644 } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index bab0c0e0f..af68074c1 100644 +index b355c3f53..27c8a97be 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -731,7 +731,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -732,7 +732,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { gen = new org.bukkit.craftbukkit.generator.NormalChunkGenerator(this, this.getSeed()); } @@ -2295,7 +2276,7 @@ index bab0c0e0f..af68074c1 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 07f6580fd..c79baa922 100644 +index a0f255ff1..eb4b3c7a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1019,8 +1019,12 @@ public final class CraftServer implements Server { @@ -2305,7 +2286,7 @@ index 07f6580fd..c79baa922 100644 - for (int j = -short1; j <= short1; j += 16) { - for (int k = -short1; k <= short1; k += 16) { + // Paper start -+ for (ChunkCoordIntPair coords : internal.getChunkProviderServer().getSpiralOutChunks(internal.getSpawn(), short1 >> 4)) {{ ++ for (ChunkCoordIntPair coords : internal.getChunkProvider().getSpiralOutChunks(internal.getSpawn(), short1 >> 4)) {{ + int j = coords.x; + int k = coords.z; + // Paper end @@ -2317,13 +2298,13 @@ index 07f6580fd..c79baa922 100644 } BlockPosition chunkcoordinates = internal.getSpawn(); -- internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true); -+ internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true, c -> {}); // Paper +- internal.getChunkProvider().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true); ++ internal.getChunkProvider().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true, c -> {}); // Paper } } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 7e6a7b0e9..ef5a7bc38 100644 +index 5552b64fb..c6d033928 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -162,6 +162,16 @@ public class CraftWorld implements World { @@ -2333,7 +2314,7 @@ index 7e6a7b0e9..ef5a7bc38 100644 + // Paper start - Async chunk load API + @Override + public java.util.concurrent.CompletableFuture getChunkAtAsync(final int x, final int z, final boolean gen) { -+ final ChunkProviderServer cps = this.world.getChunkProviderServer(); ++ final ChunkProviderServer cps = this.world.getChunkProvider(); + java.util.concurrent.CompletableFuture future = new java.util.concurrent.CompletableFuture<>(); + cps.getChunkAt(x, z, true, gen, chunk -> future.complete(chunk != null ? chunk.bukkitChunk : null)); + return future; @@ -2341,7 +2322,7 @@ index 7e6a7b0e9..ef5a7bc38 100644 + // Paper end + public Chunk getChunkAt(int x, int z) { - return this.world.getChunkProviderServer().getChunkAt(x, z, true, true).bukkitChunk; + return this.world.getChunkProvider().getChunkAt(x, z, true, true).bukkitChunk; } @@ -1457,10 +1467,13 @@ public class CraftWorld implements World { int chunkCoordZ = chunkcoordinates.getZ() >> 4; @@ -2350,7 +2331,7 @@ index 7e6a7b0e9..ef5a7bc38 100644 - for (int x = -radius; x <= radius; x++) { // Paper - for (int z = -radius; z <= radius; z++) { // Paper + // Paper start -+ for (ChunkCoordIntPair coords : world.getChunkProviderServer().getSpiralOutChunks(world.getSpawn(), radius)) {{ ++ for (ChunkCoordIntPair coords : world.getChunkProvider().getSpiralOutChunks(world.getSpawn(), radius)) {{ + int x = coords.x; + int z = coords.z; + // Paper end @@ -2361,7 +2342,7 @@ index 7e6a7b0e9..ef5a7bc38 100644 if (isChunkLoaded(chunkCoordX + x, chunkCoordZ + z)) { unloadChunk(chunkCoordX + x, chunkCoordZ + z); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 4a0a456a0..4068b8072 100644 +index f87d2bed7..603f43b7e 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -81,6 +81,7 @@ public class CraftEventFactory { @@ -2372,7 +2353,7 @@ index 4a0a456a0..4068b8072 100644 // helper methods private static boolean canBuild(CraftWorld world, Player player, int x, int z) { -@@ -382,6 +383,7 @@ public class CraftEventFactory { +@@ -456,6 +457,7 @@ public class CraftEventFactory { CraftServer craftServer = (CraftServer) entity.getServer(); CreatureSpawnEvent event = new CreatureSpawnEvent(entity, spawnReason); @@ -2380,7 +2361,7 @@ index 4a0a456a0..4068b8072 100644 craftServer.getPluginManager().callEvent(event); return event; } -@@ -1029,6 +1031,7 @@ public class CraftEventFactory { +@@ -1103,6 +1105,7 @@ public class CraftEventFactory { } BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(block.getX(), block.getY(), block.getZ()), cause, igniter); @@ -2388,7 +2369,7 @@ index 4a0a456a0..4068b8072 100644 world.getServer().getPluginManager().callEvent(event); return event; } -@@ -1053,6 +1056,7 @@ public class CraftEventFactory { +@@ -1127,6 +1130,7 @@ public class CraftEventFactory { } BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(pos.getX(), pos.getY(), pos.getZ()), cause, bukkitIgniter); @@ -2396,7 +2377,7 @@ index 4a0a456a0..4068b8072 100644 world.getServer().getPluginManager().callEvent(event); return event; } -@@ -1260,7 +1264,8 @@ public class CraftEventFactory { +@@ -1334,7 +1338,8 @@ public class CraftEventFactory { public static BlockPhysicsEvent callBlockPhysicsEvent(GeneratorAccess world, BlockPosition blockposition) { org.bukkit.block.Block block = CraftBlock.at(world, blockposition); BlockPhysicsEvent event = new BlockPhysicsEvent(block, block.getBlockData()); @@ -2406,7 +2387,7 @@ index 4a0a456a0..4068b8072 100644 return event; } -@@ -1296,6 +1301,7 @@ public class CraftEventFactory { +@@ -1370,6 +1375,7 @@ public class CraftEventFactory { } EntityPotionEffectEvent event = new EntityPotionEffectEvent((LivingEntity) entity.getBukkitEntity(), bukkitOldEffect, bukkitNewEffect, cause, action, willOverride); @@ -2414,7 +2395,7 @@ index 4a0a456a0..4068b8072 100644 Bukkit.getPluginManager().callEvent(event); return event; -@@ -1314,6 +1320,7 @@ public class CraftEventFactory { +@@ -1388,6 +1394,7 @@ public class CraftEventFactory { blockState.setData(block); BlockFormEvent event = (entity == null) ? new BlockFormEvent(blockState.getBlock(), blockState) : new EntityBlockFormEvent(entity.getBukkitEntity(), blockState.getBlock(), blockState); @@ -2423,7 +2404,7 @@ index 4a0a456a0..4068b8072 100644 if (!event.isCancelled()) { diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index 04e29f58c..5fae0c6ad 100644 +index 9c917370a..a299092a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -21,6 +21,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator Date: Fri, 28 Sep 2018 20:46:29 -0400 Subject: [PATCH] Optimize Light Recalculations @@ -14,10 +14,10 @@ Also optimizes to not repeatedly look up the same chunk for light lookups. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 0bd975b6d..603ad2393 100644 +index 654cf763b..516656f8f 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -347,7 +347,7 @@ public class Chunk implements IChunkAccess { +@@ -352,7 +352,7 @@ public class Chunk implements IChunkAccess { private void a(int i, int j, int k, int l) { if (l > k && this.areNeighborsLoaded(1)) { // Paper for (int i1 = k; i1 < l; ++i1) { @@ -26,7 +26,7 @@ index 0bd975b6d..603ad2393 100644 } this.x = true; -@@ -557,7 +557,7 @@ public class Chunk implements IChunkAccess { +@@ -562,7 +562,7 @@ public class Chunk implements IChunkAccess { } else { if (flag1) { this.initLighting(); @@ -36,7 +36,7 @@ index 0bd975b6d..603ad2393 100644 int i1 = iblockdata.b(this.world, blockposition); int j1 = iblockdata1.b(this.world, blockposition); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f8afa6f72..3c99ae7cd 100644 +index d736ac63d..4421be836 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -589,8 +589,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -51,7 +51,7 @@ index f8afa6f72..3c99ae7cd 100644 } } -@@ -2292,6 +2293,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2226,6 +2227,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) { // CraftBukkit start - Use neighbor cache instead of looking up Chunk chunk = this.getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); diff --git a/Spigot-Server-Patches/0372-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch b/Spigot-Server-Patches/0372-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch index a4f71cfb3..25a50091d 100644 --- a/Spigot-Server-Patches/0372-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch +++ b/Spigot-Server-Patches/0372-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch @@ -1,4 +1,4 @@ -From 0b05b7acbe1e2495df24a75b06ac6d07b26bbfe1 Mon Sep 17 00:00:00 2001 +From 4efe8ec5c1de9ba28e8321dc77c8f05b6924c3c0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 28 Sep 2018 21:49:53 -0400 Subject: [PATCH] Fix issues with entity loss due to unloaded chunks @@ -18,10 +18,10 @@ This change ensures the chunks are always loaded when entities are added to the world, or a valid entity moves between chunks. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 3c99ae7cd..2b9da597a 100644 +index 4421be836..d084787f1 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1145,7 +1145,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -1079,7 +1079,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int i = MathHelper.floor(entity.locX / 16.0D); int j = MathHelper.floor(entity.locZ / 16.0D); @@ -30,8 +30,8 @@ index 3c99ae7cd..2b9da597a 100644 // Paper start - Set origin location when the entity is being added to the world if (entity.origin == null) { -@@ -1649,7 +1649,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.getChunkAt(entity.ae, entity.ag).a(entity, entity.af); +@@ -1583,7 +1583,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY); } - if (!entity.bN() && !this.isChunkLoaded(i, k, true)) { diff --git a/Spigot-Server-Patches/0373-Don-t-recheck-type-after-setting-a-block.patch b/Spigot-Server-Patches/0373-Don-t-recheck-type-after-setting-a-block.patch index 694950ea9..f42413d11 100644 --- a/Spigot-Server-Patches/0373-Don-t-recheck-type-after-setting-a-block.patch +++ b/Spigot-Server-Patches/0373-Don-t-recheck-type-after-setting-a-block.patch @@ -1,4 +1,4 @@ -From 0c569b2b292c0dd86f4f5602118c0fb545f37d07 Mon Sep 17 00:00:00 2001 +From c30b895c9c264420b5a9bb8aaa76a21436f66c27 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 28 Sep 2018 22:27:33 -0400 Subject: [PATCH] Don't recheck type after setting a block @@ -16,10 +16,10 @@ be having data corruption issues anyways. This provides a small boost to all setType calls. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 603ad2393..5d0ecb114 100644 +index 516656f8f..aa7f01f19 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -552,7 +552,7 @@ public class Chunk implements IChunkAccess { +@@ -557,7 +557,7 @@ public class Chunk implements IChunkAccess { this.world.n(blockposition); } diff --git a/Spigot-Server-Patches/0374-Fix-Sending-Chunks-to-Client.patch b/Spigot-Server-Patches/0374-Fix-Sending-Chunks-to-Client.patch index d98d8f2c4..f884a899c 100644 --- a/Spigot-Server-Patches/0374-Fix-Sending-Chunks-to-Client.patch +++ b/Spigot-Server-Patches/0374-Fix-Sending-Chunks-to-Client.patch @@ -1,4 +1,4 @@ -From 5a2b308023d887a64eb67e1ae60018e5e5fe6d99 Mon Sep 17 00:00:00 2001 +From 201ce3d451f0e6fb3a7ee86019926e044b3f9512 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 29 Sep 2018 01:18:16 -0400 Subject: [PATCH] Fix Sending Chunks to Client @@ -14,10 +14,10 @@ This fix always sends chunks to the client, and simply updates the client anytime post processing is triggered with the new chunk data. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 5d0ecb114..d36c79732 100644 +index aa7f01f19..e3d97757f 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -1184,7 +1184,7 @@ public class Chunk implements IChunkAccess { +@@ -1191,7 +1191,7 @@ public class Chunk implements IChunkAccess { } public boolean isReady() { @@ -26,7 +26,7 @@ index 5d0ecb114..d36c79732 100644 } public boolean v() { -@@ -1422,6 +1422,13 @@ public class Chunk implements IChunkAccess { +@@ -1429,6 +1429,13 @@ public class Chunk implements IChunkAccess { this.h.clear(); this.a(ChunkStatus.POSTPROCESSED); this.m.a(this); @@ -41,19 +41,19 @@ index 5d0ecb114..d36c79732 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index cbff0d946..3ac09b91f 100644 +index e61538b3c..f5d971bbe 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -23,7 +23,7 @@ public class PlayerChunk { +@@ -18,7 +18,7 @@ public class PlayerChunk { private int dirtyCount; private int h; private long i; - private boolean done; + boolean done; // Paper - package-private - - // CraftBukkit start - add fields - // You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse -@@ -155,6 +155,7 @@ public class PlayerChunk { + boolean chunkExists; // Paper + // Paper start + PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest; +@@ -144,6 +144,7 @@ public class PlayerChunk { } } diff --git a/Spigot-Server-Patches/0382-Check-Drowned-for-Villager-Aggression-Config.patch b/Spigot-Server-Patches/0382-Check-Drowned-for-Villager-Aggression-Config.patch index 8d8b9e707..619a5cd31 100644 --- a/Spigot-Server-Patches/0382-Check-Drowned-for-Villager-Aggression-Config.patch +++ b/Spigot-Server-Patches/0382-Check-Drowned-for-Villager-Aggression-Config.patch @@ -1,11 +1,11 @@ -From 163eb2768d1e2d847727e3f6b2292048f23d0a2f Mon Sep 17 00:00:00 2001 +From e9e073169b601fb69b07c4f7bd67bfb8c9227c43 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Wed, 10 Oct 2018 21:22:44 -0500 Subject: [PATCH] Check Drowned for Villager Aggression Config diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java -index b4500eead..512c22df9 100644 +index 852b9e184..e34b54dc0 100644 --- a/src/main/java/net/minecraft/server/EntityDrowned.java +++ b/src/main/java/net/minecraft/server/EntityDrowned.java @@ -27,7 +27,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { @@ -17,20 +17,17 @@ index b4500eead..512c22df9 100644 this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityIronGolem.class, true)); this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget(this, EntityTurtle.class, 10, true, false, EntityTurtle.bC)); } -@@ -231,9 +231,10 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { +@@ -231,10 +231,6 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { return this.a.f(entityhuman); } - // $FF: synthetic method - public boolean test(@Nullable Object object) { -- return this.a((EntityHuman)object); -+ // Paper start - decompile error -+ public boolean test(@Nullable EntityHuman entityhuman) { -+ return this.a(entityhuman); -+ // Paper end - } +- return this.test((EntityHuman)object); +- } } + static class c extends PathfinderGoalGotoTarget { -- 2.20.0 diff --git a/Spigot-Server-Patches/0384-Turtle-API.patch b/Spigot-Server-Patches/0384-Turtle-API.patch index 6b3a0fbe5..0a63e1d3c 100644 --- a/Spigot-Server-Patches/0384-Turtle-API.patch +++ b/Spigot-Server-Patches/0384-Turtle-API.patch @@ -1,11 +1,11 @@ -From 5c8a1842d827515d28e5138c93f67a8ce83a8dd1 Mon Sep 17 00:00:00 2001 +From 9786725c7596e78454e9493e39d103ce405526c2 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 29 Sep 2018 16:08:23 -0500 Subject: [PATCH] Turtle API diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index db221a6b5..37fc10fba 100644 +index 6c4ffbf8f..2484bd272 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -27,51 +27,63 @@ public class EntityTurtle extends EntityAnimal { @@ -72,7 +72,7 @@ index db221a6b5..37fc10fba 100644 private void v(boolean flag) { this.datawatcher.set(EntityTurtle.bJ, flag); } -@@ -435,14 +447,17 @@ public class EntityTurtle extends EntityAnimal { +@@ -423,14 +435,17 @@ public class EntityTurtle extends EntityAnimal { if (!this.f.isInWater() && this.k()) { if (this.f.bK < 1) { @@ -93,7 +93,7 @@ index db221a6b5..37fc10fba 100644 } // CraftBukkit end this.f.s(false); -@@ -568,7 +583,7 @@ public class EntityTurtle extends EntityAnimal { +@@ -556,7 +571,7 @@ public class EntityTurtle extends EntityAnimal { } public boolean a() { diff --git a/Spigot-Server-Patches/0385-Fire-EntityCombustEvent-for-phantoms.patch b/Spigot-Server-Patches/0385-Fire-EntityCombustEvent-for-phantoms.patch index 3412637aa..7dcaf7ed2 100644 --- a/Spigot-Server-Patches/0385-Fire-EntityCombustEvent-for-phantoms.patch +++ b/Spigot-Server-Patches/0385-Fire-EntityCombustEvent-for-phantoms.patch @@ -1,16 +1,16 @@ -From 5fbe0cd486254c3f259c75e59496cc81a9e0263d Mon Sep 17 00:00:00 2001 +From b1d82c1797ab63209d5a318cc9deec15a64cf048 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Sat, 13 Oct 2018 22:29:17 +0200 Subject: [PATCH] Fire EntityCombustEvent for phantoms diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index 8332d5cc8..dd7dcfbf1 100644 +index 7a48719c9..d7be396ee 100644 --- a/src/main/java/net/minecraft/server/EntityPhantom.java +++ b/src/main/java/net/minecraft/server/EntityPhantom.java -@@ -105,7 +105,12 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -106,7 +106,12 @@ public class EntityPhantom extends EntityFlying implements IMonster { - public void k() { + public void movementTick() { if (this.dq()) { - this.setOnFire(8); + // Paper start - fire EntityCombustEvent @@ -21,7 +21,7 @@ index 8332d5cc8..dd7dcfbf1 100644 + // Paper end } - super.k(); + super.movementTick(); -- 2.20.0 diff --git a/Spigot-Server-Patches/0386-Limit-lightning-strike-effect-distance.patch b/Spigot-Server-Patches/0386-Limit-lightning-strike-effect-distance.patch index 1d3903091..f0b0700ce 100644 --- a/Spigot-Server-Patches/0386-Limit-lightning-strike-effect-distance.patch +++ b/Spigot-Server-Patches/0386-Limit-lightning-strike-effect-distance.patch @@ -1,4 +1,4 @@ -From 14da468379f829404d6f5480c42fff474472b823 Mon Sep 17 00:00:00 2001 +From 19a846af322a5b7aef506f0d614829c62219f055 Mon Sep 17 00:00:00 2001 From: Trigary Date: Fri, 14 Sep 2018 17:42:08 +0200 Subject: [PATCH] Limit lightning strike effect distance @@ -69,10 +69,10 @@ index afbe43dd3..d732be52e 100644 --this.lifeTicks; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index af68074c1..899c7f5f7 100644 +index 27c8a97be..63c802d02 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1087,7 +1087,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1088,7 +1088,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } // CraftBukkit end if (super.strikeLightning(entity)) { diff --git a/Spigot-Server-Patches/0389-Call-player-spectator-target-events.patch b/Spigot-Server-Patches/0389-Call-player-spectator-target-events.patch index 36b20306d..502bb4332 100644 --- a/Spigot-Server-Patches/0389-Call-player-spectator-target-events.patch +++ b/Spigot-Server-Patches/0389-Call-player-spectator-target-events.patch @@ -1,24 +1,24 @@ -From 647dd278ce28d44290e63d656da9dff190becf11 Mon Sep 17 00:00:00 2001 +From e1120a8ca023f46b28a8ff0570054a7f979ffb39 Mon Sep 17 00:00:00 2001 From: Caleb Bassham Date: Fri, 28 Sep 2018 02:32:19 -0500 Subject: [PATCH] Call player spectator target events diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index d429e552e..6105a4e14 100644 +index b5d48e7bf..2679c2358 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -62,7 +62,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { private EntityHuman.EnumChatVisibility cs; private boolean ct = true; - private long cu = SystemUtils.b(); -- private Entity cv; -+ private Entity cv; private void setSpectatorTargetField(Entity e) { this.cv = e; } // Paper - OBFHELPER + private long cu = SystemUtils.getMonotonicMillis(); +- private Entity spectatedEntity; ++ private Entity spectatedEntity; private void setSpectatorTargetField(Entity e) { this.spectatedEntity = e; } // Paper - OBFHELPER public boolean worldChangeInvuln; private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER - private final RecipeBookServer cy; -@@ -1375,15 +1375,36 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - return (Entity) (this.cv == null ? this : this.cv); + private final RecipeBookServer recipeBook; +@@ -1375,15 +1375,35 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity); } - public void setSpectatorTarget(Entity entity) { @@ -26,10 +26,10 @@ index d429e552e..6105a4e14 100644 + // Paper start - Add PlayerStartSpectatingEntityEvent and PlayerStopSpectatingEntity Event Entity entity1 = this.getSpecatorTarget(); -- this.cv = (Entity) (entity == null ? this : entity); -- if (entity1 != this.cv) { -- this.playerConnection.sendPacket(new PacketPlayOutCamera(this.cv)); -- this.playerConnection.a(this.cv.locX, this.cv.locY, this.cv.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit +- this.spectatedEntity = (Entity) (entity == null ? this : entity); +- if (entity1 != this.spectatedEntity) { +- this.playerConnection.sendPacket(new PacketPlayOutCamera(this.spectatedEntity)); +- this.playerConnection.a(this.spectatedEntity.locX, this.spectatedEntity.locY, this.spectatedEntity.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit + if (newSpectatorTarget == null) { + newSpectatorTarget = this; } @@ -53,9 +53,8 @@ index d429e552e..6105a4e14 100644 + setSpectatorTargetField(newSpectatorTarget); + + this.playerConnection.sendPacket(new PacketPlayOutCamera(newSpectatorTarget)); ++ this.playerConnection.a(this.spectatedEntity.locX, this.spectatedEntity.locY, this.spectatedEntity.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit + // Paper end -+ -+ this.playerConnection.a(this.cv.locX, this.cv.locY, this.cv.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit } protected void E() { diff --git a/Spigot-Server-Patches/0390-Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/0390-Add-Velocity-IP-Forwarding-Support.patch index a58615c45..0d44476b6 100644 --- a/Spigot-Server-Patches/0390-Add-Velocity-IP-Forwarding-Support.patch +++ b/Spigot-Server-Patches/0390-Add-Velocity-IP-Forwarding-Support.patch @@ -1,4 +1,4 @@ -From 004b5a9beb71200c6c09ef9dc7791fd697f004a5 Mon Sep 17 00:00:00 2001 +From 5c4f83db89354862564c17f9f65a37c3a9b7c31b Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 8 Oct 2018 14:36:14 -0400 Subject: [PATCH] Add Velocity IP Forwarding Support @@ -127,7 +127,7 @@ index 000000000..fdd8708f9 + } +} diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 58a2f3d28..4df31c828 100644 +index 64d2b8aec..95d34fbfe 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -43,6 +43,7 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -203,18 +203,18 @@ index 58a2f3d28..4df31c828 100644 } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index b2afec5e4..97a9dffe6 100644 +index e5cc77c6d..120416b30 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -48,7 +48,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -47,7 +47,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + private final Queue packetQueue = Queues.newConcurrentLinkedQueue(); private final Queue getPacketQueue() { return this.packetQueue; } // Paper - OBFHELPER private final ReentrantReadWriteLock j = new ReentrantReadWriteLock(); public Channel channel; - // Spigot Start // PAIL -- public SocketAddress l; -+ public SocketAddress l; public void setSpoofedRemoteAddress(SocketAddress address) { this.l = address; } // Paper - OBFHELPER +- public SocketAddress socketAddress; ++ public SocketAddress socketAddress; public void setSpoofedRemoteAddress(SocketAddress address) { this.socketAddress = address; } // Paper - OBFHELPER + // Spigot Start public java.util.UUID spoofedUUID; public com.mojang.authlib.properties.Property[] spoofedProfile; - public boolean preparing = true; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java index b95836d44..621aad150 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java diff --git a/Spigot-Server-Patches/0391-Add-more-Witch-API.patch b/Spigot-Server-Patches/0391-Add-more-Witch-API.patch index c7449cd47..053adbd14 100644 --- a/Spigot-Server-Patches/0391-Add-more-Witch-API.patch +++ b/Spigot-Server-Patches/0391-Add-more-Witch-API.patch @@ -1,11 +1,11 @@ -From 18b099c85cd5ab178d78435d918404787ea441c7 Mon Sep 17 00:00:00 2001 +From c2234ee89b3ee5b291d4ce3da8fb4e8ad095e7ce Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 12 Oct 2018 14:10:46 -0500 Subject: [PATCH] Add more Witch API diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 896388c41..7361d4c05 100644 +index f334ad88d..e3c77839b 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -1,5 +1,11 @@ @@ -75,7 +75,7 @@ index 896388c41..7361d4c05 100644 } @@ -123,6 +130,18 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { - super.k(); + super.movementTick(); } + // Paper start diff --git a/Spigot-Server-Patches/0395-Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/0395-Reset-players-airTicks-on-respawn.patch index 4dfbce44e..73e039f90 100644 --- a/Spigot-Server-Patches/0395-Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/0395-Reset-players-airTicks-on-respawn.patch @@ -1,14 +1,14 @@ -From 2140c895572c8167fc70431472908e3d26055210 Mon Sep 17 00:00:00 2001 +From 0c803b56a779ad4b3007acae7b2cb9f444ca6121 Mon Sep 17 00:00:00 2001 From: GreenMeanie Date: Sat, 20 Oct 2018 22:34:02 -0400 Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 23e6f45bf..e4c78c676 100644 +index 4f6e67915..9eeb73d67 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2335,7 +2335,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2334,7 +2334,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } @@ -18,10 +18,10 @@ index 23e6f45bf..e4c78c676 100644 } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 6105a4e14..1b47d7bd4 100644 +index 2679c2358..d04570171 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1619,6 +1619,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1618,6 +1618,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } this.setHealth(this.getMaxHealth()); diff --git a/Spigot-Server-Patches/0397-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/Spigot-Server-Patches/0397-Don-t-sleep-after-profile-lookups-if-not-needed.patch index 095957234..5030c9d77 100644 --- a/Spigot-Server-Patches/0397-Don-t-sleep-after-profile-lookups-if-not-needed.patch +++ b/Spigot-Server-Patches/0397-Don-t-sleep-after-profile-lookups-if-not-needed.patch @@ -1,4 +1,4 @@ -From ab154e556faa32e598214415f972381190fe1208 Mon Sep 17 00:00:00 2001 +From 8b5a8d3da1491173f9a0f64c64a35e01f8adf5b9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 23 Oct 2018 20:25:05 -0400 Subject: [PATCH] Don't sleep after profile lookups if not needed @@ -7,30 +7,30 @@ Mojang was sleeping even if we had no more requests to go after the current one finished, resulting in 100ms lost per profile lookup diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java -index 71e48e87b..23f1447cf 100644 +index 26a743722..6ed3199c3 100644 --- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java @@ -42,6 +42,7 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { - } - - final int page = 0; + } + + final int page = 0; + boolean hasRequested = false; // Paper - - for (final List request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) { - int failCount = 0; + + for (final List request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) { + int failCount = 0; @@ -67,6 +68,12 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { - LOGGER.debug("Couldn't find profile {}", name); - callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile")); - } + LOGGER.debug("Couldn't find profile {}", name); + callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile")); + } + // Paper start + if (!hasRequested) { + hasRequested = true; + continue; + } + // Paper end - - try { - Thread.sleep(DELAY_BETWEEN_PAGES); + + try { + Thread.sleep(DELAY_BETWEEN_PAGES); -- 2.20.0 diff --git a/Spigot-Server-Patches/0399-Use-EntityTypes-for-living-entities.patch b/Spigot-Server-Patches/0399-Use-EntityTypes-for-living-entities.patch index bb7a0b52b..8f95e9539 100644 --- a/Spigot-Server-Patches/0399-Use-EntityTypes-for-living-entities.patch +++ b/Spigot-Server-Patches/0399-Use-EntityTypes-for-living-entities.patch @@ -1,4 +1,4 @@ -From d5a03e6f186b822c7f5536897a21be7c1a7d128e Mon Sep 17 00:00:00 2001 +From 4e612d73f947ef9e6b6b08eb8be56663c8671b26 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Thu, 4 Oct 2018 10:08:02 -0500 Subject: [PATCH] Use EntityTypes for living entities @@ -66,7 +66,7 @@ index 93bf32dc1..e6063bb46 100644 entitywither.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.55D, (double) blockposition2.getZ() + 0.5D, shapedetector_shapedetectorcollection.getFacing().k() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F); diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java -index e6da1c30f..efb3c057d 100644 +index 09ad5a3ca..41e599b26 100644 --- a/src/main/java/net/minecraft/server/EnderDragonBattle.java +++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java @@ -361,7 +361,7 @@ public class EnderDragonBattle { @@ -75,37 +75,37 @@ index e6da1c30f..efb3c057d 100644 this.d.getChunkAtWorldCoords(new BlockPosition(0, 128, 0)); - EntityEnderDragon entityenderdragon = new EntityEnderDragon(this.d); + EntityEnderDragon entityenderdragon = EntityTypes.ENDER_DRAGON.create(this.d); // Paper - entityenderdragon.getDragonControllerManager().setControllerPhase(DragonControllerPhase.a); + entityenderdragon.getDragonControllerManager().setControllerPhase(DragonControllerPhase.HOLDING_PATTERN); entityenderdragon.setPositionRotation(0.0D, 128.0D, 0.0D, this.d.random.nextFloat() * 360.0F, 0.0F); this.d.addEntity(entityenderdragon); diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java -index afbcfab55..b1af04726 100644 +index ee159e0a8..070a9e7b1 100644 --- a/src/main/java/net/minecraft/server/EntityChicken.java +++ b/src/main/java/net/minecraft/server/EntityChicken.java @@ -96,7 +96,7 @@ public class EntityChicken extends EntityAnimal { } - public EntityChicken b(EntityAgeable entityageable) { + public EntityChicken createChild(EntityAgeable entityageable) { - return new EntityChicken(this.world); + return EntityTypes.CHICKEN.create(world); // Paper } public boolean f(ItemStack itemstack) { diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index 6bb80975e..180de2144 100644 +index 5874d2993..cc53e915d 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java @@ -88,7 +88,7 @@ public class EntityCow extends EntityAnimal { } - public EntityCow b(EntityAgeable entityageable) { + public EntityCow createChild(EntityAgeable entityageable) { - return new EntityCow(this.world); + return EntityTypes.COW.create(world); // Paper } public float getHeadHeight() { diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java -index 46f29272e..1d3b7edb3 100644 +index 961afa5c4..a372f6508 100644 --- a/src/main/java/net/minecraft/server/EntityEnderPearl.java +++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java @@ -74,7 +74,7 @@ public class EntityEnderPearl extends EntityProjectile { @@ -115,10 +115,10 @@ index 46f29272e..1d3b7edb3 100644 - EntityEndermite entityendermite = new EntityEndermite(this.world); + EntityEndermite entityendermite = EntityTypes.ENDERMITE.create(world); // Paper - entityendermite.a(true); + entityendermite.setPlayerSpawned(true); entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch); diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java -index 2d9631c5d..16d94fe3f 100644 +index c2c4f97e2..f510696e1 100644 --- a/src/main/java/net/minecraft/server/EntityEvoker.java +++ b/src/main/java/net/minecraft/server/EntityEvoker.java @@ -221,7 +221,7 @@ public class EntityEvoker extends EntityIllagerWizard { @@ -161,7 +161,7 @@ index 50c0a8277..627ba1038 100644 return (EntityAgeable)object; } diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index ba6c0e96a..17850e857 100644 +index 2c0cac674..e2af18326 100644 --- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java @@ -134,7 +134,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { @@ -187,20 +187,20 @@ index 560eac4af..4b928d2c7 100644 public boolean a(EntityHuman entityhuman, EnumHand enumhand) { diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index 774e4d641..0cf53b69f 100644 +index 22cea8552..ac7f37e4b 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java @@ -272,7 +272,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn } - public EntityLlama b(EntityAgeable entityageable) { + public EntityLlama createChild(EntityAgeable entityageable) { - EntityLlama entityllama1 = new EntityLlama(this.world); + EntityLlama entityllama1 = EntityTypes.LLAMA.create(world); // Paper this.a(entityageable, entityllama1); EntityLlama entityllama2 = (EntityLlama)entityageable; int i = this.random.nextInt(Math.max(this.getStrength(), entityllama2.getStrength())) + 1; diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index dab644930..737289588 100644 +index dde9f1e61..638dbe978 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java @@ -40,7 +40,7 @@ public class EntityMushroomCow extends EntityCow { @@ -215,20 +215,20 @@ index dab644930..737289588 100644 @@ -74,7 +74,7 @@ public class EntityMushroomCow extends EntityCow { } - public EntityMushroomCow c(EntityAgeable entityageable) { + public EntityMushroomCow createChild(EntityAgeable entityageable) { - return new EntityMushroomCow(this.world); + return EntityTypes.MOOSHROOM.create(world); // Paper } @Nullable diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index 2a5a5516a..58518a509 100644 +index c83f71401..34e860b4c 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -154,7 +154,7 @@ public class EntityOcelot extends EntityTameableAnimal { } - public EntityOcelot b(EntityAgeable entityageable) { + public EntityOcelot createChild(EntityAgeable entityageable) { - EntityOcelot entityocelot = new EntityOcelot(this.world); + EntityOcelot entityocelot = EntityTypes.OCELOT.create(world); // Paper @@ -244,7 +244,7 @@ index 2a5a5516a..58518a509 100644 entityocelot.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entityocelot.setAgeRaw(-24000); diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index 30306256a..4d9e8c378 100644 +index 9dc2d8be2..d1689dc33 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -153,7 +153,7 @@ public class EntityPig extends EntityAnimal { @@ -259,7 +259,7 @@ index 30306256a..4d9e8c378 100644 @@ -242,7 +242,7 @@ public class EntityPig extends EntityAnimal { } - public EntityPig b(EntityAgeable entityageable) { + public EntityPig createChild(EntityAgeable entityageable) { - return new EntityPig(this.world); + return EntityTypes.PIG.create(world); // Paper } @@ -279,25 +279,25 @@ index b9124a5b0..cb3e45f14 100644 public boolean f(ItemStack var1) { diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java -index a10de4e88..ea101bee9 100644 +index 7ee1b88f6..9605a50ae 100644 --- a/src/main/java/net/minecraft/server/EntityRabbit.java +++ b/src/main/java/net/minecraft/server/EntityRabbit.java @@ -251,7 +251,7 @@ public class EntityRabbit extends EntityAnimal { } - public EntityRabbit b(EntityAgeable entityageable) { + public EntityRabbit createChild(EntityAgeable entityageable) { - EntityRabbit entityrabbit = new EntityRabbit(this.world); + EntityRabbit entityrabbit = EntityTypes.RABBIT.create(world); // Paper int i = this.dJ(); if (this.random.nextInt(20) != 0) { diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java -index caf442610..2b50bc2ea 100644 +index b3586cd41..c0950116b 100644 --- a/src/main/java/net/minecraft/server/EntitySheep.java +++ b/src/main/java/net/minecraft/server/EntitySheep.java @@ -249,7 +249,7 @@ public class EntitySheep extends EntityAnimal { - public EntitySheep b(EntityAgeable entityageable) { + public EntitySheep createChild(EntityAgeable entityageable) { EntitySheep entitysheep = (EntitySheep) entityageable; - EntitySheep entitysheep1 = new EntitySheep(this.world); + EntitySheep entitysheep1 = EntityTypes.SHEEP.create(world); // Paper @@ -318,7 +318,7 @@ index 361c7831e..e46340e66 100644 entityskeleton.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entityskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index 37fc10fba..98268145e 100644 +index 2484bd272..fbe504737 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -218,7 +218,7 @@ public class EntityTurtle extends EntityAnimal { @@ -343,13 +343,13 @@ index 6b6fbfd79..29d5ef4c1 100644 public T a(World world) { return this.aT.apply(world); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index e4a570e01..0de37ceb3 100644 +index 2b2a6afb0..b2fb4af05 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -593,7 +593,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { } - public EntityVillager b(EntityAgeable entityageable) { + public EntityVillager createChild(EntityAgeable entityageable) { - EntityVillager entityvillager = new EntityVillager(this.world); + EntityVillager entityvillager = EntityTypes.VILLAGER.create(world); // Paper @@ -365,20 +365,20 @@ index e4a570e01..0de37ceb3 100644 // Paper start if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 9a52d33d6..878eac112 100644 +index 9599d6fa0..5f3d3e472 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -343,7 +343,7 @@ public class EntityWolf extends EntityTameableAnimal { } - public EntityWolf b(EntityAgeable entityageable) { + public EntityWolf createChild(EntityAgeable entityageable) { - EntityWolf entitywolf = new EntityWolf(this.world); + EntityWolf entitywolf = EntityTypes.WOLF.create(world); // Paper UUID uuid = this.getOwnerUUID(); if (uuid != null) { diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 823d4be7f..2d87dca68 100644 +index 40abea29c..f25bcfd8f 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -216,7 +216,7 @@ public class EntityZombie extends EntityMonster { @@ -431,7 +431,7 @@ index 85d402965..0cca7b6d5 100644 } diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index ab1b3ab5e..dbb833e49 100644 +index 17b9fd6dd..070c9c4c1 100644 --- a/src/main/java/net/minecraft/server/EntityZombieVillager.java +++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java @@ -118,7 +118,7 @@ public class EntityZombieVillager extends EntityZombie { @@ -686,7 +686,7 @@ index ee401980f..9ca9306d0 100644 entityvindicator.setPositionRotation(blockposition, 0.0F, 0.0F); entityvindicator.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityvindicator)), (GroupDataEntity)null, (NBTTagCompound)null); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 899c7f5f7..aff5a62e5 100644 +index 63c802d02..4d93a22d8 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -511,7 +511,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -699,7 +699,7 @@ index 899c7f5f7..aff5a62e5 100644 entityhorseskeleton.s(true); entityhorseskeleton.setAgeRaw(0); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 10fa12253..bd118f7f0 100644 +index 2d6d4307b..ee1079f80 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1172,153 +1172,153 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0404-Fix-SpongeAbsortEvent-handling.patch b/Spigot-Server-Patches/0404-Fix-SpongeAbsortEvent-handling.patch index 36cb20050..06a47b644 100644 --- a/Spigot-Server-Patches/0404-Fix-SpongeAbsortEvent-handling.patch +++ b/Spigot-Server-Patches/0404-Fix-SpongeAbsortEvent-handling.patch @@ -1,4 +1,4 @@ -From 4fa0b38da6fd7cb7ca6af5fdc3cdb608ec74a024 Mon Sep 17 00:00:00 2001 +From c25257eebd8c342309774a7522eac6768df7cb85 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 10 Nov 2018 05:15:21 +0000 Subject: [PATCH] Fix SpongeAbsortEvent handling @@ -6,22 +6,27 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling Only process drops when the block is actually going to be removed diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java -index afd3f32d0..2aa9b68b8 100644 +index 9c508caa9..4b762a92c 100644 --- a/src/main/java/net/minecraft/server/BlockSponge.java +++ b/src/main/java/net/minecraft/server/BlockSponge.java -@@ -100,7 +100,11 @@ public class BlockSponge extends Block { - Material material = iblockdata.getMaterial(); - - if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) { -- iblockdata.a(world, blockposition2, 0); -+ // Paper start -+ if (block.getHandle().getMaterial() == Material.AIR) { -+ iblockdata.dropNaturally(world, blockposition2, 0); -+ } -+ // Paper end +@@ -106,7 +106,11 @@ public class BlockSponge extends Block { + } else if (iblockdata.getBlock() instanceof BlockFluids) { + // NOP + } else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) { +- iblockdata.a(world, blockposition2, 0); ++ // Paper start ++ if (block.getHandle().getMaterial() == Material.AIR) { ++ iblockdata.dropNaturally(world, blockposition2, 0); ++ } ++ // Paper end + } } - world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag()); +@@ -117,3 +121,4 @@ public class BlockSponge extends Block { + return i > 0; + } + } ++ diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java index 2d855aae6..bc345a2c3 100644 --- a/src/main/java/net/minecraft/server/IBlockData.java diff --git a/Spigot-Server-Patches/0406-Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/0406-Optimize-redstone-algorithm.patch index 517715ee1..f6b4a2d6a 100644 --- a/Spigot-Server-Patches/0406-Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/0406-Optimize-redstone-algorithm.patch @@ -1,4 +1,4 @@ -From af29e4ca853324d07c80107d93b6c79d8bf326dc Mon Sep 17 00:00:00 2001 +From 9f83f2a46779d5164fce7289530d7bc2c312d673 Mon Sep 17 00:00:00 2001 From: theosib Date: Thu, 27 Sep 2018 01:43:35 -0600 Subject: [PATCH] Optimize redstone algorithm @@ -954,7 +954,7 @@ index 000000000..21d9d6d7e + } +} diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java -index 570715ea6..f95464f64 100644 +index 0adea6a17..174e84760 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java @@ -1,5 +1,7 @@ @@ -1140,7 +1140,7 @@ index 570715ea6..f95464f64 100644 iblockdata.a(world, blockposition, 0); world.setAir(blockposition); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d202360bd..05256ad3c 100644 +index a877d4a6b..d14ee6b9b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -646,6 +646,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -1151,7 +1151,7 @@ index d202360bd..05256ad3c 100644 public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (!this.isClientSide) { IBlockData iblockdata = this.getType(blockposition); -@@ -2665,6 +2666,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2599,6 +2600,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return this.getBlockFacePower(blockposition.down(), EnumDirection.DOWN) > 0 ? true : (this.getBlockFacePower(blockposition.up(), EnumDirection.UP) > 0 ? true : (this.getBlockFacePower(blockposition.north(), EnumDirection.NORTH) > 0 ? true : (this.getBlockFacePower(blockposition.south(), EnumDirection.SOUTH) > 0 ? true : (this.getBlockFacePower(blockposition.west(), EnumDirection.WEST) > 0 ? true : this.getBlockFacePower(blockposition.east(), EnumDirection.EAST) > 0)))); } diff --git a/Spigot-Server-Patches/0409-Make-the-default-permission-message-configurable.patch b/Spigot-Server-Patches/0409-Make-the-default-permission-message-configurable.patch index 73e82c9ab..dc8f7da65 100644 --- a/Spigot-Server-Patches/0409-Make-the-default-permission-message-configurable.patch +++ b/Spigot-Server-Patches/0409-Make-the-default-permission-message-configurable.patch @@ -1,4 +1,4 @@ -From 748d2881702945973d2383c3ab22ecf6ad5c945c Mon Sep 17 00:00:00 2001 +From 4479e6a4f02111bdd6b3c2ee863d394575dfd05f Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 18 Nov 2018 19:49:56 +0000 Subject: [PATCH] Make the default permission message configurable @@ -29,10 +29,10 @@ index 468aff713..241992f59 100644 private static void savePlayerData() { savePlayerData = getBoolean("settings.save-player-data", savePlayerData); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c79baa922..352f86967 100644 +index eb4b3c7a2..7c344ffa2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2148,6 +2148,10 @@ public final class CraftServer implements Server { +@@ -2147,6 +2147,10 @@ public final class CraftServer implements Server { return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; } diff --git a/Spigot-Server-Patches/0410-Add-more-Zombie-API.patch b/Spigot-Server-Patches/0410-Add-more-Zombie-API.patch index ae06d8969..0edd78955 100644 --- a/Spigot-Server-Patches/0410-Add-more-Zombie-API.patch +++ b/Spigot-Server-Patches/0410-Add-more-Zombie-API.patch @@ -1,11 +1,11 @@ -From acdfd1580144bf7970aa16eb874549d5166d5ee6 Mon Sep 17 00:00:00 2001 +From 33e6d336c29648d4c515229c8d8d83df8aa15be7 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 Oct 2018 04:29:59 -0500 Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 2d87dca68..4c0ef6e28 100644 +index f25bcfd8f..72ea3ba76 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -22,8 +22,8 @@ public class EntityZombie extends EntityMonster { @@ -13,9 +13,9 @@ index 2d87dca68..4c0ef6e28 100644 private static final DataWatcherObject bC = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject bD = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b); - private static final DataWatcherObject bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); -- private static final DataWatcherObject bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); +- public static final DataWatcherObject bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); // PAIL + private static final DataWatcherObject bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject armsRaised = bE; // Paper - OBFHELPER -+ private static final DataWatcherObject bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject drowning = bF; // Paper - OBFHELPER ++ public static final DataWatcherObject bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject drowning = bF; // Paper - OBFHELPER private final PathfinderGoalBreakDoor bG; private boolean bH; private int bI; @@ -51,11 +51,11 @@ index 2d87dca68..4c0ef6e28 100644 return this.bH; } @@ -210,11 +219,19 @@ public class EntityZombie extends EntityMonster { - super.k(); + super.movementTick(); } + public void startDrowning(int drownedConversionTime) { a(drownedConversionTime); } // Paper - OBFHELPER - private void a(int i) { + public void a(int i) { // PAIL this.drownedConversionTime = i; this.getDataWatcher().set(EntityZombie.bF, true); } @@ -111,12 +111,12 @@ index 2d87dca68..4c0ef6e28 100644 public void b(EntityLiving entityliving) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -index d2c3dbe48..43d4470d9 100644 +index 7af4ea9f8..4d4c50212 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -@@ -54,4 +54,34 @@ public class CraftZombie extends CraftMonster implements Zombie { - public Villager.Profession getVillagerProfession() { - return null; +@@ -77,4 +77,34 @@ public class CraftZombie extends CraftMonster implements Zombie { + getHandle().a(time); + } } + + // Paper start diff --git a/Spigot-Server-Patches/0411-limit-the-range-at-which-we-ll-consider-an-attackabl.patch b/Spigot-Server-Patches/0411-limit-the-range-at-which-we-ll-consider-an-attackabl.patch index 08dcd62b8..1911b8fdb 100644 --- a/Spigot-Server-Patches/0411-limit-the-range-at-which-we-ll-consider-an-attackabl.patch +++ b/Spigot-Server-Patches/0411-limit-the-range-at-which-we-ll-consider-an-attackabl.patch @@ -1,4 +1,4 @@ -From c47b48aa35d881755ab882724c0b166cb2085e6b Mon Sep 17 00:00:00 2001 +From bcbd3dc5032e7d687489b635e0eb1d12bb95860e Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 13 Nov 2018 14:01:00 +0000 Subject: [PATCH] limit the range at which we'll consider an attackable target @@ -12,10 +12,10 @@ decrease when set, allowing us to skip further checks earlier on when looking for an attackable entity diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 05256ad3c..747fda044 100644 +index d14ee6b9b..9bf3f8343 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -2793,8 +2793,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +@@ -2727,8 +2727,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman1 = (EntityHuman) this.players.get(i); diff --git a/Spigot-Server-Patches/0413-Handle-Large-Packets-disconnecting-client.patch b/Spigot-Server-Patches/0413-Handle-Large-Packets-disconnecting-client.patch index 98736386b..8f70b783e 100644 --- a/Spigot-Server-Patches/0413-Handle-Large-Packets-disconnecting-client.patch +++ b/Spigot-Server-Patches/0413-Handle-Large-Packets-disconnecting-client.patch @@ -1,4 +1,4 @@ -From abb284f681df9a0f69b977444ccfa476c3ad8a2c Mon Sep 17 00:00:00 2001 +From c5f21c24ee494a5b7a3e161a1f4af4cf6930564d Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 27 Nov 2018 21:18:06 -0500 Subject: [PATCH] Handle Large Packets disconnecting client @@ -7,7 +7,7 @@ If a players inventory is too big to send in a single packet, split the inventory set into multiple packets instead. diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 97a9dffe6..2f887932b 100644 +index 120416b30..065bede4c 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -100,6 +100,15 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -44,10 +44,10 @@ index 2e42c268b..0a9bfb07a 100644 return false; } diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java -index c20911c96..c22c3eebc 100644 +index 3448f6c53..484131e65 100644 --- a/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java -@@ -45,10 +45,32 @@ public class PacketEncoder extends MessageToByteEncoder> { +@@ -45,8 +45,31 @@ public class PacketEncoder extends MessageToByteEncoder> { throw throwable; } } @@ -64,10 +64,12 @@ index c20911c96..c22c3eebc 100644 + // Paper start + private static int MAX_PACKET_SIZE = 2097152; ++ + public static class PacketTooLargeException extends RuntimeException { + private final Packet packet; ++ + PacketTooLargeException(Packet packet, int packetLength) { -+ super("PacketTooLarge - " + packet.getClass().getSimpleName() + " is " + packetLength +". Max is " + MAX_PACKET_SIZE); ++ super("PacketTooLarge - " + packet.getClass().getSimpleName() + " is " + packetLength + ". Max is " + MAX_PACKET_SIZE); + this.packet = packet; + } + @@ -76,10 +78,7 @@ index c20911c96..c22c3eebc 100644 + } + } + // Paper end -+ - // $FF: synthetic method - protected void encode(ChannelHandlerContext channelhandlercontext, Packet object, ByteBuf bytebuf) throws Exception { // Paper - decompiler fix - this.a(channelhandlercontext, (Packet)object, bytebuf); + } diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java index 40ec398ee..ca6bcd22f 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java diff --git a/Spigot-Server-Patches/0415-Add-PlayerConnectionCloseEvent.patch b/Spigot-Server-Patches/0415-Add-PlayerConnectionCloseEvent.patch index e6ae7f129..b6a7dc5a9 100644 --- a/Spigot-Server-Patches/0415-Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-Server-Patches/0415-Add-PlayerConnectionCloseEvent.patch @@ -1,4 +1,4 @@ -From e2f257e0513b6f8699db8182a2d94fa92ecc37c0 Mon Sep 17 00:00:00 2001 +From 631184394cd176862f81504ab8355ff175ea4c55 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 7 Oct 2018 12:05:28 -0700 Subject: [PATCH] Add PlayerConnectionCloseEvent @@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent is undefined. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 4df31c828..78ea9ad18 100644 +index 95d34fbfe..d20545bad 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -36,9 +36,9 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -50,7 +50,7 @@ index 4df31c828..78ea9ad18 100644 private SecretKey loginKey; private EntityPlayer l; diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 2f887932b..1e5dfd3f7 100644 +index 065bede4c..21e92b921 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -16,6 +16,7 @@ import io.netty.handler.timeout.TimeoutException; @@ -64,14 +64,14 @@ index 2f887932b..1e5dfd3f7 100644 @@ -358,6 +359,26 @@ public class NetworkManager extends SimpleChannelInboundHandler> { this.i().a(new ChatMessage("multiplayer.disconnect.generic", new Object[0])); } - this.i.clear(); // Free up packet queue. + this.packetQueue.clear(); // Free up packet queue. + // Paper start - Add PlayerConnectionCloseEvent + final PacketListener packetListener = this.i(); + if (packetListener instanceof PlayerConnection) { + /* Player was logged in */ + final PlayerConnection playerConnection = (PlayerConnection) packetListener; + new com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent(playerConnection.player.uniqueID, -+ playerConnection.player.getName(), ((java.net.InetSocketAddress)l).getAddress(), false).callEvent(); ++ playerConnection.player.getName(), ((java.net.InetSocketAddress)socketAddress).getAddress(), false).callEvent(); + } else if (packetListener instanceof LoginListener) { + /* Player is login stage */ + final LoginListener loginListener = (LoginListener) packetListener; @@ -81,7 +81,7 @@ index 2f887932b..1e5dfd3f7 100644 + case ACCEPTED: + final com.mojang.authlib.GameProfile profile = loginListener.getGameProfile(); /* Should be non-null at this stage */ + new com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent(profile.getId(), profile.getName(), -+ ((java.net.InetSocketAddress)l).getAddress(), false).callEvent(); ++ ((java.net.InetSocketAddress)socketAddress).getAddress(), false).callEvent(); + } + } + // Paper end diff --git a/scripts/decompile.sh b/scripts/decompile.sh index 54dbf7b11..2771e260b 100755 --- a/scripts/decompile.sh +++ b/scripts/decompile.sh @@ -124,7 +124,7 @@ if [ ! -d "$spigotdecompiledir/net" ]; then echo "Decompiling classes (stage 2)..." cd "$basedir" set +e - java -jar "$workdir/BuildData/bin/fernflower.jar" -dgs=1 -hdc=0 -asc=1 -udv=0 "$classdir" "$spigotdecompiledir" + java -jar "$workdir/BuildData/bin/fernflower.jar" -dgs=1 -hdc=0 -asc=1 -udv=0 -rsy=1 "$classdir" "$spigotdecompiledir" if [ "$?" != "0" ]; then rm -rf "$spigotdecompiledir/net" echo "Failed to decompile classes." diff --git a/scripts/remap.sh b/scripts/remap.sh index 3d736e77c..8c3afcd13 100755 --- a/scripts/remap.sh +++ b/scripts/remap.sh @@ -45,7 +45,7 @@ fi echo "Applying class mappings..." if [ ! -f "$jarpath-cl.jar" ]; then - java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-cl.jar" 1>/dev/null + java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --auto-synth -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-cl.jar" 1>/dev/null if [ "$?" != "0" ]; then echo "Failed to apply class mappings." exit 1 @@ -54,7 +54,7 @@ fi echo "Applying member mappings..." if [ ! -f "$jarpath-m.jar" ]; then - java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map -i "$jarpath-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null + java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft -i "$jarpath-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null if [ "$?" != "0" ]; then echo "Failed to apply member mappings." exit 1 @@ -63,7 +63,7 @@ fi echo "Creating remapped jar..." if [ ! -f "$jarpath-mapped.jar" ]; then - java -jar "$workdir/BuildData/bin/SpecialSource.jar" --kill-lvt -i "$jarpath-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-mapped.jar" 1>/dev/null + java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only net/minecraft --only com/mojang/brigadier --kill-lvt -i "$jarpath-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-mapped.jar" 1>/dev/null if [ "$?" != "0" ]; then echo "Failed to create remapped jar." exit 1 diff --git a/work/BuildData b/work/BuildData index d56672db7..370a4d980 160000 --- a/work/BuildData +++ b/work/BuildData @@ -1 +1 @@ -Subproject commit d56672db7d59c99f62c4e78532aeca0d143bef42 +Subproject commit 370a4d9802d37f4228aa33720bdd5e9675222784 diff --git a/work/Bukkit b/work/Bukkit index 72520b78b..b850a822c 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 72520b78bb45ad6e931843c128baaf2cd4017109 +Subproject commit b850a822c1cd79cc5b8e9181b4b9e6b61977e0ec diff --git a/work/CraftBukkit b/work/CraftBukkit index 7fa173e6d..38cf676e3 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 7fa173e6d18e848f04534fe87d22a05be016fda1 +Subproject commit 38cf676e328d869f8d5cded4d9e9ad3d75afb760 diff --git a/work/Spigot b/work/Spigot index 078a7f524..1dc156ce4 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 078a7f524de58bbb5febe73f1f31db69bfbd8eff +Subproject commit 1dc156ce484f25ce6cfc7526f1de88aac5ac7a95