diff --git a/SHIT_TO_CHECK.md b/SHIT_TO_CHECK.md new file mode 100644 index 0000000000..6077d66cd2 --- /dev/null +++ b/SHIT_TO_CHECK.md @@ -0,0 +1,6 @@ +# Shit to check + +* Mini: "Allow disabling armour stand ticking": Not sure if the equipment update actually works, vanilla shifted a bunch of shit +* Mini: "Optimize World Server Map": Figure out how to fill PaperWorldMap, it needs a dim key which doesnt exist anymore? +* Mini: "MC-50319": fix if still works +* Mini: I definetly dropped a patch I didnt want to drop, we need to go thru in the end and see if all patches are still in, lol diff --git a/Spigot-Server-Patches/0002-Paper-config-files.patch b/Spigot-Server-Patches/0002-Paper-config-files.patch index 1995587bd2..edc9aad0d9 100644 --- a/Spigot-Server-Patches/0002-Paper-config-files.patch +++ b/Spigot-Server-Patches/0002-Paper-config-files.patch @@ -635,10 +635,10 @@ index 74ad1325727bdc41ed5b2e67058aeaa4fe6db4f2..03dc3dd41015dc210d2781c207261fc3 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 9c13f39e85b019440cb59bbd736ad9920e2151da..174c63f2c93693aa06a3574dc6dea91c98ea1e25 100644 +index 9aa648bb5ec42730f6ce85902b91a079084e7f8e..d9dda69118a5319da28cf3011fe5d8a64da08a5c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -792,6 +792,7 @@ public final class CraftServer implements Server { +@@ -793,6 +793,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot @@ -646,7 +646,7 @@ index 9c13f39e85b019440cb59bbd736ad9920e2151da..174c63f2c93693aa06a3574dc6dea91c for (WorldServer world : console.getWorlds()) { world.worldDataServer.setDifficulty(config.difficulty); world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals); -@@ -819,6 +820,7 @@ public final class CraftServer implements Server { +@@ -820,6 +821,7 @@ public final class CraftServer implements Server { world.ticksPerAmbientSpawns = this.getTicksPerAmbientSpawns(); } world.spigotConfig.init(); // Spigot @@ -654,7 +654,7 @@ index 9c13f39e85b019440cb59bbd736ad9920e2151da..174c63f2c93693aa06a3574dc6dea91c } pluginManager.clearPlugins(); -@@ -826,6 +828,7 @@ public final class CraftServer implements Server { +@@ -827,6 +829,7 @@ public final class CraftServer implements Server { resetRecipes(); reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot @@ -662,7 +662,7 @@ index 9c13f39e85b019440cb59bbd736ad9920e2151da..174c63f2c93693aa06a3574dc6dea91c overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2051,4 +2054,35 @@ public final class CraftServer implements Server { +@@ -2055,4 +2058,35 @@ public final class CraftServer implements Server { { return spigot; } diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch index 3d64c33748..0bd0c2f86a 100644 --- a/Spigot-Server-Patches/0004-MC-Utils.patch +++ b/Spigot-Server-Patches/0004-MC-Utils.patch @@ -3807,10 +3807,10 @@ index 0000000000000000000000000000000000000000..da7a325d070e194cd1664ed20dcb3a76 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f5346ebbc338b002a9997e13e3bfba2d31457d90..aeb2e95e4c350f0b539466fc56ac41c8280aba20 100644 +index 3cb0957d8b57c930d74fc25aa5e1a0eaaf33e747..0aed429bfa996b1b01dbe2c876c6ad489ab7fa4a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -764,6 +764,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable { -@@ -118,8 +118,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant resourcePackRepository; private final ScoreboardServer scoreboardServer; @Nullable -@@ -710,6 +710,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= 5000000000L) { -@@ -1023,14 +1044,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit @@ -1216,7 +1216,7 @@ index aeb2e95e4c350f0b539466fc56ac41c8280aba20..a7579b01d27e367603ba643c390b316b } this.methodProfiler.enter("snooper"); -@@ -1043,6 +1062,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public File bukkitDataPackFolder; -@@ -153,7 +153,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant getMaxHealth())) { diff --git a/Spigot-Server-Patches/0052-Add-velocity-warnings.patch b/Spigot-Server-Patches/0052-Add-velocity-warnings.patch index 285b90a42e..e4ddb4ad16 100644 --- a/Spigot-Server-Patches/0052-Add-velocity-warnings.patch +++ b/Spigot-Server-Patches/0052-Add-velocity-warnings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 15ee6ee6e96bb48f73cbb2944eeee8f726914e2d..49889d8c1d1f9b9c79b1d526f4cd9a94944c1c72 100644 +index 8091c4538a97fbc8f2495183ef952aecde659342..af17df4810ef30eba640028dd0b2047ed387eff0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -258,6 +258,7 @@ public final class CraftServer implements Server { +@@ -259,6 +259,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; diff --git a/Spigot-Server-Patches/0057-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/Spigot-Server-Patches/0057-Add-methods-for-working-with-arrows-stuck-in-living-.patch index e63b467a77..35b6db371e 100644 --- a/Spigot-Server-Patches/0057-Add-methods-for-working-with-arrows-stuck-in-living-.patch +++ b/Spigot-Server-Patches/0057-Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add methods for working with arrows stuck in living entities diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 20ada1ab2bea9fa5bde19cb4768d64f73a4154d2..8c3fa2335cfa1df94eb64bda5b12f1f5858dec27 100644 +index 7e95ef170c418594f5469431c052e64107c08ab5..d5b165e8275c012d775b77b8440489716a6c3c08 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -629,4 +629,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -636,4 +636,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void setMemory(MemoryKey memoryKey, T t) { getHandle().getBehaviorController().setMemory(CraftMemoryKey.fromMemoryKey(memoryKey), CraftMemoryMapper.toNms(t)); } diff --git a/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch b/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch index 44222f2870..4a9869fd1b 100644 --- a/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch +++ b/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch @@ -30,10 +30,10 @@ index f402a29b0904a0094ffe6e42dbdc6fbc0912d9d9..6ef5bb9f323da7cbf8cb24d094bf43c4 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 49889d8c1d1f9b9c79b1d526f4cd9a94944c1c72..2fb96635d7f811fd77a807ae4a4cc1c0ae0af47a 100644 +index af17df4810ef30eba640028dd0b2047ed387eff0..3b61bb5da6adc04eed934885be7ece2b3f4ea74c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -394,6 +394,7 @@ public final class CraftServer implements Server { +@@ -395,6 +395,7 @@ public final class CraftServer implements Server { if (type == PluginLoadOrder.STARTUP) { helpMap.clear(); helpMap.initializeGeneralTopics(); @@ -41,7 +41,7 @@ index 49889d8c1d1f9b9c79b1d526f4cd9a94944c1c72..2fb96635d7f811fd77a807ae4a4cc1c0 } Plugin[] plugins = pluginManager.getPlugins(); -@@ -413,7 +414,7 @@ public final class CraftServer implements Server { +@@ -414,7 +415,7 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); diff --git a/Spigot-Server-Patches/0061-Allow-Reloading-of-Custom-Permissions.patch b/Spigot-Server-Patches/0061-Allow-Reloading-of-Custom-Permissions.patch index 126942160a..8d2c6f913e 100644 --- a/Spigot-Server-Patches/0061-Allow-Reloading-of-Custom-Permissions.patch +++ b/Spigot-Server-Patches/0061-Allow-Reloading-of-Custom-Permissions.patch @@ -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 2fb96635d7f811fd77a807ae4a4cc1c0ae0af47a..530c0fb05c4631e8946a7defdf9e5c535bc3ddc2 100644 +index 3b61bb5da6adc04eed934885be7ece2b3f4ea74c..e1c39accfbdd1ac4bcfdfa9bc159f6d62a36fb50 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2140,5 +2140,23 @@ public final class CraftServer implements Server { +@@ -2144,5 +2144,23 @@ public final class CraftServer implements Server { return null; } } diff --git a/Spigot-Server-Patches/0062-Remove-Metadata-on-reload.patch b/Spigot-Server-Patches/0062-Remove-Metadata-on-reload.patch index 541a136a9d..79a205c301 100644 --- a/Spigot-Server-Patches/0062-Remove-Metadata-on-reload.patch +++ b/Spigot-Server-Patches/0062-Remove-Metadata-on-reload.patch @@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive This will remove metadata on reload so it does not crash everything if a plugin uses it. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 530c0fb05c4631e8946a7defdf9e5c535bc3ddc2..f29253ba0fdf30d78dbec58a8c706e219653ddeb 100644 +index e1c39accfbdd1ac4bcfdfa9bc159f6d62a36fb50..c8073b635ff03e2d76b1def6fd3144b88a385722 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -848,8 +848,18 @@ public final class CraftServer implements Server { +@@ -849,8 +849,18 @@ public final class CraftServer implements Server { world.paperConfig.init(); // Paper } diff --git a/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index 49923e401a..b369db1166 100644 --- a/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -32,10 +32,10 @@ index f87fc631255aa5948459f0726b188ebbbae13c5f..446a2ffcd95fd631750b74fd31b4c410 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cc3718765ed54f8042a2687e409a51098ebc67a0..3202c171cffed5c5cec74f6b082aedaeae1c7b9d 100644 +index fe47aa345b93105547e216f683491943866ccd3f..2455bbee53b4fe3084a785471fde7c4a3354dd4b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1172,6 +1172,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable { @@ -17,7 +17,7 @@ index 04429bb6f4d75800425087d8a5463ab9f4f4cef3..17846ca9190c63671ad616c668aa1fe1 public static final Logger LOGGER = LogManager.getLogger(); public static final File b = new File("usercache.json"); public static final WorldSettings c = new WorldSettings("Demo World", EnumGamemode.SURVIVAL, false, EnumDifficulty.NORMAL, false, new GameRules(), DataPackConfiguration.a); -@@ -176,6 +177,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant resourcepackrepository, Proxy proxy, DataFixer datafixer, DataPackResources datapackresources, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) { super("Server"); @@ -25,7 +25,7 @@ index 04429bb6f4d75800425087d8a5463ab9f4f4cef3..17846ca9190c63671ad616c668aa1fe1 this.m = new GameProfilerSwitcher(SystemUtils.a, this::ag); this.methodProfiler = GameProfilerDisabled.a; this.serverPing = new ServerPing(); -@@ -2033,7 +2035,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant, WorldServer> worldServer; private PlayerList playerList; private volatile boolean isRunning; @@ -41,7 +41,7 @@ index 800ca2d57295c40853f5f1e58ce15e75f1a5afad..8e47f5f5dcf217169107913cc0c8332c private boolean isStopped; private int ticks; protected final Proxy proxy; -@@ -739,7 +740,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; -@@ -214,7 +214,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= 5000000000L) { this.T = i; this.serverPing.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.getMaxPlayers(), this.getPlayerCount())); diff --git a/Spigot-Server-Patches/0204-Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/0203-Player.setPlayerProfile-API.patch similarity index 86% rename from Spigot-Server-Patches/0204-Player.setPlayerProfile-API.patch rename to Spigot-Server-Patches/0203-Player.setPlayerProfile-API.patch index 8f5e841145..8525a40dc1 100644 --- a/Spigot-Server-Patches/0204-Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/0203-Player.setPlayerProfile-API.patch @@ -6,23 +6,23 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 55d08d77480fda81e0155aa1e0287fddc827b67a..fda1b3d91b14080bf04a02c1340c63a6eb37911d 100644 +index 5326e7433dc0a4ff0e1d0ca30aad95b1ec718d6a..a781ac0cf8766e915c10ebd3823cbe5b0d1c5230 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -66,7 +66,7 @@ public abstract class EntityHuman extends EntityLiving { - protected int bO; - protected final float bP = 0.02F; - private int bS; -- private final GameProfile bT; -+ private GameProfile bT; public final void setProfile(final GameProfile profile) { this.bT = profile; } // Paper - OBFHELPER - private ItemStack bV; - private final ItemCooldown bW; +@@ -65,7 +65,7 @@ public abstract class EntityHuman extends EntityLiving { + protected int bN; + protected final float bO = 0.02F; + private int g; +- private final GameProfile bQ; ++ private final GameProfile bQ; public final void setProfile(final GameProfile profile) { this.bQ = profile; } // Paper - OBFHELPER + private ItemStack bS; + private final ItemCooldown bT; @Nullable diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 1b43f921646e3c1bfdca22ef7d3719c72aaf4520..1c4ac7bf7ac4d864ba6efd46d8c562c238dad2bc 100644 +index 80a21dbc05ed3007f2e827f7a320131244c3044b..e0f0a1e91a037f93b239e779aa8fd92be8a8c01f 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java -@@ -37,7 +37,7 @@ public class LoginListener implements PacketLoginInListener { +@@ -36,7 +36,7 @@ public class LoginListener implements PacketLoginInListener { public final NetworkManager networkManager; private LoginListener.EnumProtocolState g; private int h; @@ -31,7 +31,7 @@ index 1b43f921646e3c1bfdca22ef7d3719c72aaf4520..1c4ac7bf7ac4d864ba6efd46d8c562c2 private final String j; private SecretKey loginKey; private EntityPlayer l; -@@ -291,12 +291,12 @@ public class LoginListener implements PacketLoginInListener { +@@ -290,12 +290,12 @@ public class LoginListener implements PacketLoginInListener { final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server; // Paper start @@ -48,7 +48,7 @@ index 1b43f921646e3c1bfdca22ef7d3719c72aaf4520..1c4ac7bf7ac4d864ba6efd46d8c562c2 uniqueId = i.getId(); // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5b088b21da2ca3945de9c5dcc4370114f930d739..d571248f597cbad63d26bc1bdf91cc263f88947f 100644 +index 734274db8f8c53d7e5310f2c16b1c64a42a6277c..4f0dabdb6683402d9fd0ea789381928fa06ee119 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,6 +1,8 @@ @@ -60,7 +60,7 @@ index 5b088b21da2ca3945de9c5dcc4370114f930d739..d571248f597cbad63d26bc1bdf91cc26 import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.io.BaseEncoding; -@@ -1175,8 +1177,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1216,8 +1218,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { hiddenPlayers.put(player.getUniqueId(), hidingPlugins); // Remove this player from the hidden player's EntityTrackerEntry @@ -75,7 +75,7 @@ index 5b088b21da2ca3945de9c5dcc4370114f930d739..d571248f597cbad63d26bc1bdf91cc26 PlayerChunkMap.EntityTracker entry = tracker.trackedEntities.get(other.getId()); if (entry != null) { entry.clear(getHandle()); -@@ -1217,8 +1224,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1258,8 +1265,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } hiddenPlayers.remove(player.getUniqueId()); @@ -90,7 +90,7 @@ index 5b088b21da2ca3945de9c5dcc4370114f930d739..d571248f597cbad63d26bc1bdf91cc26 getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other)); -@@ -1227,6 +1239,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1268,6 +1280,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { entry.updatePlayer(getHandle()); } } diff --git a/Spigot-Server-Patches/0205-Fix-Dragon-Server-Crashes.patch b/Spigot-Server-Patches/0204-Fix-Dragon-Server-Crashes.patch similarity index 92% rename from Spigot-Server-Patches/0205-Fix-Dragon-Server-Crashes.patch rename to Spigot-Server-Patches/0204-Fix-Dragon-Server-Crashes.patch index 3de215fd61..018a36e91b 100644 --- a/Spigot-Server-Patches/0205-Fix-Dragon-Server-Crashes.patch +++ b/Spigot-Server-Patches/0204-Fix-Dragon-Server-Crashes.patch @@ -7,7 +7,7 @@ If the dragon tries to find "ground" and hits a hole, or off edge, it will infinitely keep looking for non air and eventually crash. diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java -index c42de9771e96f0b1bc8fbe9fe76572ab18d5d98c..40a8beff556873a5db108e44fd053e8de80e36a6 100644 +index d70a45f2530d9dd5e10aa48f20db33a97bbe952e..fbc2ec88f7c71c853c492301986a23dafc8fa7a6 100644 --- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java +++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java @@ -54,7 +54,7 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded diff --git a/Spigot-Server-Patches/0206-getPlayerUniqueId-API.patch b/Spigot-Server-Patches/0205-getPlayerUniqueId-API.patch similarity index 91% rename from Spigot-Server-Patches/0206-getPlayerUniqueId-API.patch rename to Spigot-Server-Patches/0205-getPlayerUniqueId-API.patch index 1646869da0..3777a5b872 100644 --- a/Spigot-Server-Patches/0206-getPlayerUniqueId-API.patch +++ b/Spigot-Server-Patches/0205-getPlayerUniqueId-API.patch @@ -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 3697b3298feaec30c305e3da011790f2406e12d7..0ec84609896dd53a0c2c232f45e5c8f83558a37c 100644 +index f51a59f5c1a0c8e34921fbf79c86f999c9951ee6..98475ce12d6b370b69466f1869d8be07d5130806 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1403,6 +1403,26 @@ public final class CraftServer implements Server { +@@ -1466,6 +1466,26 @@ public final class CraftServer implements Server { return recipients.size(); } diff --git a/Spigot-Server-Patches/0207-Make-player-data-saving-configurable.patch b/Spigot-Server-Patches/0206-Make-player-data-saving-configurable.patch similarity index 86% rename from Spigot-Server-Patches/0207-Make-player-data-saving-configurable.patch rename to Spigot-Server-Patches/0206-Make-player-data-saving-configurable.patch index e096021ccb..a2139ce940 100644 --- a/Spigot-Server-Patches/0207-Make-player-data-saving-configurable.patch +++ b/Spigot-Server-Patches/0206-Make-player-data-saving-configurable.patch @@ -23,14 +23,14 @@ index 5884b04f7e84048a9710736bd14237140ebf2cf7..ba341e0174cdc3b5b8bc83b743027018 + } } diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index a0254d8e519fa8b19dc282f3abf33b8ebe4f0aba..e60e10c57d5acaecb70e89c83c34f1f8870091c2 100644 +index ef9719bf20db92a7e6690bccb00cc54293d392a9..ae43d8d2af0daa68f13528d25bac1d94964662bc 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -138,6 +138,7 @@ public class WorldNBTStorage implements IPlayerFileData { +@@ -27,6 +27,7 @@ public class WorldNBTStorage { + } - @Override public void save(EntityHuman entityhuman) { + if(!com.destroystokyo.paper.PaperConfig.savePlayerData) return; // Paper - Make player data saving configurable try { NBTTagCompound nbttagcompound = entityhuman.save(new NBTTagCompound()); - File file = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat.tmp"); + File file = File.createTempFile(entityhuman.getUniqueIDString() + "-", ".dat", this.playerDir); diff --git a/Spigot-Server-Patches/0208-Make-legacy-ping-handler-more-reliable.patch b/Spigot-Server-Patches/0207-Make-legacy-ping-handler-more-reliable.patch similarity index 100% rename from Spigot-Server-Patches/0208-Make-legacy-ping-handler-more-reliable.patch rename to Spigot-Server-Patches/0207-Make-legacy-ping-handler-more-reliable.patch diff --git a/Spigot-Server-Patches/0209-Call-PaperServerListPingEvent-for-legacy-pings.patch b/Spigot-Server-Patches/0208-Call-PaperServerListPingEvent-for-legacy-pings.patch similarity index 100% rename from Spigot-Server-Patches/0209-Call-PaperServerListPingEvent-for-legacy-pings.patch rename to Spigot-Server-Patches/0208-Call-PaperServerListPingEvent-for-legacy-pings.patch diff --git a/Spigot-Server-Patches/0210-Flag-to-disable-the-channel-limit.patch b/Spigot-Server-Patches/0209-Flag-to-disable-the-channel-limit.patch similarity index 88% rename from Spigot-Server-Patches/0210-Flag-to-disable-the-channel-limit.patch rename to Spigot-Server-Patches/0209-Flag-to-disable-the-channel-limit.patch index 6422b74f23..edee7f024d 100644 --- a/Spigot-Server-Patches/0210-Flag-to-disable-the-channel-limit.patch +++ b/Spigot-Server-Patches/0209-Flag-to-disable-the-channel-limit.patch @@ -9,10 +9,10 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d571248f597cbad63d26bc1bdf91cc263f88947f..f5c722644a1955c9bc68c89fdbb84526f9bbb7a0 100644 +index 4f0dabdb6683402d9fd0ea789381928fa06ee119..ec0cb22d53733bed33019b257ac06ca9dc80d19e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -137,6 +137,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -141,6 +141,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper start private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private String resourcePackHash; @@ -20,7 +20,7 @@ index d571248f597cbad63d26bc1bdf91cc263f88947f..f5c722644a1955c9bc68c89fdbb84526 // Paper end public CraftPlayer(CraftServer server, EntityPlayer entity) { -@@ -1444,7 +1445,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1485,7 +1486,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { diff --git a/Spigot-Server-Patches/0211-Add-method-to-open-already-placed-sign.patch b/Spigot-Server-Patches/0210-Add-method-to-open-already-placed-sign.patch similarity index 88% rename from Spigot-Server-Patches/0211-Add-method-to-open-already-placed-sign.patch rename to Spigot-Server-Patches/0210-Add-method-to-open-already-placed-sign.patch index 159ab07d69..4d1123236d 100644 --- a/Spigot-Server-Patches/0211-Add-method-to-open-already-placed-sign.patch +++ b/Spigot-Server-Patches/0210-Add-method-to-open-already-placed-sign.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 191bb7345e06cbad7bef416e4e849df3727bdac0..20f0783025516048851aedef0a70759c2953ae47 100644 +index d67fd3bf1048afae0bb78a95724ddf53337d9a2f..42bc39381c4fc5ff81bdd312afd1644dcc5d40c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -617,4 +617,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -584,4 +584,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { entity.remove(); } } diff --git a/Spigot-Server-Patches/0212-Configurable-sprint-interruption-on-attack.patch b/Spigot-Server-Patches/0211-Configurable-sprint-interruption-on-attack.patch similarity index 92% rename from Spigot-Server-Patches/0212-Configurable-sprint-interruption-on-attack.patch rename to Spigot-Server-Patches/0211-Configurable-sprint-interruption-on-attack.patch index 4ccc72a2c6..b50568c135 100644 --- a/Spigot-Server-Patches/0212-Configurable-sprint-interruption-on-attack.patch +++ b/Spigot-Server-Patches/0211-Configurable-sprint-interruption-on-attack.patch @@ -20,10 +20,10 @@ index 77cdbfadf9c3eddb6a02460c321fa816d1bab8ac..171c8e3031cf4bf4da062663089cc0cb + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index fda1b3d91b14080bf04a02c1340c63a6eb37911d..14a0e3d41ccd896da3b1126a403b0b684cada907 100644 +index a781ac0cf8766e915c10ebd3823cbe5b0d1c5230..59f7fced6213c218cd19863be99964eb496b6fe6 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1112,7 +1112,11 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1091,7 +1091,11 @@ public abstract class EntityHuman extends EntityLiving { } this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D)); diff --git a/Spigot-Server-Patches/0213-Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/Spigot-Server-Patches/0212-Fix-exploit-that-allowed-colored-signs-to-be-created.patch similarity index 79% rename from Spigot-Server-Patches/0213-Fix-exploit-that-allowed-colored-signs-to-be-created.patch rename to Spigot-Server-Patches/0212-Fix-exploit-that-allowed-colored-signs-to-be-created.patch index fa360cc099..f1d904040f 100644 --- a/Spigot-Server-Patches/0213-Fix-exploit-that-allowed-colored-signs-to-be-created.patch +++ b/Spigot-Server-Patches/0212-Fix-exploit-that-allowed-colored-signs-to-be-created.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index c256e798d12098881cb5bfb655eab5b63f1614e7..a357b6167405be4034cf3dad4124827e04278366 100644 +index fa5c640239451579fba35ad7b0979739e0b7b16f..e78306cb187b5f08e32888ebd55c4c486fc8dad2 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2502,7 +2502,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2541,7 +2541,7 @@ public class PlayerConnection implements PacketListenerPlayIn { String[] lines = new String[4]; for (int i = 0; i < astring.length; ++i) { -- lines[i] = EnumChatFormat.b(new ChatComponentText(EnumChatFormat.b(astring[i])).getString()); +- lines[i] = EnumChatFormat.a(new ChatComponentText(EnumChatFormat.a(astring[i])).getString()); + lines[i] = SharedConstants.a(astring[i]); //Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created. } SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines); diff --git a/Spigot-Server-Patches/0214-EndermanEscapeEvent.patch b/Spigot-Server-Patches/0213-EndermanEscapeEvent.patch similarity index 62% rename from Spigot-Server-Patches/0214-EndermanEscapeEvent.patch rename to Spigot-Server-Patches/0213-EndermanEscapeEvent.patch index 925873536f..1002240ce3 100644 --- a/Spigot-Server-Patches/0214-EndermanEscapeEvent.patch +++ b/Spigot-Server-Patches/0213-EndermanEscapeEvent.patch @@ -8,7 +8,7 @@ Fires an event anytime an enderman intends to teleport away from the player You may cancel this, enabling ranged attacks to damage the enderman for example. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 538c2169cd53d364b941ad1251df3731f77b3a2c..2893f75bdff91e810431c64899b64047c372aa62 100644 +index 37a4bce1cd24e04b70367484c1ad3beae047ab08..888e66520548a47dbfa1c452b0d3fa5dcbe2002c 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -19,7 +19,7 @@ index 538c2169cd53d364b941ad1251df3731f77b3a2c..2893f75bdff91e810431c64899b64047 import java.util.Random; import java.util.UUID; import java.util.function.Predicate; -@@ -56,6 +57,12 @@ public class EntityEnderman extends EntityMonster { +@@ -56,6 +57,12 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true); } @@ -32,37 +32,37 @@ index 538c2169cd53d364b941ad1251df3731f77b3a2c..2893f75bdff91e810431c64899b64047 @Override public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) { if (!super.setGoalTarget(entityliving, reason, fireEvent)) { -@@ -177,7 +184,7 @@ public class EntityEnderman extends EntityMonster { - if (this.world.isDay() && this.ticksLived >= this.bA + 600) { - float f = this.aI(); +@@ -209,7 +216,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + if (this.world.isDay() && this.ticksLived >= this.bz + 600) { + float f = this.aO(); -- if (f > 0.5F && this.world.f(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { -+ if (f > 0.5F && this.world.f(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper +- if (f > 0.5F && this.world.f(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { ++ if (f > 0.5F && this.world.f(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper this.setGoalTarget((EntityLiving) null); - this.eq(); + this.eM(); } -@@ -277,17 +284,19 @@ public class EntityEnderman extends EntityMonster { - } else if (!(damagesource instanceof EntityDamageSourceIndirect) && damagesource != DamageSource.FIREWORKS) { - boolean flag = super.damageEntity(damagesource, f); - -- if (!this.world.p_() && damagesource.ignoresArmor() && this.random.nextInt(10) != 0) { -+ if (!this.world.p_() && damagesource.ignoresArmor() && this.random.nextInt(10) != 0 && this.tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper - this.eq(); - } - - return flag; - } else { +@@ -307,17 +314,19 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + if (this.isInvulnerable(damagesource)) { + return false; + } else if (damagesource instanceof EntityDamageSourceIndirect) { + if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start for (int i = 0; i < 64; ++i) { - if (this.eq()) { + if (this.eM()) { return true; } } + } // Paper end return false; - } -@@ -422,7 +431,7 @@ public class EntityEnderman extends EntityMonster { + } else { + boolean flag = super.damageEntity(damagesource, f); + +- if (!this.world.s_() && this.random.nextInt(10) != 0) { ++ if (!this.world.s_() && this.random.nextInt(10) != 0 && this.tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper + this.eM(); + } + +@@ -459,7 +468,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { static class PathfinderGoalPlayerWhoLookedAtTarget extends PathfinderGoalNearestAttackableTarget { @@ -71,12 +71,12 @@ index 538c2169cd53d364b941ad1251df3731f77b3a2c..2893f75bdff91e810431c64899b64047 private EntityHuman j; private int k; private int l; -@@ -481,7 +490,7 @@ public class EntityEnderman extends EntityMonster { +@@ -522,7 +531,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { } else { if (this.c != null && !this.i.isPassenger()) { - if (this.i.f((EntityHuman) this.c)) { + if (this.i.g((EntityHuman) this.c)) { - if (this.c.h((Entity) this.i) < 16.0D) { + if (this.c.h((Entity) this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { - this.i.eq(); + this.i.eM(); } diff --git a/Spigot-Server-Patches/0215-Enderman.teleportRandomly.patch b/Spigot-Server-Patches/0214-Enderman.teleportRandomly.patch similarity index 80% rename from Spigot-Server-Patches/0215-Enderman.teleportRandomly.patch rename to Spigot-Server-Patches/0214-Enderman.teleportRandomly.patch index 4121c3f53e..a068e22b2d 100644 --- a/Spigot-Server-Patches/0215-Enderman.teleportRandomly.patch +++ b/Spigot-Server-Patches/0214-Enderman.teleportRandomly.patch @@ -6,16 +6,16 @@ Subject: [PATCH] Enderman.teleportRandomly() Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 2893f75bdff91e810431c64899b64047c372aa62..f279c9b1482d3b3d632a762affff425139920b66 100644 +index 888e66520548a47dbfa1c452b0d3fa5dcbe2002c..67a678eceea5304d8ad1eaaee62c57c1088096f5 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -193,6 +193,7 @@ public class EntityEnderman extends EntityMonster { +@@ -225,6 +225,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { super.mobTick(); } -+ public final boolean teleportRandomly() { return this.eq(); } // Paper - OBFHELPER - protected boolean eq() { - if (!this.world.p_() && this.isAlive()) { ++ public final boolean teleportRandomly() { return this.eM(); } // Paper - OBFHELPER + protected boolean eM() { + if (!this.world.s_() && this.isAlive()) { double d0 = this.locX() + (this.random.nextDouble() - 0.5D) * 64.0D; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java index 970efabd37d380ee1028c80a8e967e0f7aee9760..0c5f35934617529e92c02729687b524c3796128c 100644 diff --git a/Spigot-Server-Patches/0216-Block-Enderpearl-Travel-Exploit.patch b/Spigot-Server-Patches/0215-Block-Enderpearl-Travel-Exploit.patch similarity index 63% rename from Spigot-Server-Patches/0216-Block-Enderpearl-Travel-Exploit.patch rename to Spigot-Server-Patches/0215-Block-Enderpearl-Travel-Exploit.patch index 3f7e943452..d3f007cb38 100644 --- a/Spigot-Server-Patches/0216-Block-Enderpearl-Travel-Exploit.patch +++ b/Spigot-Server-Patches/0215-Block-Enderpearl-Travel-Exploit.patch @@ -26,15 +26,15 @@ index 171c8e3031cf4bf4da062663089cc0cb4552fab6..9c52e31f4cf1e64a37c65c021da219fc + log("Disable Unloaded Chunk Enderpearl Exploit: " + (disableEnderpearlExploit ? "enabled" : "disabled")); + } } -diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index 724b78b5d2d7f4ce8de31c763d2d95b986c1b7f6..9eed1dce3e48683b751ebbaac0487a046354622e 100644 ---- a/src/main/java/net/minecraft/server/EntityProjectile.java -+++ b/src/main/java/net/minecraft/server/EntityProjectile.java -@@ -201,6 +201,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile { - if (nbttagcompound.hasKeyOfType("owner", 10)) { - this.shooterId = GameProfileSerializer.b(nbttagcompound.getCompound("owner")); +diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java +index 8ce491fc155450a94582f94c78c8c296f8eeb864..cdf80e50de0840002f62f4c1df4fbcc4e13675d7 100644 +--- a/src/main/java/net/minecraft/server/IProjectile.java ++++ b/src/main/java/net/minecraft/server/IProjectile.java +@@ -48,6 +48,7 @@ public abstract class IProjectile extends Entity { + protected void loadData(NBTTagCompound nbttagcompound) { + if (nbttagcompound.b("Owner")) { + this.shooter = nbttagcompound.a("Owner"); ++ if (this instanceof EntityEnderPearl && this.world != null && this.world.paperConfig.disableEnderpearlExploit) { this.shooter = null; } // Paper - Don't store shooter name for pearls to block enderpearl travel exploit } -+ if (this instanceof EntityEnderPearl && this.world != null && this.world.paperConfig.disableEnderpearlExploit) { this.shooterId = null; } // Paper - Don't store shooter name for pearls to block enderpearl travel exploit - - } + this.d = nbttagcompound.getBoolean("LeftOwner"); diff --git a/Spigot-Server-Patches/0217-Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-Server-Patches/0216-Expand-World.spawnParticle-API-and-add-Builder.patch similarity index 89% rename from Spigot-Server-Patches/0217-Expand-World.spawnParticle-API-and-add-Builder.patch rename to Spigot-Server-Patches/0216-Expand-World.spawnParticle-API-and-add-Builder.patch index f01c7fe61d..73173219f4 100644 --- a/Spigot-Server-Patches/0217-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-Server-Patches/0216-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,19 +10,19 @@ 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 e428b3cb8c8ca5a662a0e867bf74d08775f1bacd..a834a77b2de8f7287be69fd5d002ff43261a9a85 100644 +index 6d5bb1c5183c0e7fc83e197f3a6840b2dcb1ad02..7a71e6dfea35addb7d3d33d8ce187cc2c6943de6 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -56,7 +56,7 @@ public class WorldServer extends World { +@@ -56,7 +56,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { public final Int2ObjectMap entitiesById = new Int2ObjectLinkedOpenHashMap(); private final Map entitiesByUUID = Maps.newHashMap(); private final Queue entitiesToAdd = Queues.newArrayDeque(); - private final List players = Lists.newArrayList(); + public final List players = Lists.newArrayList(); // Paper - private -> public + public final ChunkProviderServer chunkProvider; // Paper - public boolean tickingEntities; private final MinecraftServer server; - private final WorldNBTStorage dataManager; -@@ -1392,12 +1392,17 @@ public class WorldServer extends World { +@@ -1311,12 +1311,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { } 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) { @@ -43,10 +43,10 @@ index e428b3cb8c8ca5a662a0e867bf74d08775f1bacd..a834a77b2de8f7287be69fd5d002ff43 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 13a83f285126123811a148453ccaea6f9bf197b4..1a3ca48485ebce128ae1288e6a50308c76ee0452 100644 +index 876a62a456c8ff938cca4944b0b40a135dd6ac1c..aa497699fc0fab80b3da1ff4dd08840260cb22d3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2287,11 +2287,17 @@ public class CraftWorld implements World { +@@ -2295,11 +2295,17 @@ public class CraftWorld implements World { @Override public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { diff --git a/Spigot-Server-Patches/0218-EndermanAttackPlayerEvent.patch b/Spigot-Server-Patches/0217-EndermanAttackPlayerEvent.patch similarity index 73% rename from Spigot-Server-Patches/0218-EndermanAttackPlayerEvent.patch rename to Spigot-Server-Patches/0217-EndermanAttackPlayerEvent.patch index 3642aff6fe..0328ba25f6 100644 --- a/Spigot-Server-Patches/0218-EndermanAttackPlayerEvent.patch +++ b/Spigot-Server-Patches/0217-EndermanAttackPlayerEvent.patch @@ -8,21 +8,21 @@ Allow control over whether or not an enderman aggros a player. This allows you to override/extend the pumpkin/stare logic. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index f279c9b1482d3b3d632a762affff425139920b66..b7c67f0cdb3d02c7a2dbe85f9a432836cb34bb6e 100644 +index 67a678eceea5304d8ad1eaaee62c57c1088096f5..7c13e5b711706c8aaa363d80350597a52920f12b 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -141,7 +141,15 @@ public class EntityEnderman extends EntityMonster { - this.setCarried(iblockdata); +@@ -168,7 +168,15 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + this.a((WorldServer) this.world, nbttagcompound); } + // Paper start - OBFHELPER - ok not really, but verify this on updates - private boolean f(EntityHuman entityhuman) { -+ boolean shouldAttack = f_real(entityhuman); + private boolean g(EntityHuman entityhuman) { ++ boolean shouldAttack = g_real(entityhuman); + com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent event = new com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent((org.bukkit.entity.Enderman) getBukkitEntity(), (org.bukkit.entity.Player) entityhuman.getBukkitEntity()); + event.setCancelled(!shouldAttack); + return event.callEvent(); + } -+ private boolean f_real(EntityHuman entityhuman) { ++ private boolean g_real(EntityHuman entityhuman) { + // Paper end ItemStack itemstack = (ItemStack) entityhuman.inventory.armor.get(3); diff --git a/Spigot-Server-Patches/0219-WitchConsumePotionEvent.patch b/Spigot-Server-Patches/0218-WitchConsumePotionEvent.patch similarity index 89% rename from Spigot-Server-Patches/0219-WitchConsumePotionEvent.patch rename to Spigot-Server-Patches/0218-WitchConsumePotionEvent.patch index a76d06b132..164db395a9 100644 --- a/Spigot-Server-Patches/0219-WitchConsumePotionEvent.patch +++ b/Spigot-Server-Patches/0218-WitchConsumePotionEvent.patch @@ -6,12 +6,12 @@ Subject: [PATCH] WitchConsumePotionEvent Fires when a witch consumes the potion in their hand diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index ddff0b57869c3511346510a91336045ec1469bdc..aa90111716c69379df250f06957a2db5178bbe92 100644 +index e146957d219960d0b6371b9460e73fb0ea150dde..a364ab990883bcdf84d8d92385a738200630864d 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java -@@ -88,7 +88,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { +@@ -85,7 +85,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { - this.setSlot(EnumItemSlot.MAINHAND, ItemStack.a); + this.setSlot(EnumItemSlot.MAINHAND, ItemStack.b); if (itemstack.getItem() == Items.POTION) { - List list = PotionUtil.getEffects(itemstack); + // Paper start diff --git a/Spigot-Server-Patches/0220-WitchThrowPotionEvent.patch b/Spigot-Server-Patches/0219-WitchThrowPotionEvent.patch similarity index 84% rename from Spigot-Server-Patches/0220-WitchThrowPotionEvent.patch rename to Spigot-Server-Patches/0219-WitchThrowPotionEvent.patch index d1d7c110e2..19bc42b807 100644 --- a/Spigot-Server-Patches/0220-WitchThrowPotionEvent.patch +++ b/Spigot-Server-Patches/0219-WitchThrowPotionEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index aa90111716c69379df250f06957a2db5178bbe92..1f2759e95e6a8382c5d27899b05a993beee25f5a 100644 +index a364ab990883bcdf84d8d92385a738200630864d..75d014ad49c701e4c693be4e2f8e7dc6d592fa5f 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -185,9 +185,16 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { @@ -27,4 +27,4 @@ index aa90111716c69379df250f06957a2db5178bbe92..1f2759e95e6a8382c5d27899b05a993b + // Paper end entitypotion.pitch -= -20.0F; entitypotion.shoot(d0, d1 + (double) (f1 * 0.2F), d2, 0.75F, 8.0F); - this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_THROW, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); + if (!this.isSilent()) { diff --git a/Spigot-Server-Patches/0221-Allow-spawning-Item-entities-with-World.spawnEntity.patch b/Spigot-Server-Patches/0220-Allow-spawning-Item-entities-with-World.spawnEntity.patch similarity index 93% rename from Spigot-Server-Patches/0221-Allow-spawning-Item-entities-with-World.spawnEntity.patch rename to Spigot-Server-Patches/0220-Allow-spawning-Item-entities-with-World.spawnEntity.patch index 69f7bafb33..1826d7235b 100644 --- a/Spigot-Server-Patches/0221-Allow-spawning-Item-entities-with-World.spawnEntity.patch +++ b/Spigot-Server-Patches/0220-Allow-spawning-Item-entities-with-World.spawnEntity.patch @@ -8,7 +8,7 @@ This API has more capabilities than .dropItem with the Consumer function Item can be set inside of the Consumer pre spawn function. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 1a3ca48485ebce128ae1288e6a50308c76ee0452..28a94e473482b414b50ca793564acd409a5dc133 100644 +index aa497699fc0fab80b3da1ff4dd08840260cb22d3..61780597747e67581531ae436249ddd1c32bae82 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1489,6 +1489,10 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0222-WitchReadyPotionEvent.patch b/Spigot-Server-Patches/0221-WitchReadyPotionEvent.patch similarity index 71% rename from Spigot-Server-Patches/0222-WitchReadyPotionEvent.patch rename to Spigot-Server-Patches/0221-WitchReadyPotionEvent.patch index 9461975855..b609ec17fe 100644 --- a/Spigot-Server-Patches/0222-WitchReadyPotionEvent.patch +++ b/Spigot-Server-Patches/0221-WitchReadyPotionEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] WitchReadyPotionEvent diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 1f2759e95e6a8382c5d27899b05a993beee25f5a..be6ecfb08aaba3fc5d96e918b7540fc75c92e89e 100644 +index 75d014ad49c701e4c693be4e2f8e7dc6d592fa5f..a6142ef24bc5bfa15a0ec84fbd8267ffab4e25bf 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java -@@ -121,7 +121,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { +@@ -118,7 +118,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { } if (potionregistry != null) { @@ -18,6 +18,6 @@ index 1f2759e95e6a8382c5d27899b05a993beee25f5a..be6ecfb08aaba3fc5d96e918b7540fc7 + org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); + this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); + // Paper end - this.by = this.getItemInMainHand().k(); - this.t(true); - this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); + this.bx = this.getItemInMainHand().k(); + this.v(true); + if (!this.isSilent()) { diff --git a/Spigot-Server-Patches/0223-ItemStack-getMaxItemUseDuration.patch b/Spigot-Server-Patches/0222-ItemStack-getMaxItemUseDuration.patch similarity index 83% rename from Spigot-Server-Patches/0223-ItemStack-getMaxItemUseDuration.patch rename to Spigot-Server-Patches/0222-ItemStack-getMaxItemUseDuration.patch index 68d6b72767..fed6fc5c02 100644 --- a/Spigot-Server-Patches/0223-ItemStack-getMaxItemUseDuration.patch +++ b/Spigot-Server-Patches/0222-ItemStack-getMaxItemUseDuration.patch @@ -6,19 +6,19 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 854cffe6c98956cbafa2ead9b831e39209a76c8d..641a52b968ef04a142b32703b61c8b75643b36a6 100644 +index c4d034c6a6ff176bc954c00c328512bdf67455a6..7b2010ec4955fb5788c60178c6e306ea3098e9ba 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -548,6 +548,7 @@ public final class ItemStack { +@@ -552,6 +552,7 @@ public final class ItemStack { this.getItem().b(this, world, entityhuman); } + public int getItemUseMaxDuration() { return k(); } // Paper - OBFHELPER public int k() { - return this.getItem().f_(this); + return this.getItem().e_(this); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 3dd912abe3fec22adb29d8edfd66b9f5f3bee4f6..a41be8fdaebe7cf61537c638392b3dc7c7f5b371 100644 +index bbee99c13e66b50401489fa4ea497980b1e50b18..4f72b8874f9575c5fc7949c39b4d489809bba097 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -174,6 +174,13 @@ public final class CraftItemStack extends ItemStack { diff --git a/Spigot-Server-Patches/0224-Implement-EntityTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0223-Implement-EntityTeleportEndGatewayEvent.patch similarity index 84% rename from Spigot-Server-Patches/0224-Implement-EntityTeleportEndGatewayEvent.patch rename to Spigot-Server-Patches/0223-Implement-EntityTeleportEndGatewayEvent.patch index 2d432ec5a8..4cf75627a4 100644 --- a/Spigot-Server-Patches/0224-Implement-EntityTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/0223-Implement-EntityTeleportEndGatewayEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement EntityTeleportEndGatewayEvent diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index 78fba79378173dc2c4290e048c3497e206332458..c71f76004ed934e9e921efc4cb637f2e77af92d2 100644 +index 4686880e1f37841ae0217654ed6aa8f813ad90a6..ea61a473d8e47428ed5cd4541a5855f0e2c50815 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -@@ -145,8 +145,19 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick +@@ -163,8 +163,19 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick } // CraftBukkit end @@ -23,7 +23,7 @@ index 78fba79378173dc2c4290e048c3497e206332458..c71f76004ed934e9e921efc4cb637f2e + return; + } -- entity.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D); +- entity1.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D); + entity.enderTeleportAndLoad(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ()); + // Paper end - EntityTeleportEndGatewayEvent } diff --git a/Spigot-Server-Patches/0225-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch b/Spigot-Server-Patches/0224-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch similarity index 88% rename from Spigot-Server-Patches/0225-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch rename to Spigot-Server-Patches/0224-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch index eb594324e8..4f67347235 100644 --- a/Spigot-Server-Patches/0225-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch +++ b/Spigot-Server-Patches/0224-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch @@ -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 374cf28fb42b13152f58fd63c4f0cb25eae6a2d9..b89530079751c13894527f21572cc37e3a5548b8 100644 +index af9ac84c2caf42d0714d6050ee7db7e39a47878b..e4c1a7c152b2c1202c77e5d5d1c386d84007bc97 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 { @@ -15,10 +15,10 @@ index 374cf28fb42b13152f58fd63c4f0cb25eae6a2d9..b89530079751c13894527f21572cc37e private static final DataWatcherObject POWERED = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); - private static final DataWatcherObject d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); + private static final DataWatcherObject d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject isIgnitedDW = d; // Paper OBFHELPER - private int bw; + private int bv; private int fuseTicks; public int maxFuseTicks = 30; -@@ -219,6 +219,7 @@ public class EntityCreeper extends EntityMonster { +@@ -217,6 +217,7 @@ public class EntityCreeper extends EntityMonster { this.createEffectCloud(); } else { fuseTicks = 0; diff --git a/Spigot-Server-Patches/0226-Fix-CraftEntity-hashCode.patch b/Spigot-Server-Patches/0225-Fix-CraftEntity-hashCode.patch similarity index 91% rename from Spigot-Server-Patches/0226-Fix-CraftEntity-hashCode.patch rename to Spigot-Server-Patches/0225-Fix-CraftEntity-hashCode.patch index b1800dac50..6e4af9b3f9 100644 --- a/Spigot-Server-Patches/0226-Fix-CraftEntity-hashCode.patch +++ b/Spigot-Server-Patches/0225-Fix-CraftEntity-hashCode.patch @@ -21,10 +21,10 @@ check is essentially the same as this.getHandle() == other.getHandle() However, replaced it too to make it clearer of intent. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 2d84f8410a7b8ff88d9dbab64741dcdf40fc1612..5f16dea1a543607e76f7ef70fe44e9a3f12e9132 100644 +index 66edc6ae67084959503ffa0df2c04174fb29b8d8..51f027e8f98240fec989ea877095031bab087bda 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -724,14 +724,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -732,14 +732,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return false; } final CraftEntity other = (CraftEntity) obj; diff --git a/Spigot-Server-Patches/0227-Configurable-Alternative-LootPool-Luck-Formula.patch b/Spigot-Server-Patches/0226-Configurable-Alternative-LootPool-Luck-Formula.patch similarity index 89% rename from Spigot-Server-Patches/0227-Configurable-Alternative-LootPool-Luck-Formula.patch rename to Spigot-Server-Patches/0226-Configurable-Alternative-LootPool-Luck-Formula.patch index ca7762f858..f9025282c6 100644 --- a/Spigot-Server-Patches/0227-Configurable-Alternative-LootPool-Luck-Formula.patch +++ b/Spigot-Server-Patches/0226-Configurable-Alternative-LootPool-Luck-Formula.patch @@ -53,21 +53,21 @@ index ba341e0174cdc3b5b8bc83b7430270181ea92793..26ab855dcf38446a3d8577108bd16fdb + } } diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java -index 3ed6a1e785f68c4bb6c5afe024c43150915968a3..03398ce8fdcc68cf5aa7caa3c8fd51c9e8e178eb 100644 +index ee9069c744df63cbb7f21dd9d28d6d554593674c..ca18d3156fd2b10f8ee48ff02f6f47e6e649200b 100644 --- a/src/main/java/net/minecraft/server/LootSelectorEntry.java +++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java @@ -11,8 +11,8 @@ import org.apache.commons.lang3.ArrayUtils; public abstract class LootSelectorEntry extends LootEntryAbstract { +- protected final int c; - protected final int e; -- protected final int f; -+ protected final int e; public int getWeight() { return e; } // Paper - OBFHELPER -+ protected final int f; public int getQuality() { return f; } // Paper - OBFHELPER - protected final LootItemFunction[] g; - private final BiFunction c; ++ protected final int c; public int getWeight() { return c; } // Paper - OBFHELPER ++ protected final int e; public int getQuality() { return e; } // Paper - OBFHELPER + protected final LootItemFunction[] f; + private final BiFunction g; private final LootEntry h = new LootSelectorEntry.c() { -@@ -145,11 +145,38 @@ public abstract class LootSelectorEntry extends LootEntryAbstract { +@@ -143,11 +143,38 @@ public abstract class LootSelectorEntry extends LootEntryAbstract { public abstract class c implements LootEntry { @@ -77,7 +77,7 @@ index 3ed6a1e785f68c4bb6c5afe024c43150915968a3..03398ce8fdcc68cf5aa7caa3c8fd51c9 @Override public int a(float f) { -- return Math.max(MathHelper.d((float) LootSelectorEntry.this.e + (float) LootSelectorEntry.this.f * f), 0); +- return Math.max(MathHelper.d((float) LootSelectorEntry.this.c + (float) LootSelectorEntry.this.e * f), 0); + // Paper start - Offer an alternative loot formula to refactor how luck bonus applies + // SEE: https://luckformula.emc.gs for details and data + if (lastLuck != null && lastLuck == f) { @@ -104,7 +104,7 @@ index 3ed6a1e785f68c4bb6c5afe024c43150915968a3..03398ce8fdcc68cf5aa7caa3c8fd51c9 + return lastWeight; } } -+ private Float lastLuck = null; -+ private int lastWeight = 0; -+ // Paper end ++ private Float lastLuck = null; ++ private int lastWeight = 0; ++ // Paper end } diff --git a/Spigot-Server-Patches/0228-Print-Error-details-when-failing-to-save-player-data.patch b/Spigot-Server-Patches/0227-Print-Error-details-when-failing-to-save-player-data.patch similarity index 78% rename from Spigot-Server-Patches/0228-Print-Error-details-when-failing-to-save-player-data.patch rename to Spigot-Server-Patches/0227-Print-Error-details-when-failing-to-save-player-data.patch index 599b081cdc..763ac896a6 100644 --- a/Spigot-Server-Patches/0228-Print-Error-details-when-failing-to-save-player-data.patch +++ b/Spigot-Server-Patches/0227-Print-Error-details-when-failing-to-save-player-data.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Print Error details when failing to save player data diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index e60e10c57d5acaecb70e89c83c34f1f8870091c2..350ac42d6b45a1023f6254de7706818775b7957b 100644 +index ae43d8d2af0daa68f13528d25bac1d94964662bc..41a1b93a9e0f16ed9415dfeccd490496650163cb 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -151,7 +151,7 @@ public class WorldNBTStorage implements IPlayerFileData { +@@ -38,7 +38,7 @@ public class WorldNBTStorage { - file.renameTo(file1); + SystemUtils.a(file1, file, file2); } catch (Exception exception) { - WorldNBTStorage.LOGGER.warn("Failed to save player data for {}", entityhuman.getDisplayName().getString()); + WorldNBTStorage.LOGGER.error("Failed to save player data for {}", entityhuman.getName(), exception); // Paper diff --git a/Spigot-Server-Patches/0229-Make-shield-blocking-delay-configurable.patch b/Spigot-Server-Patches/0228-Make-shield-blocking-delay-configurable.patch similarity index 81% rename from Spigot-Server-Patches/0229-Make-shield-blocking-delay-configurable.patch rename to Spigot-Server-Patches/0228-Make-shield-blocking-delay-configurable.patch index 84c8cf61a9..a8bb704890 100644 --- a/Spigot-Server-Patches/0229-Make-shield-blocking-delay-configurable.patch +++ b/Spigot-Server-Patches/0228-Make-shield-blocking-delay-configurable.patch @@ -19,19 +19,19 @@ index 9c52e31f4cf1e64a37c65c021da219fc26dda137..33ce9a500430a01650e69a3568c8b03d + } } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index f5da67fd8908f027835b837a8b847e27c3638790..1a1d608f5acfc92e3e55e53f63c9da6ab0aa6a0a 100644 +index 26832d31cc64d26a9ca61a3bad21424ed366c74c..2ffc8eb4615abfaa6a9e99c45ea436cdf6a461c8 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3002,7 +3002,7 @@ public abstract class EntityLiving extends Entity { +@@ -3171,7 +3171,7 @@ public abstract class EntityLiving extends Entity { if (this.isHandRaised() && !this.activeItem.isEmpty()) { Item item = this.activeItem.getItem(); -- return item.e_(this.activeItem) != EnumAnimation.BLOCK ? false : item.f_(this.activeItem) - this.bl >= 5; -+ return item.e_(this.activeItem) != EnumAnimation.BLOCK ? false : item.f_(this.activeItem) - this.bl >= getShieldBlockingDelay(); // Paper - shieldBlockingDelay +- return item.d_(this.activeItem) != EnumAnimation.BLOCK ? false : item.e_(this.activeItem) - this.bk >= 5; ++ return item.d_(this.activeItem) != EnumAnimation.BLOCK ? false : item.e_(this.activeItem) - this.bk >= getShieldBlockingDelay(); // Paper - shieldBlockingDelay } else { return false; } -@@ -3241,4 +3241,15 @@ public abstract class EntityLiving extends Entity { +@@ -3423,4 +3423,15 @@ public abstract class EntityLiving extends Entity { public void broadcastItemBreak(EnumHand enumhand) { this.broadcastItemBreak(enumhand == EnumHand.MAIN_HAND ? EnumItemSlot.MAINHAND : EnumItemSlot.OFFHAND); } @@ -48,10 +48,10 @@ index f5da67fd8908f027835b837a8b847e27c3638790..1a1d608f5acfc92e3e55e53f63c9da6a + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 1760dfa7a312b63d7608d890c977452ad995d7ae..a8e44e95d6115833f4e20e6bb007842bdc52f1ef 100644 +index 5e2642b33d36e0695d6adc879f9595030adaaf31..38eb8fbac1d5131249dd9ba8b9942b4c85de2c7f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -644,5 +644,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -657,5 +657,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void setArrowsStuck(int arrows) { getHandle().setArrowCount(arrows); } diff --git a/Spigot-Server-Patches/0230-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-Server-Patches/0229-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch similarity index 85% rename from Spigot-Server-Patches/0230-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch rename to Spigot-Server-Patches/0229-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index 5f08c8d0fe..474f9e78db 100644 --- a/Spigot-Server-Patches/0230-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-Server-Patches/0229-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -6,10 +6,10 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API Adds ability to get what arrow was shot, and control if it should be consumed. diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java -index fb9656afde07a871216a4c5e414777603be590d1..3c95c0428b211b14db65be16a95446debda789e6 100644 +index 05ffe8af6a59e05d2c2e9567c675fd020d6b0723..84f83d48a8c41a26289ce0995aa9f5fd332c0ccb 100644 --- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java -@@ -157,7 +157,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR +@@ -155,7 +155,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4)); // CraftBukkit start @@ -19,10 +19,10 @@ index fb9656afde07a871216a4c5e414777603be590d1..3c95c0428b211b14db65be16a95446de event.getProjectile().remove(); return; diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java -index 83aa70c295f93b1c19d81fb0b90876e62fe58c23..26899916d3f5274691386685d13d18f587e4ec28 100644 +index 987b59dfcd3a69886e2722477300d313340690bb..b3cb832be6db70922c5495476e89124d75c9ed6d 100644 --- a/src/main/java/net/minecraft/server/ItemBow.java +++ b/src/main/java/net/minecraft/server/ItemBow.java -@@ -36,6 +36,7 @@ public class ItemBow extends ItemProjectileWeapon { +@@ -26,6 +26,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { if ((double) f >= 0.1D) { boolean flag1 = flag && itemstack1.getItem() == Items.ARROW; @@ -30,7 +30,7 @@ index 83aa70c295f93b1c19d81fb0b90876e62fe58c23..26899916d3f5274691386685d13d18f5 if (!world.isClientSide) { ItemArrow itemarrow = (ItemArrow) ((ItemArrow) (itemstack1.getItem() instanceof ItemArrow ? itemstack1.getItem() : Items.ARROW)); EntityArrow entityarrow = itemarrow.a(world, itemstack1, (EntityLiving) entityhuman); -@@ -61,7 +62,7 @@ public class ItemBow extends ItemProjectileWeapon { +@@ -51,7 +52,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { entityarrow.setOnFire(100); } // CraftBukkit start @@ -39,7 +39,7 @@ index 83aa70c295f93b1c19d81fb0b90876e62fe58c23..26899916d3f5274691386685d13d18f5 if (event.isCancelled()) { event.getProjectile().remove(); return; -@@ -71,7 +72,8 @@ public class ItemBow extends ItemProjectileWeapon { +@@ -61,7 +62,8 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { itemstack.damage(1, entityhuman, (entityhuman1) -> { entityhuman1.broadcastItemBreak(entityhuman.getRaisedHand()); }); @@ -49,20 +49,20 @@ index 83aa70c295f93b1c19d81fb0b90876e62fe58c23..26899916d3f5274691386685d13d18f5 entityarrow.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY; } -@@ -88,7 +90,7 @@ public class ItemBow extends ItemProjectileWeapon { +@@ -78,7 +80,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { } - world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.i.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.RANDOM.nextFloat() * 0.4F + 1.2F) + f * 0.5F); - if (!flag1 && !entityhuman.abilities.canInstantlyBuild) { + if (!flag1 && !entityhuman.abilities.canInstantlyBuild && consumeArrow) { // Paper itemstack1.subtract(1); if (itemstack1.isEmpty()) { entityhuman.inventory.f(itemstack1); diff --git a/src/main/java/net/minecraft/server/ItemCrossbow.java b/src/main/java/net/minecraft/server/ItemCrossbow.java -index 7be41c8698e86727978db7d72b3dd3fbfe6b7272..60a47bccca5bc77039c0bec94eb329b3f2f0937f 100644 +index 1592e94c78611a4b968bfb24daf68570e778fadd..31c80bb0a2e403c34fb9cd4b3ee4e903d90dc356 100644 --- a/src/main/java/net/minecraft/server/ItemCrossbow.java +++ b/src/main/java/net/minecraft/server/ItemCrossbow.java -@@ -221,7 +221,7 @@ public class ItemCrossbow extends ItemProjectileWeapon { +@@ -205,7 +205,7 @@ public class ItemCrossbow extends ItemProjectileWeapon implements ItemVanishable ((IProjectile) object).shoot((double) vector3fa.a(), (double) vector3fa.b(), (double) vector3fa.c(), f1, f2); } // CraftBukkit start @@ -72,10 +72,10 @@ index 7be41c8698e86727978db7d72b3dd3fbfe6b7272..60a47bccca5bc77039c0bec94eb329b3 event.getProjectile().remove(); return; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 6d7236d3dcdb70cc1f33f462d08e78720045ccd0..b9e011256f0c8f67808ebebb5e9dc63d3358849f 100644 +index 8551d3c9ba808bb9a77897a9866249bc0845c3b2..bd820d9661616c1b294fff0a7af7581a84ada25f 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -52,6 +52,7 @@ import net.minecraft.server.GeneratorAccess; +@@ -50,6 +50,7 @@ import net.minecraft.server.GeneratorAccess; import net.minecraft.server.IBlockData; import net.minecraft.server.IChatBaseComponent; import net.minecraft.server.IInventory; @@ -83,7 +83,7 @@ index 6d7236d3dcdb70cc1f33f462d08e78720045ccd0..b9e011256f0c8f67808ebebb5e9dc63d import net.minecraft.server.ItemActionContext; import net.minecraft.server.ItemStack; import net.minecraft.server.Items; -@@ -478,16 +479,16 @@ public class CraftEventFactory { +@@ -476,16 +477,16 @@ public class CraftEventFactory { /** * EntityShootBowEvent */ diff --git a/Spigot-Server-Patches/0231-PlayerReadyArrowEvent.patch b/Spigot-Server-Patches/0230-PlayerReadyArrowEvent.patch similarity index 83% rename from Spigot-Server-Patches/0231-PlayerReadyArrowEvent.patch rename to Spigot-Server-Patches/0230-PlayerReadyArrowEvent.patch index f3c28c9ab1..686dbb752d 100644 --- a/Spigot-Server-Patches/0231-PlayerReadyArrowEvent.patch +++ b/Spigot-Server-Patches/0230-PlayerReadyArrowEvent.patch @@ -7,11 +7,11 @@ Called when a player is firing a bow and the server is choosing an arrow to use. Plugins can skip selection of certain arrows and control which is used. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 14a0e3d41ccd896da3b1126a403b0b684cada907..6e9dd4d3717567f54ac706715d75bf53d48c5f7d 100644 +index 59f7fced6213c218cd19863be99964eb496b6fe6..4893daca7ea64504731cfab455e09b0a11c65857 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -2157,6 +2157,17 @@ public abstract class EntityHuman extends EntityLiving { - return (EntitySize) EntityHuman.b.getOrDefault(entitypose, EntityHuman.bp); +@@ -2045,6 +2045,17 @@ public abstract class EntityHuman extends EntityLiving { + return ImmutableList.of(EntityPose.STANDING, EntityPose.CROUCHING, EntityPose.SWIMMING); } + // Paper start @@ -28,7 +28,7 @@ index 14a0e3d41ccd896da3b1126a403b0b684cada907..6e9dd4d3717567f54ac706715d75bf53 @Override public ItemStack f(ItemStack itemstack) { if (!(itemstack.getItem() instanceof ItemProjectileWeapon)) { -@@ -2173,7 +2184,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -2061,7 +2072,7 @@ public abstract class EntityHuman extends EntityLiving { for (int i = 0; i < this.inventory.getSize(); ++i) { ItemStack itemstack2 = this.inventory.getItem(i); diff --git a/Spigot-Server-Patches/0232-Fire-EntityShootBowEvent-for-Illusioner.patch b/Spigot-Server-Patches/0231-Fire-EntityShootBowEvent-for-Illusioner.patch similarity index 82% rename from Spigot-Server-Patches/0232-Fire-EntityShootBowEvent-for-Illusioner.patch rename to Spigot-Server-Patches/0231-Fire-EntityShootBowEvent-for-Illusioner.patch index d3093ac832..947d348539 100644 --- a/Spigot-Server-Patches/0232-Fire-EntityShootBowEvent-for-Illusioner.patch +++ b/Spigot-Server-Patches/0231-Fire-EntityShootBowEvent-for-Illusioner.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fire EntityShootBowEvent for Illusioner diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -index 2ea0583a3e9f2f13d84673cc412a3f4c9bfaf6f7..81b7cd06f2e1f1f2ce75ba84d47cc18723c2bfb6 100644 +index 350c7f73e7c9dc43c57f6fb29b40760bf00826a3..76fd0513f3c89678809a28b9f1b22940fb5e5f23 100644 --- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java +++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -@@ -138,8 +138,18 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan +@@ -134,8 +134,18 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4)); @@ -22,7 +22,7 @@ index 2ea0583a3e9f2f13d84673cc412a3f4c9bfaf6f7..81b7cd06f2e1f1f2ce75ba84d47cc187 + if (event.getProjectile() == entityarrow.getBukkitEntity()) { + this.world.addEntity(entityarrow); + } - this.a(SoundEffects.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F)); + this.playSound(SoundEffects.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F)); - this.world.addEntity(entityarrow); + // Paper end } diff --git a/Spigot-Server-Patches/0233-Implement-EntityKnockbackByEntityEvent.patch b/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch similarity index 90% rename from Spigot-Server-Patches/0233-Implement-EntityKnockbackByEntityEvent.patch rename to Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch index 5e2f5954c3..1932c4e2b8 100644 --- a/Spigot-Server-Patches/0233-Implement-EntityKnockbackByEntityEvent.patch +++ b/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent This event is called when an entity receives knockback by another entity. diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1a1d608f5acfc92e3e55e53f63c9da6ab0aa6a0a..2a567dca19034ed9071ef09b5371eabb5fff557c 100644 +index 2ffc8eb4615abfaa6a9e99c45ea436cdf6a461c8..324a98bf245f410983840ef9970e7215e84f7465 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1421,6 +1421,16 @@ public abstract class EntityLiving extends Entity { +@@ -1531,6 +1531,16 @@ public abstract class EntityLiving extends Entity { Vec3D vec3d1 = (new Vec3D(d0, 0.0D, d1)).d().a((double) f); this.setMot(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + (double) f) : vec3d.y, vec3d.z / 2.0D - vec3d1.z); diff --git a/Spigot-Server-Patches/0234-Expand-Explosions-API.patch b/Spigot-Server-Patches/0233-Expand-Explosions-API.patch similarity index 89% rename from Spigot-Server-Patches/0234-Expand-Explosions-API.patch rename to Spigot-Server-Patches/0233-Expand-Explosions-API.patch index 7f70c39212..40adbd62bd 100644 --- a/Spigot-Server-Patches/0234-Expand-Explosions-API.patch +++ b/Spigot-Server-Patches/0233-Expand-Explosions-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expand Explosions API Add Entity as a Source capability, and add more API choices, and on Location. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 28a94e473482b414b50ca793564acd409a5dc133..8968bf92b6c2718cbf9519c724bc85d27de54e72 100644 +index 2aea66553dceadc504abcf5701f8c82b24d1bda7..648af70dcb89908c0d9bf259f208861ceee884ca 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -877,6 +877,11 @@ public class CraftWorld implements World { +@@ -881,6 +881,11 @@ public class CraftWorld implements World { public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) { return !world.createExplosion(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, breakBlocks ? Explosion.Effect.BREAK : Explosion.Effect.NONE).wasCanceled; } diff --git a/Spigot-Server-Patches/0235-LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-Server-Patches/0234-LivingEntity-Hand-Raised-Item-Use-API.patch similarity index 74% rename from Spigot-Server-Patches/0235-LivingEntity-Hand-Raised-Item-Use-API.patch rename to Spigot-Server-Patches/0234-LivingEntity-Hand-Raised-Item-Use-API.patch index 98f1be53e8..3ed7f9cd81 100644 --- a/Spigot-Server-Patches/0235-LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-Server-Patches/0234-LivingEntity-Hand-Raised-Item-Use-API.patch @@ -6,36 +6,36 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API How long an entity has raised hands to charge an attack or use an item diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 2a567dca19034ed9071ef09b5371eabb5fff557c..d604728db71d4e61a11fb1ccb7f02b6f6b914a51 100644 +index 324a98bf245f410983840ef9970e7215e84f7465..3edd63cbfc3d4bf058f7fb56a4ed4a04b80fe927 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -112,7 +112,7 @@ public abstract class EntityLiving extends Entity { +@@ -118,7 +118,7 @@ public abstract class EntityLiving extends Entity { private float bB; private int jumpTicks; private float bD; - protected ItemStack activeItem; + public ItemStack activeItem; // Paper - public + protected int bk; protected int bl; - protected int bm; private BlockPosition bE; -@@ -2980,10 +2980,12 @@ public abstract class EntityLiving extends Entity { +@@ -3149,10 +3149,12 @@ public abstract class EntityLiving extends Entity { return this.activeItem; } -+ public int getItemUseRemainingTime() { return this.dE(); } // Paper - OBFHELPER - public int dE() { - return this.bl; ++ public int getItemUseRemainingTime() { return this.dY(); } // Paper - OBFHELPER + public int dY() { + return this.bk; } -+ public int getHandRaisedTime() { return this.dF(); } // Paper - OBFHELPER - public int dF() { - return this.isHandRaised() ? this.activeItem.k() - this.dE() : 0; ++ public int getHandRaisedTime() { return this.dZ(); } // Paper - OBFHELPER + public int dZ() { + return this.isHandRaised() ? this.activeItem.k() - this.dY() : 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index a8e44e95d6115833f4e20e6bb007842bdc52f1ef..3a87c6574bbad9e6c2d7573eb447194c931d7ec4 100644 +index 38eb8fbac1d5131249dd9ba8b9942b4c85de2c7f..bbe6188f50dd3c456dec5c3239bdcffbfceb3589 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -654,5 +654,25 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -667,5 +667,25 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void setShieldBlockingDelay(int delay) { getHandle().setShieldBlockingDelay(delay); } diff --git a/Spigot-Server-Patches/0236-RangedEntity-API.patch b/Spigot-Server-Patches/0235-RangedEntity-API.patch similarity index 100% rename from Spigot-Server-Patches/0236-RangedEntity-API.patch rename to Spigot-Server-Patches/0235-RangedEntity-API.patch diff --git a/Spigot-Server-Patches/0237-Add-config-to-disable-ender-dragon-legacy-check.patch b/Spigot-Server-Patches/0236-Add-config-to-disable-ender-dragon-legacy-check.patch similarity index 71% rename from Spigot-Server-Patches/0237-Add-config-to-disable-ender-dragon-legacy-check.patch rename to Spigot-Server-Patches/0236-Add-config-to-disable-ender-dragon-legacy-check.patch index 94736ffd2e..076008d167 100644 --- a/Spigot-Server-Patches/0237-Add-config-to-disable-ender-dragon-legacy-check.patch +++ b/Spigot-Server-Patches/0236-Add-config-to-disable-ender-dragon-legacy-check.patch @@ -19,30 +19,30 @@ index 33ce9a500430a01650e69a3568c8b03db325a936..cea15d50ed89430ee8d8cff9de21e1fc + } } diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java -index 06748118494f2cc8cd692511e3b0bfd269fd249c..687efa022df41c23b5ffcce2efc2edcd8bd12dd6 100644 +index 87ddabbbca4ac8444ad6ff69889d7fd0542045d4..785146bfb64fe1a467120d706aff7450cb9a8b96 100644 --- a/src/main/java/net/minecraft/server/EnderDragonBattle.java +++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java @@ -28,10 +28,10 @@ public class EnderDragonBattle { private int h; private int i; private int j; -- private boolean k; -+ private boolean k; private void setDragonKilled(boolean dragonKilled) { this.k = dragonKilled; } // Paper - OBFHELPER - private boolean l; - public UUID m; // CraftBukkit PAIL private -> public, rename dragonUUID +- private boolean dragonKilled; ++ private boolean dragonKilled; private void setDragonKilled(boolean dragonKilled) { this.dragonKilled = dragonKilled; } // Paper - OBFHELPER + private boolean previouslyKilled; + public UUID dragonUUID; - private boolean n; + private boolean n; private void setScanForLegacyFight(boolean scanForLegacyFight) { this.n = scanForLegacyFight; } private boolean scanForLegacyFight() { return this.n; } // Paper - OBFHELPER - public BlockPosition o; // CraftBukkit PAIL private -> public, rename portalLocation - public EnumDragonRespawn p; // CraftBukkit PAIL private -> public, rename respawnPhase + public BlockPosition exitPortalLocation; + public EnumDragonRespawn respawnPhase; private int q; @@ -41,6 +41,10 @@ public class EnderDragonBattle { - this.bossBattle = (BossBattleServer) (new BossBattleServer(new ChatMessage("entity.minecraft.ender_dragon", new Object[0]), BossBattle.BarColor.PINK, BossBattle.BarStyle.PROGRESS)).setPlayMusic(true).c(true); - this.e = Lists.newArrayList(); + this.bossBattle = (BossBattleServer) (new BossBattleServer(new ChatMessage("entity.minecraft.ender_dragon"), BossBattle.BarColor.PINK, BossBattle.BarStyle.PROGRESS)).setPlayMusic(true).c(true); + this.gateways = Lists.newArrayList(); this.n = true; + // Paper start + setScanForLegacyFight(worldserver.paperConfig.scanForLegacyEnderDragon); + if (!scanForLegacyFight()) setDragonKilled(true); + // Paper end - this.d = worldserver; + this.world = worldserver; if (nbttagcompound.hasKeyOfType("DragonKilled", 99)) { - if (nbttagcompound.b("DragonUUID")) { + if (nbttagcompound.b("Dragon")) { diff --git a/Spigot-Server-Patches/0238-Implement-World.getEntity-UUID-API.patch b/Spigot-Server-Patches/0237-Implement-World.getEntity-UUID-API.patch similarity index 84% rename from Spigot-Server-Patches/0238-Implement-World.getEntity-UUID-API.patch rename to Spigot-Server-Patches/0237-Implement-World.getEntity-UUID-API.patch index e0c5971e19..8f874ea40f 100644 --- a/Spigot-Server-Patches/0238-Implement-World.getEntity-UUID-API.patch +++ b/Spigot-Server-Patches/0237-Implement-World.getEntity-UUID-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement World.getEntity(UUID) API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 8968bf92b6c2718cbf9519c724bc85d27de54e72..a59172ff043e5220ffdd363582c38ae53c429f1a 100644 +index 648af70dcb89908c0d9bf259f208861ceee884ca..66c89831796db1bbdd6c83cba786b27ef339ec9b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1291,6 +1291,15 @@ public class CraftWorld implements World { +@@ -1295,6 +1295,15 @@ public class CraftWorld implements World { return list; } diff --git a/Spigot-Server-Patches/0239-InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/0238-InventoryCloseEvent-Reason-API.patch similarity index 83% rename from Spigot-Server-Patches/0239-InventoryCloseEvent-Reason-API.patch rename to Spigot-Server-Patches/0238-InventoryCloseEvent-Reason-API.patch index 7a662125a1..7c795f7406 100644 --- a/Spigot-Server-Patches/0239-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/0238-InventoryCloseEvent-Reason-API.patch @@ -7,11 +7,11 @@ 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/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 6e9dd4d3717567f54ac706715d75bf53d48c5f7d..684978be7ccc401b71b0594828a7783b209a5210 100644 +index 4893daca7ea64504731cfab455e09b0a11c65857..1f3e5c384a66bb0767cc18bdbe99b942f30faa55 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -164,7 +164,7 @@ public abstract class EntityHuman extends EntityLiving { - this.dW(); +@@ -155,7 +155,7 @@ public abstract class EntityHuman extends EntityLiving { + this.es(); super.tick(); if (!this.world.isClientSide && this.activeContainer != null && !this.activeContainer.canUse(this)) { - this.closeInventory(); @@ -19,7 +19,7 @@ index 6e9dd4d3717567f54ac706715d75bf53d48c5f7d..684978be7ccc401b71b0594828a7783b this.activeContainer = this.defaultContainer; } -@@ -363,6 +363,13 @@ public abstract class EntityHuman extends EntityLiving { +@@ -350,6 +350,13 @@ public abstract class EntityHuman extends EntityLiving { return 20; } @@ -34,10 +34,10 @@ index 6e9dd4d3717567f54ac706715d75bf53d48c5f7d..684978be7ccc401b71b0594828a7783b 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 88692d9eaea57a4d172d537a6cf2a3bffe058d54..f35d23340665ab323732915efc0c0ad7fe4d964d 100644 +index 00b19cce68abf405117c5e2d55ba86fc10e7db34..dc99c7730e72e1a52219fbe0b3b039899899f49d 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -368,7 +368,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -411,7 +411,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // Paper end if (!this.world.isClientSide && !this.activeContainer.canUse(this)) { @@ -46,7 +46,7 @@ index 88692d9eaea57a4d172d537a6cf2a3bffe058d54..f35d23340665ab323732915efc0c0ad7 this.activeContainer = this.defaultContainer; } -@@ -542,7 +542,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -585,7 +585,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // SPIGOT-943 - only call if they have an inventory open if (this.activeContainer != this.defaultContainer) { @@ -55,7 +55,7 @@ index 88692d9eaea57a4d172d537a6cf2a3bffe058d54..f35d23340665ab323732915efc0c0ad7 } String deathMessage = event.getDeathMessage(); -@@ -1057,7 +1057,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1164,7 +1164,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return OptionalInt.empty(); } else { if (this.activeContainer != this.defaultContainer) { @@ -64,7 +64,7 @@ index 88692d9eaea57a4d172d537a6cf2a3bffe058d54..f35d23340665ab323732915efc0c0ad7 } this.nextContainerCounter(); -@@ -1117,7 +1117,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1224,7 +1224,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // CraftBukkit end if (this.activeContainer != this.defaultContainer) { @@ -73,7 +73,7 @@ index 88692d9eaea57a4d172d537a6cf2a3bffe058d54..f35d23340665ab323732915efc0c0ad7 } // this.nextContainerCounter(); // CraftBukkit - moved up -@@ -1181,7 +1181,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1288,7 +1288,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override public void closeInventory() { @@ -85,26 +85,26 @@ index 88692d9eaea57a4d172d537a6cf2a3bffe058d54..f35d23340665ab323732915efc0c0ad7 + CraftEventFactory.handleInventoryCloseEvent(this, reason); // CraftBukkit + // Paper end this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId)); - this.m(); + this.o(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index a357b6167405be4034cf3dad4124827e04278366..0c9e46a8973436a4438730a49986c88f12829be1 100644 +index e78306cb187b5f08e32888ebd55c4c486fc8dad2..2cbb0e0e1046efeff7f417d0c976754bd0e7959b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2040,7 +2040,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2079,7 +2079,7 @@ public class PlayerConnection implements PacketListenerPlayIn { PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer()); if (this.player.isFrozen()) return; // CraftBukkit - CraftEventFactory.handleInventoryCloseEvent(this.player); // CraftBukkit + CraftEventFactory.handleInventoryCloseEvent(this.player, org.bukkit.event.inventory.InventoryCloseEvent.Reason.PLAYER); // CraftBukkit // Paper - this.player.m(); + this.player.o(); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 46ea6d8e487d0c051780b0bdb06622e515cd987f..950afb131bbea53e46393fa19b0bfbb9d5c647f5 100644 +index 70339603aa3e256470be241bf033f3471e2090ea..ef1ea58c252d063ce282d244236a510655538a11 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -390,7 +390,7 @@ public abstract class PlayerList { +@@ -419,7 +419,7 @@ public abstract class PlayerList { entityplayer.a(StatisticList.LEAVE_GAME); // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it @@ -114,10 +114,10 @@ index 46ea6d8e487d0c051780b0bdb06622e515cd987f..950afb131bbea53e46393fa19b0bfbb9 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a834a77b2de8f7287be69fd5d002ff43261a9a85..d4e963c169f847acce882dfba067be0d64638ec4 100644 +index 7a71e6dfea35addb7d3d33d8ce187cc2c6943de6..dbc7db5c52752c52b3e84b370bbf38772dc20766 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1045,7 +1045,7 @@ public class WorldServer extends World { +@@ -968,7 +968,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { for (TileEntity tileentity : chunk.getTileEntities().values()) { if (tileentity instanceof IInventory) { for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((IInventory) tileentity).getViewers())) { @@ -126,7 +126,7 @@ index a834a77b2de8f7287be69fd5d002ff43261a9a85..d4e963c169f847acce882dfba067be0d } } } -@@ -1103,7 +1103,7 @@ public class WorldServer extends World { +@@ -1026,7 +1026,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder) { for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) { @@ -136,10 +136,10 @@ index a834a77b2de8f7287be69fd5d002ff43261a9a85..d4e963c169f847acce882dfba067be0d } // Spigot End diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 20f0783025516048851aedef0a70759c2953ae47..a6d75c0e07a25fdb59dde2e3eb2a0213c7112515 100644 +index 42bc39381c4fc5ff81bdd312afd1644dcc5d40c2..1eac3798acfc8a6859f102250bc8e49ed29d6e21 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -467,8 +467,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -434,8 +434,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @Override public void closeInventory() { @@ -155,10 +155,10 @@ index 20f0783025516048851aedef0a70759c2953ae47..a6d75c0e07a25fdb59dde2e3eb2a0213 @Override public boolean isBlocking() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f5c722644a1955c9bc68c89fdbb84526f9bbb7a0..368f786300573ff24a8dc46d96a6fb6bac26b35a 100644 +index ec0cb22d53733bed33019b257ac06ca9dc80d19e..5575c44d6f427661de1fec2c69932b446284c54d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -784,7 +784,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -788,7 +788,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Close any foreign inventory if (getHandle().activeContainer != getHandle().defaultContainer) { @@ -168,10 +168,10 @@ index f5c722644a1955c9bc68c89fdbb84526f9bbb7a0..368f786300573ff24a8dc46d96a6fb6b // 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 b9e011256f0c8f67808ebebb5e9dc63d3358849f..4a76402c01dfe6525bae8728da2dde6e5d673765 100644 +index bd820d9661616c1b294fff0a7af7581a84ada25f..3757a30e7b0ae1ec61211b2250bab47f70c776d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1301,12 +1301,22 @@ public class CraftEventFactory { +@@ -1299,12 +1299,22 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0240-Configurable-Bed-Search-Radius.patch b/Spigot-Server-Patches/0239-Configurable-Bed-Search-Radius.patch similarity index 90% rename from Spigot-Server-Patches/0240-Configurable-Bed-Search-Radius.patch rename to Spigot-Server-Patches/0239-Configurable-Bed-Search-Radius.patch index b56a18a87b..8219587132 100644 --- a/Spigot-Server-Patches/0240-Configurable-Bed-Search-Radius.patch +++ b/Spigot-Server-Patches/0239-Configurable-Bed-Search-Radius.patch @@ -30,24 +30,23 @@ index cea15d50ed89430ee8d8cff9de21e1fc7982e1d8..387e0dcb9f01ad947daaa19211331a96 + } } diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java -index 7947563426f7f1cc9364d7b6f71256bf3beea463..e0bc6080ef29258473ec3ef7ffa7c246f08ac146 100644 +index 7604d79468ce8d7d1a4f45872a5db0c700419029..e7bd9061cceba284443b75cc5506e1b9f2ef42e8 100644 --- a/src/main/java/net/minecraft/server/BlockBed.java +++ b/src/main/java/net/minecraft/server/BlockBed.java -@@ -196,6 +196,9 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { +@@ -199,6 +199,8 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { public static Optional a(EntityTypes entitytypes, IWorldReader iworldreader, BlockPosition blockposition, int i) { EnumDirection enumdirection = (EnumDirection) iworldreader.getType(blockposition).get(BlockBed.FACING); + // Paper start - configurable bed search radius + if (entitytypes == EntityTypes.PLAYER) return findSafePosition(entitytypes, (World) iworldreader, enumdirection, blockposition); -+ int j = blockposition.getX(); int k = blockposition.getY(); int l = blockposition.getZ(); -@@ -225,7 +228,104 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { +@@ -228,7 +230,104 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { return Optional.empty(); } -- protected static Optional a(EntityTypes entitytypes, IWorldReader iworldreader, BlockPosition blockposition) { +- public static Optional a(EntityTypes entitytypes, IWorldReader iworldreader, BlockPosition blockposition) { + private static Optional findSafePosition(EntityTypes entitytypes, World world, EnumDirection updirection, BlockPosition blockposition){ + int radius = world.paperConfig.bedSearchRadius; + double angle = Math.PI / 2; @@ -143,15 +142,15 @@ index 7947563426f7f1cc9364d7b6f71256bf3beea463..e0bc6080ef29258473ec3ef7ffa7c246 + // Paper end + + // Paper start -- add maxBelow param -+ protected static Optional a(EntityTypes entitytypes, IWorldReader iworldreader, BlockPosition blockposition) { return isSafeRespawn(entitytypes, iworldreader, blockposition, 2); } -+ protected static Optional isSafeRespawn(EntityTypes entitytypes, IWorldReader iworldreader, BlockPosition blockposition, int maxBelow) { ++ public static Optional a(EntityTypes entitytypes, IWorldReader iworldreader, BlockPosition blockposition) { return isSafeRespawn(entitytypes, iworldreader, blockposition, 2); } ++ public static Optional isSafeRespawn(EntityTypes entitytypes, IWorldReader iworldreader, BlockPosition blockposition, int maxBelow) { + // Paper end VoxelShape voxelshape = iworldreader.getType(blockposition).getCollisionShape(iworldreader, blockposition); if (voxelshape.c(EnumDirection.EnumAxis.Y) > 0.4375D) { -@@ -233,7 +333,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { +@@ -236,7 +335,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { } else { - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(blockposition); + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i(); - while (blockposition_mutableblockposition.getY() >= 0 && blockposition.getY() - blockposition_mutableblockposition.getY() <= 2 && iworldreader.getType(blockposition_mutableblockposition).getCollisionShape(iworldreader, blockposition_mutableblockposition).isEmpty()) { + while (blockposition_mutableblockposition.getY() >= 0 && blockposition.getY() - blockposition_mutableblockposition.getY() <= maxBelow && iworldreader.getType(blockposition_mutableblockposition).getCollisionShape(iworldreader, blockposition_mutableblockposition).isEmpty()) { // Paper -- configurable max distance to search below diff --git a/Spigot-Server-Patches/0241-Vex-getSummoner-API.patch b/Spigot-Server-Patches/0240-Vex-getSummoner-API.patch similarity index 85% rename from Spigot-Server-Patches/0241-Vex-getSummoner-API.patch rename to Spigot-Server-Patches/0240-Vex-getSummoner-API.patch index 07dedcc9c1..82527c6c53 100644 --- a/Spigot-Server-Patches/0241-Vex-getSummoner-API.patch +++ b/Spigot-Server-Patches/0240-Vex-getSummoner-API.patch @@ -6,15 +6,15 @@ Subject: [PATCH] Vex#getSummoner API Get's the NPC that summoned this Vex diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java -index cd9fb3aabfca254ca522d39a25e54ceda0b6f5fc..a46730460e5d9f6e52d63ba1950d1e7195fe87cd 100644 +index 1eb39fd5cc4fd3b070dcaf64c467da76f99456fc..ab4ac736f8fcda1ed6b58abe0a4ecba58d3b5d43 100644 --- a/src/main/java/net/minecraft/server/EntityVex.java +++ b/src/main/java/net/minecraft/server/EntityVex.java -@@ -92,6 +92,7 @@ public class EntityVex extends EntityMonster { +@@ -89,6 +89,7 @@ public class EntityVex extends EntityMonster { } -+ public EntityInsentient getOwner() { return l(); } // Paper - OBFHELPER - public EntityInsentient l() { ++ public EntityInsentient getOwner() { return eL(); } // Paper - OBFHELPER + public EntityInsentient eL() { return this.c; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java diff --git a/Spigot-Server-Patches/0242-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/Spigot-Server-Patches/0241-Refresh-player-inventory-when-cancelling-PlayerInter.patch similarity index 89% rename from Spigot-Server-Patches/0242-Refresh-player-inventory-when-cancelling-PlayerInter.patch rename to Spigot-Server-Patches/0241-Refresh-player-inventory-when-cancelling-PlayerInter.patch index f3b5d4e6a0..a9f7b79235 100644 --- a/Spigot-Server-Patches/0242-Refresh-player-inventory-when-cancelling-PlayerInter.patch +++ b/Spigot-Server-Patches/0241-Refresh-player-inventory-when-cancelling-PlayerInter.patch @@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is cancelled to avoid this problem. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 0c9e46a8973436a4438730a49986c88f12829be1..a46ef5e72d03a32e22cfd77b2581de70edcc686a 100644 +index 2cbb0e0e1046efeff7f417d0c976754bd0e7959b..8855a1de14f970ddac25d935a4b2e00c7e277908 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1950,6 +1950,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1988,6 +1988,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } if (event.isCancelled()) { diff --git a/Spigot-Server-Patches/0243-Don-t-change-the-Entity-Random-seed-for-squids.patch b/Spigot-Server-Patches/0242-Don-t-change-the-Entity-Random-seed-for-squids.patch similarity index 82% rename from Spigot-Server-Patches/0243-Don-t-change-the-Entity-Random-seed-for-squids.patch rename to Spigot-Server-Patches/0242-Don-t-change-the-Entity-Random-seed-for-squids.patch index aba93c9b63..6b945b0334 100644 --- a/Spigot-Server-Patches/0243-Don-t-change-the-Entity-Random-seed-for-squids.patch +++ b/Spigot-Server-Patches/0242-Don-t-change-the-Entity-Random-seed-for-squids.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't change the Entity Random seed for squids diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 1c1ff2069d6daaf866a3e80a9b3ce78b19941384..92efe4e7f50fa10bcdff52fb51a9b814d995c8c9 100644 +index 9c9ec8226ab43beaae0ef4abc97632b503e2120c..c9c0b2ab265666986cdedf920955ee55ebbedaf3 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -21,7 +21,7 @@ public class EntitySquid extends EntityWaterAnimal { @@ -14,6 +14,6 @@ index 1c1ff2069d6daaf866a3e80a9b3ce78b19941384..92efe4e7f50fa10bcdff52fb51a9b814 super(entitytypes, world); - this.random.setSeed((long) this.getId()); + //this.random.setSeed((long) this.getId()); // Paper - this.bC = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; + this.bB = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; } diff --git a/Spigot-Server-Patches/0244-Re-add-vanilla-entity-warnings-for-duplicates.patch b/Spigot-Server-Patches/0243-Re-add-vanilla-entity-warnings-for-duplicates.patch similarity index 86% rename from Spigot-Server-Patches/0244-Re-add-vanilla-entity-warnings-for-duplicates.patch rename to Spigot-Server-Patches/0243-Re-add-vanilla-entity-warnings-for-duplicates.patch index 7fca9a2130..ce7537874f 100644 --- a/Spigot-Server-Patches/0244-Re-add-vanilla-entity-warnings-for-duplicates.patch +++ b/Spigot-Server-Patches/0243-Re-add-vanilla-entity-warnings-for-duplicates.patch @@ -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 d4e963c169f847acce882dfba067be0d64638ec4..1019f180397abef5ec28d00c432415a7270026e2 100644 +index dbc7db5c52752c52b3e84b370bbf38772dc20766..781b84535c105987d4b65e744977c87049b2a1a4 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1035,7 +1035,8 @@ public class WorldServer extends World { +@@ -958,7 +958,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity1 == null) { return false; } else { diff --git a/Spigot-Server-Patches/0245-Avoid-item-merge-if-stack-size-above-max-stack-size.patch b/Spigot-Server-Patches/0244-Avoid-item-merge-if-stack-size-above-max-stack-size.patch similarity index 83% rename from Spigot-Server-Patches/0245-Avoid-item-merge-if-stack-size-above-max-stack-size.patch rename to Spigot-Server-Patches/0244-Avoid-item-merge-if-stack-size-above-max-stack-size.patch index 8c3350c02a..84e8774cb6 100644 --- a/Spigot-Server-Patches/0245-Avoid-item-merge-if-stack-size-above-max-stack-size.patch +++ b/Spigot-Server-Patches/0244-Avoid-item-merge-if-stack-size-above-max-stack-size.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Avoid item merge if stack size above max stack size diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 5efcc50ab9e8a99d88a9d2e7f15ecbcc4439b93e..e5c9bac88a59d52c9b2f05df3e4f373edbe009ca 100644 +index cc173445caa0a064e724bc29b4955232a1dc1816..aad23b2c6cd674e05e609c4c019205978c6741f2 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -170,6 +170,10 @@ public class EntityItem extends Entity { +@@ -177,6 +177,10 @@ public class EntityItem extends Entity { private void mergeNearby() { - if (this.w()) { + if (this.z()) { + // Paper start - avoid item merge if stack size above max stack size + ItemStack stack = getItemStack(); + if (stack.getCount() >= stack.getMaxStackSize()) return; diff --git a/Spigot-Server-Patches/0246-Use-asynchronous-Log4j-2-loggers.patch b/Spigot-Server-Patches/0245-Use-asynchronous-Log4j-2-loggers.patch similarity index 95% rename from Spigot-Server-Patches/0246-Use-asynchronous-Log4j-2-loggers.patch rename to Spigot-Server-Patches/0245-Use-asynchronous-Log4j-2-loggers.patch index 7ddc8755fb..0b7f4c17f7 100644 --- a/Spigot-Server-Patches/0246-Use-asynchronous-Log4j-2-loggers.patch +++ b/Spigot-Server-Patches/0245-Use-asynchronous-Log4j-2-loggers.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use asynchronous Log4j 2 loggers diff --git a/pom.xml b/pom.xml -index 8ad07cf6e03cbc5354d2dd2b149b51bbb5067a9d..fc2921e9783f2db63b71c6e244e24c9416cdbf76 100644 +index 8150756361174fd46df8f73943ab48c55a523c0c..f578acae6fbe1ad7a0c05b96ba489482687ec1df 100644 --- a/pom.xml +++ b/pom.xml @@ -77,6 +77,13 @@ diff --git a/Spigot-Server-Patches/0246-add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/0246-add-more-information-to-Entity.toString.patch new file mode 100644 index 0000000000..561df855cc --- /dev/null +++ b/Spigot-Server-Patches/0246-add-more-information-to-Entity.toString.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 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() + +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 3e5b6c2a0ce6df2620d5f6505fcd25e6ea622744..3cb157cf4d1aa90b23f24b5090071d71c6bd2754 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -2430,7 +2430,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public String toString() { +- return String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f]", this.getClass().getSimpleName(), this.getDisplayName().getString(), this.id, this.world == null ? "~NULL~" : this.world.toString(), this.locX(), this.locY(), this.locZ()); ++ return String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cx=%d, cz=%d, tl=%d, v=%b, d=%b]", new Object[] { this.getClass().getSimpleName(), this.getDisplayName().getString(), Integer.valueOf(this.id), this.uniqueID.toString(), this.world == null ? "~NULL~" : this.world.toString(), Double.valueOf(this.locX()), Double.valueOf(this.locY()), Double.valueOf(this.locZ()), getChunkX(), getChunkZ(), this.ticksLived, this.valid, this.dead}); // Paper - add more information + } + + public boolean isInvulnerable(DamageSource damagesource) { diff --git a/Spigot-Server-Patches/0248-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/0247-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch similarity index 74% rename from Spigot-Server-Patches/0248-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch rename to Spigot-Server-Patches/0247-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index 8ea3b8bb72..dba29626a7 100644 --- a/Spigot-Server-Patches/0248-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/0247-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -6,10 +6,10 @@ 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 fe730cd301e6bae46320355ee8cb67d406a72a9f..5fd57a3d30972d86c62025d63cd57b56a147cc94 100644 +index 3cb157cf4d1aa90b23f24b5090071d71c6bd2754..814c885313967f007584f6832111ec5b445e4088 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -76,6 +76,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -77,6 +77,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper private CraftEntity bukkitEntity; @@ -19,18 +19,18 @@ index fe730cd301e6bae46320355ee8cb67d406a72a9f..5fd57a3d30972d86c62025d63cd57b56 if (bukkitEntity == null) { bukkitEntity = CraftEntity.getEntity(world.getServer(), this); diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 7804cc0f6a02d14f4adbe05b37e8470a382c0d26..4ee26ff08f7a058648ab54f0dcd81b466a9aced1 100644 +index 4ae3e91677ecf9c2104a229b4e8b229d18b87aa4..458802dc4b1f923b159168efff0546bb731da07b 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1064,6 +1064,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - } else { - PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = new PlayerChunkMap.EntityTracker(entity, i, j, entitytypes.isDeltaTracking()); +@@ -1093,6 +1093,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } else { + PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = new PlayerChunkMap.EntityTracker(entity, i, j, entitytypes.isDeltaTracking()); -+ entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker - this.trackedEntities.put(entity.getId(), playerchunkmap_entitytracker); - playerchunkmap_entitytracker.track(this.world.getPlayers()); - if (entity instanceof EntityPlayer) { -@@ -1106,7 +1107,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { ++ entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker + this.trackedEntities.put(entity.getId(), playerchunkmap_entitytracker); + playerchunkmap_entitytracker.track(this.world.getPlayers()); + if (entity instanceof EntityPlayer) { +@@ -1134,7 +1135,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { if (playerchunkmap_entitytracker1 != null) { playerchunkmap_entitytracker1.a(); } @@ -40,10 +40,10 @@ index 7804cc0f6a02d14f4adbe05b37e8470a382c0d26..4ee26ff08f7a058648ab54f0dcd81b46 protected void g() { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6603392f475f0bfe7af259a54ba9bb3469c18541..fb719c5e18bcfa0e424c67c6b23c5abedd234f79 100644 +index 6f91878fedd3bf8daedc16bcde7ac1fd042f704c..8148ecad0e313d2e6c0307915aaa670e7ad5a317 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -63,6 +63,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -68,6 +68,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public boolean pvpMode; public boolean keepSpawnInMemory = true; public org.bukkit.generator.ChunkGenerator generator; @@ -52,20 +52,20 @@ index 6603392f475f0bfe7af259a54ba9bb3469c18541..fb719c5e18bcfa0e424c67c6b23c5abe 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 1019f180397abef5ec28d00c432415a7270026e2..5086a854b84b05e5b9c0f5677051d19dfa42f343 100644 +index 781b84535c105987d4b65e744977c87049b2a1a4..ac0bcde5ccc9ebb88922d8b82381b03675b87ae6 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -76,6 +76,9 @@ public class WorldServer extends World { - // CraftBukkit start - private int tickPosition; +@@ -84,6 +84,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { + public final UUID uuid; + boolean hasPhysicsEvent = true; // Paper + private static Throwable getAddToWorldStackTrace(Entity entity) { + return new Throwable(entity + " Added to world at " + new java.util.Date()); + } - // Add env and gen to constructor - public WorldServer(MinecraftServer minecraftserver, Executor executor, WorldNBTStorage worldnbtstorage, WorldData worlddata, DimensionManager dimensionmanager, GameProfilerFiller gameprofilerfiller, WorldLoadListener worldloadlistener, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { -@@ -997,8 +1000,28 @@ public class WorldServer extends World { + public Chunk getChunkIfLoaded(int x, int z) { + return this.chunkProvider.getChunkAt(x, z, false); +@@ -920,8 +923,28 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit start private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot @@ -95,7 +95,7 @@ index 1019f180397abef5ec28d00c432415a7270026e2..5086a854b84b05e5b9c0f5677051d19d // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit return false; } else if (this.isUUIDTaken(entity)) { -@@ -1158,7 +1181,24 @@ public class WorldServer extends World { +@@ -1081,7 +1104,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } diff --git a/Spigot-Server-Patches/0247-add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/0247-add-more-information-to-Entity.toString.patch deleted file mode 100644 index 9a10692fca..0000000000 --- a/Spigot-Server-Patches/0247-add-more-information-to-Entity.toString.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 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() - -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 7c6bf0b91cdf59f6dcf155ee8abfbab61938cc8b..fe730cd301e6bae46320355ee8cb67d406a72a9f 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2505,7 +2505,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - } - - public String toString() { -- return String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f]", this.getClass().getSimpleName(), this.getDisplayName().getText(), this.id, this.world == null ? "~NULL~" : this.world.getWorldData().getName(), this.locX(), this.locY(), this.locZ()); -+ return String.format(Locale.ROOT, "%s[\'%s\'/%d, uuid=\'%s\', l=\'%s\', x=%.2f, y=%.2f, z=%.2f, cx=%d, cz=%d, tl=%d, v=%b, d=%b]", new Object[] { this.getClass().getSimpleName(), this.getDisplayName().getText(), Integer.valueOf(this.id), this.uniqueID.toString(), this.world == null ? "~NULL~" : this.world.getWorldData().getName(), Double.valueOf(this.locX), Double.valueOf(this.locY), Double.valueOf(this.locZ), getChunkX(), getChunkZ(), this.ticksLived, this.valid, this.dead}); // Paper - add more information - } - - public boolean isInvulnerable(DamageSource damagesource) { diff --git a/Spigot-Server-Patches/0249-EnderDragon-Events.patch b/Spigot-Server-Patches/0248-EnderDragon-Events.patch similarity index 86% rename from Spigot-Server-Patches/0249-EnderDragon-Events.patch rename to Spigot-Server-Patches/0248-EnderDragon-Events.patch index eb756a6109..b02fa9d772 100644 --- a/Spigot-Server-Patches/0249-EnderDragon-Events.patch +++ b/Spigot-Server-Patches/0248-EnderDragon-Events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] EnderDragon Events diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java -index 40a8beff556873a5db108e44fd053e8de80e36a6..18fdcd453af5dc22a5b0e3c41e77e3d3dbb70fea 100644 +index fbc2ec88f7c71c853c492301986a23dafc8fa7a6..274ebd7dab74ca9bff3d5ea941b7335bdf601db8 100644 --- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java +++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java @@ -71,7 +71,11 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded @@ -29,10 +29,10 @@ index 40a8beff556873a5db108e44fd053e8de80e36a6..18fdcd453af5dc22a5b0e3c41e77e3d3 public void e() { if (this.d != null) { diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java -index a2c36548caea7c6a0050bb3b18675567a61fb96e..a9d20ee3bbaf4dd77204df9c28a233a0d36cdbd2 100644 +index 7c94faa59c2b9887292c6d88fa2e3bb46e3e67c7..ac546ff959510a2d0120c24c90bf13ff83873161 100644 --- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java +++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java -@@ -68,7 +68,9 @@ public class DragonControllerStrafe extends AbstractDragonController { +@@ -71,7 +71,9 @@ public class DragonControllerStrafe extends AbstractDragonController { EntityDragonFireball entitydragonfireball = new EntityDragonFireball(this.a.world, this.a, d9, d10, d11); entitydragonfireball.setPositionRotation(d6, d7, d8, 0.0F, 0.0F); @@ -43,15 +43,15 @@ index a2c36548caea7c6a0050bb3b18675567a61fb96e..a9d20ee3bbaf4dd77204df9c28a233a0 if (this.d != null) { while (!this.d.b()) { diff --git a/src/main/java/net/minecraft/server/EntityDragonFireball.java b/src/main/java/net/minecraft/server/EntityDragonFireball.java -index bc08b53fcdd411f15afb939702d68c98ed697479..db43ac1cc4ae959a432eedd3efee891b4e141c7f 100644 +index 743a08d18df8890a61eeb48984c0882bb353e15c..96fdf9d068c2df154dbc2fb7978b0ba7a030c834 100644 --- a/src/main/java/net/minecraft/server/EntityDragonFireball.java +++ b/src/main/java/net/minecraft/server/EntityDragonFireball.java -@@ -41,8 +41,10 @@ public class EntityDragonFireball extends EntityFireball { +@@ -46,8 +46,10 @@ public class EntityDragonFireball extends EntityFireball { } } + if (new com.destroystokyo.paper.event.entity.EnderDragonFireballHitEvent((org.bukkit.entity.DragonFireball) this.getBukkitEntity(), list.stream().map(EntityLiving::getBukkitLivingEntity).collect(java.util.stream.Collectors.toList()), (org.bukkit.entity.AreaEffectCloud) entityareaeffectcloud.getBukkitEntity()).callEvent()) { // Paper - this.world.triggerEffect(2006, new BlockPosition(this), 0); + this.world.triggerEffect(2006, this.getChunkCoordinates(), this.isSilent() ? -1 : 1); this.world.addEntity(entityareaeffectcloud); + } else entityareaeffectcloud.die(); // Paper this.die(); diff --git a/Spigot-Server-Patches/0250-PlayerElytraBoostEvent.patch b/Spigot-Server-Patches/0249-PlayerElytraBoostEvent.patch similarity index 90% rename from Spigot-Server-Patches/0250-PlayerElytraBoostEvent.patch rename to Spigot-Server-Patches/0249-PlayerElytraBoostEvent.patch index 3a30f49496..f53dfa1f00 100644 --- a/Spigot-Server-Patches/0250-PlayerElytraBoostEvent.patch +++ b/Spigot-Server-Patches/0249-PlayerElytraBoostEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerElytraBoostEvent diff --git a/src/main/java/net/minecraft/server/ItemFireworks.java b/src/main/java/net/minecraft/server/ItemFireworks.java -index 92dac35ec4eefe0d5794d8205bc872d23a62e3cb..bd524a35bb11005adfed12f66465fa8466a155f0 100644 +index 6cc243025f5bdac9be39f8a88a018893a9941dba..885c03f62da3b14bf7aeb31f1ae6a95bc9f86de1 100644 --- a/src/main/java/net/minecraft/server/ItemFireworks.java +++ b/src/main/java/net/minecraft/server/ItemFireworks.java @@ -36,11 +36,16 @@ public class ItemFireworks extends Item { @@ -28,4 +28,4 @@ index 92dac35ec4eefe0d5794d8205bc872d23a62e3cb..bd524a35bb11005adfed12f66465fa84 + // Paper end } - return InteractionResultWrapper.success(entityhuman.b(enumhand)); + return InteractionResultWrapper.a(entityhuman.b(enumhand), world.s_()); diff --git a/Spigot-Server-Patches/0250-Improve-BlockPosition-inlining.patch b/Spigot-Server-Patches/0250-Improve-BlockPosition-inlining.patch new file mode 100644 index 0000000000..06283647f0 --- /dev/null +++ b/Spigot-Server-Patches/0250-Improve-BlockPosition-inlining.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Techcable +Date: Wed, 30 Nov 2016 20:56:58 -0600 +Subject: [PATCH] Improve BlockPosition inlining + +Normally the JVM can inline virtual getters by having two sets of code, one is the 'optimized' code and the other is the 'deoptimized' code. +If a single type is used 99% of the time, then its worth it to inline, and to revert to 'deoptimized' the 1% of the time we encounter other types. +But if two types are encountered commonly, then the JVM can't inline them both, and the call overhead remains. + +This scenario also occurs with BlockPos and MutableBlockPos. +The variables in BlockPos are final, so MutableBlockPos can't modify them. +MutableBlockPos fixes this by adding custom mutable variables, and overriding the getters to access them. + +This approach with utility methods that operate on MutableBlockPos and BlockPos. +Specific examples are BlockPosition.up(), and World.isValidLocation(). +It makes these simple methods much slower than they need to be. + +This should result in an across the board speedup in anything that accesses blocks or does logic with positions. + +This is based upon conclusions drawn from inspecting the assenmbly generated bythe JIT compiler on my microbenchmarks. +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 8b202b342f899a38b989b683bd8be4f5c4061f48..1842e69839a65e7b8d2c47fd30ec8f3179f04470 100644 +--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java ++++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java +@@ -39,7 +39,7 @@ public class BaseBlockPosition implements Comparable { + this(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); + } + +- public boolean equals(Object object) { ++ public final boolean equals(Object object) { // Paper + if (this == object) { + return true; + } else if (!(object instanceof BaseBlockPosition)) { +@@ -51,7 +51,7 @@ public class BaseBlockPosition implements Comparable { + } + } + +- public int hashCode() { ++ public final int hashCode() { // Paper + return (this.getY() + this.getZ() * 31) * 31 + this.getX(); + } + +@@ -59,15 +59,15 @@ public class BaseBlockPosition implements Comparable { + return this.getY() == baseblockposition.getY() ? (this.getZ() == baseblockposition.getZ() ? this.getX() - baseblockposition.getX() : this.getZ() - baseblockposition.getZ()) : this.getY() - baseblockposition.getY(); + } + +- public int getX() { ++ public final int getX() { // Paper + return this.a; + } + +- public int getY() { ++ public final int getY() { // Paper + return this.b; + } + +- public int getZ() { ++ public final int getZ() { // Paper + return this.e; + } + +diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java +index b61651fcd6605cd8638ce14f15e41b878add3f1c..b25b84d017ee610d8f006536fdfa63e840474a9b 100644 +--- a/src/main/java/net/minecraft/server/BlockPosition.java ++++ b/src/main/java/net/minecraft/server/BlockPosition.java +@@ -81,6 +81,7 @@ public class BlockPosition extends BaseBlockPosition { + return a(this.getX(), this.getY(), this.getZ()); + } + ++ public static long asLong(int x, int y, int z) { return a(x, y, z); } // Paper - OBFHELPER + public static long a(int i, int j, int k) { + long l = 0L; + diff --git a/Spigot-Server-Patches/0251-Improve-BlockPosition-inlining.patch b/Spigot-Server-Patches/0251-Improve-BlockPosition-inlining.patch deleted file mode 100644 index 366f75128a..0000000000 --- a/Spigot-Server-Patches/0251-Improve-BlockPosition-inlining.patch +++ /dev/null @@ -1,257 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Techcable -Date: Wed, 30 Nov 2016 20:56:58 -0600 -Subject: [PATCH] Improve BlockPosition inlining - -Normally the JVM can inline virtual getters by having two sets of code, one is the 'optimized' code and the other is the 'deoptimized' code. -If a single type is used 99% of the time, then its worth it to inline, and to revert to 'deoptimized' the 1% of the time we encounter other types. -But if two types are encountered commonly, then the JVM can't inline them both, and the call overhead remains. - -This scenario also occurs with BlockPos and MutableBlockPos. -The variables in BlockPos are final, so MutableBlockPos can't modify them. -MutableBlockPos fixes this by adding custom mutable variables, and overriding the getters to access them. - -This approach with utility methods that operate on MutableBlockPos and BlockPos. -Specific examples are BlockPosition.up(), and World.isValidLocation(). -It makes these simple methods much slower than they need to be. - -This should result in an across the board speedup in anything that accesses blocks or does logic with positions. - -This is based upon conclusions drawn from inspecting the assenmbly generated bythe JIT compiler on my microbenchmarks. -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 7b05bb9edcd059a134cef12cc9fea570217bc601..a0450a7ddf21659c5636b3f298e6bf4f0a93fc4d 100644 ---- a/src/main/java/net/minecraft/server/BaseBlockPosition.java -+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java -@@ -7,32 +7,30 @@ import javax.annotation.concurrent.Immutable; - public class BaseBlockPosition implements Comparable { - - public static final BaseBlockPosition ZERO = new BaseBlockPosition(0, 0, 0); -- @Deprecated -- private final int a; -- @Deprecated -- private final int b; -- @Deprecated -- private final int c; - // Paper start -- public boolean isValidLocation() { -- return a >= -30000000 && c >= -30000000 && a < 30000000 && c < 30000000 && b >= 0 && b < 256; -+ protected int x; -+ protected int y; -+ protected int z; -+ -+ public final boolean isValidLocation() { -+ return x >= -30000000 && z >= -30000000 && x < 30000000 && z < 30000000 && y >= 0 && y < 256; - } -- public boolean isInvalidYLocation() { -- return b < 0 || b >= 256; -+ public final boolean isInvalidYLocation() { -+ return y < 0 || y >= 256; - } - // Paper end - - public BaseBlockPosition(int i, int j, int k) { -- this.a = i; -- this.b = j; -- this.c = k; -+ this.x = i; -+ this.y = j; -+ this.z = k; - } - - public BaseBlockPosition(double d0, double d1, double d2) { - this(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); - } - -- public boolean equals(Object object) { -+ public final boolean equals(Object object) { // Paper - if (this == object) { - return true; - } else if (!(object instanceof BaseBlockPosition)) { -@@ -40,29 +38,31 @@ public class BaseBlockPosition implements Comparable { - } else { - BaseBlockPosition baseblockposition = (BaseBlockPosition) object; - -- return this.getX() != baseblockposition.getX() ? false : (this.getY() != baseblockposition.getY() ? false : this.getZ() == baseblockposition.getZ()); -+ return x == baseblockposition.x && z == baseblockposition.z && y == baseblockposition.y; // Paper - } - } - -- public int hashCode() { -- return (this.getY() + this.getZ() * 31) * 31 + this.getX(); -+ public final int hashCode() { // Paper -+ return (this.y + this.z * 31) * 31 + this.x; // Paper - } - - public int compareTo(BaseBlockPosition baseblockposition) { - return this.getY() == baseblockposition.getY() ? (this.getZ() == baseblockposition.getZ() ? this.getX() - baseblockposition.getX() : this.getZ() - baseblockposition.getZ()) : this.getY() - baseblockposition.getY(); - } - -- public int getX() { -- return this.a; -+ // Paper start -+ public final int getX() { -+ return this.x; - } - -- public int getY() { -- return this.b; -+ public final int getY() { -+ return this.y; - } - -- public int getZ() { -- return this.c; -+ public final int getZ() { -+ return this.z; - } -+ // Paper end - - public BaseBlockPosition down() { - return this.down(1); -@@ -75,13 +75,14 @@ public class BaseBlockPosition implements Comparable { - public BaseBlockPosition shift(EnumDirection enumdirection, int i) { - return i == 0 ? this : new BaseBlockPosition(this.getX() + enumdirection.getAdjacentX() * i, this.getY() + enumdirection.getAdjacentY() * i, this.getZ() + enumdirection.getAdjacentZ() * i); - } -+ // Paper end - - public BaseBlockPosition d(BaseBlockPosition baseblockposition) { - return new BaseBlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX()); - } - - public boolean a(BaseBlockPosition baseblockposition, double d0) { -- return this.distanceSquared((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ(), false) < d0 * d0; -+ return this.distanceSquared((double) baseblockposition.x, (double) baseblockposition.y, (double) baseblockposition.z, false) < d0 * d0; // Paper - } - - public boolean a(IPosition iposition, double d0) { -@@ -107,9 +108,9 @@ public class BaseBlockPosition implements Comparable { - } - - public int n(BaseBlockPosition baseblockposition) { -- float f = (float) Math.abs(baseblockposition.getX() - this.getX()); -- float f1 = (float) Math.abs(baseblockposition.getY() - this.getY()); -- float f2 = (float) Math.abs(baseblockposition.getZ() - this.getZ()); -+ float f = (float) Math.abs(baseblockposition.getX() - this.x); // Paper -+ float f1 = (float) Math.abs(baseblockposition.getY() - this.y); // Paper -+ float f2 = (float) Math.abs(baseblockposition.getZ() - this.z); // Paper - - return (int) (f + f1 + f2); - } -diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index f8ac39e1b019b0918996f745d99f6ed09db0fd11..ec0e8f970dba64561afd6477a5df2821d9a8889a 100644 ---- a/src/main/java/net/minecraft/server/BlockPosition.java -+++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -99,6 +99,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali - return new BlockPosition(b(i), c(i), d(i)); - } - -+ public static long asLong(int x, int y, int z) { return a(x, y, z); } // Paper - OBFHELPER - public static long a(int i, int j, int k) { - long l = 0L; - -@@ -113,7 +114,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali - } - - public long asLong() { -- return a(this.getX(), this.getY(), this.getZ()); -+ return a(this.x, this.y, this.z); // Paper - } - - public BlockPosition a(double d0, double d1, double d2) { -@@ -343,11 +344,13 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali - } - - public static class MutableBlockPosition extends BlockPosition { -- -+ // Paper start - comment out -+ /* - protected int b; - protected int c; - protected int d; -- -+ */ -+ // Paper end - public MutableBlockPosition() { - this(0, 0, 0); - } -@@ -357,10 +360,13 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali - } - - public MutableBlockPosition(int i, int j, int k) { -- super(0, 0, 0); -+ // Paper start -+ super(i, j, k); -+ /* - this.b = i; - this.c = j; -- this.d = k; -+ this.d = k;*/ -+ // Paper end - } - - public MutableBlockPosition(double d0, double d1, double d2) { -@@ -391,6 +397,9 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali - return super.a(enumblockrotation).immutableCopy(); - } - -+ -+ /* -+ // Paper start - use parent getters - @Override - public int getX() { - return this.b; -@@ -404,13 +413,16 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali - @Override - public int getZ() { - return this.d; -- } -+ }*/ -+ // Paper end - - public BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return d(i, j, k);} // Paper - OBFHELPER - public BlockPosition.MutableBlockPosition d(int i, int j, int k) { -- this.b = i; -- this.c = j; -- this.d = k; -+ // Paper start - use xyz -+ this.x = i; -+ this.y = j; -+ this.z = k; -+ // Paper end - return this; - } - -@@ -440,26 +452,26 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali - } - - public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) { -- return this.d(this.b + enumdirection.getAdjacentX() * i, this.c + enumdirection.getAdjacentY() * i, this.d + enumdirection.getAdjacentZ() * i); -+ return this.d(this.x + enumdirection.getAdjacentX() * i, this.y + enumdirection.getAdjacentY() * i, this.z + enumdirection.getAdjacentZ() * i); - } - - public BlockPosition.MutableBlockPosition e(int i, int j, int k) { -- return this.d(this.b + i, this.c + j, this.d + k); -+ return this.d(this.x + i, this.y + j, this.z + k); - } - - public final void setX(final int x) { this.o(x); } // Paper - OBFHELPER - public void o(int i) { -- this.b = i; -+ this.x = i; // Paper change to x - } - - public final void setY(final int y) { this.p(y); } // Paper - OBFHELPER - public void p(int i) { -- this.c = i; -+ this.y = i; // Paper change to y - } - - public final void setZ(final int z) { this.q(z); } // Paper - OBFHELPER - public void q(int i) { -- this.d = i; -+ this.z = i; // Paper change to z - } - - @Override diff --git a/Spigot-Server-Patches/0252-Optimize-RegistryID.c.patch b/Spigot-Server-Patches/0251-Optimize-RegistryID.c.patch similarity index 84% rename from Spigot-Server-Patches/0252-Optimize-RegistryID.c.patch rename to Spigot-Server-Patches/0251-Optimize-RegistryID.c.patch index 7fc1445058..73cc0f8294 100644 --- a/Spigot-Server-Patches/0252-Optimize-RegistryID.c.patch +++ b/Spigot-Server-Patches/0251-Optimize-RegistryID.c.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize RegistryID.c() This is a frequent hotspot for world loading/saving. diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java -index e15d286710ed66a01bfb6b60f8735b837efb3fd7..e8a48b9a4c999281869dfb85577c2b44d6e30eb7 100644 +index 6cdd4d46d987132c3c241800b5d59cee2dfa25e2..f9692408a1d177ba4668261070d7610ecfb53a7b 100644 --- a/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java @@ -14,12 +14,14 @@ public class RegistryID implements Registry { @@ -24,7 +24,7 @@ index e15d286710ed66a01bfb6b60f8735b837efb3fd7..e8a48b9a4c999281869dfb85577c2b44 } public int getId(@Nullable K k0) { -@@ -44,9 +46,14 @@ public class RegistryID implements Registry { +@@ -48,9 +50,14 @@ public class RegistryID implements Registry { } private int c() { @@ -39,7 +39,7 @@ index e15d286710ed66a01bfb6b60f8735b837efb3fd7..e8a48b9a4c999281869dfb85577c2b44 return this.e; } -@@ -60,6 +67,7 @@ public class RegistryID implements Registry { +@@ -64,6 +71,7 @@ public class RegistryID implements Registry { this.d = (K[]) (new Object[i]); // Paper - decompile fix this.e = 0; this.f = 0; @@ -47,7 +47,7 @@ index e15d286710ed66a01bfb6b60f8735b837efb3fd7..e8a48b9a4c999281869dfb85577c2b44 for (int j = 0; j < ak.length; ++j) { if (ak[j] != null) { -@@ -85,6 +93,7 @@ public class RegistryID implements Registry { +@@ -89,6 +97,7 @@ public class RegistryID implements Registry { this.b[k] = k0; this.c[k] = i; this.d[i] = k0; @@ -55,7 +55,7 @@ index e15d286710ed66a01bfb6b60f8735b837efb3fd7..e8a48b9a4c999281869dfb85577c2b44 ++this.f; if (i == this.e) { ++this.e; -@@ -149,6 +158,7 @@ public class RegistryID implements Registry { +@@ -153,6 +162,7 @@ public class RegistryID implements Registry { Arrays.fill(this.d, (Object) null); this.e = 0; this.f = 0; diff --git a/Spigot-Server-Patches/0253-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/0252-Option-to-prevent-armor-stands-from-doing-entity-loo.patch similarity index 77% rename from Spigot-Server-Patches/0253-Option-to-prevent-armor-stands-from-doing-entity-loo.patch rename to Spigot-Server-Patches/0252-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 50bfc2319b..547cd38154 100644 --- a/Spigot-Server-Patches/0253-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/0252-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -19,13 +19,13 @@ index 387e0dcb9f01ad947daaa19211331a96742ce004..eaaa51e4bf761f41fd516402ce1ad0f9 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index fb719c5e18bcfa0e424c67c6b23c5abedd234f79..52d0b9e37b222274cccd2a7a872f61a6a72f2f06 100644 +index 8148ecad0e313d2e6c0307915aaa670e7ad5a317..66ce6afd46be67a131091d16b6a1221bbff333b5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -782,6 +782,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -836,6 +836,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + // Paper end } } - + // Paper start - Prevent armor stands from doing entity lookups + @Override + public boolean getCubes(@Nullable Entity entity, AxisAlignedBB axisAlignedBB) { @@ -33,7 +33,6 @@ index fb719c5e18bcfa0e424c67c6b23c5abedd234f79..52d0b9e37b222274cccd2a7a872f61a6 + return GeneratorAccess.super.getCubes(entity, axisAlignedBB); + } + // Paper end -+ - public boolean b(AxisAlignedBB axisalignedbb) { - int i = MathHelper.floor(axisalignedbb.minX); - int j = MathHelper.f(axisalignedbb.maxX); + + public Explosion explode(@Nullable Entity entity, double d0, double d1, double d2, float f, Explosion.Effect explosion_effect) { + return this.createExplosion(entity, (DamageSource) null, (ExplosionDamageCalculator) null, d0, d1, d2, f, false, explosion_effect); diff --git a/Spigot-Server-Patches/0254-Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/0253-Vanished-players-don-t-have-rights.patch similarity index 65% rename from Spigot-Server-Patches/0254-Vanished-players-don-t-have-rights.patch rename to Spigot-Server-Patches/0253-Vanished-players-don-t-have-rights.patch index 273b9575ca..9871c118fc 100644 --- a/Spigot-Server-Patches/0254-Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/0253-Vanished-players-don-t-have-rights.patch @@ -4,11 +4,23 @@ 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/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java +index 47324feca49786b49563d3d0e854e74ad27c190b..16a8ee36ba2b23207cb8630623d542ac5943b9df 100644 +--- a/src/main/java/net/minecraft/server/BlockBase.java ++++ b/src/main/java/net/minecraft/server/BlockBase.java +@@ -453,6 +453,7 @@ public abstract class BlockBase { + return this.a != null ? this.a.b : this.b(iblockaccess, blockposition, VoxelShapeCollision.a()); + } + ++ public final VoxelShape getCollisionShape(IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { return this.b(iblockaccess, blockposition, voxelshapecollision); } // Paper - OBFHELPER + public VoxelShape b(IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { + return this.getBlock().c(this.p(), iblockaccess, blockposition, voxelshapecollision); + } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 5fd57a3d30972d86c62025d63cd57b56a147cc94..653e6d9a1640bedf08aaa5b436ac93e4cb1cb5b7 100644 +index 814c885313967f007584f6832111ec5b445e4088..e281ab94a1a69059db653789532735e8c5fd272a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -98,7 +98,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -99,7 +99,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke private static double e = 1.0D; private final EntityTypes f; private int id; @@ -18,54 +30,53 @@ index 5fd57a3d30972d86c62025d63cd57b56a147cc94..653e6d9a1640bedf08aaa5b436ac93e4 protected int j; @Nullable diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index 278ef79d8962cc5d337e34891c7ea3a606336cbb..5c3731f68a31b73b886b872eba69de483f78a2aa 100644 +index 5ac7957016d1ca6bc78ced0bcf3767d358677f45..ca92579304d060e2b718aab6f3e3f006d52f93e5 100644 --- a/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java -@@ -110,6 +110,16 @@ public class EntityFireworks extends Entity implements IProjectile { +@@ -118,7 +118,6 @@ public class EntityFireworks extends IProjectile { + this.move(EnumMoveType.SELF, vec3d); + this.setMot(vec3d); + } +- + MovingObjectPosition movingobjectposition = ProjectileHelper.a(this, this::a, RayTrace.BlockCollisionOption.COLLIDER); - vec3d = this.getMot(); - MovingObjectPosition movingobjectposition = ProjectileHelper.a(this, this.getBoundingBox().a(vec3d).g(1.0D), (entity) -> { + if (!this.noclip) { +diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java +index cdf80e50de0840002f62f4c1df4fbcc4e13675d7..f85d80d7bb3e4e92bb8d281dfe577f663ebe9da1 100644 +--- a/src/main/java/net/minecraft/server/IProjectile.java ++++ b/src/main/java/net/minecraft/server/IProjectile.java +@@ -129,8 +129,14 @@ public abstract class IProjectile extends Entity { + protected boolean a(Entity entity) { + if (!entity.isSpectator() && entity.isAlive() && entity.isInteractable()) { + Entity entity1 = this.getShooter(); +- + // Paper start - Cancel hit for vanished players -+ if (this.spawningEntity != null && entity instanceof EntityPlayer && this.world instanceof WorldServer) { -+ Entity spawningEntity = ((WorldServer) this.world).getEntity(this.spawningEntity); -+ if (spawningEntity instanceof EntityPlayer) { -+ org.bukkit.entity.Player collided = (org.bukkit.entity.Player) entity.getBukkitEntity(); -+ org.bukkit.entity.Player shooter = (org.bukkit.entity.Player) spawningEntity.getBukkitEntity(); -+ if (!shooter.canSee(collided)) return false; -+ } ++ if (entity1 instanceof EntityPlayer) { ++ org.bukkit.entity.Player collided = (org.bukkit.entity.Player) entity.getBukkitEntity(); ++ org.bukkit.entity.Player shooter = (org.bukkit.entity.Player) entity1.getBukkitEntity(); ++ if (!shooter.canSee(collided)) return false; + } + return entity1 == null || this.d || !entity1.isSameVehicle(entity); + // Paper end - return !entity.isSpectator() && entity.isAlive() && entity.isInteractable(); - }, RayTrace.BlockCollisionOption.COLLIDER, true); - -diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index 181661fc8fe9d46cb36cfffac38c58f0d5003192..c5fddef030489bff0de9e0efb4f11c83bcfee628 100644 ---- a/src/main/java/net/minecraft/server/IBlockData.java -+++ b/src/main/java/net/minecraft/server/IBlockData.java -@@ -147,6 +147,7 @@ public class IBlockData extends BlockDataAbstract implements - return this.c != null ? this.c.g : this.b(iblockaccess, blockposition, VoxelShapeCollision.a()); - } - -+ public final VoxelShape getCollisionShape(IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { return this.b(iblockaccess, blockposition, voxelshapecollision); } // Paper - OBFHELPER - public VoxelShape b(IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { - return this.getBlock().b(this, iblockaccess, blockposition, voxelshapecollision); - } + } else { + return false; + } diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java -index ab875a7365693264ea8e5002d9d115e16320dbc8..aed353365bfdf1a133997f47cb458edc78af6c8b 100644 +index 6c7f677f68d89d7e08c07a0f24268c5a638b4076..33d38a9a8a55c7a26d9a584e8058f42556b6ed59 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java -@@ -136,7 +136,8 @@ public class ItemBlock extends Item { +@@ -139,7 +139,8 @@ public class ItemBlock extends Item { EntityHuman entityhuman = blockactioncontext.getEntity(); VoxelShapeCollision voxelshapecollision = entityhuman == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a((Entity) entityhuman); // CraftBukkit start - store default return -- boolean defaultReturn = (!this.T_() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && blockactioncontext.getWorld().a(iblockdata, blockactioncontext.getClickPosition(), voxelshapecollision); +- boolean defaultReturn = (!this.isCheckCollisions() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && blockactioncontext.getWorld().a(iblockdata, blockactioncontext.getClickPosition(), voxelshapecollision); + World world = blockactioncontext.getWorld(); // Paper -+ boolean defaultReturn = (!this.T_() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && world.checkEntityCollision(iblockdata, entityhuman, voxelshapecollision, blockactioncontext.getClickPosition(), true); // Paper ++ boolean defaultReturn = (!this.isCheckCollisions() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && world.checkEntityCollision(iblockdata, entityhuman, voxelshapecollision, blockactioncontext.getClickPosition(), true); // Paper org.bukkit.entity.Player player = (blockactioncontext.getEntity() instanceof EntityPlayer) ? (org.bukkit.entity.Player) blockactioncontext.getEntity().getBukkitEntity() : null; BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(blockactioncontext.getWorld(), blockactioncontext.getClickPosition()), player, CraftBlockData.fromData(iblockdata), defaultReturn); diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java -index 0f64a3c0569a778cd5b8c60f253c77681a83308d..0f95bcbccb96f9d525583f6bb6c0c0ed7fb7561b 100644 +index e985b0efc20f7d271be1c7ffc2670ab89fc3a6a7..c2b8c9820663f95f58f0c3a62cd9ec99c835a82f 100644 --- a/src/main/java/net/minecraft/server/VoxelShape.java +++ b/src/main/java/net/minecraft/server/VoxelShape.java @@ -46,6 +46,7 @@ public abstract class VoxelShape { @@ -77,7 +88,7 @@ index 0f64a3c0569a778cd5b8c60f253c77681a83308d..0f95bcbccb96f9d525583f6bb6c0c0ed return (VoxelShape) (this.isEmpty() ? VoxelShapes.a() : new VoxelShapeArray(this.a, new DoubleListOffset(this.a(EnumDirection.EnumAxis.X), d0), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Y), d1), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Z), d2))); } diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java -index 0e30d8c9933dc6595b9715ef6dc99cc8910892cb..335142ec0dfad822cfe40877e99dec0f307e1a58 100644 +index 86f6f082fe2991ea9065b09c9680b76ca1cf7154..b6e2a3d8d0cf510f497c6f974356fafaf2adc13b 100644 --- a/src/main/java/net/minecraft/server/VoxelShapes.java +++ b/src/main/java/net/minecraft/server/VoxelShapes.java @@ -35,6 +35,7 @@ public final class VoxelShapes { @@ -97,10 +108,10 @@ index 0e30d8c9933dc6595b9715ef6dc99cc8910892cb..335142ec0dfad822cfe40877e99dec0f if (operatorboolean.apply(false, false)) { throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException()); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 52d0b9e37b222274cccd2a7a872f61a6a72f2f06..2db91e85bd5e95d15b607a96114f33b6e7687b19 100644 +index 66ce6afd46be67a131091d16b6a1221bbff333b5..f6cb503b8eb329cb6bfaa960f812da3c99ce45a8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -153,6 +153,46 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -170,6 +170,46 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } @@ -145,13 +156,13 @@ index 52d0b9e37b222274cccd2a7a872f61a6a72f2f06..2db91e85bd5e95d15b607a96114f33b6 + // Paper end + @Override - public boolean p_() { + public boolean s_() { return this.isClientSide; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 4a76402c01dfe6525bae8728da2dde6e5d673765..dccc187c6198ce2e8824b8460347586ccf5c6741 100644 +index 3757a30e7b0ae1ec61211b2250bab47f70c776d4..a349ce7f04d6f2b29a0de534a3f7616778026666 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1179,6 +1179,14 @@ public class CraftEventFactory { +@@ -1177,6 +1177,14 @@ public class CraftEventFactory { Projectile projectile = (Projectile) entity.getBukkitEntity(); org.bukkit.entity.Entity collided = position.getEntity().getBukkitEntity(); com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = new com.destroystokyo.paper.event.entity.ProjectileCollideEvent(projectile, collided); diff --git a/Spigot-Server-Patches/0255-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch b/Spigot-Server-Patches/0254-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch similarity index 79% rename from Spigot-Server-Patches/0255-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch rename to Spigot-Server-Patches/0254-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch index fd3744a599..3cf45230b2 100644 --- a/Spigot-Server-Patches/0255-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch +++ b/Spigot-Server-Patches/0254-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch @@ -6,10 +6,10 @@ 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 87e94693f6db07d1273854ad55e5f263f2f2239e..f0a8142b7477fde211b522e3982e614fc94e20f8 100644 +index fdc02b512f2d4bc968977564d520bc7ec7189c69..a27f91e6c3d1f5dd0adf8a3b48a640cc63676114 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -518,6 +518,7 @@ public class Chunk implements IChunkAccess { +@@ -519,6 +519,7 @@ public class Chunk implements IChunkAccess { entity.chunkZ = this.loc.z; this.entities.add(entity); // Paper - per chunk entity list this.entitySlices[k].add(entity); @@ -17,7 +17,7 @@ index 87e94693f6db07d1273854ad55e5f263f2f2239e..f0a8142b7477fde211b522e3982e614f } @Override -@@ -545,6 +546,7 @@ public class Chunk implements IChunkAccess { +@@ -546,6 +547,7 @@ public class Chunk implements IChunkAccess { return; } entityCounts.decrement(entity.getMinecraftKeyString()); diff --git a/Spigot-Server-Patches/0256-Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/0255-Add-some-Debug-to-Chunk-Entity-slices.patch similarity index 86% rename from Spigot-Server-Patches/0256-Add-some-Debug-to-Chunk-Entity-slices.patch rename to Spigot-Server-Patches/0255-Add-some-Debug-to-Chunk-Entity-slices.patch index 0975e2af16..79423f7b9e 100644 --- a/Spigot-Server-Patches/0256-Add-some-Debug-to-Chunk-Entity-slices.patch +++ b/Spigot-Server-Patches/0255-Add-some-Debug-to-Chunk-Entity-slices.patch @@ -9,10 +9,10 @@ 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 f0a8142b7477fde211b522e3982e614fc94e20f8..9f369f932ca0a63bde246420cfde7949f3e78ca2 100644 +index a27f91e6c3d1f5dd0adf8a3b48a640cc63676114..3ba19f75d24a1539c94f4fed9b8f90aecc918cdc 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -509,6 +509,25 @@ public class Chunk implements IChunkAccess { +@@ -510,6 +510,25 @@ public class Chunk implements IChunkAccess { if (k >= this.entitySlices.length) { k = this.entitySlices.length - 1; } @@ -38,7 +38,7 @@ index f0a8142b7477fde211b522e3982e614fc94e20f8..9f369f932ca0a63bde246420cfde7949 if (!entity.inChunk || entity.getCurrentChunk() != this) entityCounts.increment(entity.getMinecraftKeyString()); // Paper entity.inChunk = true; -@@ -518,6 +537,7 @@ public class Chunk implements IChunkAccess { +@@ -519,6 +538,7 @@ public class Chunk implements IChunkAccess { entity.chunkZ = this.loc.z; this.entities.add(entity); // Paper - per chunk entity list this.entitySlices[k].add(entity); @@ -46,7 +46,7 @@ index f0a8142b7477fde211b522e3982e614fc94e20f8..9f369f932ca0a63bde246420cfde7949 this.markDirty(); // Paper } -@@ -542,6 +562,10 @@ public class Chunk implements IChunkAccess { +@@ -543,6 +563,10 @@ public class Chunk implements IChunkAccess { // Paper start if (entity.currentChunk != null && entity.currentChunk.get() == this) entity.setCurrentChunk(null); @@ -58,10 +58,10 @@ index f0a8142b7477fde211b522e3982e614fc94e20f8..9f369f932ca0a63bde246420cfde7949 return; } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 653e6d9a1640bedf08aaa5b436ac93e4cb1cb5b7..84d36ea84e25a701af22900af6cd3099adf6cd54 100644 +index e281ab94a1a69059db653789532735e8c5fd272a..6012891971265323603cb05ae444cca1bb058c89 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -71,6 +71,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -72,6 +72,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } } }; diff --git a/Spigot-Server-Patches/0257-EntityTransformedEvent.patch b/Spigot-Server-Patches/0256-EntityTransformedEvent.patch similarity index 50% rename from Spigot-Server-Patches/0257-EntityTransformedEvent.patch rename to Spigot-Server-Patches/0256-EntityTransformedEvent.patch index 53a2e0a865..222965c2e8 100644 --- a/Spigot-Server-Patches/0257-EntityTransformedEvent.patch +++ b/Spigot-Server-Patches/0256-EntityTransformedEvent.patch @@ -4,43 +4,47 @@ Date: Thu, 26 Jul 2018 15:30:03 -0400 Subject: [PATCH] EntityTransformedEvent +diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java +index 3997dc6d979bf5a027861397b948aa4e8486fc58..a38a1f3447accd51dcd295fb28c4108cb87ad832 100644 +--- a/src/main/java/net/minecraft/server/EntityInsentient.java ++++ b/src/main/java/net/minecraft/server/EntityInsentient.java +@@ -1244,6 +1244,7 @@ public abstract class EntityInsentient extends EntityLiving { + if (CraftEventFactory.callEntityTransformEvent(this, t0, EntityTransformEvent.TransformReason.DROWNED).isCancelled()) { + return null; + } ++ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), t0.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.DROWNED).callEvent()) return null; // Paper + this.world.addEntity(t0, CreatureSpawnEvent.SpawnReason.DROWNED); + // CraftBukkit end + this.die(); diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index 1d96ecb2fda1b567866f620b183a5811f75fa7f2..8b199971bd67a196168afb2e63d4c72919fec8d2 100644 +index 48d7e0f971d3147218e3be774a75cdb10d8b55a6..23ef033067e388b7b7b2a981df8655e240a30594 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java -@@ -112,6 +112,7 @@ public class EntityMushroomCow extends EntityCow { - if (CraftEventFactory.callEntityTransformEvent(this, entitycow, EntityTransformEvent.TransformReason.SHEARED).isCancelled()) { - return false; - } -+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitycow.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.SHEARED).callEvent()) return false; // Paper - this.world.addEntity(entitycow, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SHEARED); - - this.die(); // CraftBukkit - from above -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 6ca4fa43c41ad555c093b90cf08cfdb1e73fda22..6e0020ae0b4d2f2597843129b83fff0d194de337 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -699,6 +699,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) { - return; - } -+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitywitch.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.LIGHTNING).callEvent()) return; // Paper - this.world.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); - // CraftBukkit end - this.die(); -diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 83d5731b7f964136edf7cfabb96421e0788d067a..97a1dedf7460d513a560d722b2e0f1bf09fe669c 100644 ---- a/src/main/java/net/minecraft/server/EntityZombie.java -+++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -257,6 +257,7 @@ public class EntityZombie extends EntityMonster { +@@ -150,6 +150,7 @@ public class EntityMushroomCow extends EntityCow implements IShearable { + if (CraftEventFactory.callEntityTransformEvent(this, entitycow, EntityTransformEvent.TransformReason.SHEARED).isCancelled()) { return; } ++ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitycow.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.SHEARED).callEvent()) return; // Paper + this.world.addEntity(entitycow, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SHEARED); + + this.die(); // CraftBukkit - from above +diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java +index 00183a7f6e2000ce045ce50454f1296c4c93b148..a23c8d54a30a1ed1a3ed4d158da08229f59ca4c5 100644 +--- a/src/main/java/net/minecraft/server/EntityVillager.java ++++ b/src/main/java/net/minecraft/server/EntityVillager.java +@@ -733,6 +733,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) { + return; + } ++ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitywitch.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.LIGHTNING).callEvent()) return; // Paper + this.world.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit end -+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entityzombie.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.DROWNED).callEvent()) return; // Paper - this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.DROWNED); // CraftBukkit - added spawn reason this.die(); - } -@@ -463,6 +464,7 @@ public class EntityZombie extends EntityMonster { +diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java +index b808477cea6bf704edfaf08a2d0366bf263e69aa..3f16f9b34a75db6dc977cb0dc1603db34dd8ddc3 100644 +--- a/src/main/java/net/minecraft/server/EntityZombie.java ++++ b/src/main/java/net/minecraft/server/EntityZombie.java +@@ -399,6 +399,7 @@ public class EntityZombie extends EntityMonster { if (CraftEventFactory.callEntityTransformEvent(this, entityzombievillager, EntityTransformEvent.TransformReason.INFECTION).isCancelled()) { return; } @@ -49,10 +53,10 @@ index 83d5731b7f964136edf7cfabb96421e0788d067a..97a1dedf7460d513a560d722b2e0f1bf this.world.addEntity(entityzombievillager, CreatureSpawnEvent.SpawnReason.INFECTION); // CraftBukkit - add SpawnReason // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index 5c2d132c3a495650c5c279065e6659a88de0421d..b1818d269a78b6cb5594dd2f21c91ab1452649f7 100644 +index 2fb6356940b57e112d1ef35bfd3aee9cd98e5754..9b920332bd397f9711f0c99702245d54b9d3841b 100644 --- a/src/main/java/net/minecraft/server/EntityZombieVillager.java +++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java -@@ -197,6 +197,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo +@@ -212,6 +212,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo ((ZombieVillager) getBukkitEntity()).setConversionTime(-1); // SPIGOT-5208: End conversion to stop event spam return; } diff --git a/Spigot-Server-Patches/0258-SkeletonHorse-Additions.patch b/Spigot-Server-Patches/0257-SkeletonHorse-Additions.patch similarity index 76% rename from Spigot-Server-Patches/0258-SkeletonHorse-Additions.patch rename to Spigot-Server-Patches/0257-SkeletonHorse-Additions.patch index fae66f94ea..4699e18102 100644 --- a/Spigot-Server-Patches/0258-SkeletonHorse-Additions.patch +++ b/Spigot-Server-Patches/0257-SkeletonHorse-Additions.patch @@ -5,33 +5,33 @@ Subject: [PATCH] SkeletonHorse Additions diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index 621f2afee599e82806d54de15ff413674523815c..290cb9337c868fa3b9cbef0545886f44a00ef804 100644 +index 2aee4c592cbf7e083c522a35846735bdb7a2e448..43e605f682709708f5b79c70398691dc195ef925 100644 --- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java @@ -6,7 +6,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { - private final PathfinderGoalHorseTrap bF = new PathfinderGoalHorseTrap(this); - private boolean bG; -- private int bH; -+ private int bH; public int getTrapTime() { return this.bH; } // Paper - OBFHELPER + private final PathfinderGoalHorseTrap bD = new PathfinderGoalHorseTrap(this); + private boolean bE; +- private int bF; ++ private int bF; public int getTrapTime() { return this.bF; } // Paper - OBFHELPER public EntityHorseSkeleton(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -124,10 +124,12 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { +@@ -125,10 +125,12 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { return 0.96F; } -+ public boolean isTrap() { return this.eq(); } // Paper - OBFHELPER - public boolean eq() { - return this.bG; ++ public boolean isTrap() { return this.eN(); } // Paper - OBFHELPER + public boolean eN() { + return this.bE; } -+ public void setTrap(boolean trap) { this.r(trap); } // Paper - OBFHELPER - public void r(boolean flag) { - if (flag != this.bG) { - this.bG = flag; ++ public void setTrap(boolean trap) { this.t(trap); } // Paper - OBFHELPER + public void t(boolean flag) { + if (flag != this.bE) { + this.bE = flag; diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java -index dfe5a63583d8c14c82cc778ee004f2877e43776d..37626f925fb7838e41f7bfab352c9360b3786b4a 100644 +index d6b02adf9fe8287d600d76fb1c3be86fdee1fa77..b37e4aa37b35863d74cb6ef95562fba65486bdf9 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java @@ -15,6 +15,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { @@ -39,9 +39,9 @@ index dfe5a63583d8c14c82cc778ee004f2877e43776d..37626f925fb7838e41f7bfab352c9360 @Override public void e() { + if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.a.getBukkitEntity()).callEvent()) return; // Paper - DifficultyDamageScaler difficultydamagescaler = this.a.world.getDamageScaler(new BlockPosition(this.a)); + DifficultyDamageScaler difficultydamagescaler = this.a.world.getDamageScaler(this.a.getChunkCoordinates()); - this.a.r(false); + this.a.t(false); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java index e822c2200d6270ca538eadd9637b748fc3602cb6..2a7d1d4ec2c1ff16840614165c6f0c37dc534d87 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java diff --git a/Spigot-Server-Patches/0259-Prevent-Saving-Bad-entities-to-chunks.patch b/Spigot-Server-Patches/0258-Prevent-Saving-Bad-entities-to-chunks.patch similarity index 89% rename from Spigot-Server-Patches/0259-Prevent-Saving-Bad-entities-to-chunks.patch rename to Spigot-Server-Patches/0258-Prevent-Saving-Bad-entities-to-chunks.patch index b6bda37c08..3abc5efc8b 100644 --- a/Spigot-Server-Patches/0259-Prevent-Saving-Bad-entities-to-chunks.patch +++ b/Spigot-Server-Patches/0258-Prevent-Saving-Bad-entities-to-chunks.patch @@ -18,10 +18,10 @@ an invalid entity. This should reduce log occurrences of dupe uuid messages. diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 13d99de2cd08de02215031a1f699110c13ef35ff..f54572773c25b6716a68166efa8d3fc8b22b6258 100644 +index 28039aa8421207ce04840cc90e03d21bc8b7269f..17b8c4445af2bd2ed907d05ed3c396d4290dc63d 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -300,6 +300,7 @@ public class ChunkRegionLoader { +@@ -301,6 +301,7 @@ public class ChunkRegionLoader { nbttagcompound1.set("TileEntities", nbttaglist1); NBTTagList nbttaglist2 = new NBTTagList(); @@ -29,7 +29,7 @@ index 13d99de2cd08de02215031a1f699110c13ef35ff..f54572773c25b6716a68166efa8d3fc8 if (ichunkaccess.getChunkStatus().getType() == ChunkStatus.Type.LEVELCHUNK) { Chunk chunk = (Chunk) ichunkaccess; -@@ -311,13 +312,28 @@ public class ChunkRegionLoader { +@@ -312,13 +313,28 @@ public class ChunkRegionLoader { while (iterator1.hasNext()) { Entity entity = (Entity) iterator1.next(); NBTTagCompound nbttagcompound4 = new NBTTagCompound(); @@ -59,7 +59,7 @@ index 13d99de2cd08de02215031a1f699110c13ef35ff..f54572773c25b6716a68166efa8d3fc8 } else { ProtoChunk protochunk = (ProtoChunk) ichunkaccess; -@@ -373,6 +389,19 @@ public class ChunkRegionLoader { +@@ -377,6 +393,19 @@ public class ChunkRegionLoader { nbttagcompound1.set("Structures", a(chunkcoordintpair, ichunkaccess.h(), ichunkaccess.v())); return nbttagcompound; } @@ -80,10 +80,10 @@ index 13d99de2cd08de02215031a1f699110c13ef35ff..f54572773c25b6716a68166efa8d3fc8 public static ChunkStatus.Type a(@Nullable NBTTagCompound nbttagcompound) { if (nbttagcompound != null) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 5086a854b84b05e5b9c0f5677051d19dfa42f343..426ca12970e0c75ba75eee6c3e3cdbf833730737 100644 +index ac0bcde5ccc9ebb88922d8b82381b03675b87ae6..d81d6f7b984dc3587baadc96fc33f087b3594dcc 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1078,6 +1078,7 @@ public class WorldServer extends World { +@@ -1001,6 +1001,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { List[] aentityslice = chunk.getEntitySlices(); // Spigot int i = aentityslice.length; @@ -91,7 +91,7 @@ index 5086a854b84b05e5b9c0f5677051d19dfa42f343..426ca12970e0c75ba75eee6c3e3cdbf8 for (int j = 0; j < i; ++j) { List entityslice = aentityslice[j]; // Spigot Iterator iterator = entityslice.iterator(); -@@ -1090,11 +1091,25 @@ public class WorldServer extends World { +@@ -1013,11 +1014,25 @@ public class WorldServer extends World implements GeneratorAccessSeed { throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Removing entity while ticking!")); } diff --git a/Spigot-Server-Patches/0260-Don-t-call-getItemMeta-on-hasItemMeta.patch b/Spigot-Server-Patches/0259-Don-t-call-getItemMeta-on-hasItemMeta.patch similarity index 95% rename from Spigot-Server-Patches/0260-Don-t-call-getItemMeta-on-hasItemMeta.patch rename to Spigot-Server-Patches/0259-Don-t-call-getItemMeta-on-hasItemMeta.patch index 2916550284..ba7fb72e4a 100644 --- a/Spigot-Server-Patches/0260-Don-t-call-getItemMeta-on-hasItemMeta.patch +++ b/Spigot-Server-Patches/0259-Don-t-call-getItemMeta-on-hasItemMeta.patch @@ -11,10 +11,10 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set. Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index a41be8fdaebe7cf61537c638392b3dc7c7f5b371..d5e8a7ee6de22d09e563ad1c124a18810a38a0c5 100644 +index 2146d1354c48b9a76b24bca321b578d401e1a0a8..3541fed804b9bbfbd8c658d6c03a74c3dd4acf25 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -@@ -553,7 +553,7 @@ public final class CraftItemStack extends ItemStack { +@@ -561,7 +561,7 @@ public final class CraftItemStack extends ItemStack { @Override public boolean hasItemMeta() { diff --git a/Spigot-Server-Patches/0261-Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/0260-Ignore-Dead-Entities-in-entityList-iteration.patch similarity index 75% rename from Spigot-Server-Patches/0261-Ignore-Dead-Entities-in-entityList-iteration.patch rename to Spigot-Server-Patches/0260-Ignore-Dead-Entities-in-entityList-iteration.patch index f73a9fa204..fc445de048 100644 --- a/Spigot-Server-Patches/0261-Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/0260-Ignore-Dead-Entities-in-entityList-iteration.patch @@ -23,18 +23,18 @@ index b839769ceae8932bb121a0b96fde1e7d129a1f63..5acad8e44f024d3ddf5ef4fd320460ac 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/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 9f369f932ca0a63bde246420cfde7949f3e78ca2..c84d90a9a0c67b5ff518ce3fbc21344c808a3cf1 100644 +index 3ba19f75d24a1539c94f4fed9b8f90aecc918cdc..f7be161c8557ae3848227b1a61e27374770ad243 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -816,6 +816,7 @@ public class Chunk implements IChunkAccess { +@@ -818,6 +818,7 @@ public class Chunk implements IChunkAccess { - while (iterator.hasNext()) { - Entity entity1 = (Entity) iterator.next(); -+ if (entity1.shouldBeRemoved) continue; // Paper + for (int i1 = 0; i1 < l; ++i1) { + Entity entity1 = (Entity) list1.get(i1); ++ if (entity1.shouldBeRemoved) continue; // Paper - if (entity1.getBoundingBox().c(axisalignedbb) && entity1 != entity) { - if (predicate == null || predicate.test(entity1)) { -@@ -853,6 +854,7 @@ public class Chunk implements IChunkAccess { + if (entity1.getBoundingBox().c(axisalignedbb) && entity1 != entity) { + if (predicate == null || predicate.test(entity1)) { +@@ -854,6 +855,7 @@ public class Chunk implements IChunkAccess { while (iterator.hasNext()) { T entity = (T) iterator.next(); // CraftBukkit - decompile error @@ -42,7 +42,7 @@ index 9f369f932ca0a63bde246420cfde7949f3e78ca2..c84d90a9a0c67b5ff518ce3fbc21344c if ((entitytypes == null || entity.getEntityType() == entitytypes) && entity.getBoundingBox().c(axisalignedbb) && predicate.test(entity)) { list.add(entity); -@@ -874,6 +876,7 @@ public class Chunk implements IChunkAccess { +@@ -875,6 +877,7 @@ public class Chunk implements IChunkAccess { while (iterator.hasNext()) { T t0 = (T) iterator.next(); // CraftBukkit - decompile error @@ -51,10 +51,10 @@ index 9f369f932ca0a63bde246420cfde7949f3e78ca2..c84d90a9a0c67b5ff518ce3fbc21344c if (oclass.isInstance(t0) && t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { // Spigot - instance check list.add(t0); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 84d36ea84e25a701af22900af6cd3099adf6cd54..6e87ff52df30f4de8cfb11d1dbfb71211d656831 100644 +index 6012891971265323603cb05ae444cca1bb058c89..9163916e6f600f2efa3e05f3df1d07ef9b60cd3a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -195,6 +195,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -196,6 +196,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke protected int numCollisions = 0; // Paper public void inactiveTick() { } // Spigot end @@ -63,19 +63,10 @@ index 84d36ea84e25a701af22900af6cd3099adf6cd54..6e87ff52df30f4de8cfb11d1dbfb7121 public float getBukkitYaw() { return this.yaw; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 426ca12970e0c75ba75eee6c3e3cdbf833730737..3067ab76d94c58fbfd52fac6754bf6d6d7f01d09 100644 +index d81d6f7b984dc3587baadc96fc33f087b3594dcc..ba0bb12dd5c5068d31c8a925e31804ddf2cec5da 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -908,7 +908,7 @@ public class WorldServer extends World { - - while (objectiterator.hasNext()) { - Entity entity = (Entity) objectiterator.next(); -- -+ if (entity.shouldBeRemoved) continue; // Paper - if (entity instanceof EntityInsentient) { - EntityInsentient entityinsentient = (EntityInsentient) entity; - -@@ -1230,6 +1230,7 @@ public class WorldServer extends World { +@@ -1153,6 +1153,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { entity.origin = entity.getBukkitEntity().getLocation(); } // Paper end @@ -83,7 +74,7 @@ index 426ca12970e0c75ba75eee6c3e3cdbf833730737..3067ab76d94c58fbfd52fac6754bf6d6 new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid } -@@ -1242,6 +1243,7 @@ public class WorldServer extends World { +@@ -1165,6 +1166,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.removeEntityFromChunk(entity); this.entitiesById.remove(entity.getId()); this.unregisterEntity(entity); @@ -92,10 +83,10 @@ index 426ca12970e0c75ba75eee6c3e3cdbf833730737..3067ab76d94c58fbfd52fac6754bf6d6 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a59172ff043e5220ffdd363582c38ae53c429f1a..6c3cd51d92d2271cd216c42c18733d549fbe668d 100644 +index 66c89831796db1bbdd6c83cba786b27ef339ec9b..411d7a3f7d4d54fbf748888e24f2032c4d091250 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1027,6 +1027,7 @@ public class CraftWorld implements World { +@@ -1031,6 +1031,7 @@ public class CraftWorld implements World { for (Object o : world.entitiesById.values()) { if (o instanceof net.minecraft.server.Entity) { net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity) o; @@ -103,7 +94,7 @@ index a59172ff043e5220ffdd363582c38ae53c429f1a..6c3cd51d92d2271cd216c42c18733d54 Entity bukkitEntity = mcEnt.getBukkitEntity(); // Assuming that bukkitEntity isn't null -@@ -1046,6 +1047,7 @@ public class CraftWorld implements World { +@@ -1050,6 +1051,7 @@ public class CraftWorld implements World { for (Object o : world.entitiesById.values()) { if (o instanceof net.minecraft.server.Entity) { net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity) o; @@ -111,7 +102,7 @@ index a59172ff043e5220ffdd363582c38ae53c429f1a..6c3cd51d92d2271cd216c42c18733d54 Entity bukkitEntity = mcEnt.getBukkitEntity(); // Assuming that bukkitEntity isn't null -@@ -1072,6 +1074,7 @@ public class CraftWorld implements World { +@@ -1076,6 +1078,7 @@ public class CraftWorld implements World { for (Object entity: world.entitiesById.values()) { if (entity instanceof net.minecraft.server.Entity) { @@ -119,7 +110,7 @@ index a59172ff043e5220ffdd363582c38ae53c429f1a..6c3cd51d92d2271cd216c42c18733d54 Entity bukkitEntity = ((net.minecraft.server.Entity) entity).getBukkitEntity(); if (bukkitEntity == null) { -@@ -1095,6 +1098,7 @@ public class CraftWorld implements World { +@@ -1099,6 +1102,7 @@ public class CraftWorld implements World { for (Object entity: world.entitiesById.values()) { if (entity instanceof net.minecraft.server.Entity) { diff --git a/Spigot-Server-Patches/0262-Implement-Expanded-ArmorStand-API.patch b/Spigot-Server-Patches/0261-Implement-Expanded-ArmorStand-API.patch similarity index 94% rename from Spigot-Server-Patches/0262-Implement-Expanded-ArmorStand-API.patch rename to Spigot-Server-Patches/0261-Implement-Expanded-ArmorStand-API.patch index 46045bd250..f305f31ce2 100644 --- a/Spigot-Server-Patches/0262-Implement-Expanded-ArmorStand-API.patch +++ b/Spigot-Server-Patches/0261-Implement-Expanded-ArmorStand-API.patch @@ -8,15 +8,15 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 992d7bfb0fd26540fbdeaf8d7845e8c2c81d608b..61d7d507aaac3e7e5a885387ae89c67dfb1c9844 100644 +index 0232ffba7b18174e0ce44d91285541a9869d07b9..a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -36,7 +36,7 @@ public class EntityArmorStand extends EntityLiving { private final NonNullList armorItems; private boolean armorStandInvisible; - public long bq; -- private int bB; -+ private int bB; public void setDisabledSlots(int i) { bB = i; } public int getDisabledSlots() { return bB; } // Paper - OBFHELPER + public long bp; +- private int bA; ++ private int bA; public void setDisabledSlots(int i) { bA = i; } public int getDisabledSlots() { return bA; } // Paper - OBFHELPER public Vector3f headPose; public Vector3f bodyPose; public Vector3f leftArmPose; @@ -26,7 +26,7 @@ index 992d7bfb0fd26540fbdeaf8d7845e8c2c81d608b..61d7d507aaac3e7e5a885387ae89c67d + public boolean isSlotDisabled(EnumItemSlot slot) { return this.d(slot); } // Paper - OBFHELPER private boolean d(EnumItemSlot enumitemslot) { - return (this.bB & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms(); + return (this.bA & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms(); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java index 124c3185bc5c344555f684629c8818130d80ab3d..d1d689e5d78c569313c4059c4652724605dc07d2 100644 diff --git a/Spigot-Server-Patches/0262-AnvilDamageEvent.patch b/Spigot-Server-Patches/0262-AnvilDamageEvent.patch new file mode 100644 index 0000000000..d8bc4d00aa --- /dev/null +++ b/Spigot-Server-Patches/0262-AnvilDamageEvent.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Fri, 20 Jul 2018 23:37:03 -0500 +Subject: [PATCH] AnvilDamageEvent + + +diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java +index 6b98557f59cb92db9987a58db58cfa3adbd6de48..24631b2bcb2a1d057c1fb6596ff401133c8b548a 100644 +--- a/src/main/java/net/minecraft/server/ContainerAnvil.java ++++ b/src/main/java/net/minecraft/server/ContainerAnvil.java +@@ -67,7 +67,16 @@ public class ContainerAnvil extends ContainerAnvilAbstract { + + if (!entityhuman.abilities.canInstantlyBuild && iblockdata.a((Tag) TagsBlock.ANVIL) && entityhuman.getRandom().nextFloat() < 0.12F) { + IBlockData iblockdata1 = BlockAnvil.c(iblockdata); +- ++ // Paper start ++ com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), iblockdata1 != null ? org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1) : null); ++ if (!event.callEvent()) { ++ return; ++ } else if (event.getDamageState() == com.destroystokyo.paper.event.block.AnvilDamagedEvent.DamageState.BROKEN) { ++ iblockdata1 = null; ++ } else { ++ iblockdata1 = ((org.bukkit.craftbukkit.block.data.CraftBlockData) event.getDamageState().getMaterial().createBlockData()).getState().set(BlockAnvil.FACING, iblockdata.get(BlockAnvil.FACING)); ++ } ++ // Paper end + if (iblockdata1 == null) { + world.a(blockposition, false); + world.triggerEffect(1029, blockposition, 0); diff --git a/Spigot-Server-Patches/0264-Add-TNTPrimeEvent.patch b/Spigot-Server-Patches/0263-Add-TNTPrimeEvent.patch similarity index 85% rename from Spigot-Server-Patches/0264-Add-TNTPrimeEvent.patch rename to Spigot-Server-Patches/0263-Add-TNTPrimeEvent.patch index 10dd1a6d15..307b17b5b8 100644 --- a/Spigot-Server-Patches/0264-Add-TNTPrimeEvent.patch +++ b/Spigot-Server-Patches/0263-Add-TNTPrimeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add TNTPrimeEvent diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java -index d32857c8724f97c7625208cf815c275264179209..b41de95a6390910ba8bb21bfa12ab61c85900218 100644 +index 0cbf4d7d460a3e9e632fd0c9cfd318f3065f18d6..1e6159f211fb445e45bab3ca1a3bf21750928302 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -15,17 +15,17 @@ index d32857c8724f97c7625208cf815c275264179209..b41de95a6390910ba8bb21bfa12ab61c +import com.destroystokyo.paper.event.block.TNTPrimeEvent; // Paper - TNTPrimeEvent import java.util.Map; import java.util.Random; - import java.util.Map.Entry; -@@ -237,7 +238,7 @@ public class BlockFire extends Block { - world.setTypeAndData(blockposition, (IBlockData) this.a((IBlockAccess) world, blockposition).set(BlockFire.AGE, l), 3); +@@ -249,7 +250,7 @@ public class BlockFire extends BlockFireAbstract { + + world.setTypeAndData(blockposition, this.a(world, blockposition, l), 3); } else { - world.a(blockposition, false); + if(iblockdata.getBlock() != Blocks.TNT) world.a(blockposition, false); // Paper - TNTPrimeEvent - We might be cancelling it below, move the setAir down } Block block = iblockdata.getBlock(); -@@ -245,6 +246,13 @@ public class BlockFire extends Block { +@@ -257,6 +258,13 @@ public class BlockFire extends BlockFireAbstract { if (block instanceof BlockTNT) { BlockTNT blocktnt = (BlockTNT) block; @@ -40,7 +40,7 @@ index d32857c8724f97c7625208cf815c275264179209..b41de95a6390910ba8bb21bfa12ab61c } } diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java -index 6cb82420b428fdc7bbcd4f22f1f65ba085a7f3c2..592fcd538a4e25d7779328d6d6cd8efda238b55d 100644 +index c6fe9c1f7ef06c4524533130b493ca5e72bd1693..7b601955f3fd36f06c838b896b455a606954d980 100644 --- a/src/main/java/net/minecraft/server/BlockTNT.java +++ b/src/main/java/net/minecraft/server/BlockTNT.java @@ -1,6 +1,7 @@ @@ -53,7 +53,7 @@ index 6cb82420b428fdc7bbcd4f22f1f65ba085a7f3c2..592fcd538a4e25d7779328d6d6cd8efd @@ -15,6 +16,11 @@ public class BlockTNT extends Block { public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { - if (iblockdata1.getBlock() != iblockdata.getBlock()) { + if (!iblockdata1.a(iblockdata.getBlock())) { if (world.isBlockIndirectlyPowered(blockposition)) { + // Paper start - TNTPrimeEvent + org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition);; @@ -80,12 +80,12 @@ index 6cb82420b428fdc7bbcd4f22f1f65ba085a7f3c2..592fcd538a4e25d7779328d6d6cd8efd public void wasExploded(World world, BlockPosition blockposition, Explosion explosion) { if (!world.isClientSide) { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition);; ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition); + org.bukkit.entity.Entity source = explosion.source != null ? explosion.source.getBukkitEntity() : null; + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.EXPLOSION, source).callEvent()) + return; + // Paper end - EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource()); + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, explosion.getSource()); entitytntprimed.setFuseTicks((short) (world.random.nextInt(entitytntprimed.getFuseTicks() / 4) + entitytntprimed.getFuseTicks() / 8)); @@ -71,6 +88,11 @@ public class BlockTNT extends Block { @@ -100,22 +100,22 @@ index 6cb82420b428fdc7bbcd4f22f1f65ba085a7f3c2..592fcd538a4e25d7779328d6d6cd8efd a(world, blockposition, (EntityLiving) entityhuman); world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 11); if (!entityhuman.isCreative()) { -@@ -101,6 +123,13 @@ public class BlockTNT extends Block { +@@ -100,6 +122,13 @@ public class BlockTNT extends Block { } // CraftBukkit end + // Paper start - TNTPrimeEvent + org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition); -+ if (!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.PROJECTILE, entityarrow.getBukkitEntity()).callEvent()) { ++ if (!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.PROJECTILE, iprojectile.getBukkitEntity()).callEvent()) { + return; + } + // Paper end + - a(world, blockposition, entity1 instanceof EntityLiving ? (EntityLiving) entity1 : null); + a(world, blockposition, entity instanceof EntityLiving ? (EntityLiving) entity : null); world.a(blockposition, false); } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 138e2ea56a91e519a34fd3be9c0ab111a4b17544..6a4ccaeb0fef2cabab87b33bf89b5a68608800e9 100644 +index 05b7cdb33b45a4f503cd7fe4130b54d59e7b6452..279807dc5045e765fe7496315494b2cb231d08f9 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -11,6 +11,7 @@ import org.bukkit.craftbukkit.block.CraftBlock; @@ -126,9 +126,9 @@ index 138e2ea56a91e519a34fd3be9c0ab111a4b17544..6a4ccaeb0fef2cabab87b33bf89b5a68 // PAIL: Fixme public class EntityEnderDragon extends EntityInsentient implements IMonster { -@@ -468,6 +469,11 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { +@@ -466,6 +467,11 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { }); - craftBlock.getNMS().dropNaturally(world, blockposition, ItemStack.a); + craftBlock.getNMS().dropNaturally(world, blockposition, ItemStack.b); } + // Paper start - TNTPrimeEvent + org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.x, blockposition.y, blockposition.z); diff --git a/Spigot-Server-Patches/0263-AnvilDamageEvent.patch b/Spigot-Server-Patches/0263-AnvilDamageEvent.patch deleted file mode 100644 index 80bbc3bcb4..0000000000 --- a/Spigot-Server-Patches/0263-AnvilDamageEvent.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath -Date: Fri, 20 Jul 2018 23:37:03 -0500 -Subject: [PATCH] AnvilDamageEvent - - -diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java -index 1d9ce5ef1cc0158e8218d4cf15bc1e84017e7620..286b930ddb7224fa3929cb0ef0b94f5f5205b104 100644 ---- a/src/main/java/net/minecraft/server/ContainerAnvil.java -+++ b/src/main/java/net/minecraft/server/ContainerAnvil.java -@@ -85,6 +85,16 @@ public class ContainerAnvil extends Container { - - if (!entityhuman.abilities.canInstantlyBuild && iblockdata.a(TagsBlock.ANVIL) && entityhuman.getRandom().nextFloat() < 0.12F) { - IBlockData iblockdata1 = BlockAnvil.e(iblockdata); -+ // Paper start -+ com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), iblockdata1 != null ? org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1) : null); -+ if (!event.callEvent()) { -+ return; -+ } else if (event.getDamageState() == com.destroystokyo.paper.event.block.AnvilDamagedEvent.DamageState.BROKEN) { -+ iblockdata1 = null; -+ } else { -+ iblockdata1 = ((org.bukkit.craftbukkit.block.data.CraftBlockData) event.getDamageState().getMaterial().createBlockData()).getState().set(BlockAnvil.FACING, iblockdata.get(BlockAnvil.FACING)); -+ } -+ // Paper end - - if (iblockdata1 == null) { - world.a(blockposition, false); diff --git a/Spigot-Server-Patches/0265-Break-up-and-make-tab-spam-limits-configurable.patch b/Spigot-Server-Patches/0264-Break-up-and-make-tab-spam-limits-configurable.patch similarity index 95% rename from Spigot-Server-Patches/0265-Break-up-and-make-tab-spam-limits-configurable.patch rename to Spigot-Server-Patches/0264-Break-up-and-make-tab-spam-limits-configurable.patch index 4158686238..3f1bf012fe 100644 --- a/Spigot-Server-Patches/0265-Break-up-and-make-tab-spam-limits-configurable.patch +++ b/Spigot-Server-Patches/0264-Break-up-and-make-tab-spam-limits-configurable.patch @@ -45,7 +45,7 @@ index 26ab855dcf38446a3d8577108bd16fdbb76126b2..adef07d4d521b4aaa6f3389b04aa27e2 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index a46ef5e72d03a32e22cfd77b2581de70edcc686a..e7ad580740bab3e102f32bd715c6b01a0e721e09 100644 +index 8855a1de14f970ddac25d935a4b2e00c7e277908..6884fcd0749eba2dc84f1447b338a879ff79f0c8 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -76,6 +76,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -56,7 +56,7 @@ index a46ef5e72d03a32e22cfd77b2581de70edcc686a..e7ad580740bab3e102f32bd715c6b01a // CraftBukkit end private int j; private final Int2ShortMap k = new Int2ShortOpenHashMap(); -@@ -207,6 +208,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -206,6 +207,7 @@ public class PlayerConnection implements PacketListenerPlayIn { this.minecraftServer.getMethodProfiler().exit(); // CraftBukkit start for (int spam; (spam = this.chatThrottle) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1); ) ; @@ -64,7 +64,7 @@ index a46ef5e72d03a32e22cfd77b2581de70edcc686a..e7ad580740bab3e102f32bd715c6b01a /* Use thread-safe field access instead if (this.chatThrottle > 0) { --this.chatThrottle; -@@ -526,7 +528,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -529,7 +531,7 @@ public class PlayerConnection implements PacketListenerPlayIn { public void a(PacketPlayInTabComplete packetplayintabcomplete) { // PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async // CraftBukkit start diff --git a/Spigot-Server-Patches/0266-Add-hand-to-bucket-events.patch b/Spigot-Server-Patches/0265-Add-hand-to-bucket-events.patch similarity index 50% rename from Spigot-Server-Patches/0266-Add-hand-to-bucket-events.patch rename to Spigot-Server-Patches/0265-Add-hand-to-bucket-events.patch index 2a6aeb13c4..1ee7ba868e 100644 --- a/Spigot-Server-Patches/0266-Add-hand-to-bucket-events.patch +++ b/Spigot-Server-Patches/0265-Add-hand-to-bucket-events.patch @@ -5,28 +5,28 @@ Subject: [PATCH] Add hand to bucket events diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index 6e385b53048da91a0f50bf02f6510de2a685baab..2c8bbf20ae7f9be2c57822833bb285b86ea1a901 100644 +index 28f97aea9c64678c6e6f821482ad47388af83089..30ee6df6b47c7cfa555a757a01270b986e4fdf9e 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java -@@ -61,7 +61,7 @@ public class EntityCow extends EntityAnimal { +@@ -58,7 +58,7 @@ public class EntityCow extends EntityAnimal { - if (itemstack.getItem() == Items.BUCKET && !entityhuman.abilities.canInstantlyBuild && !this.isBaby()) { + if (itemstack.getItem() == Items.BUCKET && !this.isBaby()) { // CraftBukkit start - Got milk? -- org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman.world, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET); -+ org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman.world, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET, enumhand); // Paper - add enumHand +- org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) entityhuman.world, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET); ++ org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) entityhuman.world, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET, enumhand); // Paper - add enumHand if (event.isCancelled()) { - return false; + return EnumInteractionResult.PASS; diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java -index 7c5c0498435e3fae6a7997e34f197d402daa3bd8..ffe4b9eb868ecd9582ba1d3fc3aef0f82372e852 100644 +index aada95b9d02d8ca0b870ec08875b5b719a543212..d68ee8d5dc5f8a75dc465f155acccb79c1ebe99c 100644 --- a/src/main/java/net/minecraft/server/ItemBucket.java +++ b/src/main/java/net/minecraft/server/ItemBucket.java @@ -41,7 +41,7 @@ public class ItemBucket extends Item { if (iblockdata.getBlock() instanceof IFluidSource) { // CraftBukkit start FluidType dummyFluid = ((IFluidSource) iblockdata.getBlock()).removeFluid(DummyGeneratorAccess.INSTANCE, blockposition, iblockdata); -- PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(world, entityhuman, blockposition, blockposition, movingobjectpositionblock.getDirection(), itemstack, dummyFluid.a()); -+ PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(world, entityhuman, blockposition, blockposition, movingobjectpositionblock.getDirection(), itemstack, dummyFluid.a(), enumhand); +- PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) world, entityhuman, blockposition, blockposition, movingobjectpositionblock.getDirection(), itemstack, dummyFluid.a()); ++ PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) world, entityhuman, blockposition, blockposition, movingobjectpositionblock.getDirection(), itemstack, dummyFluid.a(), enumhand); // Paper - add enumhand if (event.isCancelled()) { ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-5163 (see PlayerInteractManager) @@ -34,14 +34,14 @@ index 7c5c0498435e3fae6a7997e34f197d402daa3bd8..ffe4b9eb868ecd9582ba1d3fc3aef0f8 iblockdata = world.getType(blockposition); BlockPosition blockposition2 = iblockdata.getBlock() instanceof IFluidContainer && this.fluidType == FluidTypes.WATER ? blockposition : blockposition1; -- if (this.a(entityhuman, world, blockposition2, movingobjectpositionblock, movingobjectpositionblock.getDirection(), blockposition, itemstack)) { // CraftBukkit -+ if (this.a(entityhuman, world, blockposition2, movingobjectpositionblock, movingobjectpositionblock.getDirection(), blockposition, itemstack, enumhand)) { // CraftBukkit // Paper - add enumhand +- if (this.a(entityhuman, world, blockposition2, movingobjectpositionblock1, movingobjectpositionblock1.getDirection(), blockposition, itemstack)) { // CraftBukkit ++ if (this.a(entityhuman, world, blockposition2, movingobjectpositionblock1, movingobjectpositionblock1.getDirection(), blockposition, itemstack, enumhand)) { // CraftBukkit // Paper - add enumhand this.a(world, itemstack, blockposition2); if (entityhuman instanceof EntityPlayer) { CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition2, itemstack); -@@ -115,10 +115,12 @@ public class ItemBucket extends Item { +@@ -94,10 +94,12 @@ public class ItemBucket extends Item { + public void a(World world, ItemStack itemstack, BlockPosition blockposition) {} - // CraftBukkit start public boolean a(@Nullable EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPositionBlock movingobjectpositionblock) { - return a(entityhuman, world, blockposition, movingobjectpositionblock, null, null, null); + // Paper start - add enumHand @@ -54,28 +54,85 @@ index 7c5c0498435e3fae6a7997e34f197d402daa3bd8..ffe4b9eb868ecd9582ba1d3fc3aef0f8 // CraftBukkit end if (!(this.fluidType instanceof FluidTypeFlowing)) { return false; -@@ -128,11 +130,11 @@ public class ItemBucket extends Item { - boolean flag = iblockdata.a(this.fluidType); +@@ -110,7 +112,7 @@ public class ItemBucket extends Item { - if (!iblockdata.isAir() && !flag && (!(iblockdata.getBlock() instanceof IFluidContainer) || !((IFluidContainer) iblockdata.getBlock()).canPlace(world, blockposition, iblockdata, this.fluidType))) { -- return movingobjectpositionblock == null ? false : this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), (MovingObjectPositionBlock) null, enumdirection, clicked, itemstack); // CraftBukkit -+ return movingobjectpositionblock == null ? false : this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), (MovingObjectPositionBlock) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit - } else { - // CraftBukkit start - if (entityhuman != null) { -- PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(world, entityhuman, blockposition, clicked, enumdirection, itemstack); -+ PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(world, entityhuman, blockposition, clicked, enumdirection, itemstack, enumhand); - if (event.isCancelled()) { - ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity - ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541 -diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index dccc187c6198ce2e8824b8460347586ccf5c6741..2e859c32b5a7d314e38221da75d785ff244224ad 100644 ---- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -381,6 +381,20 @@ public class CraftEventFactory { + // CraftBukkit start + if (flag1 && entityhuman != null) { +- PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent((WorldServer) world, entityhuman, blockposition, clicked, enumdirection, itemstack); ++ PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent((WorldServer) world, entityhuman, blockposition, clicked, enumdirection, itemstack, enumhand); // Paper - add enumhand + if (event.isCancelled()) { + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541 +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index f6cb503b8eb329cb6bfaa960f812da3c99ce45a8..a47de606a82b840180bd203816955fb657cc7c6c 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -210,6 +210,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + } + // Paper end + ++ // Paper start - moved up from WorldServer ++ public BlockPosition getSpawn() { ++ BlockPosition blockposition = new BlockPosition(this.worldData.a(), this.worldData.b(), this.worldData.c()); ++ ++ if (!this.getWorldBorder().a(blockposition)) { ++ blockposition = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, new BlockPosition(this.getWorldBorder().getCenterX(), 0.0D, this.getWorldBorder().getCenterZ())); ++ } ++ ++ return blockposition; ++ } ++ // Paper end + @Override + public boolean s_() { + return this.isClientSide; +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index ba0bb12dd5c5068d31c8a925e31804ddf2cec5da..14ec04c6503cca58f64fc2a82a9fd715a06dcefb 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -1484,15 +1484,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { + this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition)); } - private static PlayerEvent getPlayerBucketEvent(boolean isFilling, World world, EntityHuman who, BlockPosition changed, BlockPosition clicked, EnumDirection clickedFace, ItemStack itemstack, net.minecraft.server.Item item) { +- public BlockPosition getSpawn() { +- BlockPosition blockposition = new BlockPosition(this.worldData.a(), this.worldData.b(), this.worldData.c()); +- +- if (!this.getWorldBorder().a(blockposition)) { +- blockposition = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, new BlockPosition(this.getWorldBorder().getCenterX(), 0.0D, this.getWorldBorder().getCenterZ())); +- } +- +- return blockposition; +- } ++ // Paper - moved up to World ++ //public BlockPosition getSpawn() { ++ // BlockPosition blockposition = new BlockPosition(this.worldData.a(), this.worldData.b(), this.worldData.c()); ++ // ++ // if (!this.getWorldBorder().a(blockposition)) { ++ // blockposition = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, new BlockPosition(this.getWorldBorder().getCenterX(), 0.0D, this.getWorldBorder().getCenterZ())); ++ // } ++ // ++ // return blockposition; ++ //} ++ // Paper end + + public LongSet getForceLoadedChunks() { + ForcedChunk forcedchunk = (ForcedChunk) this.getWorldPersistentData().b(ForcedChunk::new, "chunks"); +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +index a349ce7f04d6f2b29a0de534a3f7616778026666..46889e7b462673f5d03e6efc1114074da3165d47 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -220,7 +220,7 @@ public class CraftEventFactory { + public static Entity entityDamage; // For use in EntityDamageByEntityEvent + + // helper methods +- private static boolean canBuild(WorldServer world, Player player, int x, int z) { ++ private static boolean canBuild(World world, Player player, int x, int z) { + int spawnSize = Bukkit.getServer().getSpawnRadius(); + + if (world.getDimensionKey() != World.OVERWORLD) return true; +@@ -379,6 +379,20 @@ public class CraftEventFactory { + } + + private static PlayerEvent getPlayerBucketEvent(boolean isFilling, WorldServer world, EntityHuman who, BlockPosition changed, BlockPosition clicked, EnumDirection clickedFace, ItemStack itemstack, net.minecraft.server.Item item) { + // Paper start - add enumHand + return getPlayerBucketEvent(isFilling, world, who, changed, clicked, clickedFace, itemstack, item, null); + } @@ -93,7 +150,7 @@ index dccc187c6198ce2e8824b8460347586ccf5c6741..2e859c32b5a7d314e38221da75d785ff Player player = (Player) who.getBukkitEntity(); CraftItemStack itemInHand = CraftItemStack.asNewCraftStack(item); Material bucket = CraftMagicNumbers.getMaterial(itemstack.getItem()); -@@ -393,10 +407,10 @@ public class CraftEventFactory { +@@ -391,10 +405,10 @@ public class CraftEventFactory { PlayerEvent event; if (isFilling) { diff --git a/Spigot-Server-Patches/0267-MC-135506-Experience-should-save-as-Integers.patch b/Spigot-Server-Patches/0266-MC-135506-Experience-should-save-as-Integers.patch similarity index 76% rename from Spigot-Server-Patches/0267-MC-135506-Experience-should-save-as-Integers.patch rename to Spigot-Server-Patches/0266-MC-135506-Experience-should-save-as-Integers.patch index 7d74291ab1..d04dfa6a4b 100644 --- a/Spigot-Server-Patches/0267-MC-135506-Experience-should-save-as-Integers.patch +++ b/Spigot-Server-Patches/0266-MC-135506-Experience-should-save-as-Integers.patch @@ -5,11 +5,11 @@ Subject: [PATCH] MC-135506: Experience should save as Integers diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 87c6b77ce3b1446893a0d617b63f925a403e09cc..53c6c3389216c1fc5c0789b4a1621acb239cc9ec 100644 +index 7f2d8de12473c5413bbfc10ea0947d6a30802645..2396b4d6ffda648c24fc39cef22792c7d9247456 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -@@ -207,7 +207,7 @@ public class EntityExperienceOrb extends Entity { - public void b(NBTTagCompound nbttagcompound) { +@@ -202,7 +202,7 @@ public class EntityExperienceOrb extends Entity { + public void saveData(NBTTagCompound nbttagcompound) { nbttagcompound.setShort("Health", (short) this.e); nbttagcompound.setShort("Age", (short) this.c); - nbttagcompound.setShort("Value", (short) this.value); @@ -17,8 +17,8 @@ index 87c6b77ce3b1446893a0d617b63f925a403e09cc..53c6c3389216c1fc5c0789b4a1621acb this.savePaperNBT(nbttagcompound); // Paper } -@@ -215,7 +215,7 @@ public class EntityExperienceOrb extends Entity { - public void a(NBTTagCompound nbttagcompound) { +@@ -210,7 +210,7 @@ public class EntityExperienceOrb extends Entity { + public void loadData(NBTTagCompound nbttagcompound) { this.e = nbttagcompound.getShort("Health"); this.c = nbttagcompound.getShort("Age"); - this.value = nbttagcompound.getShort("Value"); diff --git a/Spigot-Server-Patches/0268-Fix-client-rendering-skulls-from-same-user.patch b/Spigot-Server-Patches/0267-Fix-client-rendering-skulls-from-same-user.patch similarity index 86% rename from Spigot-Server-Patches/0268-Fix-client-rendering-skulls-from-same-user.patch rename to Spigot-Server-Patches/0267-Fix-client-rendering-skulls-from-same-user.patch index 6d75986eeb..0cb0f59b6e 100644 --- a/Spigot-Server-Patches/0268-Fix-client-rendering-skulls-from-same-user.patch +++ b/Spigot-Server-Patches/0267-Fix-client-rendering-skulls-from-same-user.patch @@ -12,24 +12,24 @@ This allows the client to render multiple skull textures from the same user, for when different skins were used when skull was made. diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 641a52b968ef04a142b32703b61c8b75643b36a6..0b0c3c681c07cf8506df1b91b1feaf130891a440 100644 +index 7b2010ec4955fb5788c60178c6e306ea3098e9ba..95e801a9a7ca405ff7e80c920fa78493d0ef5374 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -54,7 +54,7 @@ public final class ItemStack { - // Paper end +@@ -60,7 +60,7 @@ public final class ItemStack { + private int g; @Deprecated private Item item; - private NBTTagCompound tag; + NBTTagCompound tag; // Paper -> package private - private boolean h; - private EntityItemFrame i; - private ShapeDetectorBlock j; + private boolean j; + private Entity k; + private ShapeDetectorBlock l; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index d9574a9ace96d8c5666e62a5aed96a67021b91d8..e810da87977b441cc329066e3cb158ef3bc62a66 100644 +index 6e049c2e2a142ce022b9dc278a3bb302f723e42c..e3ba2e8db98c94ed10e96601addb0110a8385926 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java -@@ -250,9 +250,18 @@ public class PacketDataSerializer extends ByteBuf { - if (item.usesDurability() || item.o()) { +@@ -274,9 +274,18 @@ public class PacketDataSerializer extends ByteBuf { + if (item.usesDurability() || item.n()) { // Spigot start - filter itemstack = itemstack.cloneItemStack(); - CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); @@ -48,7 +48,7 @@ index d9574a9ace96d8c5666e62a5aed96a67021b91d8..e810da87977b441cc329066e3cb158ef } this.a(nbttagcompound); -@@ -272,7 +281,17 @@ public class PacketDataSerializer extends ByteBuf { +@@ -296,7 +305,17 @@ public class PacketDataSerializer extends ByteBuf { itemstack.setTag(this.l()); // CraftBukkit start if (itemstack.getTag() != null) { @@ -68,10 +68,10 @@ index d9574a9ace96d8c5666e62a5aed96a67021b91d8..e810da87977b441cc329066e3cb158ef // CraftBukkit end return itemstack; diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 3a1d0deb0dec880d73185690e2a7c769a2731479..1fcbbd698a7e1b9ae3e8b5fa0328b85c43019bea 100644 +index e336437207f9d6adbab69ef2785c129ff2ec1b36..72ff0a1e6428a1776f49c26e1715f5f2428ba242 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -@@ -58,6 +58,7 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -60,6 +60,7 @@ public class PacketPlayOutMapChunk implements Packet { if (this.f() || (i & 1 << j) != 0) { NBTTagCompound nbttagcompound = tileentity.b(); @@ -80,10 +80,10 @@ index 3a1d0deb0dec880d73185690e2a7c769a2731479..1fcbbd698a7e1b9ae3e8b5fa0328b85c this.g.add(nbttagcompound); } diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index 83faa9dc5f74df4609cab34a66e4feed12990463..93030a7b24d53953b3672a23816dfc02d3c74caf 100644 +index 9a2efd38f28819355a271b9515ac98c3382c7383..fb7aa15c272678be7ec2a1d28891a62121695ed8 100644 --- a/src/main/java/net/minecraft/server/TileEntitySkull.java +++ b/src/main/java/net/minecraft/server/TileEntitySkull.java -@@ -142,9 +142,37 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa +@@ -145,9 +145,37 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa @Nullable @Override public PacketPlayOutTileEntityData getUpdatePacket() { diff --git a/Spigot-Server-Patches/0269-Add-Early-Warning-Feature-to-WatchDog.patch b/Spigot-Server-Patches/0268-Add-Early-Warning-Feature-to-WatchDog.patch similarity index 96% rename from Spigot-Server-Patches/0269-Add-Early-Warning-Feature-to-WatchDog.patch rename to Spigot-Server-Patches/0268-Add-Early-Warning-Feature-to-WatchDog.patch index 8f436a04a9..09a508e230 100644 --- a/Spigot-Server-Patches/0269-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/Spigot-Server-Patches/0268-Add-Early-Warning-Feature-to-WatchDog.patch @@ -36,10 +36,10 @@ index adef07d4d521b4aaa6f3389b04aa27e29bec0229..214b577b326bc794fa3721deb6171228 public static int tabSpamLimit = 500; private static void tabSpamLimiters() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e7ee0e9b9b68f1fe31e189fbfd7e5b175a288a50..3b89f62ab0522d23f47fd59c2f06fa7d0eacb7af 100644 +index f5fa425308e4253d961f8f2bac5b961616dd8521..6a42e480940c4081622050c07961a2c56cfaa542 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -873,6 +873,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> { +@@ -12,6 +12,8 @@ import java.io.BufferedReader; + import java.io.BufferedWriter; + import java.io.File; + import java.io.IOException; ++import java.lang.reflect.ParameterizedType; // Paper ++import java.lang.reflect.Type; // Paper + import java.nio.charset.StandardCharsets; + import java.util.Collection; + import java.util.Iterator; +@@ -26,7 +28,22 @@ public abstract class JsonList> { protected static final Logger LOGGER = LogManager.getLogger(); - protected final Gson b; + private static final Gson b = (new GsonBuilder()).setPrettyPrinting().create(); private final File c; - private final Map d = Maps.newHashMap(); + // Paper - replace HashMap is ConcurrentHashMap + private final Map d = Maps.newConcurrentMap(); private final Map getBackingMap() { return this.d; } // Paper - OBFHELPER - private boolean e = true; - private static final ParameterizedType f = new ParameterizedType() { - public Type[] getActualTypeArguments() { -@@ -84,8 +85,13 @@ public class JsonList> { ++ private boolean e = true; ++ private static final ParameterizedType f = new ParameterizedType() { ++ public Type[] getActualTypeArguments() { ++ return new Type[]{JsonListEntry.class}; ++ } ++ ++ public Type getRawType() { ++ return List.class; ++ } ++ ++ public Type getOwnerType() { ++ return null; ++ } ++ }; + + public JsonList(File file) { + this.c = file; +@@ -49,8 +66,13 @@ public abstract class JsonList> { @Nullable public V get(K k0) { -- this.h(); +- this.g(); - return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error + // Paper start -+ // this.h(); ++ // this.g(); + // return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error + return (V) this.getBackingMap().computeIfPresent(this.getMappingKey(k0), (k, v) -> { + return v.hasExpired() ? null : v; @@ -54,7 +77,7 @@ index 734e7ecf630aa13a30d72ff96e57e5d0faf35013..8570e38f42e2f489e2899ac2f0c4a7b8 } public void remove(K k0) { -@@ -114,9 +120,11 @@ public class JsonList> { +@@ -79,9 +101,11 @@ public abstract class JsonList> { // CraftBukkit end public boolean isEmpty() { @@ -67,18 +90,18 @@ index 734e7ecf630aa13a30d72ff96e57e5d0faf35013..8570e38f42e2f489e2899ac2f0c4a7b8 protected String a(K k0) { return k0.toString(); } -@@ -125,8 +133,9 @@ public class JsonList> { +@@ -90,8 +114,9 @@ public abstract class JsonList> { return this.d.containsKey(this.a(k0)); } -+ private void removeStaleEntries() { h(); } // Paper - OBFHELPER - private void h() { ++ private void removeStaleEntries() { g(); } // Paper - OBFHELPER + private void g() { - List list = Lists.newArrayList(); + /*List list = Lists.newArrayList(); Iterator iterator = this.d.values().iterator(); while (iterator.hasNext()) { -@@ -143,8 +152,10 @@ public class JsonList> { +@@ -108,8 +133,10 @@ public abstract class JsonList> { K k0 = (K) iterator.next(); // CraftBukkit - decompile error this.d.remove(this.a(k0)); @@ -89,22 +112,22 @@ index 734e7ecf630aa13a30d72ff96e57e5d0faf35013..8570e38f42e2f489e2899ac2f0c4a7b8 + // Paper end } - protected JsonListEntry a(JsonObject jsonobject) { -@@ -156,6 +167,7 @@ public class JsonList> { + protected abstract JsonListEntry a(JsonObject jsonobject); +@@ -119,6 +146,7 @@ public abstract class JsonList> { } public void save() throws IOException { + this.removeStaleEntries(); // Paper - remove expired values before saving - Collection collection = this.d.values(); - String s = this.b.toJson(collection); - BufferedWriter bufferedwriter = null; + JsonArray jsonarray = new JsonArray(); + + this.d.values().stream().map((jsonlistentry) -> { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 950afb131bbea53e46393fa19b0bfbb9d5c647f5..939cec9121c051c5459084e4078740a7607803f3 100644 +index ef1ea58c252d063ce282d244236a510655538a11..8c1d836538c678feca56076753e8781eadcd6d1d 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -512,7 +512,7 @@ public abstract class PlayerList { - } else if (!this.isWhitelisted(gameprofile, event)) { // Paper - chatmessage = new ChatMessage("multiplayer.disconnect.not_whitelisted", new Object[0]); +@@ -542,7 +542,7 @@ public abstract class PlayerList { + } else if (!this.isWhitelisted(gameprofile)) { + chatmessage = new ChatMessage("multiplayer.disconnect.not_whitelisted"); //event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot // Paper - moved to isWhitelisted - } else if (getIPBans().isBanned(socketaddress) && !getIPBans().get(socketaddress).hasExpired()) { + } else if (getIPBans().isBanned(socketaddress) && getIPBans().get(socketaddress) != null && !getIPBans().get(socketaddress).hasExpired()) { // Paper - fix NPE with temp ip bans diff --git a/Spigot-Server-Patches/0272-Use-a-Queue-for-Queueing-Commands.patch b/Spigot-Server-Patches/0271-Use-a-Queue-for-Queueing-Commands.patch similarity index 80% rename from Spigot-Server-Patches/0272-Use-a-Queue-for-Queueing-Commands.patch rename to Spigot-Server-Patches/0271-Use-a-Queue-for-Queueing-Commands.patch index bd5a8bbf6f..2eddd0e535 100644 --- a/Spigot-Server-Patches/0272-Use-a-Queue-for-Queueing-Commands.patch +++ b/Spigot-Server-Patches/0271-Use-a-Queue-for-Queueing-Commands.patch @@ -6,19 +6,19 @@ 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 ec257ba31f012d3d3576bbff41326df13ede6776..349a0ea213f7f45e927d439985e121e8fa66c041 100644 +index f6544e4fb0eacce7f3579998e8ec0743b7f46c65..715063432bb3a18421f7ac00723f6695f8a56a8c 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -44,7 +44,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -38,7 +38,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer private static final Logger LOGGER = LogManager.getLogger(); - private static final Pattern i = Pattern.compile("^[a-fA-F0-9]{40}$"); + private static final Pattern k = Pattern.compile("^[a-fA-F0-9]{40}$"); - 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 final java.util.Queue serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue<>(); // Paper - use a proper queue private RemoteStatusListener remoteStatusListener; public final RemoteControlCommandListener remoteControlCommandListener; private RemoteControlListener remoteControlListener; -@@ -454,8 +454,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -395,8 +395,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer public void handleCommandQueue() { MinecraftTimings.serverCommandTimer.startTiming(); // Spigot diff --git a/Spigot-Server-Patches/0273-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/Spigot-Server-Patches/0272-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch similarity index 85% rename from Spigot-Server-Patches/0273-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch rename to Spigot-Server-Patches/0272-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index d5aa53b9a3..0d6ca14a7c 100644 --- a/Spigot-Server-Patches/0273-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/Spigot-Server-Patches/0272-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index a843c66dfa032d041e6df498746a66bd2cb4506e..a53bb7295c5d510f2976ff3787d68857548e11cc 100644 +index e34ecdeb21f262046fe5d4cf9f1d6ecd57d72ba9..2bd7d7959ce2845dbc09e198122e3574593dca58 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -126,9 +126,16 @@ public class CraftChunk implements Chunk { +@@ -128,9 +128,16 @@ public class CraftChunk implements Chunk { @Override public BlockState[] getTileEntities() { @@ -25,7 +25,7 @@ index a843c66dfa032d041e6df498746a66bd2cb4506e..a53bb7295c5d510f2976ff3787d68857 int index = 0; net.minecraft.server.Chunk chunk = getHandle(); -@@ -140,7 +147,7 @@ public class CraftChunk implements Chunk { +@@ -142,7 +149,7 @@ public class CraftChunk implements Chunk { } BlockPosition position = (BlockPosition) obj; diff --git a/Spigot-Server-Patches/0274-Allow-disabling-armour-stand-ticking.patch b/Spigot-Server-Patches/0273-Allow-disabling-armour-stand-ticking.patch similarity index 53% rename from Spigot-Server-Patches/0274-Allow-disabling-armour-stand-ticking.patch rename to Spigot-Server-Patches/0273-Allow-disabling-armour-stand-ticking.patch index 0ef295a7b3..b792c77dbf 100644 --- a/Spigot-Server-Patches/0274-Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-Server-Patches/0273-Allow-disabling-armour-stand-ticking.patch @@ -20,7 +20,7 @@ index eaaa51e4bf761f41fd516402ce1ad0f903c6ab71..bc3df01aab3e79be9c2836820e0eacc6 + } } diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 61d7d507aaac3e7e5a885387ae89c67dfb1c9844..42b9a339e9c35db596ec78881c32c801c2d739f4 100644 +index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afdbd76b709 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -44,6 +44,12 @@ public class EntityArmorStand extends EntityLiving { @@ -37,11 +37,11 @@ index 61d7d507aaac3e7e5a885387ae89c67dfb1c9844..42b9a339e9c35db596ec78881c32c801 public EntityArmorStand(EntityTypes entitytypes, World world) { super(entitytypes, world); @@ -55,6 +61,7 @@ public class EntityArmorStand extends EntityLiving { - this.rightArmPose = EntityArmorStand.bu; - this.leftLegPose = EntityArmorStand.bv; - this.rightLegPose = EntityArmorStand.bw; + this.rightArmPose = EntityArmorStand.bt; + this.leftLegPose = EntityArmorStand.bu; + this.rightLegPose = EntityArmorStand.bv; + if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking - this.H = 0.0F; + this.G = 0.0F; } @@ -135,6 +142,7 @@ public class EntityArmorStand extends EntityLiving { @@ -136,125 +136,11 @@ index 61d7d507aaac3e7e5a885387ae89c67dfb1c9844..42b9a339e9c35db596ec78881c32c801 public void setRightLegPose(Vector3f vector3f) { this.rightLegPose = vector3f; - this.datawatcher.set(EntityArmorStand.bp, vector3f); + this.datawatcher.set(EntityArmorStand.bo, vector3f); + this.noTickPoseDirty = true; // Paper - Allow updates when not ticking } public Vector3f r() { -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index d604728db71d4e61a11fb1ccb7f02b6f6b914a51..0c3a776e207d84943fd90482a650d0c74b5ca65d 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2329,52 +2329,7 @@ public abstract class EntityLiving extends Entity { - } - } - -- EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); -- int k = aenumitemslot.length; -- -- for (int l = 0; l < k; ++l) { -- EnumItemSlot enumitemslot = aenumitemslot[l]; -- ItemStack itemstack; -- -- switch (enumitemslot.a()) { -- case HAND: -- itemstack = (ItemStack) this.bu.get(enumitemslot.b()); -- break; -- case ARMOR: -- itemstack = (ItemStack) this.bv.get(enumitemslot.b()); -- break; -- default: -- continue; -- } -- -- ItemStack itemstack1 = this.getEquipment(enumitemslot); -- -- if (!ItemStack.matches(itemstack1, itemstack)) { -- // Paper start - PlayerArmorChangeEvent -- if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR) { -- final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack); -- final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1); -- new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); -- } -- // Paper end -- ((WorldServer) this.world).getChunkProvider().broadcast(this, new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1)); -- if (!itemstack.isEmpty()) { -- this.getAttributeMap().a(itemstack.a(enumitemslot)); -- } -- -- if (!itemstack1.isEmpty()) { -- this.getAttributeMap().b(itemstack1.a(enumitemslot)); -- } -- -- switch (enumitemslot.a()) { -- case HAND: -- this.bu.set(enumitemslot.b(), itemstack1.cloneItemStack()); -- break; -- case ARMOR: -- this.bv.set(enumitemslot.b(), itemstack1.cloneItemStack()); -- } -- } -- } -+ updateEntityEquipment(); // Paper - split into own method - - if (this.ticksLived % 20 == 0) { - this.getCombatTracker().g(); -@@ -2475,6 +2430,55 @@ public abstract class EntityLiving extends Entity { - } - } - -+ // Paper start - split into own method from above -+ public void updateEntityEquipment() { -+ EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); -+ int k = aenumitemslot.length; -+ for (int l = 0; l < k; ++l) { -+ EnumItemSlot enumitemslot = aenumitemslot[l]; -+ ItemStack itemstack; -+ -+ switch (enumitemslot.a()) { -+ case HAND: -+ itemstack = (ItemStack) this.bu.get(enumitemslot.b()); -+ break; -+ case ARMOR: -+ itemstack = (ItemStack) this.bv.get(enumitemslot.b()); -+ break; -+ default: -+ continue; -+ } -+ -+ ItemStack itemstack1 = this.getEquipment(enumitemslot); -+ -+ if (!ItemStack.matches(itemstack1, itemstack)) { -+ // Paper start - PlayerArmorChangeEvent -+ if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR) { -+ final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack); -+ final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1); -+ new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); -+ } -+ // Paper end -+ ((WorldServer) this.world).getChunkProvider().broadcast(this, new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1)); -+ if (!itemstack.isEmpty()) { -+ this.getAttributeMap().a(itemstack.a(enumitemslot)); -+ } -+ -+ if (!itemstack1.isEmpty()) { -+ this.getAttributeMap().b(itemstack1.a(enumitemslot)); -+ } -+ -+ switch (enumitemslot.a()) { -+ case HAND: -+ this.bu.set(enumitemslot.b(), itemstack1.cloneItemStack()); -+ break; -+ case ARMOR: -+ this.bv.set(enumitemslot.b(), itemstack1.cloneItemStack()); -+ } -+ } -+ } -+ } -+ - protected float f(float f, float f1) { - float f2 = MathHelper.g(f - this.aI); - diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java index d1d689e5d78c569313c4059c4652724605dc07d2..ac105270d5c7e2070f52782fc7dbdcd381db33a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java diff --git a/Spigot-Server-Patches/0275-Optimize-BlockPosition-helper-methods.patch b/Spigot-Server-Patches/0274-Optimize-BlockPosition-helper-methods.patch similarity index 95% rename from Spigot-Server-Patches/0275-Optimize-BlockPosition-helper-methods.patch rename to Spigot-Server-Patches/0274-Optimize-BlockPosition-helper-methods.patch index f54af3c8cc..03a4bea330 100644 --- a/Spigot-Server-Patches/0275-Optimize-BlockPosition-helper-methods.patch +++ b/Spigot-Server-Patches/0274-Optimize-BlockPosition-helper-methods.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize BlockPosition helper methods Resolves #1338 diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index ec0e8f970dba64561afd6477a5df2821d9a8889a..a3a376e35eaf17b128048bd26a22eef713e7d535 100644 +index b25b84d017ee610d8f006536fdfa63e840474a9b..37570a3bbb9a36133d012350eca1685cca68c73b 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -135,57 +135,74 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali +@@ -113,57 +113,74 @@ public class BlockPosition extends BaseBlockPosition { } public BlockPosition up() { diff --git a/Spigot-Server-Patches/0277-Restore-vanlla-default-mob-spawn-range.patch b/Spigot-Server-Patches/0275-Restore-vanlla-default-mob-spawn-range.patch similarity index 88% rename from Spigot-Server-Patches/0277-Restore-vanlla-default-mob-spawn-range.patch rename to Spigot-Server-Patches/0275-Restore-vanlla-default-mob-spawn-range.patch index 85bd7774f6..85e9776191 100644 --- a/Spigot-Server-Patches/0277-Restore-vanlla-default-mob-spawn-range.patch +++ b/Spigot-Server-Patches/0275-Restore-vanlla-default-mob-spawn-range.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Restore vanlla default mob-spawn-range diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 98ed975a6241395b6119d5b3a62d24329aa1f05b..37ef07338e0e7ebb778b4446c8e7a630f597c7be 100644 +index 5c394d26e2d2dbc5d65e38c1273b7e5d02464f3a..f0ad5fa235adfd165b8e56be7352568a3b3ae54a 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -165,7 +165,7 @@ public class SpigotWorldConfig diff --git a/Spigot-Server-Patches/0279-Fix-MC-124320.patch b/Spigot-Server-Patches/0276-Fix-MC-124320.patch similarity index 80% rename from Spigot-Server-Patches/0279-Fix-MC-124320.patch rename to Spigot-Server-Patches/0276-Fix-MC-124320.patch index 58b2720629..7e383aa390 100644 --- a/Spigot-Server-Patches/0279-Fix-MC-124320.patch +++ b/Spigot-Server-Patches/0276-Fix-MC-124320.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Fix MC-124320 diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 5f261b9b92de4ca8638f41fa2947016cf590cf05..b9b750c3695699520c736d57cbd88c8d52254c7a 100644 +index 247d9300a755aa22c2ca3bcef86b3b25f3ed75ee..bbd2e1be0f401d7e267dcfa2c905f42c2a475dd7 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -170,6 +170,7 @@ public class Block implements IMaterial { - return tag.isTagged(this); +@@ -93,6 +93,7 @@ public class Block extends BlockBase implements IMaterial { + return this == block; } + public static IBlockData getValidBlockForPosition(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { return Block.b(iblockdata, generatoraccess, blockposition); } // Paper - OBFHELPER @@ -17,11 +17,11 @@ index 5f261b9b92de4ca8638f41fa2947016cf590cf05..b9b750c3695699520c736d57cbd88c8d IBlockData iblockdata1 = iblockdata; BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index b7c67f0cdb3d02c7a2dbe85f9a432836cb34bb6e..d86f76f30be54767d0243df716fe743e24db6726 100644 +index 7c13e5b711706c8aaa363d80350597a52920f12b..8da3b10cd6db379cf5d9d667154dd8911813284b 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -354,8 +354,9 @@ public class EntityEnderman extends EntityMonster { - if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) { +@@ -391,8 +391,9 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + if (block.a((Tag) TagsBlock.ENDERMAN_HOLDABLE) && flag) { // CraftBukkit start - Pickup event if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { - this.enderman.setCarried(iblockdata); @@ -31,7 +31,7 @@ index b7c67f0cdb3d02c7a2dbe85f9a432836cb34bb6e..d86f76f30be54767d0243df716fe743e } // CraftBukkit end } -@@ -365,6 +366,7 @@ public class EntityEnderman extends EntityMonster { +@@ -402,6 +403,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { static class PathfinderGoalEndermanPlaceBlock extends PathfinderGoal { @@ -39,7 +39,7 @@ index b7c67f0cdb3d02c7a2dbe85f9a432836cb34bb6e..d86f76f30be54767d0243df716fe743e private final EntityEnderman a; public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) { -@@ -387,7 +389,7 @@ public class EntityEnderman extends EntityMonster { +@@ -424,7 +426,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { IBlockData iblockdata = world.getType(blockposition); BlockPosition blockposition1 = blockposition.down(); IBlockData iblockdata1 = world.getType(blockposition1); diff --git a/Spigot-Server-Patches/0280-Slime-Pathfinder-Events.patch b/Spigot-Server-Patches/0277-Slime-Pathfinder-Events.patch similarity index 84% rename from Spigot-Server-Patches/0280-Slime-Pathfinder-Events.patch rename to Spigot-Server-Patches/0277-Slime-Pathfinder-Events.patch index dac983bd17..ba88f01bb1 100644 --- a/Spigot-Server-Patches/0280-Slime-Pathfinder-Events.patch +++ b/Spigot-Server-Patches/0277-Slime-Pathfinder-Events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Slime Pathfinder Events diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index 3ecf732192f7f1bd20b9d766bedef08e64434fda..2efc18df945bcaa6eba59f561733b9fd6b217d6d 100644 +index 9c83389c56083d9febf604bf30da47c89330902e..a4642cc7390b08580d00689a853d59e3e1ef6496 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -3,6 +3,14 @@ package net.minecraft.server; @@ -23,18 +23,18 @@ index 3ecf732192f7f1bd20b9d766bedef08e64434fda..2efc18df945bcaa6eba59f561733b9fd // CraftBukkit start import java.util.ArrayList; import java.util.List; -@@ -71,6 +79,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { - super.b(nbttagcompound); +@@ -65,6 +73,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + super.saveData(nbttagcompound); nbttagcompound.setInt("Size", this.getSize() - 1); - nbttagcompound.setBoolean("wasOnGround", this.bx); + nbttagcompound.setBoolean("wasOnGround", this.bw); + nbttagcompound.setBoolean("Paper.canWander", this.canWander); // Paper } @Override -@@ -84,6 +93,11 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -78,6 +87,11 @@ public class EntitySlime extends EntityInsentient implements IMonster { this.setSize(i + 1, false); - super.a(nbttagcompound); - this.bx = nbttagcompound.getBoolean("wasOnGround"); + super.loadData(nbttagcompound); + this.bw = nbttagcompound.getBoolean("wasOnGround"); + // Paper start - check exists before loading or this will be loaded as false + if (nbttagcompound.hasKey("Paper.canWander")) { + this.canWander = nbttagcompound.getBoolean("Paper.canWander"); @@ -42,8 +42,8 @@ index 3ecf732192f7f1bd20b9d766bedef08e64434fda..2efc18df945bcaa6eba59f561733b9fd + // Paper end } - public boolean ev() { -@@ -357,7 +371,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + public boolean eR() { +@@ -358,7 +372,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { @Override public boolean a() { @@ -52,21 +52,21 @@ index 3ecf732192f7f1bd20b9d766bedef08e64434fda..2efc18df945bcaa6eba59f561733b9fd } @Override -@@ -378,7 +392,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -379,7 +393,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { @Override public boolean a() { -- return (this.a.isInWater() || this.a.aH()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; -+ return (this.a.isInWater() || this.a.aH()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander && new SlimeSwimEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper +- return (this.a.isInWater() || this.a.aN()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; ++ return (this.a.isInWater() || this.a.aN()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander && new SlimeSwimEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper } @Override -@@ -404,14 +418,18 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -405,14 +419,18 @@ public class EntitySlime extends EntityInsentient implements IMonster { @Override public boolean a() { -- return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aH() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; -+ return this.a.canWander && this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aH() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; +- return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aN() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; ++ return this.a.canWander && this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aN() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; } @Override @@ -82,7 +82,7 @@ index 3ecf732192f7f1bd20b9d766bedef08e64434fda..2efc18df945bcaa6eba59f561733b9fd } ((EntitySlime.ControllerMoveSlime) this.a.getControllerMove()).a(this.b, false); -@@ -432,7 +450,15 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -433,7 +451,15 @@ public class EntitySlime extends EntityInsentient implements IMonster { public boolean a() { EntityLiving entityliving = this.a.getGoalTarget(); @@ -99,7 +99,7 @@ index 3ecf732192f7f1bd20b9d766bedef08e64434fda..2efc18df945bcaa6eba59f561733b9fd } @Override -@@ -445,7 +471,15 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -446,7 +472,15 @@ public class EntitySlime extends EntityInsentient implements IMonster { public boolean b() { EntityLiving entityliving = this.a.getGoalTarget(); @@ -116,9 +116,9 @@ index 3ecf732192f7f1bd20b9d766bedef08e64434fda..2efc18df945bcaa6eba59f561733b9fd } @Override -@@ -453,6 +487,13 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -454,6 +488,13 @@ public class EntitySlime extends EntityInsentient implements IMonster { this.a.a((Entity) this.a.getGoalTarget(), 10.0F, 10.0F); - ((EntitySlime.ControllerMoveSlime) this.a.getControllerMove()).a(this.a.yaw, this.a.eq()); + ((EntitySlime.ControllerMoveSlime) this.a.getControllerMove()).a(this.a.yaw, this.a.eM()); } + + // Paper start - clear timer and target when goal resets @@ -130,7 +130,7 @@ index 3ecf732192f7f1bd20b9d766bedef08e64434fda..2efc18df945bcaa6eba59f561733b9fd } static class ControllerMoveSlime extends ControllerMove { -@@ -511,4 +552,15 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -512,4 +553,15 @@ public class EntitySlime extends EntityInsentient implements IMonster { } } } diff --git a/Spigot-Server-Patches/0281-Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/0278-Configurable-speed-for-water-flowing-over-lava.patch similarity index 89% rename from Spigot-Server-Patches/0281-Configurable-speed-for-water-flowing-over-lava.patch rename to Spigot-Server-Patches/0278-Configurable-speed-for-water-flowing-over-lava.patch index 78b5705a11..32045df15b 100644 --- a/Spigot-Server-Patches/0281-Configurable-speed-for-water-flowing-over-lava.patch +++ b/Spigot-Server-Patches/0278-Configurable-speed-for-water-flowing-over-lava.patch @@ -20,14 +20,14 @@ index bc3df01aab3e79be9c2836820e0eacc69ea6c1f4..487b0d5cd608e84a793eba5fdbd50a9f + } } diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java -index f56e14e1e2fd974e409a324572c2d17e1533da41..6d351f0979ecfa8e500edf8dd03b4a455fd5d180 100644 +index f00b403e1e12acbb8eb6ad55da219b257219a8f4..a28ac8b00b22a8c7afc2b64f9720a4e32b653e5f 100644 --- a/src/main/java/net/minecraft/server/BlockFluids.java +++ b/src/main/java/net/minecraft/server/BlockFluids.java -@@ -70,11 +70,28 @@ public class BlockFluids extends Block implements IFluidSource { +@@ -76,11 +76,28 @@ public class BlockFluids extends Block implements IFluidSource { @Override public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { if (this.a(world, blockposition, iblockdata)) { -- world.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.a((IWorldReader) world)); +- world.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.b.a((IWorldReader) world)); + world.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.getFlowSpeed(world, blockposition)); // Paper } @@ -45,7 +45,7 @@ index f56e14e1e2fd974e409a324572c2d17e1533da41..6d351f0979ecfa8e500edf8dd03b4a45 + return world.paperConfig.waterOverLavaFlowSpeed; + } + } -+ return this.a(world); ++ return this.b.a(world); + } + // Paper end + @@ -53,11 +53,11 @@ index f56e14e1e2fd974e409a324572c2d17e1533da41..6d351f0979ecfa8e500edf8dd03b4a45 @Override public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { if (iblockdata.getFluid().isSource() || iblockdata1.getFluid().isSource()) { -@@ -87,7 +104,7 @@ public class BlockFluids extends Block implements IFluidSource { +@@ -93,7 +110,7 @@ public class BlockFluids extends Block implements IFluidSource { @Override public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) { if (this.a(world, blockposition, iblockdata)) { -- world.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.a((IWorldReader) world)); +- world.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.b.a((IWorldReader) world)); + world.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.getFlowSpeed(world, blockposition)); // Paper } diff --git a/Spigot-Server-Patches/0278-Optimize-CraftBlockData-Creation.patch b/Spigot-Server-Patches/0278-Optimize-CraftBlockData-Creation.patch deleted file mode 100644 index 7bda590b2c..0000000000 --- a/Spigot-Server-Patches/0278-Optimize-CraftBlockData-Creation.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: miclebrick -Date: Thu, 23 Aug 2018 11:45:32 -0400 -Subject: [PATCH] Optimize CraftBlockData Creation - -Avoids a hashmap lookup by cacheing a reference to the CraftBlockData -and cloning it when one is needed. - -diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index c5fddef030489bff0de9e0efb4f11c83bcfee628..cca2bf1045c1305a9defa5241909b50711b85d4c 100644 ---- a/src/main/java/net/minecraft/server/IBlockData.java -+++ b/src/main/java/net/minecraft/server/IBlockData.java -@@ -4,6 +4,8 @@ import com.google.common.collect.ImmutableMap; - import com.mojang.datafixers.Dynamic; - import com.mojang.datafixers.types.DynamicOps; - import com.mojang.datafixers.util.Pair; -+import org.bukkit.craftbukkit.block.data.CraftBlockData; -+ - import java.util.Arrays; - import java.util.Iterator; - import java.util.List; -@@ -38,6 +40,15 @@ public class IBlockData extends BlockDataAbstract implements - return (Block) this.a; - } - -+ // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time -+ private CraftBlockData cachedCraftBlockData; -+ -+ public CraftBlockData createCraftBlockData() { -+ if(cachedCraftBlockData == null) cachedCraftBlockData = CraftBlockData.createData(this); -+ return (CraftBlockData) cachedCraftBlockData.clone(); -+ } -+ // Paper end -+ - public Material getMaterial() { - return this.getBlock().k(this); - } -diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 683b17a0c9f09d90c2fc30aad6516b4d01d2f34f..a0746a1694a01996eab44a91b078ba14996f3d13 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -549,7 +549,17 @@ public class CraftBlockData implements BlockData { - return craft; - } - -+ // Paper start - optimize creating BlockData to not need a map lookup -+ static { -+ // Initialize cached data for all IBlockData instances after registration -+ Block.REGISTRY_ID.iterator().forEachRemaining(IBlockData::createCraftBlockData); -+ } - public static CraftBlockData fromData(IBlockData data) { -+ return data.createCraftBlockData(); -+ } -+ -+ public static CraftBlockData createData(IBlockData data) { -+ // Paper end - return MAP.getOrDefault(data.getBlock().getClass(), CraftBlockData::new).apply(data); - } - } diff --git a/Spigot-Server-Patches/0282-Optimize-RegistryMaterials.patch b/Spigot-Server-Patches/0279-Optimize-RegistryMaterials.patch similarity index 53% rename from Spigot-Server-Patches/0282-Optimize-RegistryMaterials.patch rename to Spigot-Server-Patches/0279-Optimize-RegistryMaterials.patch index 78841bbe8b..4b245994fa 100644 --- a/Spigot-Server-Patches/0282-Optimize-RegistryMaterials.patch +++ b/Spigot-Server-Patches/0279-Optimize-RegistryMaterials.patch @@ -8,25 +8,37 @@ Use larger initial sizes to increase bucket capacity on the BiMap BiMap.get was seen to be using a good bit of CPU time. diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java -index 2d6a7b3a47895a32903eaf132eb44820c2623c4c..8477febca23b575da21023b4d7c18bb679cf3b30 100644 +index c60140a283df47edf23fe4f54a2c1d2fca7593f8..7189204ee57343b3381e8c83eb5a5281a0e0962f 100644 --- a/src/main/java/net/minecraft/server/RegistryMaterials.java +++ b/src/main/java/net/minecraft/server/RegistryMaterials.java -@@ -16,8 +16,8 @@ import org.apache.logging.log4j.Logger; +@@ -25,9 +25,9 @@ import org.apache.logging.log4j.Logger; public class RegistryMaterials extends IRegistryWritable { protected static final Logger LOGGER = LogManager.getLogger(); - protected final RegistryID b = new RegistryID<>(256); - protected final BiMap c = HashBiMap.create(); +- private final BiMap, T> bb = HashBiMap.create(); + protected final RegistryID b = new RegistryID<>(2048); // Paper - use bigger expected size to reduce collisions + protected final BiMap c = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions ++ private final BiMap, T> bb = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions + private final Set> bc = Sets.newIdentityHashSet(); protected Object[] d; - private int V; - -@@ -101,6 +101,6 @@ public class RegistryMaterials extends IRegistryWritable { + private int bd; +@@ -124,7 +124,7 @@ public class RegistryMaterials extends IRegistryWritable { this.d = collection.toArray(new Object[collection.size()]); } -- return this.d[random.nextInt(this.d.length)]; -+ return (T) this.d[random.nextInt(this.d.length)]; // Paper - Decompile fix +- return SystemUtils.a(this.d, random); ++ return (T) SystemUtils.a(this.d, random); // Paper - Decompile fix } - } + + @Override +@@ -164,7 +164,7 @@ public class RegistryMaterials extends IRegistryWritable { + Iterator iterator = registrymaterials.b.iterator(); + + while (iterator.hasNext()) { +- T t0 = iterator.next(); ++ T t0 = (T) iterator.next(); // Paper - Decompile fix + + builder.add(Pair.of(registrymaterials.c(t0).get(), t0)); + } diff --git a/Spigot-Server-Patches/0283-Add-PhantomPreSpawnEvent.patch b/Spigot-Server-Patches/0280-Add-PhantomPreSpawnEvent.patch similarity index 90% rename from Spigot-Server-Patches/0283-Add-PhantomPreSpawnEvent.patch rename to Spigot-Server-Patches/0280-Add-PhantomPreSpawnEvent.patch index 7598814be8..1fa24c5c4d 100644 --- a/Spigot-Server-Patches/0283-Add-PhantomPreSpawnEvent.patch +++ b/Spigot-Server-Patches/0280-Add-PhantomPreSpawnEvent.patch @@ -5,10 +5,10 @@ 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 b62a8227b264b768f6ed5d1ef191b68c604e18a5..82323bf4acc140d279c399cc64fa393a0db90136 100644 +index 457be7b726ccfdd7723a8eb5da69af96abc86870..47d82722e15c5b91a86af1a09807ccc37a1b37be 100644 --- a/src/main/java/net/minecraft/server/EntityPhantom.java +++ b/src/main/java/net/minecraft/server/EntityPhantom.java -@@ -130,6 +130,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -125,6 +125,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { } this.setSize(nbttagcompound.getInt("Size")); @@ -20,7 +20,7 @@ index b62a8227b264b768f6ed5d1ef191b68c604e18a5..82323bf4acc140d279c399cc64fa393a } @Override -@@ -139,6 +144,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -134,6 +139,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { nbttagcompound.setInt("AY", this.d.getY()); nbttagcompound.setInt("AZ", this.d.getZ()); nbttagcompound.setInt("Size", this.getSize()); @@ -32,7 +32,7 @@ index b62a8227b264b768f6ed5d1ef191b68c604e18a5..82323bf4acc140d279c399cc64fa393a } @Override -@@ -185,6 +195,14 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -180,6 +190,14 @@ public class EntityPhantom extends EntityFlying implements IMonster { return entitysize.a(f); } @@ -48,10 +48,10 @@ index b62a8227b264b768f6ed5d1ef191b68c604e18a5..82323bf4acc140d279c399cc64fa393a private final PathfinderTargetCondition b; diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java -index add566ea4f476e0c4750c0f9a1080a99ea74e5d1..f488c22ed64a9fa1ce7746942b2a9ff4bc296703 100644 +index c1ea64e2a474d58139a217d271c44f219b9ef0b6..39c5350373f6a5ad30f41e8886573d6b315924c6 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java +++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java -@@ -52,8 +52,17 @@ public class MobSpawnerPhantom { +@@ -53,8 +53,17 @@ public class MobSpawnerPhantom implements MobSpawner { int k = 1 + random.nextInt(difficultydamagescaler.a().a() + 1); for (int l = 0; l < k; ++l) { diff --git a/Spigot-Server-Patches/0284-Add-More-Creeper-API.patch b/Spigot-Server-Patches/0281-Add-More-Creeper-API.patch similarity index 92% rename from Spigot-Server-Patches/0284-Add-More-Creeper-API.patch rename to Spigot-Server-Patches/0281-Add-More-Creeper-API.patch index 018f0f8a28..e6f7752c89 100644 --- a/Spigot-Server-Patches/0284-Add-More-Creeper-API.patch +++ b/Spigot-Server-Patches/0281-Add-More-Creeper-API.patch @@ -5,19 +5,19 @@ Subject: [PATCH] Add More Creeper API diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index b89530079751c13894527f21572cc37e3a5548b8..45dfc8104a75f9893c6ee03d507cac80b893249c 100644 +index e4c1a7c152b2c1202c77e5d5d1c386d84007bc97..5e7f3af37b7cb068183fc2a7637b4c770fd5f936 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -14,7 +14,7 @@ public class EntityCreeper extends EntityMonster { private static final DataWatcherObject POWERED = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject isIgnitedDW = d; // Paper OBFHELPER - private int bw; + private int bv; - private int fuseTicks; + public int fuseTicks; // Paper - public public int maxFuseTicks = 30; public int explosionRadius = 3; - private int bA; -@@ -256,7 +256,18 @@ public class EntityCreeper extends EntityMonster { + private int bz; +@@ -254,7 +254,18 @@ public class EntityCreeper extends EntityMonster { } public void ignite() { diff --git a/Spigot-Server-Patches/0285-Inventory-removeItemAnySlot.patch b/Spigot-Server-Patches/0282-Inventory-removeItemAnySlot.patch similarity index 96% rename from Spigot-Server-Patches/0285-Inventory-removeItemAnySlot.patch rename to Spigot-Server-Patches/0282-Inventory-removeItemAnySlot.patch index 7abcfeaa9a..7950dac2d1 100644 --- a/Spigot-Server-Patches/0285-Inventory-removeItemAnySlot.patch +++ b/Spigot-Server-Patches/0282-Inventory-removeItemAnySlot.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Inventory#removeItemAnySlot diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index acc2a57ff295aa56a0fd47339299489d0617ddc7..47827fbf1b80f88ffff8a252df10d70758c68703 100644 +index 98aea6b2917faa73ac2f1a070545449a4a195cf2..a04213325b8266623b076f1233539512a0a0207f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -223,10 +223,16 @@ public class CraftInventory implements Inventory { diff --git a/Spigot-Server-Patches/0286-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/Spigot-Server-Patches/0283-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch similarity index 87% rename from Spigot-Server-Patches/0286-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch rename to Spigot-Server-Patches/0283-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch index ee5898d3ec..4bf53b3ebc 100644 --- a/Spigot-Server-Patches/0286-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch +++ b/Spigot-Server-Patches/0283-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch @@ -6,10 +6,10 @@ 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 ad951812835b1fa786e964c533efc4547c57b7a2..4e7b11af047c267ce87549e0ba178d7223c03b63 100644 +index 411d7a3f7d4d54fbf748888e24f2032c4d091250..e446bd936dd198b227e483cf8e234a73035daa76 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -499,7 +499,7 @@ public class CraftWorld implements World { +@@ -500,7 +500,7 @@ public class CraftWorld implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot diff --git a/Spigot-Server-Patches/0287-Add-ray-tracing-methods-to-LivingEntity.patch b/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch similarity index 92% rename from Spigot-Server-Patches/0287-Add-ray-tracing-methods-to-LivingEntity.patch rename to Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch index 07fcc4eab0..51df1d92fa 100644 --- a/Spigot-Server-Patches/0287-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 0c3a776e207d84943fd90482a650d0c74b5ca65d..516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6 100644 +index 3edd63cbfc3d4bf058f7fb56a4ed4a04b80fe927..4f80c46e327006a3d9028ca25db8554fba7b57ea 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3258,6 +3258,23 @@ public abstract class EntityLiving extends Entity { +@@ -3436,6 +3436,23 @@ public abstract class EntityLiving extends Entity { this.broadcastItemBreak(enumhand == EnumHand.MAIN_HAND ? EnumItemSlot.MAINHAND : EnumItemSlot.OFFHAND); } // Paper start @@ -33,10 +33,10 @@ index 0c3a776e207d84943fd90482a650d0c74b5ca65d..516631b4f4b8d7a9dd5d9d558d199f71 public int getShieldBlockingDelay() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 3a87c6574bbad9e6c2d7573eb447194c931d7ec4..9e082d4514eb57667cb50a390bef7ab72b94e838 100644 +index bbe6188f50dd3c456dec5c3239bdcffbfceb3589..2e7bacff55f57fda8b5644fb9d7934a615e5f550 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -196,6 +196,28 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -199,6 +199,28 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return blocks.get(0); } diff --git a/Spigot-Server-Patches/0288-Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch similarity index 65% rename from Spigot-Server-Patches/0288-Expose-attack-cooldown-methods-for-Player.patch rename to Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch index cae32fafa1..11bffc82a9 100644 --- a/Spigot-Server-Patches/0288-Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch @@ -5,32 +5,32 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 684978be7ccc401b71b0594828a7783b209a5210..f41975165a6a66479bc8fc1811c1d271bb2a6113 100644 +index 1f3e5c384a66bb0767cc18bdbe99b942f30faa55..0fd29c42179c7ac0c89cfd35b257ab0ad3ae1612 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -2123,14 +2123,17 @@ public abstract class EntityHuman extends EntityLiving { - this.datawatcher.set(EntityHuman.bt, nbttagcompound); +@@ -2006,14 +2006,17 @@ public abstract class EntityHuman extends EntityLiving { + this.datawatcher.set(EntityHuman.bs, nbttagcompound); } -+ public float getCooldownPeriod() { return this.ex(); } // Paper - OBFHELPER - public float ex() { - return (float) (1.0D / this.getAttributeInstance(GenericAttributes.ATTACK_SPEED).getValue() * 20.0D); ++ public float getCooldownPeriod() { return this.eR(); } // Paper - OBFHELPER + public float eR() { + return (float) (1.0D / this.b(GenericAttributes.ATTACK_SPEED) * 20.0D); } -+ public float getCooledAttackStrength(float adjustTicks) { return s(adjustTicks); } // Paper - OBFHELPER - public float s(float f) { - return MathHelper.a(((float) this.aB + f) / this.ex(), 0.0F, 1.0F); ++ public float getCooledAttackStrength(float adjustTicks) { return getAttackCooldown(adjustTicks); } // Paper - OBFHELPER + public float getAttackCooldown(float f) { + return MathHelper.a(((float) this.aA + f) / this.eR(), 0.0F, 1.0F); } + public void resetCooldown() { this.ey(); } // Paper - OBFHELPER - public void ey() { - this.aB = 0; + public void resetAttackCooldown() { + this.aA = 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 368f786300573ff24a8dc46d96a6fb6bac26b35a..fefe3b67ae62daedeb214d53d0c1f9d806356792 100644 +index 5575c44d6f427661de1fec2c69932b446284c54d..3ec69b90b5e49407fc986741f189b6ea108a2118 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1904,6 +1904,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1944,6 +1944,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getInventory().setItemInMainHand(hand); } diff --git a/Spigot-Server-Patches/0289-Improve-death-events.patch b/Spigot-Server-Patches/0286-Improve-death-events.patch similarity index 82% rename from Spigot-Server-Patches/0289-Improve-death-events.patch rename to Spigot-Server-Patches/0286-Improve-death-events.patch index a6a830704f..61b9e06d3c 100644 --- a/Spigot-Server-Patches/0289-Improve-death-events.patch +++ b/Spigot-Server-Patches/0286-Improve-death-events.patch @@ -15,10 +15,10 @@ items and experience which is otherwise only properly possible by using internal code. diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java -index 6daa400d277bdaa441bf5719a273eacbe64feff9..38fe29f8a290550d1e5fa5451aadaf0f28cc4034 100644 +index 6281f7900afab3ef1c9ba3c034b91cbfa1900f50..3c2f8407906879c8dca07b538f59f4bbd31b278f 100644 --- a/src/main/java/net/minecraft/server/CombatTracker.java +++ b/src/main/java/net/minecraft/server/CombatTracker.java -@@ -175,6 +175,7 @@ public class CombatTracker { +@@ -192,6 +192,7 @@ public class CombatTracker { this.h = null; } @@ -27,27 +27,27 @@ index 6daa400d277bdaa441bf5719a273eacbe64feff9..38fe29f8a290550d1e5fa5451aadaf0f int i = this.f ? 300 : 100; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6e87ff52df30f4de8cfb11d1dbfb71211d656831..0f74ec89b3e85c918c95f9d8fef6d68403ed1107 100644 +index 9163916e6f600f2efa3e05f3df1d07ef9b60cd3a..698619c25714d6bb296084298de4f2e39f8f9c63 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1504,6 +1504,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return false; +@@ -1461,6 +1461,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } + // CraftBukkit end + public void runKillTrigger(Entity entity, int kills, DamageSource damageSource) { this.a(entity, kills, damageSource); } // Paper - OBFHELPER public void a(Entity entity, int i, DamageSource damagesource) { if (entity instanceof EntityPlayer) { CriterionTriggers.c.a((EntityPlayer) entity, this, damagesource); -@@ -2419,6 +2420,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2344,6 +2345,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.fallDistance = 0.0F; } -+ public void onKill(EntityLiving entityLiving) { this.b(entityLiving); } // Paper - OBFHELPER - public void b(EntityLiving entityliving) {} ++ public void onKill(EntityLiving entityLiving) { this.a_(entityLiving); } // Paper - OBFHELPER + public void a_(EntityLiving entityliving) {} protected void k(double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 42b9a339e9c35db596ec78881c32c801c2d739f4..8ad131e4fc20efc61b938a5f6ab64379da23bf0d 100644 +index d5c09152acc93b25d626284071599afdbd76b709..51e9f4a6e09474a7489d2872a800308ee3f02e46 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -701,7 +701,8 @@ public class EntityArmorStand extends EntityLiving { @@ -61,10 +61,10 @@ index 42b9a339e9c35db596ec78881c32c801c2d739f4..8ad131e4fc20efc61b938a5f6ab64379 } diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java -index 2be6c7bde9597d6d6d0c9ad63665b9aa74c74964..82a32d5dbf162b8c67c701d0c9647ddca103ddef 100644 +index 95874526516291607a44ae2213d4d6d65edfe18d..e6275a9fe6cd988fe4661966fd48149c3e73408c 100644 --- a/src/main/java/net/minecraft/server/EntityFox.java +++ b/src/main/java/net/minecraft/server/EntityFox.java -@@ -571,15 +571,25 @@ public class EntityFox extends EntityAnimal { +@@ -576,15 +576,25 @@ public class EntityFox extends EntityAnimal { } @Override @@ -85,7 +85,7 @@ index 2be6c7bde9597d6d6d0c9ad63665b9aa74c74964..82a32d5dbf162b8c67c701d0c9647ddc if (!itemstack.isEmpty()) { this.a(itemstack); - this.setSlot(EnumItemSlot.MAINHAND, ItemStack.a); + this.setSlot(EnumItemSlot.MAINHAND, ItemStack.b); } - super.d(damagesource); @@ -94,10 +94,10 @@ index 2be6c7bde9597d6d6d0c9ad63665b9aa74c74964..82a32d5dbf162b8c67c701d0c9647ddc public static boolean a(EntityFox entityfox, EntityLiving entityliving) { diff --git a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java -index 80717ad9ac3d45fb2d25fac4fa1b61446aebd453..53aac5bccd2b1a36941a6744bbeece6a2f724cda 100644 +index c2a3bd8f25e91f79723074d93f6a646a8ce76d8c..4934e71225fe1242615660a379e797e212040ed3 100644 --- a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java +++ b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java -@@ -55,11 +55,19 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { +@@ -50,11 +50,19 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { this.a((IMaterial) Blocks.CHEST); } @@ -116,42 +116,42 @@ index 80717ad9ac3d45fb2d25fac4fa1b61446aebd453..53aac5bccd2b1a36941a6744bbeece6a + // Paper end + @Override - public void b(NBTTagCompound nbttagcompound) { - super.b(nbttagcompound); + public void saveData(NBTTagCompound nbttagcompound) { + super.saveData(nbttagcompound); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6..8ac03288dc328ccd4ec7ef9080b61f005d8daac6 100644 +index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7e429d1b0 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -89,7 +89,7 @@ public abstract class EntityLiving extends Entity { +@@ -95,7 +95,7 @@ public abstract class EntityLiving extends Entity { + protected float aS; protected float aT; protected float aU; - protected float aV; -- protected int aW; -+ protected int aW; protected int getKillCount() { return this.aW; } // Paper - OBFHELPER +- protected int aV; ++ protected int aV; protected int getKillCount() { return this.aV; } // Paper - OBFHELPER public float lastDamage; protected boolean jumping; - public float aZ; -@@ -131,6 +131,7 @@ public abstract class EntityLiving extends Entity { - public boolean collides = true; + public float aY; +@@ -139,6 +139,7 @@ public abstract class EntityLiving extends Entity { + public Set collidableExemptions = new HashSet<>(); public boolean canPickUpLoot; public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper + public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event @Override public float getBukkitYaw() { -@@ -1139,13 +1140,17 @@ public abstract class EntityLiving extends Entity { - - if (this.getHealth() <= 0.0F) { +@@ -1248,13 +1249,17 @@ public abstract class EntityLiving extends Entity { + if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback + if (this.dk()) { if (!this.f(damagesource)) { - SoundEffect soundeffect = this.getSoundDeath(); + // Paper start - moved into CraftEventFactory event caller for cancellable death event + //SoundEffect soundeffect = this.getSoundDeath(); - if (flag1 && soundeffect != null) { -- this.a(soundeffect, this.getSoundVolume(), this.dn()); +- this.playSound(soundeffect, this.getSoundVolume(), this.dG()); - } +// if (flag1 && soundeffect != null) { -+// this.a(soundeffect, this.getSoundVolume(), this.dn()); ++// this.playSound(soundeffect, this.getSoundVolume(), this.dG()); +// } + this.silentDeath = !flag1; // mark entity as dying silently + // Paper end @@ -161,15 +161,15 @@ index 516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6..8ac03288dc328ccd4ec7ef9080b61f00 } } else if (flag1) { this.c(damagesource); -@@ -1283,6 +1288,7 @@ public abstract class EntityLiving extends Entity { +@@ -1392,6 +1397,7 @@ public abstract class EntityLiving extends Entity { Entity entity = damagesource.getEntity(); EntityLiving entityliving = this.getKillingEntity(); + /* // Paper - move down to make death event cancellable - if (this.aW >= 0 && entityliving != null) { - entityliving.a(this, this.aW, damagesource); + if (this.aV >= 0 && entityliving != null) { + entityliving.a(this, this.aV, damagesource); } -@@ -1294,16 +1300,36 @@ public abstract class EntityLiving extends Entity { +@@ -1403,16 +1409,36 @@ public abstract class EntityLiving extends Entity { if (this.isSleeping()) { this.entityWakeup(); } @@ -177,7 +177,7 @@ index 516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6..8ac03288dc328ccd4ec7ef9080b61f00 this.killed = true; - this.getCombatTracker().g(); -+ //this.getCombatTracker().g(); ++ //this.getCombatTracker().g(); // Paper if (!this.world.isClientSide) { - this.d(damagesource); + org.bukkit.event.entity.EntityDeathEvent deathEvent = this.d(damagesource); @@ -198,7 +198,7 @@ index 516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6..8ac03288dc328ccd4ec7ef9080b61f00 + } + // Paper end + - this.f(entityliving); + this.g(entityliving); } + if (this.killed) { // Paper @@ -208,16 +208,16 @@ index 516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6..8ac03288dc328ccd4ec7ef9080b61f00 } } -@@ -1311,7 +1337,7 @@ public abstract class EntityLiving extends Entity { +@@ -1420,7 +1446,7 @@ public abstract class EntityLiving extends Entity { if (!this.world.isClientSide) { boolean flag = false; - if (entityliving instanceof EntityWither) { + if (this.killed && entityliving instanceof EntityWither) { // Paper if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { - BlockPosition blockposition = new BlockPosition(this); + BlockPosition blockposition = this.getChunkCoordinates(); IBlockData iblockdata = Blocks.WITHER_ROSE.getBlockData(); -@@ -1332,7 +1358,8 @@ public abstract class EntityLiving extends Entity { +@@ -1441,7 +1467,8 @@ public abstract class EntityLiving extends Entity { } } @@ -227,12 +227,12 @@ index 516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6..8ac03288dc328ccd4ec7ef9080b61f00 Entity entity = damagesource.getEntity(); int i; -@@ -1345,22 +1372,26 @@ public abstract class EntityLiving extends Entity { +@@ -1454,22 +1481,26 @@ public abstract class EntityLiving extends Entity { boolean flag = this.lastDamageByPlayerTime > 0; this.dropInventory(); // CraftBukkit - from below + org.bukkit.event.entity.EntityDeathEvent deathEvent; // Paper - if (this.isDropExperience() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) { + if (this.cV() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) { this.a(damagesource, flag); this.dropDeathLoot(damagesource, i, flag); // CraftBukkit start - Call death event @@ -257,7 +257,7 @@ index 516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6..8ac03288dc328ccd4ec7ef9080b61f00 // CraftBukkit start public int getExpReward() { -@@ -1439,6 +1470,7 @@ public abstract class EntityLiving extends Entity { +@@ -1549,6 +1580,7 @@ public abstract class EntityLiving extends Entity { return SoundEffects.ENTITY_GENERIC_HURT; } @@ -265,7 +265,7 @@ index 516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6..8ac03288dc328ccd4ec7ef9080b61f00 @Nullable protected SoundEffect getSoundDeath() { return SoundEffects.ENTITY_GENERIC_DEATH; -@@ -1924,10 +1956,12 @@ public abstract class EntityLiving extends Entity { +@@ -2068,10 +2100,12 @@ public abstract class EntityLiving extends Entity { } @@ -274,15 +274,15 @@ index 516631b4f4b8d7a9dd5d9d558d199f71d0d7ced6..8ac03288dc328ccd4ec7ef9080b61f00 return 1.0F; } -+ public float getSoundPitch() { return dn();} // Paper - OBFHELPER - protected float dn() { ++ public float getSoundPitch() { return dG();} // Paper - OBFHELPER + protected float dG() { 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 f35d23340665ab323732915efc0c0ad7fe4d964d..f43584f0e31a1c3d0e9b4356b7021cd79226d8b5 100644 +index dc99c7730e72e1a52219fbe0b3b039899899f49d..7a0391dc2861d604f1f3acc53eb9e1134c33c64f 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -76,6 +76,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -80,6 +80,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public int ping; public boolean viewingCredits; private int containerUpdateDelay; // Paper @@ -293,7 +293,7 @@ index f35d23340665ab323732915efc0c0ad7fe4d964d..f43584f0e31a1c3d0e9b4356b7021cd7 // CraftBukkit start public String displayName; -@@ -539,6 +543,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -582,6 +586,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { String deathmessage = defaultMessage.getString(); org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage, keepInventory); @@ -309,7 +309,7 @@ index f35d23340665ab323732915efc0c0ad7fe4d964d..f43584f0e31a1c3d0e9b4356b7021cd7 // SPIGOT-943 - only call if they have an inventory open if (this.activeContainer != this.defaultContainer) { -@@ -677,8 +690,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -733,8 +746,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } } @@ -330,10 +330,10 @@ index f35d23340665ab323732915efc0c0ad7fe4d964d..f43584f0e31a1c3d0e9b4356b7021cd7 } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -index 90fdf89c811620d3c26486cd55c8cdb14ce9654c..b761a41dcd899b6556f07d3b835ce7e56da3cfbb 100644 +index 7b565ddfffd0b9c78392ee115ef9c20ab89a3380..d78b9fd608da691220f1edeff506b36e3a88f515 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -@@ -821,6 +821,22 @@ public enum CraftSound { +@@ -996,6 +996,22 @@ public enum CraftSound { WEATHER_RAIN_ABOVE("weather.rain.above"); private final String minecraftKey; @@ -357,10 +357,10 @@ index 90fdf89c811620d3c26486cd55c8cdb14ce9654c..b761a41dcd899b6556f07d3b835ce7e5 this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index fefe3b67ae62daedeb214d53d0c1f9d806356792..5445554b18c22b85cf9b3427c22d693a24bc596b 100644 +index 3ec69b90b5e49407fc986741f189b6ea108a2118..e112a87792a76ccbc25caa1253c54db601de76aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1697,7 +1697,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1738,7 +1738,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void sendHealthUpdate() { @@ -376,12 +376,12 @@ index fefe3b67ae62daedeb214d53d0c1f9d806356792..5445554b18c22b85cf9b3427c22d693a + // Paper end } - public void injectScaledMaxHealth(Collection collection, boolean force) { + 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 2e859c32b5a7d314e38221da75d785ff244224ad..6ea8650d23b9fa8826142f0de3556db14c301f61 100644 +index 46889e7b462673f5d03e6efc1114074da3165d47..3ba376b077bde759ac62ca1641962598637edd59 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -757,9 +757,16 @@ public class CraftEventFactory { +@@ -755,9 +755,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()); @@ -398,7 +398,7 @@ index 2e859c32b5a7d314e38221da75d785ff244224ad..6ea8650d23b9fa8826142f0de3556db1 victim.expToDrop = event.getDroppedExp(); for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { -@@ -775,8 +782,15 @@ public class CraftEventFactory { +@@ -773,8 +780,15 @@ public class CraftEventFactory { CraftPlayer entity = victim.getBukkitEntity(); PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage); event.setKeepInventory(keepInventory); @@ -414,7 +414,7 @@ index 2e859c32b5a7d314e38221da75d785ff244224ad..6ea8650d23b9fa8826142f0de3556db1 victim.keepLevel = event.getKeepLevel(); victim.newLevel = event.getNewLevel(); -@@ -793,6 +807,31 @@ public class CraftEventFactory { +@@ -791,6 +805,31 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0290-Allow-chests-to-be-placed-with-NBT-data.patch b/Spigot-Server-Patches/0287-Allow-chests-to-be-placed-with-NBT-data.patch similarity index 85% rename from Spigot-Server-Patches/0290-Allow-chests-to-be-placed-with-NBT-data.patch rename to Spigot-Server-Patches/0287-Allow-chests-to-be-placed-with-NBT-data.patch index 84600cf4ed..230ef63e3b 100644 --- a/Spigot-Server-Patches/0290-Allow-chests-to-be-placed-with-NBT-data.patch +++ b/Spigot-Server-Patches/0287-Allow-chests-to-be-placed-with-NBT-data.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow chests to be placed with NBT data diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 0b0c3c681c07cf8506df1b91b1feaf130891a440..d953cdef14a9b62833a35a4fe94a22b5e9b19c2d 100644 +index 95e801a9a7ca405ff7e80c920fa78493d0ef5374..a075a41d954836864a5186b383e967a9ac262df8 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -240,6 +240,7 @@ public final class ItemStack { +@@ -244,6 +244,7 @@ public final class ItemStack { enuminteractionresult = EnumInteractionResult.FAIL; // cancel placement // PAIL: Remove this when MC-99075 fixed placeEvent.getPlayer().updateInventory(); @@ -17,7 +17,7 @@ index 0b0c3c681c07cf8506df1b91b1feaf130891a440..d953cdef14a9b62833a35a4fe94a22b5 for (BlockState blockstate : blocks) { blockstate.update(true, false); diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java -index eb2b6ff8fd86233c434882c69a8890adc9861d4b..9a5f2da8c073f9b249edac98b0990615a9efb0e2 100644 +index cc15686573f3a54ff0145b3486679b772157d191..aaa40c8a8013806f41f15fcc4682e1ca4d44e956 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -292,7 +292,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic diff --git a/Spigot-Server-Patches/0291-Mob-Pathfinding-API.patch b/Spigot-Server-Patches/0288-Mob-Pathfinding-API.patch similarity index 90% rename from Spigot-Server-Patches/0291-Mob-Pathfinding-API.patch rename to Spigot-Server-Patches/0288-Mob-Pathfinding-API.patch index 23c2b858be..6f0d89713c 100644 --- a/Spigot-Server-Patches/0291-Mob-Pathfinding-API.patch +++ b/Spigot-Server-Patches/0288-Mob-Pathfinding-API.patch @@ -153,10 +153,10 @@ index 0000000000000000000000000000000000000000..af1bac9680028130e99c5e7130f258c1 + } +} diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index bdd092e49da13960cd8a65e989a351d65cb620f7..f06764973feaa29ccbb4731b65372c544dcf3032 100644 +index b06c76a369f1dc9de8d782272c3ff0573af89361..cca6242e38fc286eea810eb8f2e4d1ab5429b9df 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -80,7 +80,7 @@ public abstract class NavigationAbstract { +@@ -78,7 +78,7 @@ public abstract class NavigationAbstract { } @Nullable @@ -165,16 +165,16 @@ index bdd092e49da13960cd8a65e989a351d65cb620f7..f06764973feaa29ccbb4731b65372c54 return this.a(new BlockPosition(d0, d1, d2), i); } -@@ -100,7 +100,7 @@ public abstract class NavigationAbstract { +@@ -103,7 +103,7 @@ public abstract class NavigationAbstract { } @Nullable - public PathEntity a(Entity entity, int i) { + public final PathEntity calculateDestination(Entity entity) { return a(entity, 0); } public PathEntity a(Entity entity, int i) { - return this.a(ImmutableSet.of(new BlockPosition(entity)), entity, 16, true, i); // Paper + return this.a(ImmutableSet.of(entity.getChunkCoordinates()), entity, 16, true, i); // Paper } -@@ -164,6 +164,7 @@ public abstract class NavigationAbstract { +@@ -168,6 +168,7 @@ public abstract class NavigationAbstract { return pathentity != null && this.a(pathentity, d0); } @@ -182,7 +182,7 @@ index bdd092e49da13960cd8a65e989a351d65cb620f7..f06764973feaa29ccbb4731b65372c54 public boolean a(@Nullable PathEntity pathentity, double d0) { if (pathentity == null) { this.c = null; -@@ -191,7 +192,7 @@ public abstract class NavigationAbstract { +@@ -195,7 +196,7 @@ public abstract class NavigationAbstract { } } @@ -191,7 +191,7 @@ index bdd092e49da13960cd8a65e989a351d65cb620f7..f06764973feaa29ccbb4731b65372c54 public PathEntity k() { return this.c; } -@@ -281,6 +282,7 @@ public abstract class NavigationAbstract { +@@ -311,6 +312,7 @@ public abstract class NavigationAbstract { return !this.m(); } @@ -200,7 +200,7 @@ index bdd092e49da13960cd8a65e989a351d65cb620f7..f06764973feaa29ccbb4731b65372c54 this.c = null; } diff --git a/src/main/java/net/minecraft/server/PathEntity.java b/src/main/java/net/minecraft/server/PathEntity.java -index 312352ef848e20c210b1d32e3c362f94d78e2cca..dcb4e250803b8605f9bfb6d590c4e316dfee97d1 100644 +index 662932360bc7a9391fde99a88b60aac47f29467e..9154c01a22bc7b6d2dd390bb7b6e21ef52c8006c 100644 --- a/src/main/java/net/minecraft/server/PathEntity.java +++ b/src/main/java/net/minecraft/server/PathEntity.java @@ -5,13 +5,14 @@ import javax.annotation.Nullable; @@ -234,13 +234,13 @@ index 312352ef848e20c210b1d32e3c362f94d78e2cca..dcb4e250803b8605f9bfb6d590c4e316 return this.a(entity, this.e); } -- public Vec3D g() { -+ public Vec3D getNext() { return g(); } public Vec3D g() { // Paper - OBFHELPER - PathPoint pathpoint = (PathPoint) this.a.get(this.e); +- public BaseBlockPosition g() { ++ public BaseBlockPosition getNext() { return g(); } public BaseBlockPosition g() { // Paper - OBFHELPER + PathPoint pathpoint = this.h(); - return new Vec3D((double) pathpoint.a, (double) pathpoint.b, (double) pathpoint.c); + return new BaseBlockPosition(pathpoint.a, pathpoint.b, pathpoint.c); diff --git a/src/main/java/net/minecraft/server/PathPoint.java b/src/main/java/net/minecraft/server/PathPoint.java -index b1db95daa976f61da07a37ec1787ef49785e016a..18cdd2a6f290bf1f00db58efdb9a42f81c8e109b 100644 +index b69d6bc433711e94e3fbfa2a89c091209c95484d..e9fb295bdf727cd4543cbe5a18447ceba3d41ee0 100644 --- a/src/main/java/net/minecraft/server/PathPoint.java +++ b/src/main/java/net/minecraft/server/PathPoint.java @@ -2,9 +2,9 @@ package net.minecraft.server; @@ -257,7 +257,7 @@ index b1db95daa976f61da07a37ec1787ef49785e016a..18cdd2a6f290bf1f00db58efdb9a42f8 public int d = -1; public float e; diff --git a/src/main/java/net/minecraft/server/PathfinderAbstract.java b/src/main/java/net/minecraft/server/PathfinderAbstract.java -index af3b09f59a38020c1a45403526fca81c1da144d5..477b762e9c0c51cb3f387f70ba7ec9d35dc04132 100644 +index fca9ed99d6c11badb85e0c06cd6872dca85d6f8d..5cfcac3bc29e3f3d139b10209f5082cba292a434 100644 --- a/src/main/java/net/minecraft/server/PathfinderAbstract.java +++ b/src/main/java/net/minecraft/server/PathfinderAbstract.java @@ -11,9 +11,9 @@ public abstract class PathfinderAbstract { diff --git a/Spigot-Server-Patches/0292-Prevent-chunk-loading-from-Fluid-Flowing.patch b/Spigot-Server-Patches/0289-Prevent-chunk-loading-from-Fluid-Flowing.patch similarity index 92% rename from Spigot-Server-Patches/0292-Prevent-chunk-loading-from-Fluid-Flowing.patch rename to Spigot-Server-Patches/0289-Prevent-chunk-loading-from-Fluid-Flowing.patch index 6aad0026a5..d90ae0901c 100644 --- a/Spigot-Server-Patches/0292-Prevent-chunk-loading-from-Fluid-Flowing.patch +++ b/Spigot-Server-Patches/0289-Prevent-chunk-loading-from-Fluid-Flowing.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent chunk loading from Fluid Flowing diff --git a/src/main/java/net/minecraft/server/FluidTypeFlowing.java b/src/main/java/net/minecraft/server/FluidTypeFlowing.java -index 3099a5e654d343fba1a61d6be3477df0866feb47..376dca1889f1eca4ce9993e0e067a94eb293103d 100644 +index 663731a5e7ad3990d1ffac3e0a3028dba37f2b07..d72a88e9275eb00eed35b6467538a46e5cee32d5 100644 --- a/src/main/java/net/minecraft/server/FluidTypeFlowing.java +++ b/src/main/java/net/minecraft/server/FluidTypeFlowing.java -@@ -178,7 +178,8 @@ public abstract class FluidTypeFlowing extends FluidType { +@@ -154,7 +154,8 @@ public abstract class FluidTypeFlowing extends FluidType { EnumDirection enumdirection = (EnumDirection) entry.getKey(); Fluid fluid1 = (Fluid) entry.getValue(); BlockPosition blockposition1 = blockposition.shift(enumdirection); @@ -18,7 +18,7 @@ index 3099a5e654d343fba1a61d6be3477df0866feb47..376dca1889f1eca4ce9993e0e067a94e if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.getType())) { // CraftBukkit start -@@ -205,7 +206,8 @@ public abstract class FluidTypeFlowing extends FluidType { +@@ -181,7 +182,8 @@ public abstract class FluidTypeFlowing extends FluidType { while (iterator.hasNext()) { EnumDirection enumdirection = (EnumDirection) iterator.next(); BlockPosition blockposition1 = blockposition.shift(enumdirection); @@ -28,7 +28,7 @@ index 3099a5e654d343fba1a61d6be3477df0866feb47..376dca1889f1eca4ce9993e0e067a94e Fluid fluid = iblockdata1.getFluid(); if (fluid.getType().a((FluidType) this) && this.a(enumdirection, (IBlockAccess) iworldreader, blockposition, iblockdata, blockposition1, iblockdata1)) { -@@ -322,11 +324,18 @@ public abstract class FluidTypeFlowing extends FluidType { +@@ -298,11 +300,18 @@ public abstract class FluidTypeFlowing extends FluidType { if (enumdirection1 != enumdirection) { BlockPosition blockposition2 = blockposition.shift(enumdirection1); short short0 = a(blockposition1, blockposition2); @@ -51,7 +51,7 @@ index 3099a5e654d343fba1a61d6be3477df0866feb47..376dca1889f1eca4ce9993e0e067a94e IBlockData iblockdata1 = (IBlockData) pair.getFirst(); Fluid fluid = (Fluid) pair.getSecond(); -@@ -398,11 +407,16 @@ public abstract class FluidTypeFlowing extends FluidType { +@@ -374,11 +383,16 @@ public abstract class FluidTypeFlowing extends FluidType { EnumDirection enumdirection = (EnumDirection) iterator.next(); BlockPosition blockposition1 = blockposition.shift(enumdirection); short short0 = a(blockposition, blockposition1); diff --git a/Spigot-Server-Patches/0293-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch similarity index 93% rename from Spigot-Server-Patches/0293-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch rename to Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index e4b9c71829..badd4ad964 100644 --- a/Spigot-Server-Patches/0293-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/net/minecraft/server/ArgumentBlock.java b/src/main/java/net/minecraft/server/ArgumentBlock.java -index 005ebec266032dd873cc2e7d8919d9bd018457f7..97d85f8451a7a6cd17ac272492da52c55161789d 100644 +index b986a8e318733bdae766202bef93d4d25f18b58d..1f74602ff13a9f89c8dc40170353a79a41085649 100644 --- a/src/main/java/net/minecraft/server/ArgumentBlock.java +++ b/src/main/java/net/minecraft/server/ArgumentBlock.java -@@ -43,7 +43,7 @@ public class ArgumentBlock { +@@ -45,7 +45,7 @@ public class ArgumentBlock { private final boolean j; private final Map, Comparable> k = Maps.newLinkedHashMap(); // CraftBukkit - stable private final Map l = Maps.newHashMap(); @@ -17,7 +17,7 @@ index 005ebec266032dd873cc2e7d8919d9bd018457f7..97d85f8451a7a6cd17ac272492da52c5 private BlockStateList n; private IBlockData o; @Nullable -@@ -72,11 +72,13 @@ public class ArgumentBlock { +@@ -74,11 +74,13 @@ public class ArgumentBlock { return this.p; } @@ -32,10 +32,10 @@ index 005ebec266032dd873cc2e7d8919d9bd018457f7..97d85f8451a7a6cd17ac272492da52c5 this.s = this::l; if (this.i.canRead() && this.i.peek() == '#') { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad818679473e20382f 100644 +index e5a2779a0460500c7d58f97c605549a366b5f0ce..7e0cdc3a1dde2c2e9cf5a9a80bc42010c6695f9e 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -86,6 +86,12 @@ import org.bukkit.persistence.PersistentDataContainer; +@@ -85,6 +85,12 @@ import org.bukkit.persistence.PersistentDataContainer; import static org.spigotmc.ValidateUtils.*; // Spigot end @@ -48,7 +48,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 /** * Children must include the following: * -@@ -267,6 +273,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -266,6 +272,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Specific(Specific.To.NBT) static final ItemMetaKey BLOCK_DATA = new ItemMetaKey("BlockStateTag"); static final ItemMetaKey BUKKIT_CUSTOM_TAG = new ItemMetaKey("PublicBukkitValues"); @@ -59,7 +59,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 private IChatBaseComponent displayName; private IChatBaseComponent locName; -@@ -279,6 +289,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -278,6 +288,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private int hideFlag; private boolean unbreakable; private int damage; @@ -70,7 +70,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 private static final Set HANDLED_TAGS = Sets.newHashSet(); private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); -@@ -316,6 +330,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -315,6 +329,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.hideFlag = meta.hideFlag; this.unbreakable = meta.unbreakable; this.damage = meta.damage; @@ -86,7 +86,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 this.unhandledTags.putAll(meta.unhandledTags); this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw()); -@@ -392,6 +415,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -391,6 +414,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { persistentDataContainer.put(key, compound.get(key)); } } @@ -118,7 +118,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 Set keys = tag.getKeys(); for (String key : keys) { -@@ -529,6 +577,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -528,6 +576,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { setDamage(damage); } @@ -153,7 +153,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 String internal = SerializableMeta.getString(map, "internal", true); if (internal != null) { ByteArrayInputStream buf = new ByteArrayInputStream(Base64.decodeBase64(internal)); -@@ -657,6 +733,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -656,6 +732,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { if (hasDamage()) { itemTag.setInt(DAMAGE.NBT, damage); } @@ -177,7 +177,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 for (Map.Entry e : unhandledTags.entrySet()) { itemTag.set(e.getKey(), e.getValue()); -@@ -673,6 +766,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -672,6 +765,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -199,7 +199,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 NBTTagList createStringList(List list) { if (list == null || list.isEmpty()) { return null; -@@ -756,7 +864,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -755,7 +863,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Overridden boolean isEmpty() { @@ -208,7 +208,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 } @Override -@@ -1156,7 +1264,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1155,7 +1263,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { && (this.hideFlag == that.hideFlag) && (this.isUnbreakable() == that.isUnbreakable()) && (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage()) @@ -221,7 +221,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 } /** -@@ -1191,6 +1303,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1190,6 +1302,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { hash = 61 * hash + (hasDamage() ? this.damage : 0); hash = 61 * hash + (hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0); hash = 61 * hash + version; @@ -232,7 +232,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 return hash; } -@@ -1215,6 +1331,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1214,6 +1330,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { clone.unbreakable = this.unbreakable; clone.damage = this.damage; clone.version = this.version; @@ -247,7 +247,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 return clone; } catch (CloneNotSupportedException e) { throw new Error(e); -@@ -1272,6 +1396,24 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1271,6 +1395,24 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { builder.put(DAMAGE.BUKKIT, damage); } @@ -272,7 +272,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 final Map internalTags = new HashMap(unhandledTags); serializeInternal(internalTags); if (!internalTags.isEmpty()) { -@@ -1435,7 +1577,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1434,7 +1576,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CraftMetaArmorStand.NO_BASE_PLATE.NBT, CraftMetaArmorStand.SHOW_ARMS.NBT, CraftMetaArmorStand.SMALL.NBT, @@ -283,7 +283,7 @@ index b87d2581754fde163a7b5532b9d5e21b48d3e243..706f1bd66c79dddc26794cad81867947 // Paper end )); } -@@ -1460,4 +1604,147 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1459,4 +1603,147 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } // Paper end diff --git a/Spigot-Server-Patches/0294-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/Spigot-Server-Patches/0291-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch similarity index 78% rename from Spigot-Server-Patches/0294-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch rename to Spigot-Server-Patches/0291-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch index 175b21d02a..147617e735 100644 --- a/Spigot-Server-Patches/0294-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch +++ b/Spigot-Server-Patches/0291-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java -index bf8ca9b32aa8d7d797c430cbb98466ae9dcf738f..7ccb3d5c065d39b3a859d87a8462b6542fe40f3b 100644 +index ed29186791ac615c7d23ef8e7b8aea6a3ab8222d..29efbdd2ca77833e6be59e5b5b4c38633e43588d 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java @@ -12,11 +12,13 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { @@ -26,10 +26,10 @@ index bf8ca9b32aa8d7d797c430cbb98466ae9dcf738f..7ccb3d5c065d39b3a859d87a8462b654 @Nullable private BlockPosition a(BlockPosition blockposition, IBlockAccess iblockaccess) { -- if (iblockaccess.getType(blockposition).getBlock() == this.g) { +- if (iblockaccess.getType(blockposition).a(this.g)) { + Block block = world.getBlockIfLoaded(blockposition); // Paper + if (block == null) return null; // Paper -+ if (block == this.g) { // Paper ++ if (block.a(this.g)) { // Paper return blockposition; } else { BlockPosition[] ablockposition = new BlockPosition[]{blockposition.down(), blockposition.west(), blockposition.east(), blockposition.north(), blockposition.south(), blockposition.down().down()}; @@ -37,8 +37,8 @@ index bf8ca9b32aa8d7d797c430cbb98466ae9dcf738f..7ccb3d5c065d39b3a859d87a8462b654 for (int j = 0; j < i; ++j) { BlockPosition blockposition1 = ablockposition1[j]; -- if (iblockaccess.getType(blockposition1).getBlock() == this.g) { -+ if (world.getBlockIfLoaded(blockposition1) == this.g) { // Paper +- if (iblockaccess.getType(blockposition1).a(this.g)) { ++ if (iblockaccess.getBlockIfLoaded(blockposition1).a(this.g)) { // Paper return blockposition1; } } @@ -49,13 +49,13 @@ index bf8ca9b32aa8d7d797c430cbb98466ae9dcf738f..7ccb3d5c065d39b3a859d87a8462b654 - IChunkAccess ichunkaccess = iworldreader.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4, ChunkStatus.FULL, false); + IChunkAccess ichunkaccess = iworldreader.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4); // Paper - return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).getBlock() == this.g && ichunkaccess.getType(blockposition.up()).isAir() && ichunkaccess.getType(blockposition.up(2)).isAir(); + return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a(this.g) && ichunkaccess.getType(blockposition.up()).isAir() && ichunkaccess.getType(blockposition.up(2)).isAir(); } diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java -index d4cd50918b63e4ff503536fabb9d60b880473d23..d6a3b993394b34ddebc55a952d09df490884558d 100644 +index 39b08086d111f614286675fd4a993da12cf24ccc..dc89c707b10c5544eca06a634a625bce0dd778f0 100644 --- a/src/main/java/net/minecraft/server/RandomPositionGenerator.java +++ b/src/main/java/net/minecraft/server/RandomPositionGenerator.java -@@ -109,6 +109,7 @@ public class RandomPositionGenerator { +@@ -116,6 +116,7 @@ public class RandomPositionGenerator { } blockposition2 = new BlockPosition((double) k1 + entitycreature.locX(), (double) l1 + entitycreature.locY(), (double) i2 + entitycreature.locZ()); @@ -63,13 +63,13 @@ index d4cd50918b63e4ff503536fabb9d60b880473d23..d6a3b993394b34ddebc55a952d09df49 if (blockposition2.getY() >= 0 && blockposition2.getY() <= entitycreature.world.getBuildHeight() && (!flag3 || entitycreature.a(blockposition2)) && (!flag2 || navigationabstract.a(blockposition2))) { if (flag1) { blockposition2 = a(blockposition2, random.nextInt(l + 1) + i1, entitycreature.world.getBuildHeight(), (blockposition3) -> { -@@ -116,7 +117,8 @@ public class RandomPositionGenerator { +@@ -123,7 +124,8 @@ public class RandomPositionGenerator { }); } -- if (flag || !entitycreature.world.getFluid(blockposition2).a(TagsFluid.WATER)) { +- if (flag || !entitycreature.world.getFluid(blockposition2).a((Tag) TagsFluid.WATER)) { + Fluid fluid = entitycreature.world.getFluidIfLoaded(blockposition2); // Paper -+ if (flag || (fluid != null && !fluid.a(TagsFluid.WATER))) { // Paper - PathType pathtype = PathfinderNormal.b(entitycreature.world, blockposition2.getX(), blockposition2.getY(), blockposition2.getZ()); ++ if (flag || (fluid != null && !fluid.a((Tag) TagsFluid.WATER))) { // Paper + PathType pathtype = PathfinderNormal.a((IBlockAccess) entitycreature.world, blockposition2.i()); if (entitycreature.a(pathtype) == 0.0F) { diff --git a/Spigot-Server-Patches/0292-Prevent-mob-spawning-from-loading-generating-chunks.patch b/Spigot-Server-Patches/0292-Prevent-mob-spawning-from-loading-generating-chunks.patch new file mode 100644 index 0000000000..f504111a10 --- /dev/null +++ b/Spigot-Server-Patches/0292-Prevent-mob-spawning-from-loading-generating-chunks.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 12 Sep 2018 21:12:57 -0400 +Subject: [PATCH] Prevent mob spawning from loading/generating chunks + +also prevents if out of world border bounds + +diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java +index 4b1a5e92cc05df06edd6d2d7eab5ca70b70ede79..32d45b54fc4e67555a7f016ac72787a8ad4818f3 100644 +--- a/src/main/java/net/minecraft/server/SpawnerCreature.java ++++ b/src/main/java/net/minecraft/server/SpawnerCreature.java +@@ -139,9 +139,9 @@ public final class SpawnerCreature { + StructureManager structuremanager = worldserver.getStructureManager(); + ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator(); + int i = blockposition.getY(); +- IBlockData iblockdata = ichunkaccess.getType(blockposition); ++ IBlockData iblockdata = worldserver.getTypeIfLoadedAndInBounds(blockposition); // Paper - don't load chunks for mob spawn + +- if (!iblockdata.isOccluding(ichunkaccess, blockposition)) { ++ if (iblockdata != null && !iblockdata.isOccluding(ichunkaccess, blockposition)) { // Paper - don't load chunks for mob spawn + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); + int j = 0; + int k = 0; +@@ -170,7 +170,7 @@ public final class SpawnerCreature { + if (entityhuman != null) { + double d2 = entityhuman.g(d0, (double) i, d1); + +- if (a(worldserver, ichunkaccess, blockposition_mutableblockposition, d2)) { ++ if (a(worldserver, ichunkaccess, blockposition_mutableblockposition, d2) && worldserver.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn + if (biomebase_biomemeta == null) { + biomebase_biomemeta = a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, worldserver.random, (BlockPosition) blockposition_mutableblockposition); + if (biomebase_biomemeta == null) { diff --git a/Spigot-Server-Patches/0296-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch similarity index 69% rename from Spigot-Server-Patches/0296-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch rename to Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch index c7ccaeee33..b4461e819f 100644 --- a/Spigot-Server-Patches/0296-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch +++ b/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch @@ -6,19 +6,19 @@ Subject: [PATCH] Optimize Biome Mob Lookups for Mob Spawning Uses an EnumMap as well as a Set paired List for O(1) contains calls. diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index 253890e53702f9ba1c6628cc860a4ca10756626a..0102a170dc333fb4af01efa0aaa66df85271f1e0 100644 +index ae0ac8d383ca11a683465d8c83a8b8a66e567079..4c656f434f2637a6af4cdb9efe3414de81e4ea9b 100644 --- a/src/main/java/net/minecraft/server/BiomeBase.java +++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -40,7 +40,7 @@ public abstract class BiomeBase { - protected final Map>> r = Maps.newHashMap(); +@@ -69,7 +69,7 @@ public class BiomeBase { + protected final Map>> r; protected final List> s = Lists.newArrayList(); - protected final Map, WorldGenFeatureConfiguration> t = Maps.newHashMap(); -- private final Map> v = Maps.newHashMap(); -+ private final java.util.EnumMap> v = Maps.newEnumMap(EnumCreatureType.class); // Paper - private final ThreadLocal w = ThreadLocal.withInitial(() -> { - return (Long2FloatLinkedOpenHashMap) SystemUtils.a(() -> { - Long2FloatLinkedOpenHashMap long2floatlinkedopenhashmap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) { -@@ -92,7 +92,7 @@ public abstract class BiomeBase { + private final Map, StructureFeature> u; +- private final Map> v; ++ private final Map> v = Maps.newEnumMap(EnumCreatureType.class); // Paper + private final Map, BiomeBase.e> w = Maps.newHashMap(); + private final List x; + private final ThreadLocal y = ThreadLocal.withInitial(() -> { +@@ -127,7 +127,7 @@ public class BiomeBase { for (j = 0; j < i; ++j) { EnumCreatureType enumcreaturetype = aenumcreaturetype[j]; @@ -27,8 +27,8 @@ index 253890e53702f9ba1c6628cc860a4ca10756626a..0102a170dc333fb4af01efa0aaa66df8 } } else { -@@ -327,6 +327,38 @@ public abstract class BiomeBase { - return this.m; +@@ -433,6 +433,38 @@ public class BiomeBase { + return this.l; } + // Paper start - keep track of data in a pair set to give O(1) contains calls - we have to hook removals incase plugins mess with it @@ -63,6 +63,6 @@ index 253890e53702f9ba1c6628cc860a4ca10756626a..0102a170dc333fb4af01efa0aaa66df8 + } + // Paper end + - public static class a { + public static class d { - @Nullable + public static final Codec a = RecordCodecBuilder.create((instance) -> { diff --git a/Spigot-Server-Patches/0297-Implement-furnace-cook-speed-multiplier-API.patch b/Spigot-Server-Patches/0294-Implement-furnace-cook-speed-multiplier-API.patch similarity index 86% rename from Spigot-Server-Patches/0297-Implement-furnace-cook-speed-multiplier-API.patch rename to Spigot-Server-Patches/0294-Implement-furnace-cook-speed-multiplier-API.patch index a2cb14df35..9acaf329a6 100644 --- a/Spigot-Server-Patches/0297-Implement-furnace-cook-speed-multiplier-API.patch +++ b/Spigot-Server-Patches/0294-Implement-furnace-cook-speed-multiplier-API.patch @@ -6,18 +6,18 @@ Subject: [PATCH] Implement furnace cook speed multiplier API Signed-off-by: Tassu diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index 560e2f42b702c5c4870640ad7da3aa48c3f4b1eb..d5432bfeb727baadd8614384d3e50314de5f8dc4 100644 +index 623cd63711c6cb79dce7a46056e193fdb13334a5..f4f50fb8375fec3f6868bbccc50bc78a5cd81965 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java -@@ -8,6 +8,7 @@ import java.util.Map; - import java.util.Map.Entry; +@@ -10,6 +10,7 @@ import java.util.List; + import java.util.Map; import javax.annotation.Nullable; // CraftBukkit start +import java.util.List; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.craftbukkit.inventory.CraftItemStack; -@@ -26,6 +27,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +@@ -28,6 +29,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I protected NonNullList items; public int burnTime; private int ticksForCurrentFuel; @@ -25,8 +25,8 @@ index 560e2f42b702c5c4870640ad7da3aa48c3f4b1eb..d5432bfeb727baadd8614384d3e50314 public int cookTime; public int cookTimeTotal; protected final IContainerProperties b; -@@ -212,6 +214,11 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I - this.n.put(minecraftkey, j); +@@ -228,6 +230,11 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + this.n.put(new MinecraftKey(s), nbttagcompound1.getInt(s)); } + // Paper start - cook speed API @@ -37,15 +37,15 @@ index 560e2f42b702c5c4870640ad7da3aa48c3f4b1eb..d5432bfeb727baadd8614384d3e50314 } @Override -@@ -220,6 +227,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +@@ -236,6 +243,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I nbttagcompound.setShort("BurnTime", (short) this.burnTime); nbttagcompound.setShort("CookTime", (short) this.cookTime); nbttagcompound.setShort("CookTimeTotal", (short) this.cookTimeTotal); + nbttagcompound.setDouble("Paper.CookSpeedMultiplier", this.cookSpeedMultiplier); // Paper - cook speed multiplier API ContainerUtil.a(nbttagcompound, this.items); - nbttagcompound.setShort("RecipesUsedSize", (short) this.n.size()); - int i = 0; -@@ -283,8 +291,8 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + +@@ -295,8 +303,8 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I } if (this.isBurning() && this.canBurn(irecipe)) { diff --git a/Spigot-Server-Patches/0299-Optimize-Server-World-Map.patch b/Spigot-Server-Patches/0295-Optimize-Server-World-Map.patch similarity index 71% rename from Spigot-Server-Patches/0299-Optimize-Server-World-Map.patch rename to Spigot-Server-Patches/0295-Optimize-Server-World-Map.patch index 88931df1f5..8c39dc1f94 100644 --- a/Spigot-Server-Patches/0299-Optimize-Server-World-Map.patch +++ b/Spigot-Server-Patches/0295-Optimize-Server-World-Map.patch @@ -21,13 +21,15 @@ known NMS used methods, but we can add more if naughty plugins are found later. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldMap.java b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java new file mode 100644 -index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed44833726544f2c6011 +index 0000000000000000000000000000000000000000..0f0c5330c364909c85cc8cf58fb5c478ffdaeb25 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java -@@ -0,0 +1,191 @@ +@@ -0,0 +1,193 @@ +package com.destroystokyo.paper; + +import net.minecraft.server.DimensionManager; ++import net.minecraft.server.ResourceKey; ++import net.minecraft.server.World; +import net.minecraft.server.WorldServer; + +import javax.annotation.Nonnull; @@ -40,7 +42,7 @@ index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed4483372654 +import java.util.Map; +import java.util.Set; + -+public class PaperWorldMap extends HashMap { ++public class PaperWorldMap extends HashMap, WorldServer> { + private final List worlds = new ArrayList<>(); + private final List worldsIterable = new ArrayList() { + @Override @@ -80,10 +82,10 @@ index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed4483372654 + @Override + public WorldServer get(Object key) { + // Will hit the below method -+ return key instanceof DimensionManager ? get((DimensionManager) key) : null; ++ return key instanceof ResourceKey ? get((ResourceKey) key) : null; + } -+ -+ public WorldServer get(DimensionManager key) { ++ // TODO figure out what to do with dimension ids ++ public WorldServer get(ResourceKey key) { + int id = key.getDimensionID()+1; + return worlds.size() > id ? worlds.get(id) : null; + } @@ -98,7 +100,7 @@ index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed4483372654 + } + + @Override -+ public WorldServer put(DimensionManager key, WorldServer value) { ++ public WorldServer put(ResourceKey key, WorldServer value) { + while (worlds.size() <= key.getDimensionID()+1) { + worlds.add(null); + } @@ -111,8 +113,8 @@ index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed4483372654 + } + + @Override -+ public void putAll(Map m) { -+ for (Entry e : m.entrySet()) { ++ public void putAll(Map, ? extends WorldServer> m) { ++ for (Entry, ? extends WorldServer> e : m.entrySet()) { + put(e.getKey(), e.getValue()); + } + } @@ -142,17 +144,17 @@ index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed4483372654 + + @Override + public boolean containsValue(Object value) { -+ return value instanceof WorldServer && get(((WorldServer) value).worldProvider.getDimensionManager()) != null; ++ return value instanceof WorldServer && get(((WorldServer) value).getDimensionKey()) != null; + } + + @Nonnull + @Override -+ public Set keySet() { -+ return new AbstractSet() { ++ public Set> keySet() { ++ return new AbstractSet>() { + @Override -+ public Iterator iterator() { ++ public Iterator> iterator() { + Iterator iterator = worldsIterable.iterator(); -+ return new Iterator() { ++ return new Iterator>() { + + @Override + public boolean hasNext() { @@ -160,8 +162,8 @@ index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed4483372654 + } + + @Override -+ public DimensionManager next() { -+ return iterator.next().worldProvider.getDimensionManager(); ++ public ResourceKey next() { ++ return iterator.next().getDimensionKey(); + } + + @Override @@ -184,12 +186,12 @@ index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed4483372654 + } + + @Override -+ public Set> entrySet() { -+ return new AbstractSet>() { ++ public Set, WorldServer>> entrySet() { ++ return new AbstractSet, WorldServer>>() { + @Override -+ public Iterator> iterator() { ++ public Iterator, WorldServer>> iterator() { + Iterator iterator = worldsIterable.iterator(); -+ return new Iterator>() { ++ return new Iterator, WorldServer>>() { + + @Override + public boolean hasNext() { @@ -197,9 +199,9 @@ index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed4483372654 + } + + @Override -+ public Entry next() { ++ public Entry, WorldServer> next() { + WorldServer entry = iterator.next(); -+ return new SimpleEntry<>(entry.worldProvider.getDimensionManager(), entry); ++ return new SimpleEntry<>(entry.getDimensionKey(), entry); + } + + @Override @@ -217,32 +219,24 @@ index 0000000000000000000000000000000000000000..6bb2f98b4574bff7ac50ed4483372654 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 85f989829b5ad1d7681b57cf68519a4806b26ea1..bbda856c148588402731c03cd166acd2e1f4eee3 100644 +index 6a42e480940c4081622050c07961a2c56cfaa542..16a8300a202e0b33b6de472a72ebf74653bafc20 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -88,7 +88,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant worldServer = Maps.newLinkedHashMap(); // CraftBukkit - keep order, k+v already use identity methods -+ public final Map worldServer = new com.destroystokyo.paper.PaperWorldMap(); // Paper; + private int serverPort; + public final IRegistryCustom.Dimension f; +- public final Map, WorldServer> worldServer; ++ public final Map, WorldServer> worldServer = new com.destroystokyo.paper.PaperWorldMap(); // Paper; private PlayerList playerList; - private volatile boolean isRunning = true; + private volatile boolean isRunning; private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart -@@ -459,7 +459,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant -Date: Wed, 12 Sep 2018 21:12:57 -0400 -Subject: [PATCH] Prevent mob spawning from loading/generating chunks - -also prevents if out of world border bounds - -diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 224443e03c9e55af2744eebd7e754e2a1b3fa296..fdac5bb3a2d4a73035e1d914979b87fc224b6b20 100644 ---- a/src/main/java/net/minecraft/server/SpawnerCreature.java -+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -25,9 +25,9 @@ public final class SpawnerCreature { - int l = blockposition1.getZ(); - - if (k >= 1) { -- IBlockData iblockdata = chunk.getType(blockposition1); -+ IBlockData iblockdata = worldserver.getTypeIfLoadedAndInBounds(blockposition1); // Paper - don't load chunks for mob spawn - -- if (!iblockdata.isOccluding(chunk, blockposition1)) { -+ if (iblockdata != null && !iblockdata.isOccluding(chunk, blockposition1)) { // Paper - don't load chunks for mob spawn - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); - int i1 = 0; - -@@ -55,7 +55,7 @@ public final class SpawnerCreature { - if (entityhuman != null) { - double d0 = entityhuman.g((double) f, (double) k, (double) f1); - -- if (d0 > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D)) { -+ if (d0 > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D) && worldserver.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn - ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition_mutableblockposition); - - if (Objects.equals(chunkcoordintpair, chunk.getPos()) || worldserver.getChunkProvider().a(chunkcoordintpair)) { diff --git a/Spigot-Server-Patches/0300-PreSpawnerSpawnEvent.patch b/Spigot-Server-Patches/0296-PreSpawnerSpawnEvent.patch similarity index 94% rename from Spigot-Server-Patches/0300-PreSpawnerSpawnEvent.patch rename to Spigot-Server-Patches/0296-PreSpawnerSpawnEvent.patch index 3b94d0fa02..7126767ccf 100644 --- a/Spigot-Server-Patches/0300-PreSpawnerSpawnEvent.patch +++ b/Spigot-Server-Patches/0296-PreSpawnerSpawnEvent.patch @@ -9,7 +9,7 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for spawners. diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 43c491f71b7739c782b46ee77ff8debe44213f11..cb7cb789b82461093fbbb4c8ae6d03fcbfe57383 100644 +index 45cd44335427a818a580158d57025289f37079bf..e2f5354709819e56f9bc66b8c8d5e095bc8387b4 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -111,11 +111,11 @@ public abstract class MobSpawnerAbstract { diff --git a/Spigot-Server-Patches/0301-Catch-JsonParseException-in-Entity-and-TE-names.patch b/Spigot-Server-Patches/0297-Catch-JsonParseException-in-Entity-and-TE-names.patch similarity index 69% rename from Spigot-Server-Patches/0301-Catch-JsonParseException-in-Entity-and-TE-names.patch rename to Spigot-Server-Patches/0297-Catch-JsonParseException-in-Entity-and-TE-names.patch index 0547b7b897..26c0bd7f92 100644 --- a/Spigot-Server-Patches/0301-Catch-JsonParseException-in-Entity-and-TE-names.patch +++ b/Spigot-Server-Patches/0297-Catch-JsonParseException-in-Entity-and-TE-names.patch @@ -13,10 +13,10 @@ Shulkers) may need to be changed in order for it to re-save properly No more crashing though. diff --git a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java -index 786712297435fed5247abd577efd092bcb9c44cb..ef2a496eda45ae5ee8fe52ef09e77c2906069d2e 100644 +index 850e79b764513bd68a28b675e075f804f59b75a8..7e13b1cf6d92c3e0f2dab1ba1d42bd4f250e256c 100644 --- a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java +++ b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java -@@ -59,7 +59,7 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener { +@@ -60,7 +60,7 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener { this.command = nbttagcompound.getString("Command"); this.successCount = nbttagcompound.getInt("SuccessCount"); if (nbttagcompound.hasKeyOfType("CustomName", 8)) { @@ -25,24 +25,11 @@ index 786712297435fed5247abd577efd092bcb9c44cb..ef2a496eda45ae5ee8fe52ef09e77c29 } if (nbttagcompound.hasKeyOfType("TrackOutput", 1)) { -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 0f74ec89b3e85c918c95f9d8fef6d68403ed1107..4609e402b419ed21e17ad34d02dca55b47c1c95e 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1680,7 +1680,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.Z(); - this.setYawPitch(this.yaw, this.pitch); - if (nbttagcompound.hasKeyOfType("CustomName", 8)) { -- this.setCustomName(IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"))); -+ this.setCustomName(MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound)); // Paper - Catch ParseException - } - - this.setCustomNameVisible(nbttagcompound.getBoolean("CustomNameVisible")); diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 148917547bb7a626d1b2bacce7385607043db7e2..49178cbcebe7e7af9e9a2485ae11058fd1c6b20f 100644 +index 797654c653ec6dc4d46b457cf8a6121b29eca7aa..2eacc5de340ca5558d9a0cba9baa26bbebef714d 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -518,4 +518,19 @@ public final class MCUtil { +@@ -506,4 +506,19 @@ public final class MCUtil { return null; } } @@ -63,12 +50,12 @@ index 148917547bb7a626d1b2bacce7385607043db7e2..49178cbcebe7e7af9e9a2485ae11058f + } } diff --git a/src/main/java/net/minecraft/server/TileEntityBanner.java b/src/main/java/net/minecraft/server/TileEntityBanner.java -index 93911a825154d04dd3f1495b1bab5a3ab2aea30b..d35604edb21441032bce87d658b76b39fea917fc 100644 +index 4f886c4145325d8fd8217ae3f681632f0396689f..5397d8a69a0326cf73fe0ee1175d1871cac3769d 100644 --- a/src/main/java/net/minecraft/server/TileEntityBanner.java +++ b/src/main/java/net/minecraft/server/TileEntityBanner.java @@ -60,7 +60,7 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity { - public void load(NBTTagCompound nbttagcompound) { - super.load(nbttagcompound); + public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) { + super.load(iblockdata, nbttagcompound); if (nbttagcompound.hasKeyOfType("CustomName", 8)) { - this.a = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")); + this.a = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException @@ -76,11 +63,11 @@ index 93911a825154d04dd3f1495b1bab5a3ab2aea30b..d35604edb21441032bce87d658b76b39 if (this.hasWorld()) { diff --git a/src/main/java/net/minecraft/server/TileEntityContainer.java b/src/main/java/net/minecraft/server/TileEntityContainer.java -index 473ec2cbde5b31398f57bf9ab7034139572fa666..ab6b86e4e9f99a60140187c06480cf511327a710 100644 +index 8f94b9c52c3842b9c32280499aee1b551dc16095..74390aebd353c969353a6efc0904bafe30774d65 100644 --- a/src/main/java/net/minecraft/server/TileEntityContainer.java +++ b/src/main/java/net/minecraft/server/TileEntityContainer.java @@ -17,7 +17,7 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento - super.load(nbttagcompound); + super.load(iblockdata, nbttagcompound); this.chestLock = ChestLock.b(nbttagcompound); if (nbttagcompound.hasKeyOfType("CustomName", 8)) { - this.customName = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")); diff --git a/Spigot-Server-Patches/0303-Honor-EntityAgeable.ageLock.patch b/Spigot-Server-Patches/0298-Honor-EntityAgeable.ageLock.patch similarity index 77% rename from Spigot-Server-Patches/0303-Honor-EntityAgeable.ageLock.patch rename to Spigot-Server-Patches/0298-Honor-EntityAgeable.ageLock.patch index 85785a67e9..f25452fae7 100644 --- a/Spigot-Server-Patches/0303-Honor-EntityAgeable.ageLock.patch +++ b/Spigot-Server-Patches/0298-Honor-EntityAgeable.ageLock.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Honor EntityAgeable.ageLock diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java -index cec938436d2fb4ba9cafa57af7b447b2a0df0f9f..3d27f0964a5808af5fd6d1519c91071e50bc239d 100644 +index 8665ac06c6d2eb70127f1a12cb8c44de569a97f9..d861a96b4cb5a5480deb93708207002da782bb51 100644 --- a/src/main/java/net/minecraft/server/EntityAgeable.java +++ b/src/main/java/net/minecraft/server/EntityAgeable.java -@@ -101,6 +101,7 @@ public abstract class EntityAgeable extends EntityCreature { +@@ -73,6 +73,7 @@ public abstract class EntityAgeable extends EntityCreature { } public void setAge(int i, boolean flag) { diff --git a/Spigot-Server-Patches/0304-Configurable-connection-throttle-kick-message.patch b/Spigot-Server-Patches/0299-Configurable-connection-throttle-kick-message.patch similarity index 75% rename from Spigot-Server-Patches/0304-Configurable-connection-throttle-kick-message.patch rename to Spigot-Server-Patches/0299-Configurable-connection-throttle-kick-message.patch index 2537b2ac2d..1ba9b14279 100644 --- a/Spigot-Server-Patches/0304-Configurable-connection-throttle-kick-message.patch +++ b/Spigot-Server-Patches/0299-Configurable-connection-throttle-kick-message.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable connection throttle kick message diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 559e6b42ba5bf0ea92cccbabd2ef1d4c27b03064..092bff78ab5288ede0cdeaa94a59190b79aea239 100644 +index 214b577b326bc794fa3721deb6171228dd4f25e6..19c5d2047040c43711339a0206bd01df8e03b5ea 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -274,6 +274,11 @@ public class PaperConfig { +@@ -272,6 +272,11 @@ public class PaperConfig { authenticationServersDownKickMessage = Strings.emptyToNull(getString("messages.kick.authentication-servers-down", authenticationServersDownKickMessage)); } @@ -21,15 +21,15 @@ index 559e6b42ba5bf0ea92cccbabd2ef1d4c27b03064..092bff78ab5288ede0cdeaa94a59190b private static void savePlayerData() { savePlayerData = getBoolean("settings.save-player-data", savePlayerData); diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index 8928d93e49bec174e86a2b451ac40f3946193009..0532f975b7af5b3f2916c26141221cd3701765d0 100644 +index 8049f54f049122b065ea30e7e831c33486a83b7e..401e89079934929ddf29b126e9c4908d93321df8 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java -@@ -38,7 +38,7 @@ public class HandshakeListener implements PacketHandshakingInListener { +@@ -37,7 +37,7 @@ public class HandshakeListener implements PacketHandshakingInListener { synchronized (throttleTracker) { if (throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - throttleTracker.get(address) < connectionThrottle) { throttleTracker.put(address, currentTime); - chatmessage = new ChatMessage("Connection throttled! Please wait before reconnecting."); -+ chatmessage = new ChatMessage(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message - this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage)); - this.b.close(chatmessage); ++ chatmessage = new ChatMessage(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message + this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage)); + this.c.close(chatmessage); return; diff --git a/Spigot-Server-Patches/0305-Hook-into-CB-plugin-rewrites.patch b/Spigot-Server-Patches/0300-Hook-into-CB-plugin-rewrites.patch similarity index 87% rename from Spigot-Server-Patches/0305-Hook-into-CB-plugin-rewrites.patch rename to Spigot-Server-Patches/0300-Hook-into-CB-plugin-rewrites.patch index 7ce2295ff8..fc0c5bd6f9 100644 --- a/Spigot-Server-Patches/0305-Hook-into-CB-plugin-rewrites.patch +++ b/Spigot-Server-Patches/0300-Hook-into-CB-plugin-rewrites.patch @@ -7,21 +7,8 @@ Allows us to do fun stuff like rewrite the OBC util fastutil location to our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. -diff --git a/pom.xml b/pom.xml -index fc2921e9783f2db63b71c6e244e24c9416cdbf76..64bd667e8b11263e483364efc3414396819a255c 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -87,7 +87,7 @@ - - org.ow2.asm - asm -- 7.3.1 -+ 8.0.1 - compile - - diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 9b4a0f0678a7e8e347ef062ad15562484a74452b..4ae41fd2557dcc2a8e31d39ed978b2b26093dd06 100644 +index ac48431777b70c200f9e4113c8a0c03957126e90..6ef2baa62cdc36c2363973f4b9235085cfb8aba6 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -6,7 +6,9 @@ import java.io.FileOutputStream; @@ -93,12 +80,9 @@ index 9b4a0f0678a7e8e347ef062ad15562484a74452b..4ae41fd2557dcc2a8e31d39ed978b2b2 public static void main(String[] args) { OptionParser parser = new OptionParser(); -@@ -128,17 +171,92 @@ public class Commodore - ClassReader cr = new ClassReader( b ); - ClassWriter cw = new ClassWriter( cr, 0 ); +@@ -130,15 +173,86 @@ public class Commodore -- cr.accept( new ClassVisitor( Opcodes.ASM7, cw ) -+ cr.accept( new ClassVisitor( Opcodes.ASM8, cw) // Paper + cr.accept( new ClassVisitor( Opcodes.ASM8, cw ) { + // Paper start - Rewrite plugins + @Override @@ -160,8 +144,6 @@ index 9b4a0f0678a7e8e347ef062ad15562484a74452b..4ae41fd2557dcc2a8e31d39ed978b2b2 + super.visitFrame( type, nLocal, local, nStack, stack ); + } + -+ -+ + @Override + public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index) + { @@ -170,8 +152,6 @@ index 9b4a0f0678a7e8e347ef062ad15562484a74452b..4ae41fd2557dcc2a8e31d39ed978b2b2 + super.visitLocalVariable( name, descriptor, signature, start, end, index ); + } + // Paper end -+ -+ @Override public void visitFieldInsn(int opcode, String owner, String name, String desc) @@ -184,10 +164,10 @@ index 9b4a0f0678a7e8e347ef062ad15562484a74452b..4ae41fd2557dcc2a8e31d39ed978b2b2 + } + // Paper end + - if ( modern ) + if ( owner.equals( "org/bukkit/block/Biome" ) ) { - if ( owner.equals( "org/bukkit/Material" ) ) -@@ -237,6 +355,14 @@ public class Commodore + switch ( name ) +@@ -260,6 +374,14 @@ public class Commodore return; } diff --git a/Spigot-Server-Patches/0306-Allow-setting-the-vex-s-summoner.patch b/Spigot-Server-Patches/0301-Allow-setting-the-vex-s-summoner.patch similarity index 89% rename from Spigot-Server-Patches/0306-Allow-setting-the-vex-s-summoner.patch rename to Spigot-Server-Patches/0301-Allow-setting-the-vex-s-summoner.patch index 48073d132f..1ec7fb6b26 100644 --- a/Spigot-Server-Patches/0306-Allow-setting-the-vex-s-summoner.patch +++ b/Spigot-Server-Patches/0301-Allow-setting-the-vex-s-summoner.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow setting the vex's summoner diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java -index a46730460e5d9f6e52d63ba1950d1e7195fe87cd..cf274666c70695ef597b2f5651c18c60702c2dc1 100644 +index ab4ac736f8fcda1ed6b58abe0a4ecba58d3b5d43..99a98e37ebd292f8fb1c3613348bd6dd51e9191b 100644 --- a/src/main/java/net/minecraft/server/EntityVex.java +++ b/src/main/java/net/minecraft/server/EntityVex.java -@@ -133,6 +133,7 @@ public class EntityVex extends EntityMonster { +@@ -130,6 +130,7 @@ public class EntityVex extends EntityMonster { this.a(1, flag); } diff --git a/Spigot-Server-Patches/0307-Add-sun-related-API.patch b/Spigot-Server-Patches/0302-Add-sun-related-API.patch similarity index 79% rename from Spigot-Server-Patches/0307-Add-sun-related-API.patch rename to Spigot-Server-Patches/0302-Add-sun-related-API.patch index b6b1d73cac..6ef848fd8e 100644 --- a/Spigot-Server-Patches/0307-Add-sun-related-API.patch +++ b/Spigot-Server-Patches/0302-Add-sun-related-API.patch @@ -5,22 +5,22 @@ Subject: [PATCH] Add sun related API diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index b5816dc89ede5f5f1780d3086d9b1a41fba2b19d..bed15873b675bbd05c0149d655f9fb165bbbc73e 100644 +index a38a1f3447accd51dcd295fb28c4108cb87ad832..df98f2244a161c0e66e80f92c91760409734dc69 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1341,6 +1341,7 @@ public abstract class EntityInsentient extends EntityLiving { - return flag; +@@ -1509,6 +1509,7 @@ public abstract class EntityInsentient extends EntityLiving { + } -+ public boolean isInDaylight() { return this.en(); } // Paper - OBFHELPER - protected boolean en() { ++ public boolean isInDaylight() { return this.eH(); } // Paper - OBFHELPER + protected boolean eH() { if (this.world.isDay() && !this.world.isClientSide) { - float f = this.aI(); + float f = this.aO(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4e7b11af047c267ce87549e0ba178d7223c03b63..07729667f5c66bbcb85fc59cb5fa3c218efa2ec8 100644 +index e446bd936dd198b227e483cf8e234a73035daa76..fb7e4e2f02b62f7cfeec6a619a4c2943cc071c46 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -858,6 +858,13 @@ public class CraftWorld implements World { +@@ -862,6 +862,13 @@ public class CraftWorld implements World { } } diff --git a/Spigot-Server-Patches/0310-Turtle-API.patch b/Spigot-Server-Patches/0303-Turtle-API.patch similarity index 61% rename from Spigot-Server-Patches/0310-Turtle-API.patch rename to Spigot-Server-Patches/0303-Turtle-API.patch index 96bf18cff1..3052a291a7 100644 --- a/Spigot-Server-Patches/0310-Turtle-API.patch +++ b/Spigot-Server-Patches/0303-Turtle-API.patch @@ -5,80 +5,64 @@ 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 76296119a197a433747ee2481079b36aebdb085c..dd02cb3485021c3afd23c2985a71e93c6b0ab07d 100644 +index dd745894614982fad6277e77b98bed75fc2a2f55..5862e2026b685df80de45c529f1367382a2a60b0 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 { - this.H = 1.0F; +@@ -27,10 +27,12 @@ public class EntityTurtle extends EntityAnimal { + this.G = 1.0F; } -+ public final void setHome(BlockPosition pos) { g(pos); } // Paper - OBFHELPER - public void g(BlockPosition blockposition) { - this.datawatcher.set(EntityTurtle.bx, blockposition); ++ public final void setHome(BlockPosition pos) { setHomePos(pos); } // Paper - OBFHELPER + public void setHomePos(BlockPosition blockposition) { + this.datawatcher.set(EntityTurtle.bw, blockposition); + } +- ++ // TODO Paper: Obf helpers here can prolly be removed? check that no newer patches use them ++ public final BlockPosition getHome() { return this.getHomePos(); } // Paper - OBFHELPER + private BlockPosition getHomePos() { + return (BlockPosition) this.datawatcher.get(EntityTurtle.bw); + } +@@ -51,27 +53,33 @@ public class EntityTurtle extends EntityAnimal { + this.datawatcher.set(EntityTurtle.bx, flag); } -+ public final BlockPosition getHome() { return this.es(); } // Paper - OBFHELPER - private BlockPosition es() { - return (BlockPosition) this.datawatcher.get(EntityTurtle.bx); - } - -+ public final void setTravelPos(BlockPosition pos) { this.h(pos); } // Paper - OBFHELPER - private void h(BlockPosition blockposition) { - this.datawatcher.set(EntityTurtle.bA, blockposition); - } - -+ public final BlockPosition getTravelPos() { return this.et(); } // Paper - OBFHELPER - private BlockPosition et() { - return (BlockPosition) this.datawatcher.get(EntityTurtle.bA); - } - -+ public final boolean hasEgg() { return this.eq(); } // Paper - OBFHELPER - public boolean eq() { ++ public final boolean isDigging() { return this.eM(); } // Paper - OBFHELPER + public boolean eM() { return (Boolean) this.datawatcher.get(EntityTurtle.by); } -+ public final void setHasEgg(boolean hasEgg) { this.r(hasEgg); } // Paper - OBFHELPER - private void r(boolean flag) { ++ public final void setDigging(boolean digging) { this.u(digging); } // Paper - OBFHELPER + private void u(boolean flag) { + this.bC = flag ? 1 : 0; this.datawatcher.set(EntityTurtle.by, flag); } -+ public final boolean isDigging() { return this.er(); } // Paper - OBFHELPER - public boolean er() { - return (Boolean) this.datawatcher.get(EntityTurtle.bz); ++ public final boolean isGoingHome() { return this.eV(); } // Paper - OBFHELPER + private boolean eV() { + return (Boolean) this.datawatcher.get(EntityTurtle.bA); } -+ public final void setDigging(boolean digging) { this.s(digging); } // Paper - OBFHELPER - private void s(boolean flag) { - this.bD = flag ? 1 : 0; - this.datawatcher.set(EntityTurtle.bz, flag); ++ public final void setGoingHome(boolean goingHome) { this.v(goingHome); } // Paper - OBFHELPER + private void v(boolean flag) { + this.datawatcher.set(EntityTurtle.bA, flag); } -+ public final boolean isGoingHome() { return this.eu(); } // Paper - OBFHELPER - private boolean eu() { ++ public final boolean isTravelling() { return this.eW(); } // Paper - OBFHELPER + private boolean eW() { return (Boolean) this.datawatcher.get(EntityTurtle.bB); } -+ public final void setGoingHome(boolean goingHome) { this.t(goingHome); } // Paper - OBFHELPER - private void t(boolean flag) { ++ public final void setTravelling(boolean travelling) { this.w(travelling); } // Paper - OBFHELPER + private void w(boolean flag) { this.datawatcher.set(EntityTurtle.bB, flag); } - -+ public final boolean isTravelling() { return this.ez(); } // Paper - OBFHELPER - private boolean ez() { - return (Boolean) this.datawatcher.get(EntityTurtle.bC); - } - -+ public final void setTravelling(boolean travelling) { this.u(travelling); } // Paper - OBFHELPER - private void u(boolean flag) { - this.datawatcher.set(EntityTurtle.bC, flag); - } -@@ -443,14 +455,17 @@ public class EntityTurtle extends EntityAnimal { +@@ -438,14 +446,17 @@ public class EntityTurtle extends EntityAnimal { if (!this.g.isInWater() && this.k()) { - if (this.g.bD < 1) { -- this.g.s(true); + if (this.g.bC < 1) { +- this.g.u(true); + this.g.setDigging(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.g.getBukkitEntity(), MCUtil.toLocation(this.g.world, this.e)).callEvent()); // Paper - } else if (this.g.bD > 200) { + } else if (this.g.bC > 200) { World world = this.g.world; // CraftBukkit start @@ -92,13 +76,13 @@ index 76296119a197a433747ee2481079b36aebdb085c..dd02cb3485021c3afd23c2985a71e93c + world.setTypeAndData(this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, layEggEvent.getEggCount()), 3); } // CraftBukkit end - this.g.r(false); -@@ -585,7 +600,7 @@ public class EntityTurtle extends EntityAnimal { + this.g.setHasEgg(false); +@@ -574,7 +585,7 @@ public class EntityTurtle extends EntityAnimal { @Override public boolean a() { -- return this.a.isBaby() ? false : (this.a.eq() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.es().a((IPosition) this.a.getPositionVector(), 64.0D))); -+ return this.a.isBaby() ? false : (this.a.eq() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.es().a((IPosition) this.a.getPositionVector(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.a.getBukkitEntity()).callEvent(); // Paper +- return this.a.isBaby() ? false : (this.a.hasEgg() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.getHomePos().a((IPosition) this.a.getPositionVector(), 64.0D))); ++ return this.a.isBaby() ? false : (this.a.hasEgg() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.getHomePos().a((IPosition) this.a.getPositionVector(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.a.getBukkitEntity()).callEvent(); // Paper } @Override diff --git a/Spigot-Server-Patches/0304-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/Spigot-Server-Patches/0304-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch new file mode 100644 index 0000000000..32df6d42f5 --- /dev/null +++ b/Spigot-Server-Patches/0304-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 17 Oct 2018 19:17:27 -0400 +Subject: [PATCH] MC-50319: Check other worlds for shooter of projectiles + +Say a player shoots an arrow through a nether portal, the game +would lose the shooter for determining things such as Player Kills, +because the entity is in another world. + +If the projectile fails to find the shooter in the current world, check +other worlds. + +diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java +index f85d80d7bb3e4e92bb8d281dfe577f663ebe9da1..ceecb0520a63d2eff5f4cadf45fa49f56eaea8dd 100644 +--- a/src/main/java/net/minecraft/server/IProjectile.java ++++ b/src/main/java/net/minecraft/server/IProjectile.java +@@ -29,7 +29,18 @@ public abstract class IProjectile extends Entity { + + @Nullable + public Entity getShooter() { +- return this.shooter != null && this.world instanceof WorldServer ? ((WorldServer) this.world).getEntity(this.shooter) : (this.c != 0 ? this.world.getEntity(this.c) : null); ++ // Paper start - MC-50319 - shooter might be in another world (arrows through portals) ++ Entity entity = this.shooter != null && this.world instanceof WorldServer ? ((WorldServer) this.world).getEntity(this.shooter) : (this.c != 0 ? this.world.getEntity(this.c) : null); ++ if (entity == null) { ++ for (WorldServer world : world.getMinecraftServer().getWorlds()) { ++ entity = world.getEntity(this.shooter); ++ if (entity != null) { ++ break; ++ } ++ } ++ } ++ return entity; ++ // Paper end + } + + @Override diff --git a/Spigot-Server-Patches/0313-Call-player-spectator-target-events-and-improve-impl.patch b/Spigot-Server-Patches/0305-Call-player-spectator-target-events-and-improve-impl.patch similarity index 94% rename from Spigot-Server-Patches/0313-Call-player-spectator-target-events-and-improve-impl.patch rename to Spigot-Server-Patches/0305-Call-player-spectator-target-events-and-improve-impl.patch index 1a9a7a8a82..5e91efce62 100644 --- a/Spigot-Server-Patches/0313-Call-player-spectator-target-events-and-improve-impl.patch +++ b/Spigot-Server-Patches/0305-Call-player-spectator-target-events-and-improve-impl.patch @@ -19,10 +19,10 @@ spectate the target entity. Co-authored-by: Spottedleaf diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index f43584f0e31a1c3d0e9b4356b7021cd79226d8b5..3175b0735f3b5f4d7e3e02dc083d32262d463de7 100644 +index 7a0391dc2861d604f1f3acc53eb9e1134c33c64f..9972ee33433914ef9abc5075f274e58d46a9192f 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1586,15 +1586,59 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1694,15 +1694,59 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity); } @@ -88,10 +88,10 @@ index f43584f0e31a1c3d0e9b4356b7021cd79226d8b5..3175b0735f3b5f4d7e3e02dc083d3226 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e7ad580740bab3e102f32bd715c6b01a0e721e09..577268fed52bfc2657ef03099cbebeb0adabdf94 100644 +index 6884fcd0749eba2dc84f1447b338a879ff79f0c8..54e70688c94343ba3988eb775993c61bbc807bcc 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1110,6 +1110,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1132,6 +1132,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } // CraftBukkit start - Delegate to teleport(Location) diff --git a/Spigot-Server-Patches/0314-Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/0306-Add-Velocity-IP-Forwarding-Support.patch similarity index 91% rename from Spigot-Server-Patches/0314-Add-Velocity-IP-Forwarding-Support.patch rename to Spigot-Server-Patches/0306-Add-Velocity-IP-Forwarding-Support.patch index 5c21db0604..6978ec5f38 100644 --- a/Spigot-Server-Patches/0314-Add-Velocity-IP-Forwarding-Support.patch +++ b/Spigot-Server-Patches/0306-Add-Velocity-IP-Forwarding-Support.patch @@ -14,7 +14,7 @@ forwarding, and is integrated into the Minecraft login process by using the 1.13 login plugin message packet. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 092bff78ab5288ede0cdeaa94a59190b79aea239..79cf4e598fedf75e5ee943acb7930cb265dd11f6 100644 +index 19c5d2047040c43711339a0206bd01df8e03b5ea..29cab8730a5e61aeb8bf4d69ccad192c1ff975f4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -8,6 +8,7 @@ import java.io.IOException; @@ -25,7 +25,7 @@ index 092bff78ab5288ede0cdeaa94a59190b79aea239..79cf4e598fedf75e5ee943acb7930cb2 import java.util.HashMap; import java.util.List; import java.util.Map; -@@ -245,7 +246,7 @@ public class PaperConfig { +@@ -243,7 +244,7 @@ public class PaperConfig { } public static boolean isProxyOnlineMode() { @@ -34,9 +34,9 @@ index 092bff78ab5288ede0cdeaa94a59190b79aea239..79cf4e598fedf75e5ee943acb7930cb2 } public static int packetInSpamThreshold = 300; -@@ -336,4 +337,21 @@ public class PaperConfig { - } +@@ -315,4 +316,21 @@ public class PaperConfig { } + tabSpamLimit = getInt("settings.spam-limiter.tab-spam-limit", tabSpamLimit); } + + public static boolean velocitySupport; @@ -130,10 +130,10 @@ index 0000000000000000000000000000000000000000..fdd8708f974700c7cde6e436c2f189d9 + } +} diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 1c4ac7bf7ac4d864ba6efd46d8c562c238dad2bc..47cf105019b3ea28f413274d234a34cdb41941dd 100644 +index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..57520943befea80b334ccf2385057b88131ddd8e 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java -@@ -42,6 +42,7 @@ public class LoginListener implements PacketLoginInListener { +@@ -41,6 +41,7 @@ public class LoginListener implements PacketLoginInListener { private SecretKey loginKey; private EntityPlayer l; public String hostname = ""; // CraftBukkit - add field @@ -141,7 +141,7 @@ index 1c4ac7bf7ac4d864ba6efd46d8c562c238dad2bc..47cf105019b3ea28f413274d234a34cd public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) { this.g = LoginListener.EnumProtocolState.HELLO; -@@ -193,6 +194,14 @@ public class LoginListener implements PacketLoginInListener { +@@ -192,6 +193,14 @@ public class LoginListener implements PacketLoginInListener { this.g = LoginListener.EnumProtocolState.KEY; this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.getKeyPair().getPublic(), this.e)); } else { @@ -156,7 +156,7 @@ index 1c4ac7bf7ac4d864ba6efd46d8c562c238dad2bc..47cf105019b3ea28f413274d234a34cd // Spigot start // Paper start - Cache authenticator threads authenticatorPool.execute(new Runnable() { -@@ -285,6 +294,12 @@ public class LoginListener implements PacketLoginInListener { +@@ -284,6 +293,12 @@ public class LoginListener implements PacketLoginInListener { public class LoginHandler { public void fireEvents() throws Exception { @@ -169,7 +169,7 @@ index 1c4ac7bf7ac4d864ba6efd46d8c562c238dad2bc..47cf105019b3ea28f413274d234a34cd String playerName = i.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress(); java.util.UUID uniqueId = i.getId(); -@@ -332,6 +347,35 @@ public class LoginListener implements PacketLoginInListener { +@@ -331,6 +346,35 @@ public class LoginListener implements PacketLoginInListener { // Spigot end public void a(PacketLoginInCustomPayload packetloginincustompayload) { @@ -202,11 +202,11 @@ index 1c4ac7bf7ac4d864ba6efd46d8c562c238dad2bc..47cf105019b3ea28f413274d234a34cd + return; + } + // Paper end - this.disconnect(new ChatMessage("multiplayer.disconnect.unexpected_query_response", new Object[0])); + this.disconnect(new ChatMessage("multiplayer.disconnect.unexpected_query_response")); } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 08e314af7cbd6523bbd0bd5a5ad0a0fff2f080be..046196d54df35ceafb8bc477e740e1dc834345d5 100644 +index 8cb29ddc0d5a5951ea35e1a16c023efb9b0be42d..2916119507ec5ecd9266569b0003d0504a79f6c4 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> { @@ -219,10 +219,10 @@ index 08e314af7cbd6523bbd0bd5a5ad0a0fff2f080be..046196d54df35ceafb8bc477e740e1dc public java.util.UUID spoofedUUID; public com.mojang.authlib.properties.Property[] spoofedProfile; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index e810da87977b441cc329066e3cb158ef3bc62a66..c9a2d42d4fed56db4a1177b0d52292fe591a2540 100644 +index e3ba2e8db98c94ed10e96601addb0110a8385926..6d3db25dd9bf33b08cb6945d8db3c32420efb7e3 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java -@@ -140,6 +140,7 @@ public class PacketDataSerializer extends ByteBuf { +@@ -164,6 +164,7 @@ public class PacketDataSerializer extends ByteBuf { return this.d(oenum.ordinal()); } @@ -230,7 +230,7 @@ index e810da87977b441cc329066e3cb158ef3bc62a66..c9a2d42d4fed56db4a1177b0d52292fe public int i() { int i = 0; int j = 0; -@@ -180,6 +181,7 @@ public class PacketDataSerializer extends ByteBuf { +@@ -204,6 +205,7 @@ public class PacketDataSerializer extends ByteBuf { return this; } @@ -238,7 +238,7 @@ index e810da87977b441cc329066e3cb158ef3bc62a66..c9a2d42d4fed56db4a1177b0d52292fe public UUID k() { return new UUID(this.readLong(), this.readLong()); } -@@ -298,6 +300,7 @@ public class PacketDataSerializer extends ByteBuf { +@@ -322,6 +324,7 @@ public class PacketDataSerializer extends ByteBuf { } } @@ -281,10 +281,10 @@ index ae74dc9e183e66062455cf2a18ab43ae87976046..7eb230f1b27eddf48f1b12fc78877a36 public void a(PacketDataSerializer packetdataserializer) throws IOException { this.a = packetdataserializer.i(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3c43f318c4cff914128e2f7060516ce7ebb6e1c9..7b53ebb6d7cf241c6b89ec04acd0bcc25e1c105a 100644 +index 5cb1eab09a56617c97eb01f902ad4d268eacd7cb..5db8ccb0d30e2927c33b04ff51ebebd0dfe96a63 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -648,7 +648,7 @@ public final class CraftServer implements Server { +@@ -673,7 +673,7 @@ public final class CraftServer implements Server { @Override public long getConnectionThrottle() { // Spigot Start - Automatically set connection throttle for bungee configurations diff --git a/Spigot-Server-Patches/0315-Add-more-Witch-API.patch b/Spigot-Server-Patches/0307-Add-more-Witch-API.patch similarity index 60% rename from Spigot-Server-Patches/0315-Add-more-Witch-API.patch rename to Spigot-Server-Patches/0307-Add-more-Witch-API.patch index b4e2d91dc2..34eb5813ce 100644 --- a/Spigot-Server-Patches/0315-Add-more-Witch-API.patch +++ b/Spigot-Server-Patches/0307-Add-more-Witch-API.patch @@ -5,7 +5,7 @@ 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 be6ecfb08aaba3fc5d96e918b7540fc75c92e89e..7b6b1ad17b600b688d16c4208f4e2ac17b36a257 100644 +index a6142ef24bc5bfa15a0ec84fbd8267ffab4e25bf..e8d8935b8ef2db0d4405ee1ff8e2f0f2e17a91b3 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -1,5 +1,11 @@ @@ -24,28 +24,28 @@ index be6ecfb08aaba3fc5d96e918b7540fc75c92e89e..7b6b1ad17b600b688d16c4208f4e2ac1 public class EntityWitch extends EntityRaider implements IRangedEntity { private static final UUID b = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); -- private static final AttributeModifier bw = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false); -+ private static final AttributeModifier bw = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false); private static final AttributeModifier DRINKING_SPEED = bw; // Paper - OBFHELPER - private static final DataWatcherObject bx = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i); -- private int by; -+ private int by; public int getPotionUseTimeLeft() { return by; } public void setPotionUseTimeLeft(int timeLeft) { by = timeLeft; } // Paper - OBFHELPER - private PathfinderGoalNearestHealableRaider bz; - private PathfinderGoalNearestAttackableTargetWitch bA; +- private static final AttributeModifier bv = new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION); ++ private static final AttributeModifier bv = new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION); private static final AttributeModifier DRINKING_SPEED = bv; // Paper - OBFHELPER + private static final DataWatcherObject bw = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i); +- private int bx; ++ private int bx; public int getPotionUseTimeLeft() { return bx; } public void setPotionUseTimeLeft(int timeLeft) { bx = timeLeft; } // Paper - OBFHELPER + private PathfinderGoalNearestHealableRaider by; + private PathfinderGoalNearestAttackableTargetWitch bz; @@ -56,10 +62,12 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { return SoundEffects.ENTITY_WITCH_DEATH; } -+ public void setDrinkingPotion(boolean drinkingPotion) { t(drinkingPotion); } // Paper - OBFHELPER - public void t(boolean flag) { - this.getDataWatcher().set(EntityWitch.bx, flag); ++ public void setDrinkingPotion(boolean drinkingPotion) { v(drinkingPotion); } // Paper - OBFHELPER + public void v(boolean flag) { + this.getDataWatcher().set(EntityWitch.bw, flag); } -+ public boolean isDrinkingPotion() { return l(); } // Paper - OBFHELPER - public boolean l() { - return (Boolean) this.getDataWatcher().get(EntityWitch.bx); ++ public boolean isDrinkingPotion() { return m(); } // Paper - OBFHELPER + public boolean m() { + return (Boolean) this.getDataWatcher().get(EntityWitch.bw); } -@@ -121,18 +129,20 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { +@@ -118,21 +126,22 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { } if (potionregistry != null) { @@ -53,48 +53,56 @@ index be6ecfb08aaba3fc5d96e918b7540fc75c92e89e..7b6b1ad17b600b688d16c4208f4e2ac1 - ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry); - org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); - this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); -+ // Paper start - move all this down into its own method -+// ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry); -+// org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); -+// this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); -+// // Paper end -+// this.bB = this.getItemInMainHand().k(); -+// this.s(true); -+// this.world.playSound((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); -+// AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); -+// -+// attributeinstance.removeModifier(EntityWitch.bz); -+// attributeinstance.addModifier(EntityWitch.bz); -+ this.setDrinkingPotion(PotionUtil.addPotionToItemStack(new ItemStack(Items.POTION), potionregistry)); - // Paper end -- this.by = this.getItemInMainHand().k(); -- this.t(true); -- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); -- AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); +- // Paper end +- this.bx = this.getItemInMainHand().k(); +- this.v(true); +- if (!this.isSilent()) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); +- } - -- attributeinstance.removeModifier(EntityWitch.bw); -- attributeinstance.addModifier(EntityWitch.bw); +- AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); +- +- attributemodifiable.removeModifier(EntityWitch.bv); +- attributemodifiable.b(EntityWitch.bv); ++ //// Paper start ++ //ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry); ++ //org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); ++ //this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); ++ //// Paper end ++ //this.bx = this.getItemInMainHand().k(); ++ //this.v(true); ++ //if (!this.isSilent()) { ++ // this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); ++ //} ++ // ++ //AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); ++ // ++ //attributemodifiable.removeModifier(EntityWitch.bv); ++ //attributemodifiable.b(EntityWitch.bv); ++ this.setDrinkingPotion(PotionUtil.addPotionToItemStack(new ItemStack(Items.POTION), potionregistry)); } } -@@ -144,6 +154,18 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { +@@ -144,6 +153,20 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { super.movementTick(); } -+ // Paper start ++ // Paper start - moved to its own method + public void setDrinkingPotion(ItemStack potion) { + setSlot(EnumItemSlot.MAINHAND, CraftItemStack.asNMSCopy(WitchReadyPotionEvent.process((Witch) getBukkitEntity(), CraftItemStack.asCraftMirror(potion)))); + setPotionUseTimeLeft(getItemInMainHand().getItemUseMaxDuration()); + setDrinkingPotion(true); -+ world.sendSoundEffect(null, locX(), locY(), locZ(), SoundEffects.ENTITY_WITCH_DRINK, getSoundCategory(), 1.0F, 0.8F + random.nextFloat() * 0.4F); -+ AttributeInstance attributeinstance = getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); -+ attributeinstance.removeModifier(EntityWitch.DRINKING_SPEED); -+ attributeinstance.addModifier(EntityWitch.DRINKING_SPEED); ++ if (!this.isSilent()) { ++ this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); ++ } ++ AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); ++ attributemodifiable.removeModifier(EntityWitch.bv); ++ attributemodifiable.b(EntityWitch.bv); + } + // Paper end + @Override - public SoundEffect eq() { + public SoundEffect eM() { return SoundEffects.ENTITY_WITCH_CELEBRATE; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java index bae107e76e4c8df446d4a7be8dda291d820074d7..b43a2bbd5bfd613887a7ae1519f6e729faf9bcc2 100644 diff --git a/Spigot-Server-Patches/0317-Add-option-to-prevent-players-from-moving-into-unloa.patch b/Spigot-Server-Patches/0308-Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 90% rename from Spigot-Server-Patches/0317-Add-option-to-prevent-players-from-moving-into-unloa.patch rename to Spigot-Server-Patches/0308-Add-option-to-prevent-players-from-moving-into-unloa.patch index 5cc408b283..189701cc38 100644 --- a/Spigot-Server-Patches/0317-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/Spigot-Server-Patches/0308-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b8789c8ecc5a6e4117bb7ce0d5487a6e5774b67f..0862a1d629435dea92178fb5473068f23a15adf2 100644 +index 487b0d5cd608e84a793eba5fdbd50a9f3d95c79b..b49a1a6f5017c9e183a7d08b16e89899c25a9717 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -427,4 +427,9 @@ public class PaperWorldConfig { +@@ -405,4 +405,9 @@ public class PaperWorldConfig { waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5); log("Water over lava flow speed: " + waterOverLavaFlowSpeed); } @@ -20,10 +20,10 @@ index b8789c8ecc5a6e4117bb7ce0d5487a6e5774b67f..0862a1d629435dea92178fb5473068f2 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 577268fed52bfc2657ef03099cbebeb0adabdf94..82b98839e554e02e196113d551881a524a3b1658 100644 +index 54e70688c94343ba3988eb775993c61bbc807bcc..ff4ba9b60c60fa77f26a04a065436063270984d1 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -351,6 +351,13 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -350,6 +350,13 @@ public class PlayerConnection implements PacketListenerPlayIn { } speed *= 2f; // TODO: Get the speed of the vehicle instead of the player @@ -37,7 +37,7 @@ index 577268fed52bfc2657ef03099cbebeb0adabdf94..82b98839e554e02e196113d551881a52 if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isExemptPlayer()) { // CraftBukkit end PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8); -@@ -900,9 +907,9 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -919,9 +926,9 @@ public class PlayerConnection implements PacketListenerPlayIn { double d1 = this.player.locY(); double d2 = this.player.locZ(); double d3 = this.player.locY(); @@ -49,7 +49,7 @@ index 577268fed52bfc2657ef03099cbebeb0adabdf94..82b98839e554e02e196113d551881a52 float f = packetplayinflying.a(this.player.yaw); float f1 = packetplayinflying.b(this.player.pitch); double d7 = d4 - this.l; -@@ -941,6 +948,12 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -960,6 +967,12 @@ public class PlayerConnection implements PacketListenerPlayIn { } else { speed = player.abilities.walkSpeed * 10f; } diff --git a/Spigot-Server-Patches/0308-Check-Drowned-for-Villager-Aggression-Config.patch b/Spigot-Server-Patches/0308-Check-Drowned-for-Villager-Aggression-Config.patch deleted file mode 100644 index ccfa4c8ed2..0000000000 --- a/Spigot-Server-Patches/0308-Check-Drowned-for-Villager-Aggression-Config.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 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 70c06ca775a6955459f36b36dbb48ad3cd1bdef0..77885f67ffa907f7b6dced5d0040d9a9a73454f4 100644 ---- a/src/main/java/net/minecraft/server/EntityDrowned.java -+++ b/src/main/java/net/minecraft/server/EntityDrowned.java -@@ -29,7 +29,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { - this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, 1.0D)); - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityDrowned.class})).a(EntityPigZombie.class)); - this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::i)); -- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); -+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); // Paper - this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); - this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bw)); - } diff --git a/Spigot-Server-Patches/0309-Here-s-Johnny.patch b/Spigot-Server-Patches/0309-Here-s-Johnny.patch deleted file mode 100644 index f608a431f2..0000000000 --- a/Spigot-Server-Patches/0309-Here-s-Johnny.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath -Date: Fri, 12 Oct 2018 01:37:22 -0500 -Subject: [PATCH] Here's Johnny! - - -diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java -index 73ecdd22ea1157abe00795d90c3e7b748650dbc8..c974c02e92345fdc43f4acc9b02d40c735b677df 100644 ---- a/src/main/java/net/minecraft/server/EntityVindicator.java -+++ b/src/main/java/net/minecraft/server/EntityVindicator.java -@@ -11,7 +11,7 @@ public class EntityVindicator extends EntityIllagerAbstract { - private static final Predicate b = (enumdifficulty) -> { - return enumdifficulty == EnumDifficulty.NORMAL || enumdifficulty == EnumDifficulty.HARD; - }; -- private boolean bw; -+ private boolean bw; public boolean isJohnny() { return bw; } public void setJohnny(boolean johnny) { bw = johnny; } // Paper - OBFHELPER - - public EntityVindicator(EntityTypes entitytypes, World world) { - super(entitytypes, world); -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java -index 951d47929893fce38183b81cf4ec6a7d4204acd1..5ff957ced7a86f4fa3a0751b4eed5a6fdc525da4 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java -@@ -25,4 +25,14 @@ public class CraftVindicator extends CraftIllager implements Vindicator { - public EntityType getType() { - return EntityType.VINDICATOR; - } -+ -+ // Paper start -+ public boolean isJohnny() { -+ return getHandle().isJohnny(); -+ } -+ -+ public void setJohnny(boolean johnny) { -+ getHandle().setJohnny(johnny); -+ } -+ // Paper end - } diff --git a/Spigot-Server-Patches/0318-Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/0309-Reset-players-airTicks-on-respawn.patch similarity index 71% rename from Spigot-Server-Patches/0318-Reset-players-airTicks-on-respawn.patch rename to Spigot-Server-Patches/0309-Reset-players-airTicks-on-respawn.patch index b81bcd787a..b61fa994c8 100644 --- a/Spigot-Server-Patches/0318-Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/0309-Reset-players-airTicks-on-respawn.patch @@ -5,22 +5,22 @@ 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 4609e402b419ed21e17ad34d02dca55b47c1c95e..ce0eadbae95a9f6b4e5a46a9d0ee1ccf69c6779a 100644 +index 698619c25714d6bb296084298de4f2e39f8f9c63..28714c10c2bf30fc51c591060bec87c330fc62c1 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2332,6 +2332,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2257,6 +2257,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } -+ public int getMaxAirTicks() { return bw(); } // Paper - OBFHELPER - public int bw() { ++ public int getMaxAirTicks() { return bD(); } // Paper - OBFHELPER + public int bD() { return 300; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3175b0735f3b5f4d7e3e02dc083d32262d463de7..8c1cd0673e4b070ebbc9ecf7d9d4acf01d33ba3b 100644 +index 9972ee33433914ef9abc5075f274e58d46a9192f..8de15e4856217fb4fc4fc44d9460437e0c8c65ee 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1887,6 +1887,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -2025,6 +2025,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } this.setHealth(this.getMaxHealth()); diff --git a/Spigot-Server-Patches/0319-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/Spigot-Server-Patches/0310-Don-t-sleep-after-profile-lookups-if-not-needed.patch similarity index 87% rename from Spigot-Server-Patches/0319-Don-t-sleep-after-profile-lookups-if-not-needed.patch rename to Spigot-Server-Patches/0310-Don-t-sleep-after-profile-lookups-if-not-needed.patch index dc184c36cf..01be147e24 100644 --- a/Spigot-Server-Patches/0319-Don-t-sleep-after-profile-lookups-if-not-needed.patch +++ b/Spigot-Server-Patches/0310-Don-t-sleep-after-profile-lookups-if-not-needed.patch @@ -7,10 +7,10 @@ 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 71e48e87b4280f8913d762e8b4fc9bea4c7f7d29..23f1447cfcef89683a9bc98f0f912d76a1f93012 100644 +index a3ab666b5fa89aad7ee167d9aeff2f62019a4a78..8e182fdd69dba6e1c52e2f6a893534d77fb3bfaa 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 { +@@ -43,6 +43,7 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { } final int page = 0; @@ -18,7 +18,7 @@ index 71e48e87b4280f8913d762e8b4fc9bea4c7f7d29..23f1447cfcef89683a9bc98f0f912d76 for (final List request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) { int failCount = 0; -@@ -67,6 +68,12 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { +@@ -68,6 +69,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")); } diff --git a/Spigot-Server-Patches/0320-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/Spigot-Server-Patches/0311-Improve-Server-Thread-Pool-and-Thread-Priorities.patch similarity index 79% rename from Spigot-Server-Patches/0320-Improve-Server-Thread-Pool-and-Thread-Priorities.patch rename to Spigot-Server-Patches/0311-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index 3e29ce9572..84edc47501 100644 --- a/Spigot-Server-Patches/0320-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/Spigot-Server-Patches/0311-Improve-Server-Thread-Pool-and-Thread-Priorities.patch @@ -12,17 +12,17 @@ server threads Allow usage of a single thread executor by not using ForkJoin so single core CPU's. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index bbda856c148588402731c03cd166acd2e1f4eee3..5d54825171d5214d504b3fad03342c0769ff50f9 100644 +index 16a8300a202e0b33b6de472a72ebf74653bafc20..ba9b0a7b8b34919eb67c611c11dacbd1805bb226 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1361,6 +1361,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant -Date: Wed, 17 Oct 2018 19:17:27 -0400 -Subject: [PATCH] MC-50319: Check other worlds for shooter of projectiles - -Say a player shoots an arrow through a nether portal, the game -would lose the shooter for determining things such as Player Kills, -because the entity is in another world. - -If the projectile fails to find the shooter in the current world, check -other worlds. - -diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index 9eed1dce3e48683b751ebbaac0487a046354622e..6c091b68087d60b0b916871eb0ce06c6a2776bf8 100644 ---- a/src/main/java/net/minecraft/server/EntityProjectile.java -+++ b/src/main/java/net/minecraft/server/EntityProjectile.java -@@ -209,6 +209,16 @@ public abstract class EntityProjectile extends Entity implements IProjectile { - public EntityLiving getShooter() { - if ((this.shooter == null || this.shooter.dead) && this.shooterId != null && this.world instanceof WorldServer) { - Entity entity = ((WorldServer) this.world).getEntity(this.shooterId); -+ // Paper start - MC-50319 - shooter might be in another world (arrows through portals) -+ if (entity == null) { -+ for (WorldServer world : world.getMinecraftServer().getWorlds()) { -+ entity = world.getEntity(this.shooterId); -+ if (entity != null) { -+ break; -+ } -+ } -+ } -+ // Paper end - - if (entity instanceof EntityLiving) { - this.shooter = (EntityLiving) entity; diff --git a/Spigot-Server-Patches/0321-Optimize-World-Time-Updates.patch b/Spigot-Server-Patches/0312-Optimize-World-Time-Updates.patch similarity index 94% rename from Spigot-Server-Patches/0321-Optimize-World-Time-Updates.patch rename to Spigot-Server-Patches/0312-Optimize-World-Time-Updates.patch index aeb5e6709f..d5a65cc969 100644 --- a/Spigot-Server-Patches/0321-Optimize-World-Time-Updates.patch +++ b/Spigot-Server-Patches/0312-Optimize-World-Time-Updates.patch @@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5d54825171d5214d504b3fad03342c0769ff50f9..738ba4ee303b796cadf17b78791fad461545f1cc 100644 +index ba9b0a7b8b34919eb67c611c11dacbd1805bb226..f1098b1b62fd568579fd0e1fda63478f58036c8c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1169,12 +1169,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java -index 685a30f3f14232dba88e22ec86e2e66f7da86d0b..9edf937a652a5b463ff049c414f3230bb0ecd9ed 100644 +index e3e4837dab995dba3c509d0e192bbfed5a1b8bc1..362750bd85bc65c304f5fece344ecdeddebaf4ee 100644 --- a/src/main/java/net/minecraft/server/BlockSponge.java +++ b/src/main/java/net/minecraft/server/BlockSponge.java @@ -115,8 +115,11 @@ public class BlockSponge extends Block { diff --git a/Spigot-Server-Patches/0325-Don-t-allow-digging-into-unloaded-chunks.patch b/Spigot-Server-Patches/0316-Don-t-allow-digging-into-unloaded-chunks.patch similarity index 64% rename from Spigot-Server-Patches/0325-Don-t-allow-digging-into-unloaded-chunks.patch rename to Spigot-Server-Patches/0316-Don-t-allow-digging-into-unloaded-chunks.patch index 98e536456f..e6ca3af0bb 100644 --- a/Spigot-Server-Patches/0325-Don-t-allow-digging-into-unloaded-chunks.patch +++ b/Spigot-Server-Patches/0316-Don-t-allow-digging-into-unloaded-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow digging into unloaded chunks diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 82b98839e554e02e196113d551881a524a3b1658..f45c4d1fdf7e23d23999f9ce78dcd25d9c608f49 100644 +index ff4ba9b60c60fa77f26a04a065436063270984d1..64f7694b91e4b1a84cb1f38534056c14404124fb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1273,6 +1273,11 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1296,6 +1296,11 @@ public class PlayerConnection implements PacketListenerPlayIn { case START_DESTROY_BLOCK: case ABORT_DESTROY_BLOCK: case STOP_DESTROY_BLOCK: @@ -21,48 +21,48 @@ index 82b98839e554e02e196113d551881a524a3b1658..f45c4d1fdf7e23d23999f9ce78dcd25d return; default: diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index e2e5c17c24c8f5e9807ca879b1025d13cb195226..ed3f3362b640746649455f8dd2255ac2da03df7c 100644 +index 36cf4c332054a350ae193637f895a45a8b04da9b..a32490f0eb754b065ee34c41465176db78b1625d 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java -@@ -69,8 +69,8 @@ public class PlayerInteractManager { +@@ -80,8 +80,8 @@ public class PlayerInteractManager { IBlockData iblockdata; - if (this.i) { -- iblockdata = this.world.getType(this.j); + if (this.j) { +- iblockdata = this.world.getType(this.k); - if (iblockdata.isAir()) { -+ iblockdata = this.world.getTypeIfLoaded(this.j); // Paper ++ iblockdata = this.world.getTypeIfLoaded(this.k); // Paper + if (iblockdata == null || iblockdata.isAir()) { // Paper - this.i = false; + this.j = false; } else { - float f = this.a(iblockdata, this.j, this.k); -@@ -81,7 +81,13 @@ public class PlayerInteractManager { + float f = this.a(iblockdata, this.k, this.l); +@@ -92,7 +92,13 @@ public class PlayerInteractManager { } } - } else if (this.e) { -- iblockdata = this.world.getType(this.g); + } else if (this.f) { +- iblockdata = this.world.getType(this.h); + // Paper start - don't want to do same logic as above, return instead -+ iblockdata = this.world.getTypeIfLoaded(this.g); ++ iblockdata = this.world.getTypeIfLoaded(this.h); + if (iblockdata == null) { -+ this.e = false; ++ this.f = false; + return; + } + // Paper end if (iblockdata.isAir()) { - this.world.a(this.player.getId(), this.g, -1); - this.l = -1; -@@ -253,10 +259,12 @@ public class PlayerInteractManager { + this.world.a(this.player.getId(), this.h, -1); + this.m = -1; +@@ -256,10 +262,12 @@ public class PlayerInteractManager { this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, true, "stopped destroying")); } else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) { - this.e = false; -- if (!Objects.equals(this.g, blockposition)) { -+ if (!Objects.equals(this.g, blockposition) && !BlockPosition.ZERO.equals(this.g)) { // Paper - PlayerInteractManager.LOGGER.debug("Mismatch in destroy block pos: " + this.g + " " + blockposition); // CraftBukkit - SPIGOT-5457 sent by client when interact event cancelled -- this.world.a(this.player.getId(), this.g, -1); -- this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.g, this.world.getType(this.g), packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying")); -+ IBlockData type = this.world.getTypeIfLoaded(this.g); // Paper - don't load unloaded chunks for stale records here -+ if (type != null) this.world.a(this.player.getId(), this.g, -1); // Paper -+ if (type != null) this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.g, type, packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying")); // Paper -+ this.g = BlockPosition.ZERO; // Paper + this.f = false; +- if (!Objects.equals(this.h, blockposition)) { ++ if (!Objects.equals(this.h, blockposition) && !BlockPosition.ZERO.equals(this.h)) { + PlayerInteractManager.LOGGER.debug("Mismatch in destroy block pos: " + this.h + " " + blockposition); // CraftBukkit - SPIGOT-5457 sent by client when interact event cancelled +- this.world.a(this.player.getId(), this.h, -1); +- this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.h, this.world.getType(this.h), packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying")); ++ IBlockData type = this.world.getTypeIfLoaded(this.h); // Paper - don't load unloaded chunks for stale records here ++ if (type != null) this.world.a(this.player.getId(), this.h, -1); // Paper ++ if (type != null) this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.h, type, packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying")); // Paper ++ this.h = BlockPosition.ZERO; // Paper } this.world.a(this.player.getId(), blockposition, -1); diff --git a/Spigot-Server-Patches/0328-Book-Size-Limits.patch b/Spigot-Server-Patches/0317-Book-Size-Limits.patch similarity index 90% rename from Spigot-Server-Patches/0328-Book-Size-Limits.patch rename to Spigot-Server-Patches/0317-Book-Size-Limits.patch index deaa619d7e..7d5aa7cfc0 100644 --- a/Spigot-Server-Patches/0328-Book-Size-Limits.patch +++ b/Spigot-Server-Patches/0317-Book-Size-Limits.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Book Size Limits Puts some limits on the size of books. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 79cf4e598fedf75e5ee943acb7930cb265dd11f6..6d069c73d0058f58e908f351a849ec3a753f2d22 100644 +index 29cab8730a5e61aeb8bf4d69ccad192c1ff975f4..6f688cca9f769a6d7b1d1b9bc48e16632da3a847 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -354,4 +354,11 @@ public class PaperConfig { +@@ -333,4 +333,11 @@ public class PaperConfig { velocitySecretKey = secret.getBytes(StandardCharsets.UTF_8); } } @@ -22,18 +22,18 @@ index 79cf4e598fedf75e5ee943acb7930cb265dd11f6..6d069c73d0058f58e908f351a849ec3a + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index f45c4d1fdf7e23d23999f9ce78dcd25d9c608f49..07e7093aa99015e10e44e0a6e4805701094b601d 100644 +index 64f7694b91e4b1a84cb1f38534056c14404124fb..06d4f5f0a2410478ff3eb5b9a57d963e4c74893b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -14,6 +14,7 @@ import java.util.Iterator; - import java.util.Optional; +@@ -14,6 +14,7 @@ import java.util.Optional; import java.util.Set; + import java.util.stream.Stream; import javax.annotation.Nullable; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -795,6 +796,42 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -814,6 +815,42 @@ public class PlayerConnection implements PacketListenerPlayIn { @Override public void a(PacketPlayInBEdit packetplayinbedit) { diff --git a/Spigot-Server-Patches/0329-Make-the-default-permission-message-configurable.patch b/Spigot-Server-Patches/0318-Make-the-default-permission-message-configurable.patch similarity index 83% rename from Spigot-Server-Patches/0329-Make-the-default-permission-message-configurable.patch rename to Spigot-Server-Patches/0318-Make-the-default-permission-message-configurable.patch index 1acf2eb727..e01e5e223a 100644 --- a/Spigot-Server-Patches/0329-Make-the-default-permission-message-configurable.patch +++ b/Spigot-Server-Patches/0318-Make-the-default-permission-message-configurable.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 6d069c73d0058f58e908f351a849ec3a753f2d22..dbd14399707cdd43f98af40191be8ff3e76edf43 100644 +index 6f688cca9f769a6d7b1d1b9bc48e16632da3a847..1aa7d0cfaf5697daeeb98e237387f27e76bca16f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -20,6 +20,7 @@ import java.util.regex.Pattern; +@@ -19,6 +19,7 @@ import java.util.regex.Pattern; import com.google.common.collect.Lists; import net.minecraft.server.MinecraftServer; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.command.Command; - import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.InvalidConfigurationException; -@@ -280,6 +281,11 @@ public class PaperConfig { + import org.bukkit.configuration.file.YamlConfiguration; +@@ -278,6 +279,11 @@ public class PaperConfig { connectionThrottleKickMessage = getString("messages.kick.connection-throttle", connectionThrottleKickMessage); } @@ -29,10 +29,10 @@ index 6d069c73d0058f58e908f351a849ec3a753f2d22..dbd14399707cdd43f98af40191be8ff3 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 7b53ebb6d7cf241c6b89ec04acd0bcc25e1c105a..811e676e4f9f1f8beb8eb9e20cef3ef03633a856 100644 +index 5db8ccb0d30e2927c33b04ff51ebebd0dfe96a63..4ac310fd1b502054dc291c5e52e7845ce43364ed 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2180,6 +2180,11 @@ public final class CraftServer implements Server { +@@ -2235,6 +2235,11 @@ public final class CraftServer implements Server { return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; } diff --git a/Spigot-Server-Patches/0331-Prevent-rayTrace-from-loading-chunks.patch b/Spigot-Server-Patches/0319-Prevent-rayTrace-from-loading-chunks.patch similarity index 90% rename from Spigot-Server-Patches/0331-Prevent-rayTrace-from-loading-chunks.patch rename to Spigot-Server-Patches/0319-Prevent-rayTrace-from-loading-chunks.patch index 8e75d4a3c4..125c3c3bc2 100644 --- a/Spigot-Server-Patches/0331-Prevent-rayTrace-from-loading-chunks.patch +++ b/Spigot-Server-Patches/0319-Prevent-rayTrace-from-loading-chunks.patch @@ -7,10 +7,10 @@ ray tracing into an unloaded chunk should be treated as a miss this saves a ton of lag for when AI tries to raytrace near unloaded chunks. diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java -index 0dff023529ba9e44a7406ad6388cad35730917ba..29cdc00875aa5004132820f36e781c7bf4573162 100644 +index 077fcb67f6248156aaebe7545e370ade4311b9e4..a59df0e48a9bcbb32c51ec0013f634d474f68e52 100644 --- a/src/main/java/net/minecraft/server/IBlockAccess.java +++ b/src/main/java/net/minecraft/server/IBlockAccess.java -@@ -41,7 +41,15 @@ public interface IBlockAccess { +@@ -46,7 +46,15 @@ public interface IBlockAccess { // CraftBukkit start - moved block handling into separate method for use by Block#rayTrace default MovingObjectPositionBlock rayTraceBlock(RayTrace raytrace1, BlockPosition blockposition) { diff --git a/Spigot-Server-Patches/0332-Handle-Large-Packets-disconnecting-client.patch b/Spigot-Server-Patches/0320-Handle-Large-Packets-disconnecting-client.patch similarity index 93% rename from Spigot-Server-Patches/0332-Handle-Large-Packets-disconnecting-client.patch rename to Spigot-Server-Patches/0320-Handle-Large-Packets-disconnecting-client.patch index f6bdcd6bc4..8c099de176 100644 --- a/Spigot-Server-Patches/0332-Handle-Large-Packets-disconnecting-client.patch +++ b/Spigot-Server-Patches/0320-Handle-Large-Packets-disconnecting-client.patch @@ -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 046196d54df35ceafb8bc477e740e1dc834345d5..d4aad8a5b7dd8ee837fa7f9b70271e0554bb04e1 100644 +index 2916119507ec5ecd9266569b0003d0504a79f6c4..cd97b6a24010165d9435a5c62b6f896278674418 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -97,6 +97,15 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -80,10 +80,10 @@ index 63c4dbd327beb7b6ab42eb44650d68accd3b0de6..b0cfef52cbb5e23beae528668e4e98ce + // Paper end } diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 1fcbbd698a7e1b9ae3e8b5fa0328b85c43019bea..a0b87f89df77ba8ac6ce3f135d4f3a34ed2b3543 100644 +index 72ff0a1e6428a1776f49c26e1715f5f2428ba242..6e1426127fc5b5ddc205603b8d03b98a046f9741 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -@@ -79,7 +79,7 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -82,7 +82,7 @@ public class PacketPlayOutMapChunk implements Packet { int i = packetdataserializer.i(); @@ -93,7 +93,7 @@ index 1fcbbd698a7e1b9ae3e8b5fa0328b85c43019bea..a0b87f89df77ba8ac6ce3f135d4f3a34 } else { this.f = new byte[i]; diff --git a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java -index f7c3655671cb75a7e78796bcddc3cfd9817e2b90..631234324d5c53015b3cef21b20bb3211e335af8 100644 +index ac42c913246f1aa9425fdf6eca48adf29e917c90..901a5df3f7d3f9ee60485ec1044a05e8aff89ccb 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java @@ -9,6 +9,15 @@ public class PacketPlayOutWindowItems implements Packet { diff --git a/Spigot-Server-Patches/0327-force-entity-dismount-during-teleportation.patch b/Spigot-Server-Patches/0321-force-entity-dismount-during-teleportation.patch similarity index 83% rename from Spigot-Server-Patches/0327-force-entity-dismount-during-teleportation.patch rename to Spigot-Server-Patches/0321-force-entity-dismount-during-teleportation.patch index 1bb99efc20..7313539082 100644 --- a/Spigot-Server-Patches/0327-force-entity-dismount-during-teleportation.patch +++ b/Spigot-Server-Patches/0321-force-entity-dismount-during-teleportation.patch @@ -20,16 +20,16 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ce0eadbae95a9f6b4e5a46a9d0ee1ccf69c6779a..3d44188e68df31d188f25820000e2c39aa5b6ce0 100644 +index 28714c10c2bf30fc51c591060bec87c330fc62c1..777d2a6aac7dd1b74124b7a8af87b258a27f4726 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2033,12 +2033,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1949,12 +1949,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } -- public void stopRiding() { +- public void bb() { + // Paper start -+ public void stopRiding() { stopRiding(false); } ++ public void bb() { stopRiding(false); } + public void stopRiding(boolean suppressCancellation) { + // Paper end if (this.vehicle != null) { @@ -41,7 +41,7 @@ index ce0eadbae95a9f6b4e5a46a9d0ee1ccf69c6779a..3d44188e68df31d188f25820000e2c39 } } -@@ -2089,7 +2092,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2009,7 +2012,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return true; // CraftBukkit } @@ -53,7 +53,7 @@ index ce0eadbae95a9f6b4e5a46a9d0ee1ccf69c6779a..3d44188e68df31d188f25820000e2c39 if (entity.getVehicle() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { -@@ -2099,7 +2105,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2019,7 +2025,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { VehicleExitEvent event = new VehicleExitEvent( (Vehicle) getBukkitEntity(), @@ -62,7 +62,7 @@ index ce0eadbae95a9f6b4e5a46a9d0ee1ccf69c6779a..3d44188e68df31d188f25820000e2c39 ); Bukkit.getPluginManager().callEvent(event); CraftEntity craftn = (CraftEntity) entity.getBukkitEntity().getVehicle(); -@@ -2110,7 +2116,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2030,7 +2036,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end // Spigot start @@ -72,18 +72,18 @@ index ce0eadbae95a9f6b4e5a46a9d0ee1ccf69c6779a..3d44188e68df31d188f25820000e2c39 if (event.isCancelled()) { return false; diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index f41975165a6a66479bc8fc1811c1d271bb2a6113..61c9e030a105ee78a7e59fbf36cf7a77f87a0e88 100644 +index 0fd29c42179c7ac0c89cfd35b257ab0ad3ae1612..8af8676888e4deff66094053d14203c2f5b20ab1 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -968,9 +968,11 @@ public abstract class EntityHuman extends EntityLiving { +@@ -942,9 +942,11 @@ public abstract class EntityHuman extends EntityLiving { return -0.35D; } - @Override -- public void stopRiding() { -- super.stopRiding(); +- public void bb() { +- super.bb(); + // Paper start -+ @Override public void stopRiding() { stopRiding(false); } ++ @Override public void bb() { stopRiding(false); } + @Override public void stopRiding(boolean suppressCancellation) { + // Paper end + super.stopRiding(suppressCancellation); // Paper - suppress @@ -91,11 +91,11 @@ index f41975165a6a66479bc8fc1811c1d271bb2a6113..61c9e030a105ee78a7e59fbf36cf7a77 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 8ac03288dc328ccd4ec7ef9080b61f005d8daac6..347d4abdecddf0c92f81b2958fbaccc22cf16b26 100644 +index 7105192a5cd8666ac46dcd8a524709d7e429d1b0..1481cbafa1b4e48822d9e0fa2735b9829440fca3 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2738,11 +2738,13 @@ public abstract class EntityLiving extends Entity { - return ((Byte) this.datawatcher.get(EntityLiving.ao) & 4) != 0; +@@ -2886,11 +2886,13 @@ public abstract class EntityLiving extends Entity { + return ((Byte) this.datawatcher.get(EntityLiving.an) & 4) != 0; } - @Override @@ -112,10 +112,10 @@ index 8ac03288dc328ccd4ec7ef9080b61f005d8daac6..347d4abdecddf0c92f81b2958fbaccc2 this.a(entity); } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 8c1cd0673e4b070ebbc9ecf7d9d4acf01d33ba3b..ab5e502a293c514bc0a71bb47b921a6a23a3c95a 100644 +index 8de15e4856217fb4fc4fc44d9460437e0c8c65ee..6f5045177af7a59aa0ce6982fd6a2f37e9462ff4 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1023,11 +1023,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1132,11 +1132,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } diff --git a/Spigot-Server-Patches/0330-Add-more-Zombie-API.patch b/Spigot-Server-Patches/0322-Add-more-Zombie-API.patch similarity index 81% rename from Spigot-Server-Patches/0330-Add-more-Zombie-API.patch rename to Spigot-Server-Patches/0322-Add-more-Zombie-API.patch index 93f734c026..80105a9fa1 100644 --- a/Spigot-Server-Patches/0330-Add-more-Zombie-API.patch +++ b/Spigot-Server-Patches/0322-Add-more-Zombie-API.patch @@ -5,31 +5,31 @@ Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index bed15873b675bbd05c0149d655f9fb165bbbc73e..6d53254f8381f3a957673930c7fdf42d4b9d2f36 100644 +index df98f2244a161c0e66e80f92c91760409734dc69..081baca9a101d188e4810d04f69811d52de7a107 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1260,6 +1260,8 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1423,6 +1423,8 @@ public abstract class EntityInsentient extends EntityLiving { this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 2) : (byte) (b0 & -3)); } + public boolean isArmsRaisedZombie() { return (this.datawatcher.get(EntityInsentient.b) & 4) != 0; } // Paper - OBFHELPER -+ public void setArmsRaisedZombie(boolean flag) { this.q(flag); } // Paper - OBFHELPER - public void q(boolean flag) { ++ public void setArmsRaisedZombie(boolean flag) { this.setAggressive(flag); } // Paper - OBFHELPER + public void setAggressive(boolean flag) { byte b0 = (Byte) this.datawatcher.get(EntityInsentient.b); diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 97a1dedf7460d513a560d722b2e0f1bf09fe669c..d64c03f006af1c829862d02d1fc4fde007dd9a5b 100644 +index 3f16f9b34a75db6dc977cb0dc1603db34dd8ddc3..18705e1e2a04ec2790b104a290b9edc8e9fb4f1a 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -33,6 +33,7 @@ public class EntityZombie extends EntityMonster { - private int bC; + private int bA; public int drownedConversionTime; private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field + private boolean shouldBurnInDay = true; // Paper public EntityZombie(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -80,6 +81,7 @@ public class EntityZombie extends EntityMonster { +@@ -74,6 +75,7 @@ public class EntityZombie extends EntityMonster { this.getDataWatcher().register(EntityZombie.DROWN_CONVERTING, false); } @@ -37,7 +37,7 @@ index 97a1dedf7460d513a560d722b2e0f1bf09fe669c..d64c03f006af1c829862d02d1fc4fde0 public boolean isDrownConverting() { return (Boolean) this.getDataWatcher().get(EntityZombie.DROWN_CONVERTING); } -@@ -212,6 +214,13 @@ public class EntityZombie extends EntityMonster { +@@ -206,6 +208,13 @@ public class EntityZombie extends EntityMonster { this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true); } @@ -48,15 +48,15 @@ index 97a1dedf7460d513a560d722b2e0f1bf09fe669c..d64c03f006af1c829862d02d1fc4fde0 + } + // Paper end + - protected void ev() { - this.b(EntityTypes.DROWNED); - this.world.a((EntityHuman) null, 1040, new BlockPosition(this), 0); -@@ -292,10 +301,17 @@ public class EntityZombie extends EntityMonster { - } + protected void eQ() { + this.c(EntityTypes.DROWNED); + if (!this.isSilent()) { +@@ -225,10 +234,17 @@ public class EntityZombie extends EntityMonster { + } -+ public boolean shouldBurnInDay() { return K_(); } // Paper - OBFHELPER - protected boolean K_() { ++ public boolean shouldBurnInDay() { return U_(); } // Paper - OBFHELPER + protected boolean U_() { - return true; + return shouldBurnInDay; } @@ -70,15 +70,15 @@ index 97a1dedf7460d513a560d722b2e0f1bf09fe669c..d64c03f006af1c829862d02d1fc4fde0 @Override public boolean damageEntity(DamageSource damagesource, float f) { if (super.damageEntity(damagesource, f)) { -@@ -413,6 +429,7 @@ public class EntityZombie extends EntityMonster { - nbttagcompound.setBoolean("CanBreakDoors", this.ey()); - nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bC : -1); +@@ -348,6 +364,7 @@ public class EntityZombie extends EntityMonster { + nbttagcompound.setBoolean("CanBreakDoors", this.eV()); + nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bA : -1); nbttagcompound.setInt("DrownedConversionTime", this.isDrownConverting() ? this.drownedConversionTime : -1); + nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Paper } @Override -@@ -427,7 +444,11 @@ public class EntityZombie extends EntityMonster { +@@ -362,7 +379,11 @@ public class EntityZombie extends EntityMonster { if (nbttagcompound.hasKeyOfType("DrownedConversionTime", 99) && nbttagcompound.getInt("DrownedConversionTime") > -1) { this.startDrownedConversion(nbttagcompound.getInt("DrownedConversionTime")); } diff --git a/Spigot-Server-Patches/0334-Add-PlayerConnectionCloseEvent.patch b/Spigot-Server-Patches/0323-Add-PlayerConnectionCloseEvent.patch similarity index 92% rename from Spigot-Server-Patches/0334-Add-PlayerConnectionCloseEvent.patch rename to Spigot-Server-Patches/0323-Add-PlayerConnectionCloseEvent.patch index 0197eb474f..56d5df397c 100644 --- a/Spigot-Server-Patches/0334-Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-Server-Patches/0323-Add-PlayerConnectionCloseEvent.patch @@ -34,10 +34,10 @@ 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 47cf105019b3ea28f413274d234a34cdb41941dd..f1222fcb2bd52b8781d0f92c94e1472fa7b1e493 100644 +index 57520943befea80b334ccf2385057b88131ddd8e..8c5c57ecd98a286a4992a36effae95596b37fc8a 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java -@@ -35,9 +35,9 @@ public class LoginListener implements PacketLoginInListener { +@@ -34,9 +34,9 @@ public class LoginListener implements PacketLoginInListener { private final byte[] e = new byte[4]; private final MinecraftServer server; public final NetworkManager networkManager; @@ -50,11 +50,11 @@ index 47cf105019b3ea28f413274d234a34cdb41941dd..f1222fcb2bd52b8781d0f92c94e1472f 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 d4aad8a5b7dd8ee837fa7f9b70271e0554bb04e1..b1dededc15cce686ead74a99bee64c89ac1de22c 100644 +index cd97b6a24010165d9435a5c62b6f896278674418..64d61eca4bbb4a9e18d78c8d2a55114134f56b6f 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -336,6 +336,26 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - this.i().a(new ChatMessage("multiplayer.disconnect.generic", new Object[0])); +@@ -335,6 +335,26 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + this.i().a(new ChatMessage("multiplayer.disconnect.generic")); } this.packetQueue.clear(); // Free up packet queue. + // Paper start - Add PlayerConnectionCloseEvent diff --git a/Spigot-Server-Patches/0335-Prevent-Enderman-from-loading-chunks.patch b/Spigot-Server-Patches/0324-Prevent-Enderman-from-loading-chunks.patch similarity index 86% rename from Spigot-Server-Patches/0335-Prevent-Enderman-from-loading-chunks.patch rename to Spigot-Server-Patches/0324-Prevent-Enderman-from-loading-chunks.patch index 40f98fe856..b94647d3de 100644 --- a/Spigot-Server-Patches/0335-Prevent-Enderman-from-loading-chunks.patch +++ b/Spigot-Server-Patches/0324-Prevent-Enderman-from-loading-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent Enderman from loading chunks diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index d86f76f30be54767d0243df716fe743e24db6726..212636dcb2107816340f40784f9f89a7daf50ad2 100644 +index 8da3b10cd6db379cf5d9d667154dd8911813284b..b61de33513989a9097e2729f0bd733dda687644d 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -344,7 +344,8 @@ public class EntityEnderman extends EntityMonster { +@@ -381,7 +381,8 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { int j = MathHelper.floor(this.enderman.locY() + random.nextDouble() * 3.0D); int k = MathHelper.floor(this.enderman.locZ() - 2.0D + random.nextDouble() * 4.0D); BlockPosition blockposition = new BlockPosition(i, j, k); @@ -18,7 +18,7 @@ index d86f76f30be54767d0243df716fe743e24db6726..212636dcb2107816340f40784f9f89a7 Block block = iblockdata.getBlock(); Vec3D vec3d = new Vec3D((double) MathHelper.floor(this.enderman.locX()) + 0.5D, (double) j + 0.5D, (double) MathHelper.floor(this.enderman.locZ()) + 0.5D); Vec3D vec3d1 = new Vec3D((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D); -@@ -386,7 +387,8 @@ public class EntityEnderman extends EntityMonster { +@@ -423,7 +424,8 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { int j = MathHelper.floor(this.a.locY() + random.nextDouble() * 2.0D); int k = MathHelper.floor(this.a.locZ() - 1.0D + random.nextDouble() * 2.0D); BlockPosition blockposition = new BlockPosition(i, j, k); diff --git a/Spigot-Server-Patches/0336-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-Server-Patches/0325-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch similarity index 88% rename from Spigot-Server-Patches/0336-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch rename to Spigot-Server-Patches/0325-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index 0d2b0e25fd..7c8b0c5b65 100644 --- a/Spigot-Server-Patches/0336-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/Spigot-Server-Patches/0325-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ab5e502a293c514bc0a71bb47b921a6a23a3c95a..98d480165ff3446317b4c9358a936cd7276cf908 100644 +index 6f5045177af7a59aa0ce6982fd6a2f37e9462ff4..cafe8de58abb56bbf0b33c0aa35acf638eb2ee97 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -76,6 +76,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -80,6 +80,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public int ping; public boolean viewingCredits; private int containerUpdateDelay; // Paper @@ -28,10 +28,10 @@ index ab5e502a293c514bc0a71bb47b921a6a23a3c95a..98d480165ff3446317b4c9358a936cd7 public boolean queueHealthUpdatePacket = false; public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 917ea676d9ce2ea0b10e3a75b7f35f011c3599f6..6d7eb21fb05b2771084ab634ff4d32997b62ee9e 100644 +index 8c1d836538c678feca56076753e8781eadcd6d1d..a6606eff5ac89c54bdcbee0d3bf124d737d9735b 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -94,6 +94,7 @@ public abstract class PlayerList { +@@ -97,6 +97,7 @@ public abstract class PlayerList { } public void a(NetworkManager networkmanager, EntityPlayer entityplayer) { @@ -40,10 +40,10 @@ index 917ea676d9ce2ea0b10e3a75b7f35f011c3599f6..6d7eb21fb05b2771084ab634ff4d3299 UserCache usercache = this.server.getUserCache(); GameProfile gameprofile1 = usercache.getProfile(gameprofile.getId()); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 0e8a21b80371dd5ce833da3daf12fdcd9aabae9f..32e02af96e8f8db68509022f742a1239c9b7b4c7 100644 +index 00333548b470435aa89fb0f4b29047eb1461e992..5770d4183c1b9ab6119a25930283c0235250ed6e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -@@ -260,6 +260,61 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa +@@ -244,6 +244,61 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa return getData() != null; } @@ -106,10 +106,10 @@ index 0e8a21b80371dd5ce833da3daf12fdcd9aabae9f..32e02af96e8f8db68509022f742a1239 public Location getBedSpawnLocation() { NBTTagCompound data = getData(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5445554b18c22b85cf9b3427c22d693a24bc596b..2b18f158b14ca3968f4382fc1436e04d155e04a4 100644 +index e112a87792a76ccbc25caa1253c54db601de76aa..346629cba5ff956229e386caa5449fd068a16c60 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -138,6 +138,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -142,6 +142,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private String resourcePackHash; private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit @@ -117,7 +117,7 @@ index 5445554b18c22b85cf9b3427c22d693a24bc596b..2b18f158b14ca3968f4382fc1436e04d // Paper end public CraftPlayer(CraftServer server, EntityPlayer entity) { -@@ -1348,6 +1349,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1389,6 +1390,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = firstPlayed; } @@ -136,7 +136,7 @@ index 5445554b18c22b85cf9b3427c22d693a24bc596b..2b18f158b14ca3968f4382fc1436e04d public void readExtraData(NBTTagCompound nbttagcompound) { hasPlayedBefore = true; if (nbttagcompound.hasKey("bukkit")) { -@@ -1370,6 +1383,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1411,6 +1424,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setExtraData(NBTTagCompound nbttagcompound) { @@ -145,7 +145,7 @@ index 5445554b18c22b85cf9b3427c22d693a24bc596b..2b18f158b14ca3968f4382fc1436e04d if (!nbttagcompound.hasKey("bukkit")) { nbttagcompound.set("bukkit", new NBTTagCompound()); } -@@ -1384,6 +1399,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1425,6 +1440,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { data.setLong("firstPlayed", getFirstPlayed()); data.setLong("lastPlayed", System.currentTimeMillis()); data.setString("lastKnownName", handle.getName()); diff --git a/Spigot-Server-Patches/0337-Fix-PlayerEditBookEvent.patch b/Spigot-Server-Patches/0326-Fix-PlayerEditBookEvent.patch similarity index 91% rename from Spigot-Server-Patches/0337-Fix-PlayerEditBookEvent.patch rename to Spigot-Server-Patches/0326-Fix-PlayerEditBookEvent.patch index 27d2476933..9fa41f0874 100644 --- a/Spigot-Server-Patches/0337-Fix-PlayerEditBookEvent.patch +++ b/Spigot-Server-Patches/0326-Fix-PlayerEditBookEvent.patch @@ -10,10 +10,10 @@ it impossible to properly cancel the event or modify the book meta cancelled writing diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 07e7093aa99015e10e44e0a6e4805701094b601d..da99aed8e7a94c43f9e1bcbf711ad19f41ecc634 100644 +index 06d4f5f0a2410478ff3eb5b9a57d963e4c74893b..782cfec6247d52a0e3aa12f21247f3aab1bb3c47 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -871,9 +871,11 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -890,9 +890,11 @@ public class PlayerConnection implements PacketListenerPlayIn { itemstack2.a("pages", (NBTBase) nbttaglist); this.player.a(packetplayinbedit.d(), CraftEventFactory.handleEditBookEvent(player, enumitemslot, itemstack1, itemstack2)); // CraftBukkit } else { diff --git a/Spigot-Server-Patches/0338-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/Spigot-Server-Patches/0327-Workaround-for-vehicle-tracking-issue-on-disconnect.patch similarity index 80% rename from Spigot-Server-Patches/0338-Workaround-for-vehicle-tracking-issue-on-disconnect.patch rename to Spigot-Server-Patches/0327-Workaround-for-vehicle-tracking-issue-on-disconnect.patch index 855b157d7a..c33559cdb0 100644 --- a/Spigot-Server-Patches/0338-Workaround-for-vehicle-tracking-issue-on-disconnect.patch +++ b/Spigot-Server-Patches/0327-Workaround-for-vehicle-tracking-issue-on-disconnect.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 98d480165ff3446317b4c9358a936cd7276cf908..2f09034fd9ee037987de06bbd130b379089ff306 100644 +index cafe8de58abb56bbf0b33c0aa35acf638eb2ee97..d137fd0b0543fb59aeaa40329c552edf689276e2 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1291,6 +1291,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - public void n() { - this.cq = true; +@@ -1398,6 +1398,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + public void p() { + this.co = true; this.ejectPassengers(); + + // Paper start - Workaround an issue where the vehicle doesn't track the passenger disconnection dismount. diff --git a/Spigot-Server-Patches/0339-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch b/Spigot-Server-Patches/0328-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch similarity index 91% rename from Spigot-Server-Patches/0339-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch rename to Spigot-Server-Patches/0328-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch index bd4dfeec9b..d40aa8bc37 100644 --- a/Spigot-Server-Patches/0339-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch +++ b/Spigot-Server-Patches/0328-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch @@ -24,10 +24,10 @@ Instead we opt to remove the check entirely so that the event fires for all piston types. diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java -index 1170a28107bee73c32cedd6a0a3d1d7c65129b10..b29525c40dc8e3ae747b8ddf5a3bd79b7cc0b792 100644 +index d4e2c68d32aa7113cf344a154777f2314ca03cca..c068a4115e3b82f4886d822d2472e8b522946674 100644 --- a/src/main/java/net/minecraft/server/BlockPiston.java +++ b/src/main/java/net/minecraft/server/BlockPiston.java -@@ -122,7 +122,7 @@ public class BlockPiston extends BlockDirectional { +@@ -112,7 +112,7 @@ public class BlockPiston extends BlockDirectional { } // CraftBukkit start @@ -36,7 +36,7 @@ index 1170a28107bee73c32cedd6a0a3d1d7c65129b10..b29525c40dc8e3ae747b8ddf5a3bd79b org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.of(), CraftBlock.notchToBlockFace(enumdirection)); world.getServer().getPluginManager().callEvent(event); -@@ -130,7 +130,7 @@ public class BlockPiston extends BlockDirectional { +@@ -120,7 +120,7 @@ public class BlockPiston extends BlockDirectional { if (event.isCancelled()) { return; } @@ -44,4 +44,4 @@ index 1170a28107bee73c32cedd6a0a3d1d7c65129b10..b29525c40dc8e3ae747b8ddf5a3bd79b + //} // Paper // PAIL: checkME - what happened to setTypeAndData? // CraftBukkit end - world.playBlockAction(blockposition, this, b0, enumdirection.b()); + world.playBlockAction(blockposition, this, b0, enumdirection.c()); diff --git a/Spigot-Server-Patches/0340-Block-Entity-remove-from-being-called-on-Players.patch b/Spigot-Server-Patches/0329-Block-Entity-remove-from-being-called-on-Players.patch similarity index 89% rename from Spigot-Server-Patches/0340-Block-Entity-remove-from-being-called-on-Players.patch rename to Spigot-Server-Patches/0329-Block-Entity-remove-from-being-called-on-Players.patch index 8c99ab2b44..713a6809cc 100644 --- a/Spigot-Server-Patches/0340-Block-Entity-remove-from-being-called-on-Players.patch +++ b/Spigot-Server-Patches/0329-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 2b18f158b14ca3968f4382fc1436e04d155e04a4..a614db834dfe8096ec0a7e6bc6e0348bfb300a1d 100644 +index 346629cba5ff956229e386caa5449fd068a16c60..addce5ab16b975b3c6690ae09aef88dfbfb454b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1949,6 +1949,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1989,6 +1989,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetCooldown() { getHandle().resetCooldown(); } diff --git a/Spigot-Server-Patches/0341-BlockDestroyEvent.patch b/Spigot-Server-Patches/0330-BlockDestroyEvent.patch similarity index 77% rename from Spigot-Server-Patches/0341-BlockDestroyEvent.patch rename to Spigot-Server-Patches/0330-BlockDestroyEvent.patch index 3c3f0d5790..b1debf0a1b 100644 --- a/Spigot-Server-Patches/0341-BlockDestroyEvent.patch +++ b/Spigot-Server-Patches/0330-BlockDestroyEvent.patch @@ -11,10 +11,10 @@ floating in the air. This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 29594e5fcddfd47d543813a2bf12234d9cbd29fd..3d13efc50b06748b94d6bb4a5a2f9ade1699a726 100644 +index a47de606a82b840180bd203816955fb657cc7c6c..366e4c6f3d83fd038c08f92d97d500e47d8e2104 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -453,8 +453,20 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -529,8 +529,20 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return false; } else { Fluid fluid = this.getFluid(blockposition); @@ -31,8 +31,8 @@ index 29594e5fcddfd47d543813a2bf12234d9cbd29fd..3d13efc50b06748b94d6bb4a5a2f9ade + } + // Paper end -- this.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata)); -+ if (playEffect) this.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata)); // Paper - if (flag) { - TileEntity tileentity = iblockdata.getBlock().isTileEntity() ? this.getTileEntity(blockposition) : null; +- if (!(iblockdata.getBlock() instanceof BlockFireAbstract)) { ++ if (playEffect && !(iblockdata.getBlock() instanceof BlockFireAbstract)) { // Paper + this.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata)); + } diff --git a/Spigot-Server-Patches/0342-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch b/Spigot-Server-Patches/0331-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch similarity index 100% rename from Spigot-Server-Patches/0342-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch rename to Spigot-Server-Patches/0331-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch diff --git a/Spigot-Server-Patches/0343-Fix-sign-edit-memory-leak.patch b/Spigot-Server-Patches/0332-Fix-sign-edit-memory-leak.patch similarity index 74% rename from Spigot-Server-Patches/0343-Fix-sign-edit-memory-leak.patch rename to Spigot-Server-Patches/0332-Fix-sign-edit-memory-leak.patch index c84015f126..4fea6bbb43 100644 --- a/Spigot-Server-Patches/0343-Fix-sign-edit-memory-leak.patch +++ b/Spigot-Server-Patches/0332-Fix-sign-edit-memory-leak.patch @@ -6,31 +6,31 @@ Subject: [PATCH] Fix sign edit memory leak when a player edits a sign, a reference to their Entity is never cleand up. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index da99aed8e7a94c43f9e1bcbf711ad19f41ecc634..a2ef24d7eb10f2bebfc095ff6707d1fab171b284 100644 +index 782cfec6247d52a0e3aa12f21247f3aab1bb3c47..76d67b6b0afa590e7e0f838aa7abb4efadfda045 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2547,7 +2547,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2586,7 +2586,7 @@ public class PlayerConnection implements PacketListenerPlayIn { TileEntitySign tileentitysign = (TileEntitySign) tileentity; - if (!tileentitysign.d() || tileentitysign.f() != this.player) { + if (!tileentitysign.d() || tileentitysign.signEditor == null || !tileentitysign.signEditor.equals(this.player.getUniqueID())) { - this.minecraftServer.warning("Player " + this.player.getDisplayName().getString() + " just tried to change non-editable sign"); + PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getDisplayName().getString()); this.sendPacket(tileentity.getUpdatePacket()); // CraftBukkit return; diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index 03f6ddf0003f0ef44ede31cf7a3491580ff0b5de..a934020190da937adaf2a0599259f85d3cbda269 100644 +index 8e77c662f7d970d8ff86f6c5b9bccc598442594d..2746cb4d4950b303f4d6b4822223d26b51ebe5a4 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java -@@ -10,6 +10,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // +@@ -11,6 +11,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // private EntityHuman c; - private final String[] g = new String[4]; + private final IChatFormatted[] g; private EnumColor color; + public java.util.UUID signEditor; // Paper public TileEntitySign() { super(TileEntityTypes.SIGN); -@@ -108,7 +109,10 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // +@@ -112,7 +113,10 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // } public void a(EntityHuman entityhuman) { diff --git a/Spigot-Server-Patches/0333-Lazy-init-world-storage-in-CraftOfflinePlayer.patch b/Spigot-Server-Patches/0333-Lazy-init-world-storage-in-CraftOfflinePlayer.patch deleted file mode 100644 index 6b1e4eb6ef..0000000000 --- a/Spigot-Server-Patches/0333-Lazy-init-world-storage-in-CraftOfflinePlayer.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Tue, 11 Dec 2018 22:25:07 -0500 -Subject: [PATCH] Lazy init world storage in CraftOfflinePlayer - -Allows access to some offline player properties even when there are no -worlds loaded. This is typically a rare occurrence but probably one that -should be covered as best we can. - -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 58e10381c898afc676b64cb02a16fbcedf151041..0e8a21b80371dd5ce833da3daf12fdcd9aabae9f 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -@@ -29,12 +29,12 @@ import org.bukkit.plugin.Plugin; - public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializable { - private final GameProfile profile; - private final CraftServer server; -- private final WorldNBTStorage storage; -+ private WorldNBTStorage storage; // Paper - lazy init - - protected CraftOfflinePlayer(CraftServer server, GameProfile profile) { - this.server = server; - this.profile = profile; -- this.storage = (WorldNBTStorage) (server.console.getWorldServer(DimensionManager.OVERWORLD).getDataManager()); -+ //this.storage = (WorldNBTStorage) (server.console.getWorldServer(DimensionManager.OVERWORLD).getDataManager()); // Paper - lazy init - - } - -@@ -181,8 +181,23 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa - return hash; - } - -+ // Paper - lazy -+ private WorldNBTStorage getStorageLazy() { -+ if (this.storage == null) { -+ net.minecraft.server.WorldServer worldServer = server.console.getWorldServer(DimensionManager.OVERWORLD); -+ if (worldServer == null) { -+ throw new IllegalStateException("Cannot get world storage when there are no worlds loaded!"); -+ } else { -+ this.storage = (WorldNBTStorage) worldServer.getDataManager(); -+ } -+ } -+ -+ return this.storage; -+ } -+ // Paper end -+ - private NBTTagCompound getData() { -- return storage.getPlayerData(getUniqueId().toString()); -+ return getStorageLazy().getPlayerData(getUniqueId().toString()); - } - - private NBTTagCompound getBukkitData() { -@@ -199,7 +214,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa - } - - private File getDataFile() { -- return new File(storage.getPlayerDir(), getUniqueId() + ".dat"); -+ return new File(getStorageLazy().getPlayerDir(), getUniqueId() + ".dat"); - } - - @Override diff --git a/Spigot-Server-Patches/0344-Limit-Client-Sign-length-more.patch b/Spigot-Server-Patches/0333-Limit-Client-Sign-length-more.patch similarity index 94% rename from Spigot-Server-Patches/0344-Limit-Client-Sign-length-more.patch rename to Spigot-Server-Patches/0333-Limit-Client-Sign-length-more.patch index 04e94a9a86..8f91800e6f 100644 --- a/Spigot-Server-Patches/0344-Limit-Client-Sign-length-more.patch +++ b/Spigot-Server-Patches/0333-Limit-Client-Sign-length-more.patch @@ -22,7 +22,7 @@ it only impacts data sent from the client. Set -DPaper.maxSignLength=XX to change limit or -1 to disable diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index a2ef24d7eb10f2bebfc095ff6707d1fab171b284..c215cb599da70403a46b09c1cdb01e02aadc96b7 100644 +index 76d67b6b0afa590e7e0f838aa7abb4efadfda045..0296dfc4e944de9156715c93a33b699c2d7cf63a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -103,6 +103,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -33,7 +33,7 @@ index a2ef24d7eb10f2bebfc095ff6707d1fab171b284..c215cb599da70403a46b09c1cdb01e02 private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit public PlayerConnection(MinecraftServer minecraftserver, NetworkManager networkmanager, EntityPlayer entityplayer) { -@@ -2563,6 +2564,15 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2602,6 +2603,15 @@ public class PlayerConnection implements PacketListenerPlayIn { String[] lines = new String[4]; for (int i = 0; i < astring.length; ++i) { diff --git a/Spigot-Server-Patches/0345-Don-t-check-ConvertSigns-boolean-every-sign-save.patch b/Spigot-Server-Patches/0334-Don-t-check-ConvertSigns-boolean-every-sign-save.patch similarity index 80% rename from Spigot-Server-Patches/0345-Don-t-check-ConvertSigns-boolean-every-sign-save.patch rename to Spigot-Server-Patches/0334-Don-t-check-ConvertSigns-boolean-every-sign-save.patch index 5b34219b56..e334dde496 100644 --- a/Spigot-Server-Patches/0345-Don-t-check-ConvertSigns-boolean-every-sign-save.patch +++ b/Spigot-Server-Patches/0334-Don-t-check-ConvertSigns-boolean-every-sign-save.patch @@ -7,18 +7,18 @@ property lookups arent super cheap. they synchronize, validate and check security managers. diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index a934020190da937adaf2a0599259f85d3cbda269..0e9a90b70f84b8da530814ac0b9b4b5fef458729 100644 +index 2746cb4d4950b303f4d6b4822223d26b51ebe5a4..c4b0d8720e71c7bf2cac7ed962b8fd33cf0b49b3 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java -@@ -11,6 +11,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // - private final String[] g = new String[4]; +@@ -12,6 +12,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // + private final IChatFormatted[] g; private EnumColor color; public java.util.UUID signEditor; // Paper + private static final boolean CONVERT_LEGACY_SIGNS = Boolean.getBoolean("convertLegacySigns"); // Paper public TileEntitySign() { super(TileEntityTypes.SIGN); -@@ -28,7 +29,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // +@@ -32,7 +33,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // } // CraftBukkit start diff --git a/Spigot-Server-Patches/0346-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/Spigot-Server-Patches/0335-Optimize-Network-Manager-and-add-advanced-packet-sup.patch similarity index 92% rename from Spigot-Server-Patches/0346-Optimize-Network-Manager-and-add-advanced-packet-sup.patch rename to Spigot-Server-Patches/0335-Optimize-Network-Manager-and-add-advanced-packet-sup.patch index 3dd3be3280..916220447e 100644 --- a/Spigot-Server-Patches/0346-Optimize-Network-Manager-and-add-advanced-packet-sup.patch +++ b/Spigot-Server-Patches/0335-Optimize-Network-Manager-and-add-advanced-packet-sup.patch @@ -28,7 +28,7 @@ and then catch exceptions and close if they fire. Part of this commit was authored by: Spottedleaf diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index b1dededc15cce686ead74a99bee64c89ac1de22c..32886109d03f9991446381160d5406056d2bf860 100644 +index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40e4902f29 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -64,6 +64,10 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -50,8 +50,8 @@ index b1dededc15cce686ead74a99bee64c89ac1de22c..32886109d03f9991446381160d540605 this.channel.attr(NetworkManager.c).set(enumprotocol); this.channel.config().setAutoRead(true); NetworkManager.LOGGER.debug("Enabled auto read"); -@@ -158,19 +163,82 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - NetworkManager.LOGGER.debug("Set listener of {} to {}", this, packetlistener); +@@ -157,19 +162,82 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + Validate.notNull(packetlistener, "packetListener", new Object[0]); this.packetListener = packetlistener; } + // Paper start @@ -138,7 +138,7 @@ index b1dededc15cce686ead74a99bee64c89ac1de22c..32886109d03f9991446381160d540605 } private void dispatchPacket(Packet packet, @Nullable GenericFutureListener> genericFutureListener) { this.b(packet, genericFutureListener); } // Paper - OBFHELPER -@@ -184,51 +252,116 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -183,51 +251,116 @@ public class NetworkManager extends SimpleChannelInboundHandler> { this.channel.config().setAutoRead(false); } @@ -265,7 +265,7 @@ index b1dededc15cce686ead74a99bee64c89ac1de22c..32886109d03f9991446381160d540605 public void a() { this.o(); -@@ -257,9 +390,21 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -256,9 +389,21 @@ public class NetworkManager extends SimpleChannelInboundHandler> { return this.socketAddress; } @@ -287,7 +287,7 @@ index b1dededc15cce686ead74a99bee64c89ac1de22c..32886109d03f9991446381160d540605 // Spigot End if (this.channel.isOpen()) { this.channel.close(); // We can't wait as this may be called from an event loop. -@@ -327,7 +472,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -326,7 +471,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { public void handleDisconnection() { if (this.channel != null && !this.channel.isOpen()) { if (this.o) { @@ -296,9 +296,9 @@ index b1dededc15cce686ead74a99bee64c89ac1de22c..32886109d03f9991446381160d540605 } else { this.o = true; if (this.j() != null) { -@@ -335,7 +480,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -334,7 +479,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } else if (this.i() != null) { - this.i().a(new ChatMessage("multiplayer.disconnect.generic", new Object[0])); + this.i().a(new ChatMessage("multiplayer.disconnect.generic")); } - this.packetQueue.clear(); // Free up packet queue. + clearPacketQueue(); // Paper @@ -331,18 +331,18 @@ index 2d8e6a2f4a0c3c5d74a647d7164b0028781d3bf5..c5edf8c4b01cc7ddac06797133e6fd13 return false; } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 6d7eb21fb05b2771084ab634ff4d32997b62ee9e..133a6eb9785baa0720ae254636d1ecafb5ee0217 100644 +index a6606eff5ac89c54bdcbee0d3bf124d737d9735b..7b3ac5620d5556a55838f1d57b3cbc11955a5712 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -143,6 +143,7 @@ public abstract class PlayerList { +@@ -166,6 +166,7 @@ public abstract class PlayerList { + boolean flag1 = gamerules.getBoolean(GameRules.REDUCED_DEBUG_INFO); - // CraftBukkit - getType() // Spigot - view distance + networkmanager.queueImmunity = true; // Paper - playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), WorldData.c(worlddata.getSeed()), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager().getType(), this.getMaxPlayers(), worlddata.getType(), worldserver.spigotConfig.viewDistance, flag1, !flag)); + playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.E(), this.s, worldserver1.getTypeKey(), worldserver1.getDimensionKey(), this.getMaxPlayers(), worldserver.spigotConfig.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld())); entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName()))); -@@ -152,6 +153,7 @@ public abstract class PlayerList { +@@ -175,6 +176,7 @@ public abstract class PlayerList { playerconnection.sendPacket(new PacketPlayOutRecipeUpdate(this.server.getCraftingManager().b())); playerconnection.sendPacket(new PacketPlayOutTags(this.server.getTagRegistry())); playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean(GameRules.REDUCED_DEBUG_INFO) ? 22 : 23))); // Paper - fix this rule not being initialized on the client @@ -351,10 +351,10 @@ index 6d7eb21fb05b2771084ab634ff4d32997b62ee9e..133a6eb9785baa0720ae254636d1ecaf entityplayer.getStatisticManager().c(); entityplayer.B().a(entityplayer); diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 37a22ba6f7a2ac54759428d23d5ea9787bb557f7..ceecb78ff879e4d6a3295b05d04deb01b7fb1da6 100644 +index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..8055a8aab682cfd81fc45f587d3578e25a2128f0 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java -@@ -41,10 +41,12 @@ public class ServerConnection { +@@ -40,10 +40,12 @@ public class ServerConnection { private final List connectedChannels = Collections.synchronizedList(Lists.newArrayList()); // Paper start - prevent blocking on adding a new network manager while the server is ticking private final java.util.Queue pending = new java.util.concurrent.ConcurrentLinkedQueue<>(); @@ -367,7 +367,7 @@ index 37a22ba6f7a2ac54759428d23d5ea9787bb557f7..ceecb78ff879e4d6a3295b05d04deb01 } } // Paper end -@@ -79,6 +81,7 @@ public class ServerConnection { +@@ -78,6 +80,7 @@ public class ServerConnection { ; } diff --git a/Spigot-Server-Patches/0347-Handle-Oversized-Tile-Entities-in-chunks.patch b/Spigot-Server-Patches/0336-Handle-Oversized-Tile-Entities-in-chunks.patch similarity index 83% rename from Spigot-Server-Patches/0347-Handle-Oversized-Tile-Entities-in-chunks.patch rename to Spigot-Server-Patches/0336-Handle-Oversized-Tile-Entities-in-chunks.patch index 8303b56472..0adb9b89ea 100644 --- a/Spigot-Server-Patches/0347-Handle-Oversized-Tile-Entities-in-chunks.patch +++ b/Spigot-Server-Patches/0336-Handle-Oversized-Tile-Entities-in-chunks.patch @@ -9,10 +9,10 @@ creating too large of a packet to sed. Co authored by Spottedleaf diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index a0b87f89df77ba8ac6ce3f135d4f3a34ed2b3543..23223f3f45210cf23f44f9012f292db80df781a0 100644 +index 6e1426127fc5b5ddc205603b8d03b98a046f9741..900f16efde29ace3f073b1cbc01df8bafc360a9a 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -@@ -23,6 +23,15 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -24,6 +24,15 @@ public class PacketPlayOutMapChunk implements Packet { public PacketPlayOutMapChunk() {} @@ -25,18 +25,18 @@ index a0b87f89df77ba8ac6ce3f135d4f3a34ed2b3543..23223f3f45210cf23f44f9012f292db8 + return extraPackets; + } + // Paper end - public PacketPlayOutMapChunk(Chunk chunk, int i) { + public PacketPlayOutMapChunk(Chunk chunk, int i, boolean flag) { ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); -@@ -49,6 +58,7 @@ public class PacketPlayOutMapChunk implements Packet { - this.c = this.a(new PacketDataSerializer(this.j()), chunk, i); +@@ -51,6 +60,7 @@ public class PacketPlayOutMapChunk implements Packet { + this.c = this.a(new PacketDataSerializer(this.k()), chunk, i); this.g = Lists.newArrayList(); iterator = chunk.getTileEntities().entrySet().iterator(); + int totalTileEntities = 0; // Paper while (iterator.hasNext()) { entry = (Entry) iterator.next(); -@@ -57,6 +67,15 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -59,6 +69,15 @@ public class PacketPlayOutMapChunk implements Packet { int j = blockposition.getY() >> 4; if (this.f() || (i & 1 << j) != 0) { diff --git a/Spigot-Server-Patches/0348-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch b/Spigot-Server-Patches/0337-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch similarity index 52% rename from Spigot-Server-Patches/0348-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch rename to Spigot-Server-Patches/0337-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch index 5e8d349191..135948b87f 100644 --- a/Spigot-Server-Patches/0348-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch +++ b/Spigot-Server-Patches/0337-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch @@ -10,32 +10,11 @@ everything to the Whitelist object. https://github.com/PaperMC/Paper/issues/1880 -diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java -index 8570e38f42e2f489e2899ac2f0c4a7b8dda3bb75..c97be42dd7b4c6ea2cadcc97f47185c7f02e2cce 100644 ---- a/src/main/java/net/minecraft/server/JsonList.java -+++ b/src/main/java/net/minecraft/server/JsonList.java -@@ -64,6 +64,7 @@ public class JsonList> { - return this.e; - } - -+ public void setEnabled(boolean flag) { this.a(flag); } // Paper - OBFHeLPER - public void a(boolean flag) { - this.e = flag; - } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 133a6eb9785baa0720ae254636d1ecafb5ee0217..566aad94dc986fa1d8a2e139e79a24d567c3c6ef 100644 +index 7b3ac5620d5556a55838f1d57b3cbc11955a5712..ce2cf5f9432c9e20d351914646a78974d1f17b03 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -62,7 +62,7 @@ public abstract class PlayerList { - // private final Map p; - // CraftBukkit end - public IPlayerFileData playerFileData; -- private boolean hasWhitelist; -+ //private boolean hasWhitelist; - protected final int maxPlayers; - private int viewDistance; - private EnumGamemode t; -@@ -889,9 +889,9 @@ public abstract class PlayerList { +@@ -931,9 +931,9 @@ public abstract class PlayerList { } public boolean isWhitelisted(GameProfile gameprofile, org.bukkit.event.player.PlayerLoginEvent loginEvent) { boolean isOp = this.operators.d(gameprofile); @@ -47,17 +26,3 @@ index 133a6eb9785baa0720ae254636d1ecafb5ee0217..566aad94dc986fa1d8a2e139e79a24d5 event.callEvent(); if (!event.isWhitelisted()) { if (loginEvent != null) { -@@ -1022,11 +1022,11 @@ public abstract class PlayerList { - } - - public boolean getHasWhitelist() { -- return this.hasWhitelist; -+ return this.whitelist.isEnabled(); // Paper - } - - public void setHasWhitelist(boolean flag) { -- this.hasWhitelist = flag; -+ this.whitelist.setEnabled(flag); // Paper - } - - public List b(String s) { diff --git a/Spigot-Server-Patches/0349-Set-Zombie-last-tick-at-start-of-drowning-process.patch b/Spigot-Server-Patches/0338-Set-Zombie-last-tick-at-start-of-drowning-process.patch similarity index 72% rename from Spigot-Server-Patches/0349-Set-Zombie-last-tick-at-start-of-drowning-process.patch rename to Spigot-Server-Patches/0338-Set-Zombie-last-tick-at-start-of-drowning-process.patch index a7e687c118..a3745587c3 100644 --- a/Spigot-Server-Patches/0349-Set-Zombie-last-tick-at-start-of-drowning-process.patch +++ b/Spigot-Server-Patches/0338-Set-Zombie-last-tick-at-start-of-drowning-process.patch @@ -6,14 +6,14 @@ Subject: [PATCH] Set Zombie last tick at start of drowning process Fixes GH-1887 diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index d64c03f006af1c829862d02d1fc4fde007dd9a5b..e8b9a21baf74645cc07cd9daf741bf9f65deff08 100644 +index 18705e1e2a04ec2790b104a290b9edc8e9fb4f1a..9bb54d13a318199bbce3d5b32db3710f822daa40 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -168,6 +168,7 @@ public class EntityZombie extends EntityMonster { - ++this.bC; - if (this.bC >= 600) { +@@ -162,6 +162,7 @@ public class EntityZombie extends EntityMonster { + ++this.bA; + if (this.bA >= 600) { this.startDrownedConversion(300); + this.lastTick = MinecraftServer.currentTick; // Paper - Make sure this is set at start of process - GH-1887 } } else { - this.bC = -1; + this.bA = -1; diff --git a/Spigot-Server-Patches/0350-Allow-Saving-of-Oversized-Chunks.patch b/Spigot-Server-Patches/0339-Allow-Saving-of-Oversized-Chunks.patch similarity index 94% rename from Spigot-Server-Patches/0350-Allow-Saving-of-Oversized-Chunks.patch rename to Spigot-Server-Patches/0339-Allow-Saving-of-Oversized-Chunks.patch index 93dccd951b..4eef91158a 100644 --- a/Spigot-Server-Patches/0350-Allow-Saving-of-Oversized-Chunks.patch +++ b/Spigot-Server-Patches/0339-Allow-Saving-of-Oversized-Chunks.patch @@ -51,7 +51,7 @@ index db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..2322c0c8c5aacebb6317eab8ce424555 a((NBTBase) nbttagcompound, dataoutput); } diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index cee1ea8f43e3135cd72a67c1c8067174feaf956e..6b543f89d4e32fb79bfe9aa7b815e4117dbea602 100644 +index 26b55108ecf4cd48762b00da625b0ce1d2f42c67..f781bb12a1c37d8b3088d0f638eae80d5b80aca4 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -17,6 +17,8 @@ import java.nio.file.Files; @@ -69,18 +69,18 @@ index cee1ea8f43e3135cd72a67c1c8067174feaf956e..6b543f89d4e32fb79bfe9aa7b815e411 private final RegionFileBitSet freeSectors; + public final File file; - public RegionFile(File file, File file1) throws IOException { - this(file.toPath(), file1.toPath(), RegionFileCompression.b); + public RegionFile(File file, File file1, boolean flag) throws IOException { + this(file.toPath(), file1.toPath(), RegionFileCompression.b, flag); } - public RegionFile(java.nio.file.Path java_nio_file_path, java.nio.file.Path java_nio_file_path1, RegionFileCompression regionfilecompression) throws IOException { + public RegionFile(java.nio.file.Path java_nio_file_path, java.nio.file.Path java_nio_file_path1, RegionFileCompression regionfilecompression, boolean flag) throws IOException { + this.file = java_nio_file_path.toFile(); // Paper this.f = ByteBuffer.allocateDirect(8192); + initOversizedState(); this.freeSectors = new RegionFileBitSet(); this.e = regionfilecompression; if (!Files.isDirectory(java_nio_file_path1, new LinkOption[0])) { -@@ -384,6 +389,74 @@ public class RegionFile implements AutoCloseable { +@@ -389,6 +394,74 @@ public class RegionFile implements AutoCloseable { void run() throws IOException; } @@ -156,10 +156,10 @@ index cee1ea8f43e3135cd72a67c1c8067174feaf956e..6b543f89d4e32fb79bfe9aa7b815e411 private final ChunkCoordIntPair b; diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 5065ece393a47add3c4e888fd7fb3d9ba47acfed..942b7d323936a872d83c536c1901b4b436aa7e7c 100644 +index 0305f3c93e8485552890dd5eca8e79277e2bb886..02bd568af727633a6e834d5328683a9ff67b9dd7 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -42,6 +42,74 @@ public final class RegionFileCache implements AutoCloseable { +@@ -44,6 +44,74 @@ public final class RegionFileCache implements AutoCloseable { } } @@ -234,7 +234,7 @@ index 5065ece393a47add3c4e888fd7fb3d9ba47acfed..942b7d323936a872d83c536c1901b4b4 @Nullable public NBTTagCompound read(ChunkCoordIntPair chunkcoordintpair) throws IOException { // CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing -@@ -51,6 +119,12 @@ public final class RegionFileCache implements AutoCloseable { +@@ -53,6 +121,12 @@ public final class RegionFileCache implements AutoCloseable { } // CraftBukkit end DataInputStream datainputstream = regionfile.a(chunkcoordintpair); @@ -247,7 +247,7 @@ index 5065ece393a47add3c4e888fd7fb3d9ba47acfed..942b7d323936a872d83c536c1901b4b4 Throwable throwable = null; NBTTagCompound nbttagcompound; -@@ -91,6 +165,7 @@ public final class RegionFileCache implements AutoCloseable { +@@ -93,6 +167,7 @@ public final class RegionFileCache implements AutoCloseable { try { NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); diff --git a/Spigot-Server-Patches/0351-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/Spigot-Server-Patches/0340-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch similarity index 75% rename from Spigot-Server-Patches/0351-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch rename to Spigot-Server-Patches/0340-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch index 430d5da7e4..a94c7e1b1e 100644 --- a/Spigot-Server-Patches/0351-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch +++ b/Spigot-Server-Patches/0340-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 566aad94dc986fa1d8a2e139e79a24d567c3c6ef..6c0bd57a75f7fc65f412054529793273940d9ff4 100644 +index ce2cf5f9432c9e20d351914646a78974d1f17b03..e4651eb2a94080bfa431b0b775ae8019fc922538 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1026,6 +1026,7 @@ public abstract class PlayerList { +@@ -1049,6 +1049,7 @@ public abstract class PlayerList { } public void setHasWhitelist(boolean flag) { + new com.destroystokyo.paper.event.server.WhitelistToggleEvent(flag).callEvent(); - this.whitelist.setEnabled(flag); // Paper + this.hasWhitelist = flag; } diff --git a/Spigot-Server-Patches/0352-Add-LivingEntity-getTargetEntity.patch b/Spigot-Server-Patches/0341-Add-LivingEntity-getTargetEntity.patch similarity index 84% rename from Spigot-Server-Patches/0352-Add-LivingEntity-getTargetEntity.patch rename to Spigot-Server-Patches/0341-Add-LivingEntity-getTargetEntity.patch index 9266f64728..d39459ba8e 100644 --- a/Spigot-Server-Patches/0352-Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-Server-Patches/0341-Add-LivingEntity-getTargetEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java -index 3e90b57b6fd5dcb6cb1325861306e2ff84d0cccb..1a466e92956e1eee5c0a7d30f89177e4b189fcb8 100644 +index 02c09f39848399a86d46bd17569b4f01a7b5ab1f..ed9b2f9adfecdc6d1b9925579ec510657adde11f 100644 --- a/src/main/java/net/minecraft/server/AxisAlignedBB.java +++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java -@@ -108,6 +108,7 @@ public class AxisAlignedBB { +@@ -112,6 +112,7 @@ public class AxisAlignedBB { return this.b(vec3d.x, vec3d.y, vec3d.z); } @@ -16,7 +16,7 @@ index 3e90b57b6fd5dcb6cb1325861306e2ff84d0cccb..1a466e92956e1eee5c0a7d30f89177e4 public AxisAlignedBB b(double d0, double d1, double d2) { double d3 = this.minX; double d4 = this.minY; -@@ -137,6 +138,12 @@ public class AxisAlignedBB { +@@ -141,6 +142,12 @@ public class AxisAlignedBB { return new AxisAlignedBB(d3, d4, d5, d6, d7, d8); } @@ -29,15 +29,15 @@ index 3e90b57b6fd5dcb6cb1325861306e2ff84d0cccb..1a466e92956e1eee5c0a7d30f89177e4 public AxisAlignedBB grow(double d0, double d1, double d2) { double d3 = this.minX - d0; double d4 = this.minY - d1; -@@ -196,6 +203,7 @@ public class AxisAlignedBB { +@@ -200,6 +207,7 @@ public class AxisAlignedBB { return this.minX < d3 && this.maxX > d0 && this.minY < d4 && this.maxY > d1 && this.minZ < d5 && this.maxZ > d2; } -+ public final boolean contains(Vec3D vec3d) { return c(vec3d); } // Paper - OBFHELPER - public boolean c(Vec3D vec3d) { ++ public final boolean contains(Vec3D vec3d) { return d(vec3d); } // Paper - OBFHELPER + public boolean d(Vec3D vec3d) { return this.e(vec3d.x, vec3d.y, vec3d.z); } -@@ -229,6 +237,7 @@ public class AxisAlignedBB { +@@ -233,6 +241,7 @@ public class AxisAlignedBB { return this.g(-d0); } @@ -46,10 +46,10 @@ index 3e90b57b6fd5dcb6cb1325861306e2ff84d0cccb..1a466e92956e1eee5c0a7d30f89177e4 double[] adouble = new double[]{1.0D}; double d0 = vec3d1.x - vec3d.x; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 3d44188e68df31d188f25820000e2c39aa5b6ce0..9368c4afa7bbb336894d73069b3c0858231d1e81 100644 +index 777d2a6aac7dd1b74124b7a8af87b258a27f4726..84aa003d90b64c0a37e155f38041c7908860b7f9 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1476,6 +1476,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1427,6 +1427,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.c(f - 90.0F, f1); } @@ -57,19 +57,19 @@ index 3d44188e68df31d188f25820000e2c39aa5b6ce0..9368c4afa7bbb336894d73069b3c0858 public final Vec3D j(float f) { if (f == 1.0F) { return new Vec3D(this.locX(), this.getHeadY(), this.locZ()); -@@ -2132,6 +2133,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2052,6 +2053,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.getPassengers().size() < 1; } -+ public final float getCollisionBorderSize() { return aV(); } // Paper - OBFHELPER - public float aV() { ++ public final float getCollisionBorderSize() { return bc(); } // Paper - OBFHELPER + public float bc() { return 0.0F; } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 347d4abdecddf0c92f81b2958fbaccc22cf16b26..0a31f2e931bba74ecda40c3792718a530acec3af 100644 +index 1481cbafa1b4e48822d9e0fa2735b9829440fca3..79cf31d6fcd0e82ee146c489448a93a6e55e4190 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3311,6 +3311,37 @@ public abstract class EntityLiving extends Entity { +@@ -3489,6 +3489,37 @@ public abstract class EntityLiving extends Entity { return world.rayTrace(raytrace); } @@ -108,7 +108,7 @@ index 347d4abdecddf0c92f81b2958fbaccc22cf16b26..0a31f2e931bba74ecda40c3792718a53 public int getShieldBlockingDelay() { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index c1f462d9d3eefdab767bea28da484bfb1dfda06a..498f381099b2cf9460104688e12afc5f586e057a 100644 +index d7e3580067bcbca09b66f05f02e8736863bd7ef5..28f10ab2e427872c04bc97ebc392cf6d58854cf9 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -18,6 +18,7 @@ public final class IEntitySelector { @@ -117,13 +117,13 @@ index c1f462d9d3eefdab767bea28da484bfb1dfda06a..498f381099b2cf9460104688e12afc5f }; + public static Predicate notSpectator() { return f; } // Paper - OBFHELPER public static final Predicate f = (entity) -> { - return !entity.isSpectator(); + return !(entity instanceof EntityHuman) || !entity.isSpectator() && !((EntityHuman) entity).isCreative() && entity.world.getDifficulty() != EnumDifficulty.PEACEFUL; }; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 9e082d4514eb57667cb50a390bef7ab72b94e838..7d101d9630848b68b15acc5efdc16ae51dc1f132 100644 +index 2e7bacff55f57fda8b5644fb9d7934a615e5f550..39b8ab223bc708e5ee3dc967e489fdc76d944416 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -216,6 +216,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -219,6 +219,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { new com.destroystokyo.paper.block.TargetBlockInfo(org.bukkit.craftbukkit.block.CraftBlock.at(getHandle().world, ((net.minecraft.server.MovingObjectPositionBlock)rayTrace).getBlockPosition()), net.minecraft.server.MCUtil.toBukkitBlockFace(((net.minecraft.server.MovingObjectPositionBlock)rayTrace).getDirection())); } diff --git a/Spigot-Server-Patches/0353-Use-proper-max-length-when-serialising-BungeeCord-te.patch b/Spigot-Server-Patches/0342-Use-proper-max-length-when-serialising-BungeeCord-te.patch similarity index 91% rename from Spigot-Server-Patches/0353-Use-proper-max-length-when-serialising-BungeeCord-te.patch rename to Spigot-Server-Patches/0342-Use-proper-max-length-when-serialising-BungeeCord-te.patch index feae128d09..2918d2ee68 100644 --- a/Spigot-Server-Patches/0353-Use-proper-max-length-when-serialising-BungeeCord-te.patch +++ b/Spigot-Server-Patches/0342-Use-proper-max-length-when-serialising-BungeeCord-te.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Use proper max length when serialising BungeeCord text diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java -index 0ab611564edc3cd9322e0dbe21832510e9c35bbf..f7b2095bb75ac4533133cf6ad547ccf53492f215 100644 +index 6ae26f8c3637e0c9e56ed3e14aaac0e3f781cb43..b9b2ddc1acadb96a0c750aeba0c0f6928f74e2fe 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java -@@ -3,7 +3,7 @@ package net.minecraft.server; - import java.io.IOException; +@@ -4,7 +4,7 @@ import java.io.IOException; + import java.util.UUID; public class PacketPlayOutChat implements Packet { - diff --git a/Spigot-Server-Patches/0354-Entity-getEntitySpawnReason.patch b/Spigot-Server-Patches/0343-Entity-getEntitySpawnReason.patch similarity index 85% rename from Spigot-Server-Patches/0354-Entity-getEntitySpawnReason.patch rename to Spigot-Server-Patches/0343-Entity-getEntitySpawnReason.patch index 295ba32c56..519ccc919f 100644 --- a/Spigot-Server-Patches/0354-Entity-getEntitySpawnReason.patch +++ b/Spigot-Server-Patches/0343-Entity-getEntitySpawnReason.patch @@ -10,10 +10,10 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 9368c4afa7bbb336894d73069b3c0858231d1e81..ae0f5e5a71502c432a4dcaa42a3fc9eeffe28e72 100644 +index 84aa003d90b64c0a37e155f38041c7908860b7f9..8144433d6c309d49b624e88623a3dd376f7c62b3 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -72,6 +72,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -73,6 +73,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } }; List entitySlice = null; @@ -21,7 +21,7 @@ index 9368c4afa7bbb336894d73069b3c0858231d1e81..ae0f5e5a71502c432a4dcaa42a3fc9ee // Paper end public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper -@@ -1629,6 +1630,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1590,6 +1591,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (this.origin != null) { nbttagcompound.set("Paper.Origin", this.createList(origin.getX(), origin.getY(), origin.getZ())); } @@ -31,7 +31,7 @@ index 9368c4afa7bbb336894d73069b3c0858231d1e81..ae0f5e5a71502c432a4dcaa42a3fc9ee // Save entity's from mob spawner status if (spawnedViaMobSpawner) { nbttagcompound.setBoolean("Paper.FromMobSpawner", true); -@@ -1755,6 +1759,26 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1718,6 +1722,26 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } spawnedViaMobSpawner = nbttagcompound.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status @@ -59,12 +59,12 @@ index 9368c4afa7bbb336894d73069b3c0858231d1e81..ae0f5e5a71502c432a4dcaa42a3fc9ee } catch (Throwable throwable) { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 6c0bd57a75f7fc65f412054529793273940d9ff4..c673f3579f868b4a25a46815877289c568e7763b 100644 +index e4651eb2a94080bfa431b0b775ae8019fc922538..4b8dd6c1a9c796ded5ee0a63ccecebca9ac2b8ca 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -240,7 +240,7 @@ public abstract class PlayerList { +@@ -263,7 +263,7 @@ public abstract class PlayerList { // CraftBukkit start - WorldServer finalWorldServer = worldserver; + WorldServer finalWorldServer = worldserver1; Entity entity = EntityTypes.a(nbttagcompound1.getCompound("Entity"), finalWorldServer, (entity1) -> { - return !finalWorldServer.addEntitySerialized(entity1) ? null : entity1; + return !finalWorldServer.addEntitySerialized(entity1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.MOUNT) ? null : entity1; // Paper @@ -72,10 +72,10 @@ index 6c0bd57a75f7fc65f412054529793273940d9ff4..c673f3579f868b4a25a46815877289c5 }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 271a1ef3d0aae7c1d0b373963504e70f2843cd24..0decbee892c532c0188b373728d8458c8cbbc0d9 100644 +index 14ec04c6503cca58f64fc2a82a9fd715a06dcefb..a72f16cbcbc226854043bfec07e1e57dbe33c62c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1000,6 +1000,7 @@ public class WorldServer extends World { +@@ -923,6 +923,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit start private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot @@ -84,10 +84,10 @@ index 271a1ef3d0aae7c1d0b373963504e70f2843cd24..0decbee892c532c0188b373728d8458c if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 5f16dea1a543607e76f7ef70fe44e9a3f12e9132..d16d3fe58e6a45e3023946174d2e137a0670e455 100644 +index 51f027e8f98240fec989ea877095031bab087bda..821417610fdb23791bd83e263977026b9d09e31a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1052,5 +1052,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1060,5 +1060,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public boolean fromMobSpawner() { return getHandle().spawnedViaMobSpawner; } diff --git a/Spigot-Server-Patches/0355-Update-entity-Metadata-for-all-tracked-players.patch b/Spigot-Server-Patches/0344-Update-entity-Metadata-for-all-tracked-players.patch similarity index 86% rename from Spigot-Server-Patches/0355-Update-entity-Metadata-for-all-tracked-players.patch rename to Spigot-Server-Patches/0344-Update-entity-Metadata-for-all-tracked-players.patch index 2dfc05f151..ff83ee17da 100644 --- a/Spigot-Server-Patches/0355-Update-entity-Metadata-for-all-tracked-players.patch +++ b/Spigot-Server-Patches/0344-Update-entity-Metadata-for-all-tracked-players.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Update entity Metadata for all tracked players diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 3ff7a7b4a853068eba2fb034246a58116a846523..3a88c9a67062eb73ad8257ea786efca7e7e99f65 100644 +index b5a76f37c27cde25b2561a23c7c0fe7bdd992fee..9b89c0c8a3f1dada4e9b2aaeed0b92e56229b7ca 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -387,6 +387,12 @@ public class EntityTrackerEntry { +@@ -392,6 +392,12 @@ public class EntityTrackerEntry { return PacketPlayOutEntity.a(this.xLoc, this.yLoc, this.zLoc); } @@ -22,10 +22,10 @@ index 3ff7a7b4a853068eba2fb034246a58116a846523..3a88c9a67062eb73ad8257ea786efca7 this.f.accept(packet); if (this.tracker instanceof EntityPlayer) { diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index c215cb599da70403a46b09c1cdb01e02aadc96b7..266aa79420238d144a07022aab4a3ced5b0707e4 100644 +index 0296dfc4e944de9156715c93a33b699c2d7cf63a..4a718ab0cccef1eef2bcf6fdc5942ba820858dc1 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2007,7 +2007,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2045,7 +2045,14 @@ public class PlayerConnection implements PacketListenerPlayIn { if (event.isCancelled() || this.player.inventory.getItemInHand() == null || this.player.inventory.getItemInHand().getItem() != origItem) { // Refresh the current entity metadata diff --git a/Spigot-Server-Patches/0357-Implement-PlayerPostRespawnEvent.patch b/Spigot-Server-Patches/0345-Implement-PlayerPostRespawnEvent.patch similarity index 63% rename from Spigot-Server-Patches/0357-Implement-PlayerPostRespawnEvent.patch rename to Spigot-Server-Patches/0345-Implement-PlayerPostRespawnEvent.patch index e5cf9f570d..085f34bbd9 100644 --- a/Spigot-Server-Patches/0357-Implement-PlayerPostRespawnEvent.patch +++ b/Spigot-Server-Patches/0345-Implement-PlayerPostRespawnEvent.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Implement PlayerPostRespawnEvent diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index c673f3579f868b4a25a46815877289c568e7763b..559a411627ed7b018f00b90e8dfc1b470af4a531 100644 +index 4b8dd6c1a9c796ded5ee0a63ccecebca9ac2b8ca..8d067082ad52397d11822277438f00a43d7f3e09 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -627,9 +627,14 @@ public abstract class PlayerList { - - // this.a(entityplayer1, entityplayer, worldserver); // CraftBukkit - removed +@@ -665,9 +665,14 @@ public abstract class PlayerList { + // this.a(entityplayer1, entityplayer, worldserver1); // CraftBukkit - removed + boolean flag2 = false; + // Paper start + boolean isBedSpawn = false; @@ -20,19 +20,19 @@ index c673f3579f868b4a25a46815877289c568e7763b..559a411627ed7b018f00b90e8dfc1b47 // CraftBukkit start - fire PlayerRespawnEvent if (location == null) { - boolean isBedSpawn = false; -+ //boolean isBedSpawn = false; Paper - moved up - CraftWorld cworld = (CraftWorld) this.server.server.getWorld(entityplayer.spawnWorld); - if (cworld != null && blockposition != null) { - Optional optional = EntityHuman.getBed(cworld.getHandle(), blockposition, flag1); -@@ -662,6 +667,7 @@ public abstract class PlayerList { ++ // boolean isBedSpawn = false; // Paper - moved up + WorldServer worldserver1 = this.server.getWorldServer(entityplayer.getSpawnDimension()); + if (worldserver1 != null) { + Optional optional; +@@ -708,6 +713,7 @@ public abstract class PlayerList { location = respawnEvent.getRespawnLocation(); if (!flag) entityplayer.reset(); // SPIGOT-4785 + isRespawn = true; // Paper } else { - location.setWorld(server.getWorldServer(dimensionmanager).getWorld()); + location.setWorld(worldserver.getWorld()); } -@@ -723,6 +729,13 @@ public abstract class PlayerList { +@@ -765,6 +771,13 @@ public abstract class PlayerList { if (entityplayer.playerConnection.isDisconnected()) { this.savePlayerFile(entityplayer); } diff --git a/Spigot-Server-Patches/0358-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/Spigot-Server-Patches/0346-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch similarity index 90% rename from Spigot-Server-Patches/0358-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch rename to Spigot-Server-Patches/0346-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch index 1fecfc7491..761fcc4931 100644 --- a/Spigot-Server-Patches/0358-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch +++ b/Spigot-Server-Patches/0346-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch @@ -6,7 +6,7 @@ Subject: [PATCH] don't go below 0 for pickupDelay, breaks picking up items vanilla checks for == 0 diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index e5c9bac88a59d52c9b2f05df3e4f373edbe009ca..ef2cf6565b5935b1f1a80f12670609017aebb2c8 100644 +index aad23b2c6cd674e05e609c4c019205978c6741f2..465550656356394074ebf4cc8d6188455daded88 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -60,6 +60,7 @@ public class EntityItem extends Entity { @@ -17,7 +17,7 @@ index e5c9bac88a59d52c9b2f05df3e4f373edbe009ca..ef2cf6565b5935b1f1a80f1267060901 if (this.age != -32768) this.age += elapsedTicks; this.lastTick = MinecraftServer.currentTick; // CraftBukkit end -@@ -146,6 +147,7 @@ public class EntityItem extends Entity { +@@ -147,6 +148,7 @@ public class EntityItem extends Entity { // CraftBukkit start - Use wall time for pickup and despawn timers int elapsedTicks = MinecraftServer.currentTick - this.lastTick; if (this.pickupDelay != 32767) this.pickupDelay -= elapsedTicks; diff --git a/Spigot-Server-Patches/0359-Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-Server-Patches/0347-Implement-getters-and-setters-for-EntityItem-owner-a.patch similarity index 100% rename from Spigot-Server-Patches/0359-Implement-getters-and-setters-for-EntityItem-owner-a.patch rename to Spigot-Server-Patches/0347-Implement-getters-and-setters-for-EntityItem-owner-a.patch diff --git a/Spigot-Server-Patches/0360-Server-Tick-Events.patch b/Spigot-Server-Patches/0348-Server-Tick-Events.patch similarity index 81% rename from Spigot-Server-Patches/0360-Server-Tick-Events.patch rename to Spigot-Server-Patches/0348-Server-Tick-Events.patch index 3eb33d48c7..e3877e97ef 100644 --- a/Spigot-Server-Patches/0360-Server-Tick-Events.patch +++ b/Spigot-Server-Patches/0348-Server-Tick-Events.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Server Tick Events Fires event at start and end of a server tick diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 738ba4ee303b796cadf17b78791fad461545f1cc..992c03d799f9dbbb9f63559d787124b04b00283e 100644 +index f1098b1b62fd568579fd0e1fda63478f58036c8c..5d62daec9afe60cfb0069b6ed867d1d2530389a8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1092,6 +1092,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= -30000000 && j >= -30000000 && i < 30000000 && j < 30000000) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 07729667f5c66bbcb85fc59cb5fa3c218efa2ec8..2a3d133e51326b0088af2ce53e09bf2fe4b0c3c6 100644 +index fb7e4e2f02b62f7cfeec6a619a4c2943cc071c46..199103ab72b0666b23f78961dd7435c3ff210339 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -339,6 +339,29 @@ public class CraftWorld implements World { +@@ -340,6 +340,29 @@ public class CraftWorld implements World { return getHighestBlockYAt(x, z, org.bukkit.HeightMap.MOTION_BLOCKING); } diff --git a/Spigot-Server-Patches/0364-Mob-Spawner-API-Enhancements.patch b/Spigot-Server-Patches/0352-Mob-Spawner-API-Enhancements.patch similarity index 98% rename from Spigot-Server-Patches/0364-Mob-Spawner-API-Enhancements.patch rename to Spigot-Server-Patches/0352-Mob-Spawner-API-Enhancements.patch index a36af687a1..513265985f 100644 --- a/Spigot-Server-Patches/0364-Mob-Spawner-API-Enhancements.patch +++ b/Spigot-Server-Patches/0352-Mob-Spawner-API-Enhancements.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Mob Spawner API Enhancements diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index cb7cb789b82461093fbbb4c8ae6d03fcbfe57383..41001b02a654194c4a8e25ad5f7af8fdd91090b2 100644 +index e2f5354709819e56f9bc66b8c8d5e095bc8387b4..921abae4914c7b3f28d387f7a682d991293c4798 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -47,6 +47,7 @@ public abstract class MobSpawnerAbstract { diff --git a/Spigot-Server-Patches/0353-Per-Player-View-Distance-API-placeholders.patch b/Spigot-Server-Patches/0353-Per-Player-View-Distance-API-placeholders.patch new file mode 100644 index 0000000000..947adc711f --- /dev/null +++ b/Spigot-Server-Patches/0353-Per-Player-View-Distance-API-placeholders.patch @@ -0,0 +1,62 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Mon, 6 May 2019 01:29:25 -0400 +Subject: [PATCH] Per-Player View Distance API placeholders + +I hope to look at this more in-depth soon. It appears doable. +However this should not block the update. + +diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java +index 279807dc5045e765fe7496315494b2cb231d08f9..ac12d782539a5f502e8996eb39eb2ddbab46f756 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java ++++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java +@@ -576,9 +576,10 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + if (this.deathAnimationTicks == 1 && !this.isSilent()) { + // CraftBukkit start - Use relative location for far away sounds + // this.world.b(1028, this.getChunkCoordinates(), 0); +- //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API ++ int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API + for (EntityPlayer player : (List) ((WorldServer)world).getPlayers()) { +- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch ++ // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch ++ // Paper end + double deltaX = this.locX() - player.locX(); + double deltaZ = this.locZ() - player.locZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java +index 9331f96f68f121b41ce74904d624520291b7c72e..1074995e8c8a83f6cdb94019123fbffa309d5e08 100644 +--- a/src/main/java/net/minecraft/server/EntityWither.java ++++ b/src/main/java/net/minecraft/server/EntityWither.java +@@ -208,9 +208,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + if (!this.isSilent()) { + // CraftBukkit start - Use relative location for far away sounds + // this.world.b(1023, new BlockPosition(this), 0); +- //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API ++ int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API + for (EntityPlayer player : (List)this.world.getPlayers()) { +- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch ++ // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch + double deltaX = this.locX() - player.locX(); + double deltaZ = this.locZ() - player.locZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index addce5ab16b975b3c6690ae09aef88dfbfb454b8..4bef2d3c8318da57e5721d728953f8d5ac6b0ff6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -1998,6 +1998,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + super.remove(); + } + } ++ ++ @Override ++ public int getViewDistance() { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public void setViewDistance(int viewDistance) { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } + // Paper end + + // Spigot start diff --git a/Spigot-Server-Patches/0366-Fix-CB-call-to-changed-postToMainThread-method.patch b/Spigot-Server-Patches/0354-Fix-CB-call-to-changed-postToMainThread-method.patch similarity index 82% rename from Spigot-Server-Patches/0366-Fix-CB-call-to-changed-postToMainThread-method.patch rename to Spigot-Server-Patches/0354-Fix-CB-call-to-changed-postToMainThread-method.patch index 977e0e6456..c91eeeb6b6 100644 --- a/Spigot-Server-Patches/0366-Fix-CB-call-to-changed-postToMainThread-method.patch +++ b/Spigot-Server-Patches/0354-Fix-CB-call-to-changed-postToMainThread-method.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 266aa79420238d144a07022aab4a3ced5b0707e4..a5700a955b6d7927228a14128860b49e79e61f03 100644 +index 4a718ab0cccef1eef2bcf6fdc5942ba820858dc1..35536527a01e72841e358c643631b2739dd0bf26 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -286,7 +286,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -285,7 +285,7 @@ public class PlayerConnection implements PacketListenerPlayIn { this.networkManager.getClass(); // CraftBukkit - Don't wait diff --git a/Spigot-Server-Patches/0367-Fix-sounds-when-item-frames-are-modified-MC-123450.patch b/Spigot-Server-Patches/0355-Fix-sounds-when-item-frames-are-modified-MC-123450.patch similarity index 86% rename from Spigot-Server-Patches/0367-Fix-sounds-when-item-frames-are-modified-MC-123450.patch rename to Spigot-Server-Patches/0355-Fix-sounds-when-item-frames-are-modified-MC-123450.patch index b74fb1507e..2be27fd3c8 100644 --- a/Spigot-Server-Patches/0367-Fix-sounds-when-item-frames-are-modified-MC-123450.patch +++ b/Spigot-Server-Patches/0355-Fix-sounds-when-item-frames-are-modified-MC-123450.patch @@ -6,16 +6,16 @@ Subject: [PATCH] Fix sounds when item frames are modified (MC-123450) This also fixes the adding sound playing when the item frame direction is changed. diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java -index 9b1e07452f9e7e9a6d069d6e62112a487ff288d4..f8a2f32f1d93e3cdbc7c40783beef05f5f05794f 100644 +index 38e9d49fe5698a0526f3edb15c6e016e43abae2b..2c5cb36c3c060a98d58622a96fbda4fef7160905 100644 --- a/src/main/java/net/minecraft/server/EntityItemFrame.java +++ b/src/main/java/net/minecraft/server/EntityItemFrame.java -@@ -224,7 +224,7 @@ public class EntityItemFrame extends EntityHanging { +@@ -247,7 +247,7 @@ public class EntityItemFrame extends EntityHanging { } this.getDataWatcher().set(EntityItemFrame.ITEM, itemstack); - if (!itemstack.isEmpty() && playSound) { // CraftBukkit + if (!itemstack.isEmpty() && flag && playSound) { // CraftBukkit // Paper - only play sound when update flag is set - this.a(SoundEffects.ENTITY_ITEM_FRAME_ADD_ITEM, 1.0F, 1.0F); + this.playSound(SoundEffects.ENTITY_ITEM_FRAME_ADD_ITEM, 1.0F, 1.0F); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java diff --git a/Spigot-Server-Patches/0368-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch b/Spigot-Server-Patches/0356-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch similarity index 84% rename from Spigot-Server-Patches/0368-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch rename to Spigot-Server-Patches/0356-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch index 24bf94882c..31538b25e4 100644 --- a/Spigot-Server-Patches/0368-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch +++ b/Spigot-Server-Patches/0356-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch @@ -16,10 +16,10 @@ handling that should have been handled synchronously will be handled synchronously when the server gets shut down. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 992c03d799f9dbbb9f63559d787124b04b00283e..eabca3975af61b669fd31a23cb7c27883db7833e 100644 +index 5d62daec9afe60cfb0069b6ed867d1d2530389a8..d1a237a5185fa3bf0308540d9cf8d0686dbbf748 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2221,7 +2221,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant, PlayerChunk.Failure>> completablefuture = this.a(chunkcoordintpair, 1, (i) -> { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a699c5e0b240fac3066e874e7d52f061d01e0c5a..55c0b5dc30cff8de5a83a97ae17fec7624cbe3d9 100644 +index c14d51f1ec37d7b40172ce8cc1c66a7a4f4a3bd5..4e926d5f483ad0d0fae5ceddf0b279128c030a5e 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -3,6 +3,8 @@ package net.minecraft.server; - import com.google.common.annotations.VisibleForTesting; +@@ -5,6 +5,8 @@ import com.google.common.collect.ImmutableList; + import com.google.common.collect.Iterables; import co.aikar.timings.TimingHistory; // Paper import co.aikar.timings.Timings; // Paper + @@ -209,7 +209,7 @@ index a699c5e0b240fac3066e874e7d52f061d01e0c5a..55c0b5dc30cff8de5a83a97ae17fec76 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Queues; -@@ -1062,8 +1064,24 @@ public class WorldServer extends World { +@@ -989,8 +991,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity1 == null) { return false; } else { diff --git a/Spigot-Server-Patches/0371-improve-CraftWorld-isChunkLoaded.patch b/Spigot-Server-Patches/0359-improve-CraftWorld-isChunkLoaded.patch similarity index 90% rename from Spigot-Server-Patches/0371-improve-CraftWorld-isChunkLoaded.patch rename to Spigot-Server-Patches/0359-improve-CraftWorld-isChunkLoaded.patch index 38c1e0435f..33ea97aab4 100644 --- a/Spigot-Server-Patches/0371-improve-CraftWorld-isChunkLoaded.patch +++ b/Spigot-Server-Patches/0359-improve-CraftWorld-isChunkLoaded.patch @@ -9,10 +9,10 @@ waiting for the execution queue to get to our request; We can just query the chunk status and get a response now, vs having to wait diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 2a3d133e51326b0088af2ce53e09bf2fe4b0c3c6..568eca9d3c499e33290aa8ab8548d9c64c97ce5f 100644 +index 199103ab72b0666b23f78961dd7435c3ff210339..edc8abd6569fdb897a549081784c180167118789 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -405,13 +405,13 @@ public class CraftWorld implements World { +@@ -406,13 +406,13 @@ public class CraftWorld implements World { @Override public boolean isChunkLoaded(int x, int z) { diff --git a/Spigot-Server-Patches/0372-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/0360-Configurable-Keep-Spawn-Loaded-range-per-world.patch similarity index 89% rename from Spigot-Server-Patches/0372-Configurable-Keep-Spawn-Loaded-range-per-world.patch rename to Spigot-Server-Patches/0360-Configurable-Keep-Spawn-Loaded-range-per-world.patch index 1aeb58ac84..8211a97509 100644 --- a/Spigot-Server-Patches/0372-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/Spigot-Server-Patches/0360-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world This lets you disable it for some worlds and lower it for others. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 572679e4d1ca0d84a08a5c48542fa40d426461e5..071e5e7f729d6c3ffb70506e7ef32eebee1e9118 100644 +index 2debafdc1bb539a49c3f0723b696ea56e9b3eb16..91c9a027dd7aef8253f3d707c95e4ed917d32580 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -481,4 +481,10 @@ public class PaperWorldConfig { +@@ -449,4 +449,10 @@ public class PaperWorldConfig { break; } } @@ -21,10 +21,10 @@ index 572679e4d1ca0d84a08a5c48542fa40d426461e5..071e5e7f729d6c3ffb70506e7ef32eeb + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index eabca3975af61b669fd31a23cb7c27883db7833e..257adcf4d5387fc18d5c48e0fa221f68539ad8f9 100644 +index d1a237a5185fa3bf0308540d9cf8d0686dbbf748..531031221346d2ed46bd25793c6c2b81029860d4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -586,6 +586,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant pendingChunkUpdates = Sets.newHashSet(); @@ -61,7 +61,7 @@ index ae661297774f51c8b61fc08ca43e13ba368d0021..83da76fdc495225b563cecbdb71422ae } else { if (!this.l.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 6e9f402fb0faccc222b4289deb36e2d85a66eb7c..980044b9a81232e7d0eab8e4947db6ca1f845c1c 100644 +index ca41e420a1ab22f097dd0b98e156fd51434733d8..5efd611859648ed3c1bcda70728ea6106bd4bf4c 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -18,6 +18,7 @@ public class PlayerChunk { diff --git a/Spigot-Server-Patches/0376-Implement-CraftBlockSoundGroup.patch b/Spigot-Server-Patches/0363-Implement-CraftBlockSoundGroup.patch similarity index 63% rename from Spigot-Server-Patches/0376-Implement-CraftBlockSoundGroup.patch rename to Spigot-Server-Patches/0363-Implement-CraftBlockSoundGroup.patch index 9609100498..5869a0140b 100644 --- a/Spigot-Server-Patches/0376-Implement-CraftBlockSoundGroup.patch +++ b/Spigot-Server-Patches/0363-Implement-CraftBlockSoundGroup.patch @@ -48,58 +48,46 @@ index 0000000000000000000000000000000000000000..99f99330d01fc61ce8ede9f225b0c42b + return CraftSound.getSoundByEffect(soundEffectType.getFallSound()); + } +} -diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index cca2bf1045c1305a9defa5241909b50711b85d4c..321eae23c575528788b1b575f17593580d6ba737 100644 ---- a/src/main/java/net/minecraft/server/IBlockData.java -+++ b/src/main/java/net/minecraft/server/IBlockData.java -@@ -276,6 +276,7 @@ public class IBlockData extends BlockDataAbstract implements - return this.getBlock().isTicking(this); - } - -+ public final SoundEffectType getStepSound() { return this.r(); } // Paper - OBFHELPER - public SoundEffectType r() { - return this.getBlock().getStepSound(this); - } diff --git a/src/main/java/net/minecraft/server/SoundEffectType.java b/src/main/java/net/minecraft/server/SoundEffectType.java -index b774d2d8d903acc1ce4c5bd9240b2e96779e1d53..adf0913a0ecc3eaf330bee303d9cc7fb4bc51dee 100644 +index 957799e034ad8bc7201815b849244b7a809fb666..2301b38ac3b488809d2f624055ad3e23663d3fdb 100644 --- a/src/main/java/net/minecraft/server/SoundEffectType.java +++ b/src/main/java/net/minecraft/server/SoundEffectType.java -@@ -27,10 +27,10 @@ public class SoundEffectType { - public static final SoundEffectType w = new SoundEffectType(1.0F, 1.0F, SoundEffects.BLOCK_LANTERN_BREAK, SoundEffects.BLOCK_LANTERN_STEP, SoundEffects.BLOCK_LANTERN_PLACE, SoundEffects.BLOCK_LANTERN_HIT, SoundEffects.BLOCK_LANTERN_FALL); - public final float x; - public final float y; -- private final SoundEffect z; -+ private final SoundEffect z; public final SoundEffect getBreakSound() { return this.z; } // Paper - OBFHELPER - private final SoundEffect A; - private final SoundEffect B; -- private final SoundEffect C; -+ private final SoundEffect C; public final SoundEffect getHitSound() { return this.C; } // Paper - OBFHELPER - private final SoundEffect D; +@@ -51,10 +51,10 @@ public class SoundEffectType { + public static final SoundEffectType U = new SoundEffectType(1.0F, 1.0F, SoundEffects.BLOCK_GILDED_BLACKSTONE_BREAK, SoundEffects.BLOCK_GILDED_BLACKSTONE_STEP, SoundEffects.BLOCK_GILDED_BLACKSTONE_PLACE, SoundEffects.BLOCK_GILDED_BLACKSTONE_HIT, SoundEffects.BLOCK_GILDED_BLACKSTONE_FALL); + public final float V; + public final float W; +- private final SoundEffect X; ++ private final SoundEffect X; public final SoundEffect getBreakSound() { return this.X; } // Paper - OBFHELPER + private final SoundEffect Y; + private final SoundEffect Z; +- private final SoundEffect aa; ++ private final SoundEffect aa; public final SoundEffect getHitSound() { return this.aa; } // Paper - OBFHELPER + private final SoundEffect ab; public SoundEffectType(float f, float f1, SoundEffect soundeffect, SoundEffect soundeffect1, SoundEffect soundeffect2, SoundEffect soundeffect3, SoundEffect soundeffect4) { -@@ -51,14 +51,17 @@ public class SoundEffectType { - return this.y; +@@ -75,14 +75,17 @@ public class SoundEffectType { + return this.W; } + public final SoundEffect getStepSound() { return this.d(); } // Paper - OBFHELPER public SoundEffect d() { - return this.A; + return this.Y; } + public final SoundEffect getPlaceSound() { return this.e(); } // Paper - OBFHELPER public SoundEffect e() { - return this.B; + return this.Z; } + public final SoundEffect getFallSound() { return this.g(); } // Paper - OBFHELPER public SoundEffect g() { - return this.D; + return this.ab; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index dd0bccd6995a79c52ec20cf45df27bb7ed06a5e6..16349e8e796c5e7e4e43fb355d4d641df7f41dc9 100644 +index 20a294723869756495b4bd5c23846be4049d52a6..2e24b75d2b56dc40d05200ddded817d6ae06803c 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -704,4 +704,11 @@ public class CraftBlock implements Block { +@@ -717,4 +717,11 @@ public class CraftBlock implements Block { AxisAlignedBB aabb = shape.getBoundingBox(); return new BoundingBox(getX() + aabb.minX, getY() + aabb.minY, getZ() + aabb.minZ, getX() + aabb.maxX, getY() + aabb.maxY, getZ() + aabb.maxZ); } diff --git a/Spigot-Server-Patches/0377-Chunk-debug-command.patch b/Spigot-Server-Patches/0364-Chunk-debug-command.patch similarity index 95% rename from Spigot-Server-Patches/0377-Chunk-debug-command.patch rename to Spigot-Server-Patches/0364-Chunk-debug-command.patch index ad712dc109..86c21d406e 100644 --- a/Spigot-Server-Patches/0377-Chunk-debug-command.patch +++ b/Spigot-Server-Patches/0364-Chunk-debug-command.patch @@ -185,20 +185,20 @@ index 5acad8e44f024d3ddf5ef4fd320460ac516e0fb8..af810987846efcd2bffbd23c31481b2d * Ported from MinecraftForge - author: LexManos - License: LGPLv2.1 */ diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 261eff5bdb4f4dfae2f66eecad79b21fef69ea8f..8a8fb6acaabc5fc179a23ce3e23ddb54e1ee23a4 100644 +index 6921def2dc8dd7f2b8ba9d46ab697a9f9b62cf4e..9f4c79629c981d496b96cf8a7a4c8e058f102b8b 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -22,7 +22,7 @@ import org.apache.logging.log4j.Logger; +@@ -23,7 +23,7 @@ import org.apache.logging.log4j.Logger; + public class ChunkProviderServer extends IChunkProvider { - private static final int b = (int) Math.pow(17.0D, 2.0D); -- private static final List c = ChunkStatus.a(); -+ private static final List c = ChunkStatus.a(); static final List getPossibleChunkStatuses() { return ChunkProviderServer.c; } // Paper - OBFHELPER +- private static final List b = ChunkStatus.a(); ++ private static final List b = ChunkStatus.a(); static final List getPossibleChunkStatuses() { return ChunkProviderServer.b; } // Paper - OBFHELPER private final ChunkMapDistance chunkMapDistance; - public final ChunkGenerator chunkGenerator; + public final ChunkGenerator chunkGenerator; private final WorldServer world; diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 49178cbcebe7e7af9e9a2485ae11058fd1c6b20f..ece411feee81f96ae0462cf7643ec450cafad7a7 100644 +index 2eacc5de340ca5558d9a0cba9baa26bbebef714d..5658b2a3c4601d07545b08b0a7179c8f3b051bd4 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -5,7 +5,13 @@ import com.destroystokyo.paper.profile.CraftPlayerProfile; @@ -227,7 +227,7 @@ index 49178cbcebe7e7af9e9a2485ae11058fd1c6b20f..ece411feee81f96ae0462cf7643ec450 import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.LinkedBlockingQueue; -@@ -533,4 +542,170 @@ public final class MCUtil { +@@ -521,4 +530,170 @@ public final class MCUtil { return null; } @@ -399,7 +399,7 @@ index 49178cbcebe7e7af9e9a2485ae11058fd1c6b20f..ece411feee81f96ae0462cf7643ec450 + } } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 980044b9a81232e7d0eab8e4947db6ca1f845c1c..47e3e618c9e683e6975fb64e1094dc7078574dae 100644 +index 5efd611859648ed3c1bcda70728ea6106bd4bf4c..d806b6acbcfbf141f4c1436bd5a163fbf11bf4e6 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -27,7 +27,7 @@ public class PlayerChunk { @@ -412,10 +412,10 @@ index 980044b9a81232e7d0eab8e4947db6ca1f845c1c..47e3e618c9e683e6975fb64e1094dc70 private int dirtyCount; private int r; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 1d255ce3833a0ea735bedbb33ae8259751346ab2..34f470779fa5d1cf9638431253024481236c073b 100644 +index 936be3fd8954933ac218f62a172df6878d128ec9..684d84e3c5caf1a0c816895c4930d056b2ba8be5 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -58,7 +58,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -59,7 +59,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final Long2ObjectLinkedOpenHashMap updatingChunks = new Long2ObjectLinkedOpenHashMap(); public volatile Long2ObjectLinkedOpenHashMap visibleChunks; private final Long2ObjectLinkedOpenHashMap pendingUnload; @@ -424,7 +424,7 @@ index 1d255ce3833a0ea735bedbb33ae8259751346ab2..34f470779fa5d1cf9638431253024481 public final WorldServer world; private final LightEngineThreaded lightEngine; private final IAsyncTaskHandler executor; -@@ -71,7 +71,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -72,7 +72,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { private final Mailbox> mailboxWorldGen; private final Mailbox> mailboxMain; public final WorldLoadListener worldLoadListener; diff --git a/Spigot-Server-Patches/0365-Per-Player-View-Distance-API-placeholders.patch b/Spigot-Server-Patches/0365-Per-Player-View-Distance-API-placeholders.patch deleted file mode 100644 index 28c3c8c34f..0000000000 --- a/Spigot-Server-Patches/0365-Per-Player-View-Distance-API-placeholders.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Mon, 6 May 2019 01:29:25 -0400 -Subject: [PATCH] Per-Player View Distance API placeholders - -I hope to look at this more in-depth soon. It appears doable. -However this should not block the update. - -diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 6a4ccaeb0fef2cabab87b33bf89b5a68608800e9..5bf99e0028b886a6ba1d2f39f8dc4cd3c9aa0943 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderDragon.java -+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -579,9 +579,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - // CraftBukkit start - Use relative location for far away sounds - // this.world.b(1028, new BlockPosition(this), 0); - // Paper start -- //int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API -+ int viewDistance = this.world.getWorld().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API - for (EntityPlayer player : ((WorldServer)world).getPlayers()) { -- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch -+ //final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch - // Paper end - double deltaX = this.locX() - player.locX(); - double deltaZ = this.locZ() - player.locZ(); -diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index 2e95069c1907df951680f2a00441a72500c48430..2f466af4d56d6f87c9d98226276b041ba2e89ac5 100644 ---- a/src/main/java/net/minecraft/server/EntityWither.java -+++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -208,9 +208,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity { - // CraftBukkit start - Use relative location for far away sounds - // this.world.b(1023, new BlockPosition(this), 0); - // Paper start -- //int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API -+ int viewDistance = this.world.getWorld().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API - for (EntityPlayer player : ((WorldServer)world).getPlayers()) { -- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch -+ //final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch - // Paper end - double deltaX = this.locX() - player.locX(); - double deltaZ = this.locZ() - player.locZ(); -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a614db834dfe8096ec0a7e6bc6e0348bfb300a1d..71d5ebe8c6ea2d52886c28e0fdc55e5993238709 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1958,6 +1958,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - super.remove(); - } - } -+ -+ @Override -+ public int getViewDistance() { -+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO -+ } -+ -+ @Override -+ public void setViewDistance(int viewDistance) { -+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO -+ } - // Paper end - - // Spigot start diff --git a/Spigot-Server-Patches/0379-Catch-exceptions-from-dispenser-entity-spawns.patch b/Spigot-Server-Patches/0366-Catch-exceptions-from-dispenser-entity-spawns.patch similarity index 93% rename from Spigot-Server-Patches/0379-Catch-exceptions-from-dispenser-entity-spawns.patch rename to Spigot-Server-Patches/0366-Catch-exceptions-from-dispenser-entity-spawns.patch index 7fccaa308e..be995a8f41 100644 --- a/Spigot-Server-Patches/0379-Catch-exceptions-from-dispenser-entity-spawns.patch +++ b/Spigot-Server-Patches/0366-Catch-exceptions-from-dispenser-entity-spawns.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Catch exceptions from dispenser entity spawns diff --git a/src/main/java/net/minecraft/server/IDispenseBehavior.java b/src/main/java/net/minecraft/server/IDispenseBehavior.java -index 5a8c4dc6ba370af2da15949c1b514317a85e743b..b6b7e3c6c973886e35bde0bf10787b62c7f015ca 100644 +index aa6af83512e2baea4e3d942b7f7407ad05ea0f24..5432c24919bb5c32ca1eec4c9861ad127f72a60a 100644 --- a/src/main/java/net/minecraft/server/IDispenseBehavior.java +++ b/src/main/java/net/minecraft/server/IDispenseBehavior.java @@ -163,7 +163,14 @@ public interface IDispenseBehavior { diff --git a/Spigot-Server-Patches/0276-Send-nearby-packets-from-world-player-list-not-serve.patch b/removed/1.16/0276-Send-nearby-packets-from-world-player-list-not-serve.patch similarity index 100% rename from Spigot-Server-Patches/0276-Send-nearby-packets-from-world-player-list-not-serve.patch rename to removed/1.16/0276-Send-nearby-packets-from-world-player-list-not-serve.patch diff --git a/Spigot-Server-Patches/0298-Support-Overriding-World-Seeds.patch b/removed/1.16/0298-Support-Overriding-World-Seeds.patch similarity index 100% rename from Spigot-Server-Patches/0298-Support-Overriding-World-Seeds.patch rename to removed/1.16/0298-Support-Overriding-World-Seeds.patch diff --git a/Spigot-Server-Patches/0302-Avoid-dimension-id-collisions.patch b/removed/1.16/0302-Avoid-dimension-id-collisions.patch similarity index 100% rename from Spigot-Server-Patches/0302-Avoid-dimension-id-collisions.patch rename to removed/1.16/0302-Avoid-dimension-id-collisions.patch diff --git a/Spigot-Server-Patches/0311-Limit-lightning-strike-effect-distance.patch b/removed/1.16/0311-Limit-lightning-strike-effect-distance.patch similarity index 100% rename from Spigot-Server-Patches/0311-Limit-lightning-strike-effect-distance.patch rename to removed/1.16/0311-Limit-lightning-strike-effect-distance.patch diff --git a/Spigot-Server-Patches/0326-Optimize-redstone-algorithm.patch b/removed/1.16/0326-Optimize-redstone-algorithm.patch similarity index 100% rename from Spigot-Server-Patches/0326-Optimize-redstone-algorithm.patch rename to removed/1.16/0326-Optimize-redstone-algorithm.patch diff --git a/Spigot-Server-Patches/0356-Fire-event-on-GS4-query.patch b/removed/1.16/0356-Fire-event-on-GS4-query.patch similarity index 100% rename from Spigot-Server-Patches/0356-Fire-event-on-GS4-query.patch rename to removed/1.16/0356-Fire-event-on-GS4-query.patch diff --git a/Spigot-Server-Patches/0373-Fix-some-generation-concurrency-issues.patch b/removed/1.16/0373-Fix-some-generation-concurrency-issues.patch similarity index 100% rename from Spigot-Server-Patches/0373-Fix-some-generation-concurrency-issues.patch rename to removed/1.16/0373-Fix-some-generation-concurrency-issues.patch diff --git a/Spigot-Server-Patches/0378-incremental-chunk-saving.patch b/removed/1.16/0378-incremental-chunk-saving.patch similarity index 100% rename from Spigot-Server-Patches/0378-incremental-chunk-saving.patch rename to removed/1.16/0378-incremental-chunk-saving.patch diff --git a/work/Bukkit b/work/Bukkit index 32fcd349d4..6f3c5f4a5a 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 32fcd349d4074c564116bbeb4b481332460902ee +Subproject commit 6f3c5f4a5a0867ef265df9d58b48bdc43079e3dd diff --git a/work/CraftBukkit b/work/CraftBukkit index 2b00831c95..3f0c333870 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 2b00831c95f8dda096ad22ae88bc615d9dd31ea1 +Subproject commit 3f0c333870ba74705e98d19322174d6f0c10c900