From 63214cb7958d7c26aa4cb06827068c4b3ccbb62f Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 16 Jul 2018 16:34:55 +0100 Subject: [PATCH] NOT FINISHED!!! More progress on 1.13-pre7 This work is unfinished, keep your paws off this branch! --- .../0024-Entity-Origin-API.patch | 10 +- ...to-configure-frosted_ice-properties.patch} | 37 +- ...-Vehicle-Event-Cancellation-Changes.patch} | 22 +- .../0112-Don-t-tick-Skulls-unused-code.patch | 22 - ...possibility-for-getServer-singleton.patch} | 22 +- .../0113-Configurable-Player-Collision.patch | 136 ------- ...tem-frames-performance-and-bug-fixe.patch} | 47 +-- ...ent-to-allow-plugins-to-handle-clien.patch | 49 --- ...API-Replenishable-Lootables-Feature.patch} | 114 +++--- ...-Do-not-load-chunks-for-pathfinding.patch} | 8 +- ...> 0116-Entity-Tracking-Improvements.patch} | 12 +- ...Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch | 60 --- .../0117-Configurable-RCON-IP-address.patch | 23 -- ...-scoreboard-teams-to-scoreboard.dat.patch} | 8 +- ... 0118-Fix-Chunk-Unload-Queue-Issues.patch} | 24 +- ...118-Prevent-Fire-from-loading-chunks.patch | 47 --- ...19-Implement-PlayerLocaleChangeEvent.patch | 75 ---- ...em-property-for-disabling-watchdoge.patch} | 4 +- ...ityRegainHealthEvent-isFastRegen-API.patch | 45 -- ...mize-EAR.patch => 0120-Optimize-EAR.patch} | 13 +- ...0121-Optimize-UserCache-Thread-Safe.patch} | 33 +- ...locking-on-Network-Manager-creation.patch} | 29 +- ...-Optional-TNT-doesn-t-move-in-water.patch} | 25 +- ...-redstone-torch-rapid-clock-removal.patch} | 22 +- ...Ensure-Chunks-never-ever-load-async.patch} | 14 +- ...h => 0126-Add-server-name-parameter.patch} | 6 +- ...n-Wither-Death-sounds-to-same-world.patch} | 12 +- ...-FallingBlocks-being-stuck-on-fences.patch | 105 ----- .../0142-Make-entities-look-for-hoppers.patch | 383 ------------------ .../0144-Toggleable-Elytra-Wall-Damage.patch | 45 -- ...-dispenser-dropper-furnace-placement.patch | 0 ...hunks-as-active-for-neighbor-updates.patch | 0 .../0269-Optimize-Hoppers.patch | 0 work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 36 files changed, 229 insertions(+), 1229 deletions(-) rename Spigot-Server-Patches/{0121-Add-ability-to-configure-frosted_ice-properties.patch => 0110-Add-ability-to-configure-frosted_ice-properties.patch} (52%) rename Spigot-Server-Patches/{0122-Vehicle-Event-Cancellation-Changes.patch => 0111-Vehicle-Event-Cancellation-Changes.patch} (73%) delete mode 100644 Spigot-Server-Patches/0112-Don-t-tick-Skulls-unused-code.patch rename Spigot-Server-Patches/{0124-remove-null-possibility-for-getServer-singleton.patch => 0112-remove-null-possibility-for-getServer-singleton.patch} (52%) delete mode 100644 Spigot-Server-Patches/0113-Configurable-Player-Collision.patch rename Spigot-Server-Patches/{0125-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch => 0113-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch} (79%) delete mode 100644 Spigot-Server-Patches/0114-Add-handshake-event-to-allow-plugins-to-handle-clien.patch rename Spigot-Server-Patches/{0126-LootTable-API-Replenishable-Lootables-Feature.patch => 0114-LootTable-API-Replenishable-Lootables-Feature.patch} (91%) rename Spigot-Server-Patches/{0127-Do-not-load-chunks-for-pathfinding.patch => 0115-Do-not-load-chunks-for-pathfinding.patch} (78%) rename Spigot-Server-Patches/{0128-Entity-Tracking-Improvements.patch => 0116-Entity-Tracking-Improvements.patch} (92%) delete mode 100644 Spigot-Server-Patches/0116-Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch delete mode 100644 Spigot-Server-Patches/0117-Configurable-RCON-IP-address.patch rename Spigot-Server-Patches/{0129-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch => 0117-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch} (90%) rename Spigot-Server-Patches/{0131-Fix-Chunk-Unload-Queue-Issues.patch => 0118-Fix-Chunk-Unload-Queue-Issues.patch} (71%) delete mode 100644 Spigot-Server-Patches/0118-Prevent-Fire-from-loading-chunks.patch delete mode 100644 Spigot-Server-Patches/0119-Implement-PlayerLocaleChangeEvent.patch rename Spigot-Server-Patches/{0132-System-property-for-disabling-watchdoge.patch => 0119-System-property-for-disabling-watchdoge.patch} (92%) delete mode 100644 Spigot-Server-Patches/0120-EntityRegainHealthEvent-isFastRegen-API.patch rename Spigot-Server-Patches/{0133-Optimize-EAR.patch => 0120-Optimize-EAR.patch} (88%) rename Spigot-Server-Patches/{0134-Optimize-UserCache-Thread-Safe.patch => 0121-Optimize-UserCache-Thread-Safe.patch} (79%) rename Spigot-Server-Patches/{0135-Avoid-blocking-on-Network-Manager-creation.patch => 0122-Avoid-blocking-on-Network-Manager-creation.patch} (60%) rename Spigot-Server-Patches/{0136-Optional-TNT-doesn-t-move-in-water.patch => 0123-Optional-TNT-doesn-t-move-in-water.patch} (84%) rename Spigot-Server-Patches/{0137-Faster-redstone-torch-rapid-clock-removal.patch => 0124-Faster-redstone-torch-rapid-clock-removal.patch} (67%) rename Spigot-Server-Patches/{0138-Ensure-Chunks-never-ever-load-async.patch => 0125-Ensure-Chunks-never-ever-load-async.patch} (83%) rename Spigot-Server-Patches/{0139-Add-server-name-parameter.patch => 0126-Add-server-name-parameter.patch} (89%) rename Spigot-Server-Patches/{0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch => 0127-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch} (92%) delete mode 100644 Spigot-Server-Patches/0141-Fix-FallingBlocks-being-stuck-on-fences.patch delete mode 100644 Spigot-Server-Patches/0142-Make-entities-look-for-hoppers.patch delete mode 100644 Spigot-Server-Patches/0144-Toggleable-Elytra-Wall-Damage.patch rename {Spigot-Server-Patches => removed}/0123-SPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patch (100%) rename {Spigot-Server-Patches => removed}/0130-Do-not-mark-chunks-as-active-for-neighbor-updates.patch (100%) rename {Spigot-Server-Patches => removed}/0269-Optimize-Hoppers.patch (100%) diff --git a/Spigot-Server-Patches/0024-Entity-Origin-API.patch b/Spigot-Server-Patches/0024-Entity-Origin-API.patch index fbde3fe916..febd01aee8 100644 --- a/Spigot-Server-Patches/0024-Entity-Origin-API.patch +++ b/Spigot-Server-Patches/0024-Entity-Origin-API.patch @@ -1,11 +1,11 @@ -From d97bed2c5c938d245595b74e0cdda94a68a6bc27 Mon Sep 17 00:00:00 2001 +From 5c858f71d8de97fd30722aadac29e55925f707c1 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 1 Mar 2016 23:45:08 -0600 Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 12b86ab75..2288df268 100644 +index 20248de7e..6bb4cf48e 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -160,6 +160,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -118,10 +118,10 @@ index fd64b75ed..3f0b6ac26 100644 flag = true; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 1e3675e4f..0daa15f1b 100644 +index f4edde236..9882fe466 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -781,4 +781,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -777,4 +777,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return spigot; } // Spigot end @@ -135,5 +135,5 @@ index 1e3675e4f..0daa15f1b 100644 + // Paper end } -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0121-Add-ability-to-configure-frosted_ice-properties.patch b/Spigot-Server-Patches/0110-Add-ability-to-configure-frosted_ice-properties.patch similarity index 52% rename from Spigot-Server-Patches/0121-Add-ability-to-configure-frosted_ice-properties.patch rename to Spigot-Server-Patches/0110-Add-ability-to-configure-frosted_ice-properties.patch index c656c2e7de..620a2fcad4 100644 --- a/Spigot-Server-Patches/0121-Add-ability-to-configure-frosted_ice-properties.patch +++ b/Spigot-Server-Patches/0110-Add-ability-to-configure-frosted_ice-properties.patch @@ -1,14 +1,14 @@ -From b3b76f21bc0e86a173661b9fa351c886b89394e3 Mon Sep 17 00:00:00 2001 +From 434dc56dd20d8354389d021209ca13482f41c1de Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 21 Apr 2016 23:51:55 -0700 Subject: [PATCH] Add ability to configure frosted_ice properties diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 6ea608ba9..d96311f6b 100644 +index ff9929a05..0c50cb4bd 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -293,4 +293,14 @@ public class PaperWorldConfig { +@@ -243,4 +243,14 @@ public class PaperWorldConfig { private void useVanillaScoreboardColoring() { useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false); } @@ -24,25 +24,28 @@ index 6ea608ba9..d96311f6b 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index 950863fb9..a8dbbf20a 100644 +index 1d5c24c7a..77cf6b8e9 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java -@@ -19,10 +19,14 @@ public class BlockIceFrost extends BlockIce { +@@ -12,6 +12,7 @@ public class BlockIceFrost extends BlockIce { } - public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) { + if (!world.paperConfig.frostedIceEnabled) return; // Paper - add ability to disable frosted ice - if ((random.nextInt(3) == 0 || this.c(world, blockposition) < 4) && world.getLightLevel(blockposition) > 11 - ((Integer) iblockdata.get(BlockIceFrost.a)).intValue() - iblockdata.c()) { - this.a(world, blockposition, iblockdata, random, true); - } else { -- world.a(blockposition, (Block) this, MathHelper.nextInt(random, 20, 40)); -+ // Paper start - use configurable min/max delay -+ //world.a(blockposition, (Block) this, MathHelper.nextInt(random, 20, 40)); -+ world.a(blockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); -+ // Paper end - } + if ((random.nextInt(3) == 0 || this.a(world, blockposition, 4)) && world.getLightLevel(blockposition) > 11 - ((Integer) iblockdata.get(BlockIceFrost.a)).intValue() - iblockdata.b(world, blockposition) && this.c(iblockdata, world, blockposition)) { + BlockPosition.b blockposition_b = BlockPosition.b.r(); + Throwable throwable = null; +@@ -27,7 +28,9 @@ public class BlockIceFrost extends BlockIce { + IBlockData iblockdata1 = world.getType(blockposition_b); - } + if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition_b)) { +- world.I().a(blockposition_b, this, MathHelper.nextInt(random, 20, 40)); ++ // Paper start - use configurable min/max delay ++ world.I().a(blockposition_b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); ++ // Paper end + } + } + } catch (Throwable throwable1) { -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0122-Vehicle-Event-Cancellation-Changes.patch b/Spigot-Server-Patches/0111-Vehicle-Event-Cancellation-Changes.patch similarity index 73% rename from Spigot-Server-Patches/0122-Vehicle-Event-Cancellation-Changes.patch rename to Spigot-Server-Patches/0111-Vehicle-Event-Cancellation-Changes.patch index 6fd39b9597..9fd45005fd 100644 --- a/Spigot-Server-Patches/0122-Vehicle-Event-Cancellation-Changes.patch +++ b/Spigot-Server-Patches/0111-Vehicle-Event-Cancellation-Changes.patch @@ -1,23 +1,23 @@ -From eb11e43a94909435f4ce4020d2eded1eb0b8cdb1 Mon Sep 17 00:00:00 2001 +From e27e2dd897b4f710aad5f7ac293ca48ffad02fcb Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 22 Apr 2016 18:20:05 -0500 Subject: [PATCH] Vehicle Event Cancellation Changes diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 88faa4601..aece54d26 100644 +index fecf29710..115504bf6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -70,7 +70,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper - public boolean i; +@@ -80,7 +80,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + public boolean j; public final List passengers; - protected int j; -- private Entity au; -+ private Entity au;public void setVehicle(Entity entity) { this.au = entity; } // Paper // OBFHELPER + protected int k; +- private Entity ax; ++ private Entity ax;public void setVehicle(Entity entity) { this.au = entity; } // Paper // OBFHELPER public boolean attachedToPlayer; public World world; public double lastX; -@@ -2004,6 +2004,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -2110,6 +2110,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { // CraftBukkit start @@ -25,7 +25,7 @@ index 88faa4601..aece54d26 100644 CraftEntity craft = (CraftEntity) entity.getBukkitEntity().getVehicle(); Entity orig = craft == null ? null : craft.getHandle(); if (getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { -@@ -2019,7 +2020,13 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -2125,7 +2126,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } } // CraftBukkit end @@ -38,8 +38,8 @@ index 88faa4601..aece54d26 100644 + // Paper end + this.passengers.remove(entity); - entity.j = 60; + entity.k = 60; } -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0112-Don-t-tick-Skulls-unused-code.patch b/Spigot-Server-Patches/0112-Don-t-tick-Skulls-unused-code.patch deleted file mode 100644 index 2880cfa5e9..0000000000 --- a/Spigot-Server-Patches/0112-Don-t-tick-Skulls-unused-code.patch +++ /dev/null @@ -1,22 +0,0 @@ -From ac45d8457a0c7eae58e0b9feebedd4e415bd383e Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 13 Apr 2016 00:30:10 -0400 -Subject: [PATCH] Don't tick Skulls - unused code - - -diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index a796c08ab..dd2665881 100644 ---- a/src/main/java/net/minecraft/server/TileEntitySkull.java -+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java -@@ -24,7 +24,7 @@ import com.mojang.authlib.ProfileLookupCallback; - import java.util.concurrent.Callable; - // Spigot end - --public class TileEntitySkull extends TileEntity implements ITickable { -+public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Paper - remove tickable - - private int a; - public int rotation; --- -2.18.0 - diff --git a/Spigot-Server-Patches/0124-remove-null-possibility-for-getServer-singleton.patch b/Spigot-Server-Patches/0112-remove-null-possibility-for-getServer-singleton.patch similarity index 52% rename from Spigot-Server-Patches/0124-remove-null-possibility-for-getServer-singleton.patch rename to Spigot-Server-Patches/0112-remove-null-possibility-for-getServer-singleton.patch index 0dbecc755f..0100e1a69d 100644 --- a/Spigot-Server-Patches/0124-remove-null-possibility-for-getServer-singleton.patch +++ b/Spigot-Server-Patches/0112-remove-null-possibility-for-getServer-singleton.patch @@ -1,4 +1,4 @@ -From ce05afd0428918d9eab5599842bc9f2a485120f9 Mon Sep 17 00:00:00 2001 +From 2d68b62e5d00ca7d2ad4c9773f33304070f53f75 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 28 Apr 2016 00:57:27 -0400 Subject: [PATCH] remove null possibility for getServer singleton @@ -6,26 +6,26 @@ Subject: [PATCH] remove null possibility for getServer singleton to stop IDE complaining about potential NPE diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b6c4d98fd..45d3dbde2 100644 +index c5670fe8d..e11289217 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -53,6 +53,7 @@ import co.aikar.timings.MinecraftTimings; // Paper +@@ -68,6 +68,7 @@ import co.aikar.timings.MinecraftTimings; // Paper - public abstract class MinecraftServer implements ICommandListener, Runnable, IAsyncTaskHandler, IMojangStatistics { + public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStatistics, ICommandListener, Runnable { + private static MinecraftServer SERVER; // Paper public static final Logger LOGGER = LogManager.getLogger(); public static final File a = new File("usercache.json"); public Convertable convertable; -@@ -124,6 +125,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -152,6 +153,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // Spigot end - public MinecraftServer(OptionSet options, Proxy proxy, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { + public MinecraftServer(OptionSet options, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { + SERVER = this; // Paper - better singleton - io.netty.util.ResourceLeakDetector.setEnabled( false ); // Spigot - disable - this.e = proxy; - this.V = yggdrasilauthenticationservice; -@@ -1636,7 +1638,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs + this.commandDispatcher = commanddispatcher; // CraftBukkit + this.ac = new ResourceManager(EnumResourcePackType.SERVER_DATA); + this.resourcePackRepository = new ResourcePackRepository(ResourcePackLoader::new); +@@ -1742,7 +1744,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // CraftBukkit start @Deprecated public static MinecraftServer getServer() { @@ -35,5 +35,5 @@ index b6c4d98fd..45d3dbde2 100644 // CraftBukkit end } -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0113-Configurable-Player-Collision.patch b/Spigot-Server-Patches/0113-Configurable-Player-Collision.patch deleted file mode 100644 index d7bb5f9952..0000000000 --- a/Spigot-Server-Patches/0113-Configurable-Player-Collision.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 10c2e6d3aef1221db2bc29f97cedc0b3c44bddf8 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 13 Apr 2016 02:10:49 -0400 -Subject: [PATCH] Configurable Player Collision - - -diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index ec4643384..430b5d0cd 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -220,4 +220,9 @@ public class PaperConfig { - private static void regionFileCacheSize() { - regionFileCacheSize = getInt("settings.region-file-cache-size", 256); - } -+ -+ public static boolean enablePlayerCollisions = true; -+ private static void enablePlayerCollisions() { -+ enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true); -+ } - } -diff --git a/src/main/java/net/minecraft/server/CommandScoreboard.java b/src/main/java/net/minecraft/server/CommandScoreboard.java -index b08274d93..0607e55d3 100644 ---- a/src/main/java/net/minecraft/server/CommandScoreboard.java -+++ b/src/main/java/net/minecraft/server/CommandScoreboard.java -@@ -183,6 +183,13 @@ public class CommandScoreboard extends CommandAbstract { - throw new ExceptionUsage("commands.scoreboard.teams.option.usage", new Object[0]); - } - -+ // Paper start - Block setting options on our collideRule team as it is not persistent -+ if (astring[2].equals(MinecraftServer.getServer().getPlayerList().collideRuleTeamName)) { -+ icommandlistener.sendMessage(new ChatMessage("You cannot set team options on the collideRule team")); -+ return; -+ } -+ // Paper end -+ - this.c(icommandlistener, astring, 2, minecraftserver); - } - } -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2300ee10b..b6c4d98fd 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -332,6 +332,20 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs - this.v.setPlayerFileData(this.worldServer); - this.a(this.getDifficulty()); - this.l(); -+ -+ // Paper start - Handle collideRule team for player collision toggle -+ final Scoreboard scoreboard = this.getWorld().getScoreboard(); -+ final java.util.Collection toRemove = scoreboard.getTeams().stream().filter(team -> team.getName().startsWith("collideRule_")).map(ScoreboardTeam::getName).collect(java.util.stream.Collectors.toList()); -+ for (String teamName : toRemove) { -+ scoreboard.removeTeam(scoreboard.getTeam(teamName)); // Clean up after ourselves -+ } -+ -+ if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) { -+ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + this.getWorld().random.nextInt(), 16); -+ ScoreboardTeam collideTeam = scoreboard.createTeam(this.getPlayerList().collideRuleTeamName); -+ collideTeam.setCanSeeFriendlyInvisibles(false); // Because we want to mimic them not being on a team at all -+ } -+ // Paper end - } - - protected void l() { -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java -index 549d4e89d..df11764e0 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java -@@ -96,7 +96,7 @@ public class PacketPlayOutScoreboardTeam implements Packet playersByName = new org.spigotmc.CaseInsensitiveMap(); -+ @Nullable String collideRuleTeamName; // Paper - Team name used for collideRule - - public PlayerList(MinecraftServer minecraftserver) { - this.cserver = minecraftserver.server = new CraftServer(minecraftserver, this); -@@ -234,6 +235,12 @@ public abstract class PlayerList { - } - - entityplayer.syncInventory(); -+ // Paper start - Add to collideRule team if needed -+ final Scoreboard scoreboard = this.getServer().getWorld().getScoreboard(); -+ if (this.collideRuleTeamName != null && scoreboard.getTeam(collideRuleTeamName) != null && entityplayer.getTeam() == null) { -+ scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeamName); -+ } -+ // Paper end - // CraftBukkit - Moved from above, added world - PlayerList.f.info(entityplayer.getName() + "[" + s1 + "] logged in with entity id " + entityplayer.getId() + " at ([" + entityplayer.world.worldData.getName() + "]" + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")"); - } -@@ -425,6 +432,16 @@ public abstract class PlayerList { - entityplayer.playerTick();// SPIGOT-924 - // CraftBukkit end - -+ // Paper start - Remove from collideRule team if needed -+ if (this.collideRuleTeamName != null) { -+ final Scoreboard scoreBoard = this.server.getWorld().getScoreboard(); -+ final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName); -+ if (entityplayer.getTeam() == team && team != null) { -+ scoreBoard.removePlayerFromTeam(entityplayer.getName(), team); -+ } -+ } -+ // Paper end -+ - this.savePlayerFile(entityplayer); - if (entityplayer.isPassenger()) { - Entity entity = entityplayer.getVehicle(); -@@ -1352,7 +1369,13 @@ public abstract class PlayerList { - player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message - } - // CraftBukkit end -- -+ // Paper start - Remove collideRule team if it exists -+ if (this.collideRuleTeamName != null) { -+ final Scoreboard scoreboard = this.getServer().getWorld().getScoreboard(); -+ final ScoreboardTeam team = scoreboard.getTeam(this.collideRuleTeamName); -+ if (team != null) scoreboard.removeTeam(team); -+ } -+ // Paper end - } - - // CraftBukkit start --- -2.18.0 - diff --git a/Spigot-Server-Patches/0125-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/Spigot-Server-Patches/0113-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch similarity index 79% rename from Spigot-Server-Patches/0125-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch rename to Spigot-Server-Patches/0113-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index d869119b9b..1639a506b2 100644 --- a/Spigot-Server-Patches/0125-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/Spigot-Server-Patches/0113-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -1,4 +1,4 @@ -From ed9719aea67d9235b946eeb5e93922c4ceda3707 Mon Sep 17 00:00:00 2001 +From 2cfae6d7882500d8af89756f8353d22d148098f1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 29 Apr 2016 20:02:00 -0400 Subject: [PATCH] Improve Maps (in item frames) performance and bug fixes @@ -13,10 +13,10 @@ custom renderers are in use, defaulting to the much simpler Vanilla system. Additionally, numerous issues to player position tracking on maps has been fixed. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 467c5bf1a..0f1d99636 100644 +index 1aa32bf11..36a961cb7 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -548,6 +548,12 @@ public abstract class EntityHuman extends EntityLiving { +@@ -610,6 +610,12 @@ public abstract class EntityHuman extends EntityLiving { return null; } // CraftBukkit end @@ -30,10 +30,10 @@ index 467c5bf1a..0f1d99636 100644 ItemStack itemstack1 = this.a(entityitem); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 4c6eb6ed1..759dacba7 100644 +index 6ae576a2e..af1981967 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -90,11 +90,11 @@ public class EntityTrackerEntry { +@@ -90,7 +90,7 @@ public class EntityTrackerEntry { } // PAIL : rename @@ -42,16 +42,11 @@ index 4c6eb6ed1..759dacba7 100644 EntityItemFrame entityitemframe = (EntityItemFrame) this.tracker; ItemStack itemstack = entityitemframe.getItem(); -- if (this.a % 10 == 0 && itemstack.getItem() instanceof ItemWorldMap) { // CraftBukkit - Moved this.a % 10 logic here so item frames do not enter the other blocks -+ if (itemstack != null && itemstack.getItem() instanceof ItemWorldMap) { // Paper - moved back up - WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, this.tracker.world); - Iterator iterator = this.trackedPlayers.iterator(); // CraftBukkit - diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 5f92355db..eca4903ed 100644 +index 3b3cc69de..4588df4b1 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1223,6 +1223,7 @@ public abstract class World implements IBlockAccess { +@@ -1075,6 +1075,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose { if ( iter.next().trackee == entity ) { @@ -60,18 +55,18 @@ index 5f92355db..eca4903ed 100644 } } diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java -index 1096b5c1f..59173605e 100644 +index 445a016b7..4c64f90be 100644 --- a/src/main/java/net/minecraft/server/WorldMap.java +++ b/src/main/java/net/minecraft/server/WorldMap.java -@@ -28,6 +28,7 @@ public class WorldMap extends PersistentBase { - public List i = Lists.newArrayList(); - public final Map k = Maps.newHashMap(); // Spigot private -> public - public Map decorations = Maps.newLinkedHashMap(); // Spigot +@@ -29,6 +29,7 @@ public class WorldMap extends PersistentBase { + public final Map j = Maps.newHashMap(); // Spigot private -> public + private final Map k = Maps.newHashMap(); + public Map decorations = Maps.newLinkedHashMap(); + private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper // CraftBukkit start public final CraftMapView mapView; -@@ -40,6 +41,7 @@ public class WorldMap extends PersistentBase { +@@ -41,6 +42,7 @@ public class WorldMap extends PersistentBase { // CraftBukkit start mapView = new CraftMapView(this); server = (CraftServer) org.bukkit.Bukkit.getServer(); @@ -79,23 +74,23 @@ index 1096b5c1f..59173605e 100644 // CraftBukkit end } -@@ -114,6 +116,7 @@ public class WorldMap extends PersistentBase { - } - } +@@ -105,6 +107,7 @@ public class WorldMap extends PersistentBase { + this.k.put(mapiconbanner.f(), mapiconbanner); + this.a(mapiconbanner.c(), (GeneratorAccess) null, mapiconbanner.f(), (double) mapiconbanner.a().getX(), (double) mapiconbanner.a().getZ(), 180.0D, mapiconbanner.d()); } + vanillaRender.buffer = colors; // Paper } -@@ -149,6 +152,7 @@ public class WorldMap extends PersistentBase { +@@ -148,6 +151,7 @@ public class WorldMap extends PersistentBase { return nbttagcompound; } + public void updateSeenPlayers(EntityHuman entityhuman, ItemStack itemstack) { a(entityhuman, itemstack); } // Paper - OBFHELPER public void a(EntityHuman entityhuman, ItemStack itemstack) { - if (!this.k.containsKey(entityhuman)) { + if (!this.j.containsKey(entityhuman)) { WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman); -@@ -314,6 +318,21 @@ public class WorldMap extends PersistentBase { +@@ -361,6 +365,21 @@ public class WorldMap extends PersistentBase { public class WorldMapHumanTracker { @@ -117,7 +112,7 @@ index 1096b5c1f..59173605e 100644 public final EntityHuman trackee; private boolean d = true; private int e; -@@ -330,9 +349,12 @@ public class WorldMap extends PersistentBase { +@@ -377,9 +396,12 @@ public class WorldMap extends PersistentBase { @Nullable public Packet a(ItemStack itemstack) { // CraftBukkit start @@ -145,5 +140,5 @@ index 256a13178..5768cd512 100644 public RenderData() { -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0114-Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-Server-Patches/0114-Add-handshake-event-to-allow-plugins-to-handle-clien.patch deleted file mode 100644 index 2713cc18cc..0000000000 --- a/Spigot-Server-Patches/0114-Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 4680099c5915c8bc2ad1f64d3e1899efe5430da8 Mon Sep 17 00:00:00 2001 -From: kashike -Date: Wed, 13 Apr 2016 20:21:38 -0700 -Subject: [PATCH] Add handshake event to allow plugins to handle client - handshaking logic themselves - - -diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index c3c9c3c1f..309ab18df 100644 ---- a/src/main/java/net/minecraft/server/HandshakeListener.java -+++ b/src/main/java/net/minecraft/server/HandshakeListener.java -@@ -72,8 +72,33 @@ public class HandshakeListener implements PacketHandshakingInListener { - this.b.close(chatmessage); - } else { - this.b.setPacketListener(new LoginListener(this.a, this.b)); -+ // Paper start - handshake event -+ boolean proxyLogicEnabled = org.spigotmc.SpigotConfig.bungee; -+ boolean handledByEvent = false; -+ // Try and handle the handshake through the event -+ if (com.destroystokyo.paper.event.player.PlayerHandshakeEvent.getHandlerList().getRegisteredListeners().length != 0) { // Hello? Can you hear me? -+ com.destroystokyo.paper.event.player.PlayerHandshakeEvent event = new com.destroystokyo.paper.event.player.PlayerHandshakeEvent(packethandshakinginsetprotocol.hostname, !proxyLogicEnabled); -+ if (event.callEvent()) { -+ // If we've failed somehow, let the client know so and go no further. -+ if (event.isFailed()) { -+ chatmessage = new ChatMessage(event.getFailMessage()); -+ this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage)); -+ this.b.close(chatmessage); -+ return; -+ } -+ -+ packethandshakinginsetprotocol.hostname = event.getServerHostname(); -+ this.b.l = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort()); -+ this.b.spoofedUUID = event.getUniqueId(); -+ this.b.spoofedProfile = gson.fromJson(event.getPropertiesJson(), com.mojang.authlib.properties.Property[].class); -+ handledByEvent = true; // Hooray, we did it! -+ } -+ } -+ // Don't try and handle default logic if it's been handled by the event. -+ if (!handledByEvent && proxyLogicEnabled) { -+ // Paper end - // Spigot Start -- if (org.spigotmc.SpigotConfig.bungee) { -+ //if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! - String[] split = packethandshakinginsetprotocol.hostname.split("\00"); - if ( split.length == 3 || split.length == 4 ) { - packethandshakinginsetprotocol.hostname = split[0]; --- -2.18.0 - diff --git a/Spigot-Server-Patches/0126-LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/0114-LootTable-API-Replenishable-Lootables-Feature.patch similarity index 91% rename from Spigot-Server-Patches/0126-LootTable-API-Replenishable-Lootables-Feature.patch rename to Spigot-Server-Patches/0114-LootTable-API-Replenishable-Lootables-Feature.patch index 5f4ce59772..d8488530b0 100644 --- a/Spigot-Server-Patches/0126-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/0114-LootTable-API-Replenishable-Lootables-Feature.patch @@ -1,4 +1,4 @@ -From e390dbccabd0c678c953bc4769e771a54e4c38bb Mon Sep 17 00:00:00 2001 +From 1ccbd86167f75dcdfa7824285a9b772ae1b8dcfb Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 1 May 2016 21:19:14 -0400 Subject: [PATCH] LootTable API & Replenishable Lootables Feature @@ -11,10 +11,10 @@ This feature is good for long term worlds so that newer players do not suffer with "Every chest has been looted" diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index d96311f6b..067cb233e 100644 +index 0c50cb4bd..38de48ebc 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -303,4 +303,26 @@ public class PaperWorldConfig { +@@ -253,4 +253,26 @@ public class PaperWorldConfig { this.frostedIceDelayMax = this.getInt("frosted-ice.delay.max", this.frostedIceDelayMax); log("Frosted Ice: " + (this.frostedIceEnabled ? "enabled" : "disabled") + " / delay: min=" + this.frostedIceDelayMin + ", max=" + this.frostedIceDelayMax); } @@ -231,7 +231,7 @@ index 000000000..668097620 +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java new file mode 100644 -index 000000000..de2eff17e +index 000000000..9a65603bc --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java @@ -0,0 +1,182 @@ @@ -364,7 +364,7 @@ index 000000000..de2eff17e + this.lootedPlayers = new HashMap<>(list.size()); + } + for (int i = 0; i < size; i++) { -+ final NBTTagCompound cmp = list.get(i); ++ final NBTTagCompound cmp = list.getCompound(i); + lootedPlayers.put(cmp.getUUID("UUID"), cmp.getLong("Time")); + } + } @@ -418,7 +418,7 @@ index 000000000..de2eff17e + } +} diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -index d6afa4aa6..50d7d34b8 100644 +index dc329dcc5..d3bf88585 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java @@ -6,17 +6,21 @@ import javax.annotation.Nullable; @@ -445,7 +445,7 @@ index d6afa4aa6..50d7d34b8 100644 // CraftBukkit start public List transaction = new java.util.ArrayList(); -@@ -164,12 +168,13 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp +@@ -159,12 +163,13 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp protected void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); @@ -460,7 +460,7 @@ index d6afa4aa6..50d7d34b8 100644 ContainerUtil.a(nbttagcompound, this.items); } -@@ -177,11 +182,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp +@@ -172,11 +177,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp protected void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); @@ -474,20 +474,20 @@ index d6afa4aa6..50d7d34b8 100644 ContainerUtil.b(nbttagcompound, this.items); } -@@ -230,10 +236,10 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp +@@ -225,10 +231,10 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp } public void f(@Nullable EntityHuman entityhuman) { -- if (this.c != null) { -+ if (lootableData.shouldReplenish(entityhuman)) { // Paper - LootTable loottable = this.world.getLootTableRegistry().a(this.c); +- if (this.c != null && this.world.getMinecraftServer() != null) { ++ if (lootableData.shouldReplenish(entityhuman) && this.world.getMinecraftServer() != null) { // Paper + LootTable loottable = this.world.getMinecraftServer().aP().a(this.c); - this.c = null; + lootableData.processRefill(entityhuman); // Paper Random random; if (this.d == 0L) { -@@ -258,12 +264,52 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp +@@ -253,12 +259,51 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp this.items.clear(); } @@ -497,9 +497,8 @@ index d6afa4aa6..50d7d34b8 100644 this.d = i; } -+ -+ public MinecraftKey getLootTableKey() { return b(); } // Paper - OBFHELPER - public MinecraftKey b() { ++ public MinecraftKey getLootTableKey() { return Q_(); } // Paper - OBFHELPER + public MinecraftKey Q_() { return this.c; } + @@ -541,10 +540,10 @@ index d6afa4aa6..50d7d34b8 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java -index a97ad2037..618521304 100644 +index ce710d219..9c8bebe4b 100644 --- a/src/main/java/net/minecraft/server/TileEntityLootable.java +++ b/src/main/java/net/minecraft/server/TileEntityLootable.java -@@ -1,44 +1,50 @@ +@@ -1,12 +1,16 @@ package net.minecraft.server; +import com.destroystokyo.paper.loottable.CraftLootableInventoryData; // Paper @@ -557,18 +556,20 @@ index a97ad2037..618521304 100644 -public abstract class TileEntityLootable extends TileEntityContainer implements ILootable { +public abstract class TileEntityLootable extends TileEntityContainer implements ILootable, CraftLootableInventory { // Paper - protected MinecraftKey m; -- protected long n; -+ protected long n; public long getLootTableSeed() { return n; } // Paper - OBFHELPER - protected String o; + protected MinecraftKey g; +- protected long h; ++ protected long h; public long getLootTableSeed() { return h; } // Paper - OBFHELPER + protected IChatBaseComponent i; - public TileEntityLootable() {} + protected TileEntityLootable(TileEntityTypes tileentitytypes) { +@@ -23,16 +27,18 @@ public abstract class TileEntityLootable extends TileEntityContainer implements + } - protected boolean c(NBTTagCompound nbttagcompound) { + protected boolean d(NBTTagCompound nbttagcompound) { + lootableData.loadNbt(nbttagcompound); // Paper if (nbttagcompound.hasKeyOfType("LootTable", 8)) { - this.m = new MinecraftKey(nbttagcompound.getString("LootTable")); - this.n = nbttagcompound.getLong("LootTableSeed"); + this.g = new MinecraftKey(nbttagcompound.getString("LootTable")); + this.h = nbttagcompound.getLong("LootTableSeed"); - return true; + return false; // Paper - always load the items, table may still remain } else { @@ -576,49 +577,47 @@ index a97ad2037..618521304 100644 } } - protected boolean d(NBTTagCompound nbttagcompound) { + protected boolean e(NBTTagCompound nbttagcompound) { + lootableData.saveNbt(nbttagcompound); // Paper - if (this.m != null) { - nbttagcompound.setString("LootTable", this.m.toString()); - if (this.n != 0L) { - nbttagcompound.setLong("LootTableSeed", this.n); + if (this.g == null) { + return false; + } else { +@@ -41,15 +47,15 @@ public abstract class TileEntityLootable extends TileEntityContainer implements + nbttagcompound.setLong("LootTableSeed", this.h); } - return true; + return false; // Paper - always save the items, table may still remain - } else { - return false; } } public void d(@Nullable EntityHuman entityhuman) { -- if (this.m != null) { -+ if (lootableData.shouldReplenish(entityhuman)) { // Paper - LootTable loottable = this.world.getLootTableRegistry().a(this.m); +- if (this.g != null && this.world.getMinecraftServer() != null) { ++ if (lootableData.shouldReplenish(entityhuman) && this.world.getMinecraftServer() != null) { // Paper + LootTable loottable = this.world.getMinecraftServer().aP().a(this.g); -- this.m = null; +- this.g = null; + lootableData.processRefill(entityhuman); // Paper Random random; - if (this.n == 0L) { -@@ -58,10 +64,12 @@ public abstract class TileEntityLootable extends TileEntityContainer implements + if (this.h == 0L) { +@@ -70,10 +76,12 @@ public abstract class TileEntityLootable extends TileEntityContainer implements } -+ public MinecraftKey getLootTableKey() { return b(); } // Paper - OBFHELPER - public MinecraftKey b() { - return this.m; ++ public MinecraftKey getLootTableKey() { return Q_(); } // Paper - OBFHELPER + public MinecraftKey Q_() { + return this.g; } + public void setLootTable(MinecraftKey key, long seed) { a(key, seed);} // Paper - OBFHELPER public void a(MinecraftKey minecraftkey, long i) { - this.m = minecraftkey; - this.n = i; -@@ -134,4 +142,42 @@ public abstract class TileEntityLootable extends TileEntityContainer implements - } - + this.g = minecraftkey; + this.h = i; +@@ -152,4 +160,41 @@ public abstract class TileEntityLootable extends TileEntityContainer implements protected abstract NonNullList q(); -+ + + protected abstract void a(NonNullList nonnulllist); + // Paper start - LootTable API + private final CraftLootableInventoryData lootableData = new CraftLootableInventoryData(this); + @@ -652,16 +651,16 @@ index a97ad2037..618521304 100644 + @Override + public void clearLootTable() { + //noinspection RedundantCast -+ this.m = (MinecraftKey) null; ++ this.g = (MinecraftKey) null; + } + // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -index 8328ed005..266f87d7f 100644 +index ac9b4297b..0558cafe3 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -@@ -60,7 +60,7 @@ public class CraftBlockEntityState extends CraftBlockState +@@ -61,7 +61,7 @@ public class CraftBlockEntityState extends CraftBlockState } // gets the wrapped TileEntity @@ -671,17 +670,18 @@ index 8328ed005..266f87d7f 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -index 85f3bb272..733c04ef7 100644 +index 6a54f2a16..a94c78512 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -@@ -1,5 +1,6 @@ +@@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; + import net.minecraft.server.BlockChest; +import com.destroystokyo.paper.loottable.CraftLootableBlockInventory; // Paper import net.minecraft.server.BlockPosition; - import net.minecraft.server.TileEntityChest; - -@@ -11,7 +12,7 @@ import org.bukkit.craftbukkit.inventory.CraftInventory; + import net.minecraft.server.Blocks; + import net.minecraft.server.ITileInventory; +@@ -15,7 +16,7 @@ import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest; import org.bukkit.inventory.Inventory; @@ -791,5 +791,5 @@ index e9963e21c..acb4dee04 100644 CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) { -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0127-Do-not-load-chunks-for-pathfinding.patch b/Spigot-Server-Patches/0115-Do-not-load-chunks-for-pathfinding.patch similarity index 78% rename from Spigot-Server-Patches/0127-Do-not-load-chunks-for-pathfinding.patch rename to Spigot-Server-Patches/0115-Do-not-load-chunks-for-pathfinding.patch index 92f72311ad..497ce09c07 100644 --- a/Spigot-Server-Patches/0127-Do-not-load-chunks-for-pathfinding.patch +++ b/Spigot-Server-Patches/0115-Do-not-load-chunks-for-pathfinding.patch @@ -1,14 +1,14 @@ -From a49583a3643759dfa8082967cbb3ff44021d6394 Mon Sep 17 00:00:00 2001 +From 02a8ef4ee2f4d3efc01255a137a232fa5f974352 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Jan 2016 00:13:19 -0500 Subject: [PATCH] Do not load chunks for pathfinding diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java -index 08b986fd7..786d1dd22 100644 +index 6d153e431..07444a86a 100644 --- a/src/main/java/net/minecraft/server/ChunkCache.java +++ b/src/main/java/net/minecraft/server/ChunkCache.java -@@ -25,7 +25,7 @@ public class ChunkCache implements IBlockAccess { +@@ -27,7 +27,7 @@ public class ChunkCache implements IIBlockAccess { for (l = this.a; l <= j; ++l) { for (i1 = this.b; i1 <= k; ++i1) { @@ -18,5 +18,5 @@ index 08b986fd7..786d1dd22 100644 } -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0128-Entity-Tracking-Improvements.patch b/Spigot-Server-Patches/0116-Entity-Tracking-Improvements.patch similarity index 92% rename from Spigot-Server-Patches/0128-Entity-Tracking-Improvements.patch rename to Spigot-Server-Patches/0116-Entity-Tracking-Improvements.patch index 9430cc7514..25a47c2680 100644 --- a/Spigot-Server-Patches/0128-Entity-Tracking-Improvements.patch +++ b/Spigot-Server-Patches/0116-Entity-Tracking-Improvements.patch @@ -1,4 +1,4 @@ -From 2c29fda252395dc3caf19e77deea3ef876473ace Mon Sep 17 00:00:00 2001 +From e138c0afb73cd67fdc728c5fb0d20bc9f82b578a Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 17 Jun 2013 01:24:00 -0400 Subject: [PATCH] Entity Tracking Improvements @@ -7,10 +7,10 @@ If any part of a Vehicle/Passenger relationship is visible to a player, send all passenger/vehicles to the player in the chain. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index d1f07bbbd..945f06c93 100644 +index 115504bf6..509254b35 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -53,6 +53,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -57,6 +57,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke protected CraftEntity bukkitEntity; @@ -19,7 +19,7 @@ index d1f07bbbd..945f06c93 100644 if (bukkitEntity == null) { bukkitEntity = CraftEntity.getEntity(world.getServer(), this); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 759dacba7..efc4c79ab 100644 +index af1981967..e054ae905 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -49,6 +49,7 @@ public class EntityTrackerEntry { @@ -90,7 +90,7 @@ index 759dacba7..efc4c79ab 100644 double d0 = entityplayer.locX - (double) this.xLoc / 4096.0D; double d1 = entityplayer.locZ - (double) this.zLoc / 4096.0D; int i = Math.min(this.e, this.f); -@@ -593,6 +636,7 @@ public class EntityTrackerEntry { +@@ -597,6 +640,7 @@ public class EntityTrackerEntry { this.trackedPlayers.remove(entityplayer); this.tracker.c(entityplayer); entityplayer.c(this.tracker); @@ -99,5 +99,5 @@ index 759dacba7..efc4c79ab 100644 } -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0116-Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch b/Spigot-Server-Patches/0116-Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch deleted file mode 100644 index adaf07efa0..0000000000 --- a/Spigot-Server-Patches/0116-Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 868e6d9441457ad084678875f8c583f27d306916 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Thu, 14 Apr 2016 21:01:39 -0400 -Subject: [PATCH] Fix Bugs with Spigot Mob Spawn Logic - -Spigot drastically altered vanilla mob spawn logic and caused a few issues. -1) Used only spawnable chunks vs entire world for entity counting, resulting in ignoring -other entities in the world, and causing the world to go over its intended limit. - -Specially with servers using smaller mob spawn ranges than view distance, as well as affects spawning API - -2) Spigot was using 16x16 division instead of vanilla 17x17 division. - -This patch returns mob counting to use all loaded chunks, and 17x17 division. - -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index e07ef14ed..aca1457b0 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -716,7 +716,7 @@ public class Chunk { - i = this.entitySlices.length - 1; - } - -- this.entitySlices[i].remove(entity); -+ if (!this.entitySlices[i].remove(entity)) { return; } // Paper - // Paper start - update counts - if (entity instanceof EntityItem) { - itemCounts[i]--; -diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 45a83ae99..ed22607d9 100644 ---- a/src/main/java/net/minecraft/server/SpawnerCreature.java -+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -23,6 +23,15 @@ public final class SpawnerCreature { - // Spigot start - get entity count only from chunks being processed in b - private int getEntityCount(WorldServer server, Class oClass) - { -+ // Paper start - use entire world, not just active chunks. Spigot broke vanilla expectations. -+ if (true) { -+ int sum = 0; -+ for (Chunk c : server.getChunkProviderServer().chunks.values()) { -+ sum += c.entityCount.get(oClass); -+ } -+ return sum; -+ } -+ // Paper end - int i = 0; - Iterator it = this.b.iterator(); - while ( it.hasNext() ) -@@ -126,7 +135,7 @@ public final class SpawnerCreature { - int l1 = limit * i / a; // CraftBukkit - use per-world limits - */ // Paper end - -- if ((mobcnt = getEntityCount(worldserver, enumcreaturetype.a())) <= limit * i / 256) { -+ if ((mobcnt = getEntityCount(worldserver, enumcreaturetype.a())) <= limit * i / 289) { // Paper - use 17x17 like vanilla (a at top of file) - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); - Iterator iterator1 = this.b.iterator(); - --- -2.18.0 - diff --git a/Spigot-Server-Patches/0117-Configurable-RCON-IP-address.patch b/Spigot-Server-Patches/0117-Configurable-RCON-IP-address.patch deleted file mode 100644 index a27de8db74..0000000000 --- a/Spigot-Server-Patches/0117-Configurable-RCON-IP-address.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 5381880d6b4b91e8b8cf2377ba8a09a7eb5d4cc0 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sat, 16 Apr 2016 00:39:33 -0400 -Subject: [PATCH] Configurable RCON IP address - -For servers with multiple IP's, ability to bind to a specific interface. - -diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java -index a6a0d5a29..efcafe77f 100644 ---- a/src/main/java/net/minecraft/server/RemoteControlListener.java -+++ b/src/main/java/net/minecraft/server/RemoteControlListener.java -@@ -24,7 +24,7 @@ public class RemoteControlListener extends RemoteConnectionThread { - super(iminecraftserver, "RCON Listener"); - this.h = iminecraftserver.a("rcon.port", 0); - this.l = iminecraftserver.a("rcon.password", ""); -- this.j = iminecraftserver.d_(); -+ this.j = iminecraftserver.a("rcon.ip", iminecraftserver.d_()); // Paper - this.i = iminecraftserver.e_(); - if (0 == this.h) { - this.h = this.i + 10; --- -2.18.0 - diff --git a/Spigot-Server-Patches/0129-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch b/Spigot-Server-Patches/0117-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch similarity index 90% rename from Spigot-Server-Patches/0129-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch rename to Spigot-Server-Patches/0117-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch index 45046410f4..a5924c50ce 100644 --- a/Spigot-Server-Patches/0129-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch +++ b/Spigot-Server-Patches/0117-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch @@ -1,4 +1,4 @@ -From 046d1dbd3f9ea1948d7d1c66e188f5d1f142b382 Mon Sep 17 00:00:00 2001 +From 0564a6de9dfcd2be9f73d342a46a610210e4ae32 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 May 2016 23:33:08 -0400 Subject: [PATCH] Don't save empty scoreboard teams to scoreboard.dat @@ -19,10 +19,10 @@ index 430b5d0cd..011cbf5e3 100644 + } } diff --git a/src/main/java/net/minecraft/server/PersistentScoreboard.java b/src/main/java/net/minecraft/server/PersistentScoreboard.java -index c9c01fad9..89c8d045b 100644 +index 81afa3195..ed3d5c889 100644 --- a/src/main/java/net/minecraft/server/PersistentScoreboard.java +++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java -@@ -184,6 +184,7 @@ public class PersistentScoreboard extends PersistentBase { +@@ -175,6 +175,7 @@ public class PersistentScoreboard extends PersistentBase { while (iterator.hasNext()) { ScoreboardTeam scoreboardteam = (ScoreboardTeam) iterator.next(); @@ -31,5 +31,5 @@ index c9c01fad9..89c8d045b 100644 nbttagcompound.setString("Name", scoreboardteam.getName()); -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0131-Fix-Chunk-Unload-Queue-Issues.patch b/Spigot-Server-Patches/0118-Fix-Chunk-Unload-Queue-Issues.patch similarity index 71% rename from Spigot-Server-Patches/0131-Fix-Chunk-Unload-Queue-Issues.patch rename to Spigot-Server-Patches/0118-Fix-Chunk-Unload-Queue-Issues.patch index 08c390b79d..0d3b49fff0 100644 --- a/Spigot-Server-Patches/0131-Fix-Chunk-Unload-Queue-Issues.patch +++ b/Spigot-Server-Patches/0118-Fix-Chunk-Unload-Queue-Issues.patch @@ -1,4 +1,4 @@ -From 43debbd620fdfdcda18b02c5826c4b1bfeea5979 Mon Sep 17 00:00:00 2001 +From 73a66676b80b85ce66c2fb365c6c361a219a0491 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 12 May 2016 02:03:56 -0400 Subject: [PATCH] Fix Chunk Unload Queue Issues @@ -9,23 +9,23 @@ has not resolved all the bugs with the changes. This patch fixes known issues and really should be applied by Spigot team. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index ba3ee64f8..857df2937 100644 +index aaa65582b..8ecdf7a5b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -75,7 +75,7 @@ public class Chunk { - private long w; - private int x; - private final ConcurrentLinkedQueue y; +@@ -58,7 +58,7 @@ public class Chunk implements IChunkAccess { + private long A; public long getInhabitedTime() { return A; } // Paper - OBFHELPER + private int B; + private final ConcurrentLinkedQueue C; - public boolean d; + public boolean d; public void setShouldUnload(boolean unload) { this.d = unload; } public boolean isUnloading() { return d; } // Paper - OBFHELPER - protected gnu.trove.map.hash.TObjectIntHashMap entityCount = new gnu.trove.map.hash.TObjectIntHashMap(); // Spigot - - // Paper start + private ChunkStatus D; + private int E; + private final AtomicInteger F; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 1771a1794..5cc192bbd 100644 +index bb96a7392..7825dc91b 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -299,6 +299,7 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -302,6 +302,7 @@ public class ChunkProviderServer implements IChunkProvider { if (chunk != null && chunk.d) { // CraftBukkit start - move unload logic to own method @@ -34,5 +34,5 @@ index 1771a1794..5cc192bbd 100644 continue; } -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0118-Prevent-Fire-from-loading-chunks.patch b/Spigot-Server-Patches/0118-Prevent-Fire-from-loading-chunks.patch deleted file mode 100644 index dd6d36f24b..0000000000 --- a/Spigot-Server-Patches/0118-Prevent-Fire-from-loading-chunks.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 419c239883797136eb0bbde7cdb5bfd8841d37e6 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sun, 17 Apr 2016 17:27:09 -0400 -Subject: [PATCH] Prevent Fire from loading chunks - -This causes the nether to spam unload/reload chunks, plus overall -bad behavior. - -diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java -index a3a5c853c..6832a19af 100644 ---- a/src/main/java/net/minecraft/server/BlockFire.java -+++ b/src/main/java/net/minecraft/server/BlockFire.java -@@ -164,6 +164,7 @@ public class BlockFire extends Block { - } - - BlockPosition blockposition1 = blockposition.a(j, l, k); -+ if (!world.isLoaded(blockposition1)) continue; // Paper - int j1 = this.d(world, blockposition1); - - if (j1 > 0) { -@@ -232,10 +233,13 @@ public class BlockFire extends Block { - } - - private void a(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition -+ // Paper start -+ final IBlockData iblockdata = world.getTypeIfLoaded(blockposition); -+ if (iblockdata == null) return; - int k = this.e(world.getType(blockposition).getBlock()); - - if (random.nextInt(i) < k) { -- IBlockData iblockdata = world.getType(blockposition); -+ //IBlockData iblockdata = world.getType(blockposition); // Paper - - // CraftBukkit start - org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); -@@ -294,6 +298,8 @@ public class BlockFire extends Block { - for (int k = 0; k < j; ++k) { - EnumDirection enumdirection = aenumdirection[k]; - -+ final IBlockData type = world.getTypeIfLoaded(blockposition.shift(enumdirection)); // Paper -+ if (type == null) continue; // Paper - i = Math.max(this.f(world.getType(blockposition.shift(enumdirection)).getBlock()), i); - } - --- -2.18.0 - diff --git a/Spigot-Server-Patches/0119-Implement-PlayerLocaleChangeEvent.patch b/Spigot-Server-Patches/0119-Implement-PlayerLocaleChangeEvent.patch deleted file mode 100644 index 151c8faac7..0000000000 --- a/Spigot-Server-Patches/0119-Implement-PlayerLocaleChangeEvent.patch +++ /dev/null @@ -1,75 +0,0 @@ -From bbc97e4f39fba21a155703397d8ddbce77535318 Mon Sep 17 00:00:00 2001 -From: Isaac Moore -Date: Tue, 19 Apr 2016 14:09:31 -0500 -Subject: [PATCH] Implement PlayerLocaleChangeEvent - - -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ed3546ccc..4b6976b19 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -31,7 +31,7 @@ import org.bukkit.inventory.MainHand; - public class EntityPlayer extends EntityHuman implements ICrafting { - - private static final Logger bV = LogManager.getLogger(); -- public String locale = "en_us"; // CraftBukkit - lowercase -+ public String locale = null; // PAIL: private -> public // Paper - default to null - public PlayerConnection playerConnection; - public final MinecraftServer server; - public final PlayerInteractManager playerInteractManager; -@@ -1238,12 +1238,24 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT); - this.server.server.getPluginManager().callEvent(event); - } -- if (!this.locale.equals(packetplayinsettings.a())) { -+ -+ // Paper start - add PlayerLocaleChangeEvent -+ // Since the field is initialized to null, this event should always fire the first time the packet is received -+ String oldLocale = this.locale; -+ this.locale = packetplayinsettings.a(); -+ if (!this.locale.equals(oldLocale)) { -+ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent(); -+ } -+ -+ // Compat with Bukkit -+ oldLocale = oldLocale != null ? oldLocale : "en_us"; -+ // Paper end -+ -+ if (!oldLocale.equals(packetplayinsettings.a())) { - PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(getBukkitEntity(), packetplayinsettings.a()); - this.server.server.getPluginManager().callEvent(event); - } - // CraftBukkit end -- this.locale = packetplayinsettings.a(); - this.cl = packetplayinsettings.c(); - this.cm = packetplayinsettings.d(); - this.getDataWatcher().set(EntityPlayer.br, Byte.valueOf((byte) packetplayinsettings.e())); -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6e2773cbb..532b211c4 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1637,8 +1637,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - - @Override - public String getLocale() { -- return getHandle().locale; -- -+ // Paper start - Locale change event -+ final String locale = getHandle().locale; -+ return locale != null ? locale : "en_us"; -+ // Paper end - } - - public void setAffectsSpawning(boolean affects) { -@@ -1775,7 +1777,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - @Override - public String getLocale() - { -- return getHandle().locale; -+ return CraftPlayer.this.getLocale(); // Paper - } - - @Override --- -2.18.0 - diff --git a/Spigot-Server-Patches/0132-System-property-for-disabling-watchdoge.patch b/Spigot-Server-Patches/0119-System-property-for-disabling-watchdoge.patch similarity index 92% rename from Spigot-Server-Patches/0132-System-property-for-disabling-watchdoge.patch rename to Spigot-Server-Patches/0119-System-property-for-disabling-watchdoge.patch index 2b33e2fbe5..817d2d6c28 100644 --- a/Spigot-Server-Patches/0132-System-property-for-disabling-watchdoge.patch +++ b/Spigot-Server-Patches/0119-System-property-for-disabling-watchdoge.patch @@ -1,4 +1,4 @@ -From 031e6fb04b93ac290d753cf7777fd87830f14e9e Mon Sep 17 00:00:00 2001 +From 8d20e9bc7ae7d6fa474f5afa0823368327d65fd4 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 12 May 2016 23:02:58 -0500 Subject: [PATCH] System property for disabling watchdoge @@ -18,5 +18,5 @@ index 0c106ea9c..57a4748a3 100644 Logger log = Bukkit.getServer().getLogger(); log.log( Level.SEVERE, "The server has stopped responding!" ); -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0120-EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-Server-Patches/0120-EntityRegainHealthEvent-isFastRegen-API.patch deleted file mode 100644 index 19a7b25a88..0000000000 --- a/Spigot-Server-Patches/0120-EntityRegainHealthEvent-isFastRegen-API.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 66452482b3e19d2cb4b1c67a60345302bc8fc29f Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Fri, 22 Apr 2016 01:43:11 -0500 -Subject: [PATCH] EntityRegainHealthEvent isFastRegen API - -Don't even get me started - -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index a92b89d7c..4b6bb38ae 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -773,10 +773,16 @@ public abstract class EntityLiving extends Entity { - } - - public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) { -+ // Paper start - Forward -+ heal(f, regainReason, false); -+ } -+ -+ public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason, boolean isFastRegen) { -+ // Paper end - float f1 = this.getHealth(); - - if (f1 > 0.0F) { -- EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason); -+ EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason, isFastRegen); // Paper - Add isFastRegen - this.world.getServer().getPluginManager().callEvent(event); - - if (!event.isCancelled()) { -diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java -index d42db9b45..c715138ee 100644 ---- a/src/main/java/net/minecraft/server/FoodMetaData.java -+++ b/src/main/java/net/minecraft/server/FoodMetaData.java -@@ -65,7 +65,7 @@ public class FoodMetaData { - if (this.foodTickTimer >= 10) { - float f = Math.min(this.saturationLevel, 6.0F); - -- entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason -+ entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen - this.a(f); - this.foodTickTimer = 0; - } --- -2.18.0 - diff --git a/Spigot-Server-Patches/0133-Optimize-EAR.patch b/Spigot-Server-Patches/0120-Optimize-EAR.patch similarity index 88% rename from Spigot-Server-Patches/0133-Optimize-EAR.patch rename to Spigot-Server-Patches/0120-Optimize-EAR.patch index d74e6b9565..a6c67bffd1 100644 --- a/Spigot-Server-Patches/0133-Optimize-EAR.patch +++ b/Spigot-Server-Patches/0120-Optimize-EAR.patch @@ -1,11 +1,11 @@ -From 12df16929d8bd8779a79431e03c8246128398d59 Mon Sep 17 00:00:00 2001 +From 72b6d02ca1dc326e89a88ea9fbd0333e3df1f20e Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 13 May 2016 01:38:06 -0400 Subject: [PATCH] Optimize EAR diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 3265a6c25..47865c027 100644 +index 1aade75f3..a9b84fdec 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -2,6 +2,8 @@ package org.spigotmc; @@ -26,13 +26,14 @@ index 3265a6c25..47865c027 100644 import net.minecraft.server.EntityFireball; import net.minecraft.server.EntityFireworks; import net.minecraft.server.EntityHuman; -@@ -21,16 +23,15 @@ import net.minecraft.server.EntityLiving; +@@ -21,17 +23,16 @@ import net.minecraft.server.EntityLiving; import net.minecraft.server.EntityMonster; import net.minecraft.server.EntityProjectile; import net.minecraft.server.EntitySheep; -import net.minecraft.server.EntitySlice; import net.minecraft.server.EntitySlime; import net.minecraft.server.EntityTNTPrimed; + import net.minecraft.server.EntityThrownTrident; import net.minecraft.server.EntityVillager; import net.minecraft.server.EntityWeather; import net.minecraft.server.EntityWither; @@ -44,7 +45,7 @@ index 3265a6c25..47865c027 100644 public class ActivationRange { -@@ -108,6 +109,7 @@ public class ActivationRange +@@ -110,6 +111,7 @@ public class ActivationRange maxRange = Math.max( maxRange, miscActivationRange ); maxRange = Math.min( ( world.spigotConfig.viewDistance << 4 ) - 8, maxRange ); @@ -52,7 +53,7 @@ index 3265a6c25..47865c027 100644 for ( EntityHuman player : world.players ) { -@@ -126,9 +128,9 @@ public class ActivationRange +@@ -128,9 +130,9 @@ public class ActivationRange { for ( int j1 = k; j1 <= l; ++j1 ) { @@ -65,5 +66,5 @@ index 3265a6c25..47865c027 100644 } } -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0134-Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/0121-Optimize-UserCache-Thread-Safe.patch similarity index 79% rename from Spigot-Server-Patches/0134-Optimize-UserCache-Thread-Safe.patch rename to Spigot-Server-Patches/0121-Optimize-UserCache-Thread-Safe.patch index 14d7bab5e8..a442386cfe 100644 --- a/Spigot-Server-Patches/0134-Optimize-UserCache-Thread-Safe.patch +++ b/Spigot-Server-Patches/0121-Optimize-UserCache-Thread-Safe.patch @@ -1,4 +1,4 @@ -From 98047b4440fafc8e21ca5562b707725067676c80 Mon Sep 17 00:00:00 2001 +From 554c388f9f637afab8f6c877cf81c456037d505a Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 16 May 2016 20:47:41 -0400 Subject: [PATCH] Optimize UserCache / Thread Safe @@ -10,20 +10,20 @@ Additionally, move Saving of the User cache to be done async, incase the user never changed the default setting for Spigot's save on stop only. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 45d3dbde2..ab7933079 100644 +index e11289217..49b2c27c6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -528,7 +528,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -631,7 +631,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // Spigot start if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { LOGGER.info("Saving usercache.json"); -- this.Y.c(); -+ this.Y.c(false); // Paper +- this.getUserCache().c(); ++ this.getUserCache().c(false); // Paper } // Spigot end } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 487fc11f1..4fb17a801 100644 +index 0e168ad34..f8b7d695c 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java @@ -109,7 +109,7 @@ public class UserCache { @@ -35,8 +35,8 @@ index 487fc11f1..4fb17a801 100644 UUID uuid = gameprofile.getId(); if (date == null) { -@@ -123,8 +123,9 @@ public class UserCache { - String s = gameprofile.getName().toLowerCase(Locale.ROOT); +@@ -122,8 +122,9 @@ public class UserCache { + UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date, null); - if (this.e.containsKey(uuid)) { @@ -46,7 +46,7 @@ index 487fc11f1..4fb17a801 100644 this.d.remove(usercache_usercacheentry1.a().getName().toLowerCase(Locale.ROOT)); this.f.remove(gameprofile); -@@ -137,7 +138,7 @@ public class UserCache { +@@ -136,7 +137,7 @@ public class UserCache { } @Nullable @@ -55,17 +55,10 @@ index 487fc11f1..4fb17a801 100644 String s1 = s.toLowerCase(Locale.ROOT); UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(s1); -@@ -166,14 +167,15 @@ public class UserCache { +@@ -165,8 +166,9 @@ public class UserCache { return usercache_usercacheentry == null ? null : usercache_usercacheentry.a(); } -- public String[] a() { -+ public synchronized String[] a() { // Paper - synchronize - ArrayList arraylist = Lists.newArrayList(this.d.keySet()); - - return (String[]) arraylist.toArray(new String[arraylist.size()]); - } - + @Nullable public GameProfile getProfile(UUID uuid) { return a(uuid); } // Paper - OBFHELPER @Nullable - public GameProfile a(UUID uuid) { @@ -73,7 +66,7 @@ index 487fc11f1..4fb17a801 100644 UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.e.get(uuid); return usercache_usercacheentry == null ? null : usercache_usercacheentry.a(); -@@ -228,8 +230,15 @@ public class UserCache { +@@ -221,8 +223,15 @@ public class UserCache { } @@ -89,7 +82,7 @@ index 487fc11f1..4fb17a801 100644 BufferedWriter bufferedwriter = null; try { -@@ -243,6 +252,14 @@ public class UserCache { +@@ -236,6 +245,14 @@ public class UserCache { } finally { IOUtils.closeQuietly(bufferedwriter); } @@ -105,5 +98,5 @@ index 487fc11f1..4fb17a801 100644 } -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0135-Avoid-blocking-on-Network-Manager-creation.patch b/Spigot-Server-Patches/0122-Avoid-blocking-on-Network-Manager-creation.patch similarity index 60% rename from Spigot-Server-Patches/0135-Avoid-blocking-on-Network-Manager-creation.patch rename to Spigot-Server-Patches/0122-Avoid-blocking-on-Network-Manager-creation.patch index 7fecff9fa0..c4fdb851c9 100644 --- a/Spigot-Server-Patches/0135-Avoid-blocking-on-Network-Manager-creation.patch +++ b/Spigot-Server-Patches/0122-Avoid-blocking-on-Network-Manager-creation.patch @@ -1,4 +1,4 @@ -From db6311ce32e96a9747aeb851cde530df2d5c21a4 Mon Sep 17 00:00:00 2001 +From d942862dba8093d6d712a08f72e134d53ced4e58 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 16 May 2016 23:19:16 -0400 Subject: [PATCH] Avoid blocking on Network Manager creation @@ -6,42 +6,41 @@ Subject: [PATCH] Avoid blocking on Network Manager creation Per Paper issue 294 diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 567edb300..4a629aaa1 100644 +index be8d07f41..ad49673c1 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java -@@ -60,6 +60,15 @@ public class ServerConnection { - public volatile boolean d; - private final List g = Collections.synchronizedList(Lists.newArrayList()); - private final List h = Collections.synchronizedList(Lists.newArrayList()); +@@ -40,6 +40,15 @@ public class ServerConnection { + public volatile boolean c; + private final List f = Collections.synchronizedList(Lists.newArrayList()); + private final List g = Collections.synchronizedList(Lists.newArrayList()); + // Paper start - prevent blocking on adding a new network manager while the server is ticking + private final List pending = Collections.synchronizedList(Lists.newArrayList()); + private void addPending() { + synchronized (pending) { -+ this.h.addAll(pending); // Paper - OBFHELPER - List of network managers ++ this.g.addAll(pending); // Paper - OBFHELPER - List of network managers + pending.clear(); + } + } + // Paper end public ServerConnection(MinecraftServer minecraftserver) { - this.f = minecraftserver; -@@ -94,7 +103,7 @@ public class ServerConnection { - channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(ServerConnection.this)).addLast("splitter", new PacketSplitter()).addLast("decoder", new PacketDecoder(EnumProtocolDirection.SERVERBOUND)).addLast("prepender", new PacketPrepender()).addLast("encoder", new PacketEncoder(EnumProtocolDirection.CLIENTBOUND)); + this.e = minecraftserver; +@@ -75,6 +84,7 @@ public class ServerConnection { NetworkManager networkmanager = new NetworkManager(EnumProtocolDirection.SERVERBOUND); -- ServerConnection.this.h.add(networkmanager); + ServerConnection.this.g.add(networkmanager); + pending.add(networkmanager); // Paper channel.pipeline().addLast("packet_handler", networkmanager); - networkmanager.setPacketListener(new HandshakeListener(ServerConnection.this.f, networkmanager)); + networkmanager.setPacketListener(new HandshakeListener(ServerConnection.this.e, networkmanager)); } -@@ -123,6 +132,7 @@ public class ServerConnection { +@@ -103,6 +113,7 @@ public class ServerConnection { - synchronized (this.h) { + synchronized (this.g) { // Spigot Start + addPending(); // Paper // This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order if ( org.spigotmc.SpigotConfig.playerShuffle > 0 && MinecraftServer.currentTick % org.spigotmc.SpigotConfig.playerShuffle == 0 ) { -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0136-Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/0123-Optional-TNT-doesn-t-move-in-water.patch similarity index 84% rename from Spigot-Server-Patches/0136-Optional-TNT-doesn-t-move-in-water.patch rename to Spigot-Server-Patches/0123-Optional-TNT-doesn-t-move-in-water.patch index aad33635f4..acd164b084 100644 --- a/Spigot-Server-Patches/0136-Optional-TNT-doesn-t-move-in-water.patch +++ b/Spigot-Server-Patches/0123-Optional-TNT-doesn-t-move-in-water.patch @@ -1,11 +1,11 @@ -From d45df5fa649ad40f1cb1057bc29f5f23aed74c96 Mon Sep 17 00:00:00 2001 +From f1d0ebbcfd08ddec06753cc6fc2d008f2c8c57ca Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 22 May 2016 20:20:55 -0500 Subject: [PATCH] Optional TNT doesn't move in water diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 067cb233e..06acdaaf0 100644 +index 38de48ebc..321da3be3 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -2,7 +2,6 @@ package com.destroystokyo.paper; @@ -16,7 +16,7 @@ index 067cb233e..06acdaaf0 100644 import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -325,4 +324,14 @@ public class PaperWorldConfig { +@@ -275,4 +274,14 @@ public class PaperWorldConfig { ); } } @@ -32,25 +32,26 @@ index 067cb233e..06acdaaf0 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c105dd9b0..334441ed7 100644 +index 509254b35..1aa4519a6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1114,6 +1114,11 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -1182,6 +1182,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean aq() { ++ // Paper start + return this.doWaterMovement(); + } + + public boolean doWaterMovement() { + // Paper end - if (this.bJ() instanceof EntityBoat) { - this.inWater = false; - } else if (this.world.a(this.getBoundingBox().grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.001D), Material.WATER, this)) { -@@ -2587,6 +2592,11 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper + return this.isInWater() || this.q(); } - public boolean bo() { +@@ -2724,6 +2730,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public boolean bw() { + return this.pushedByWater(); + } + @@ -60,7 +61,7 @@ index c105dd9b0..334441ed7 100644 } diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index bb0904f86..50811852a 100644 +index 87f3205f8..8c1d25979 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -147,4 +147,49 @@ public class EntityTNTPrimed extends Entity { @@ -114,5 +115,5 @@ index bb0904f86..50811852a 100644 + // Paper end } -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0137-Faster-redstone-torch-rapid-clock-removal.patch b/Spigot-Server-Patches/0124-Faster-redstone-torch-rapid-clock-removal.patch similarity index 67% rename from Spigot-Server-Patches/0137-Faster-redstone-torch-rapid-clock-removal.patch rename to Spigot-Server-Patches/0124-Faster-redstone-torch-rapid-clock-removal.patch index eaa9f88699..c8aa9dc3cd 100644 --- a/Spigot-Server-Patches/0137-Faster-redstone-torch-rapid-clock-removal.patch +++ b/Spigot-Server-Patches/0124-Faster-redstone-torch-rapid-clock-removal.patch @@ -1,4 +1,4 @@ -From 892b93e90757a501afa2715e83dcc8ecdd626cd5 Mon Sep 17 00:00:00 2001 +From fd74417cf92dd20fe65e116cef1b7ba61ad81f6c Mon Sep 17 00:00:00 2001 From: Martin Panzer Date: Mon, 23 May 2016 12:12:37 +0200 Subject: [PATCH] Faster redstone torch rapid clock removal @@ -6,12 +6,12 @@ Subject: [PATCH] Faster redstone torch rapid clock removal Only resize the the redstone torch list once, since resizing arrays / lists is costly diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java -index 5b0028a78..429f26ed5 100644 +index 6a54da4d6..ebd47196b 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java -@@ -94,9 +94,17 @@ public class BlockRedstoneTorch extends BlockTorch { - boolean flag = this.g(world, blockposition, iblockdata); - List list = (List) BlockRedstoneTorch.g.get(world); +@@ -63,9 +63,17 @@ public class BlockRedstoneTorch extends BlockTorch { + public static void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random, boolean flag) { + List list = (List) BlockRedstoneTorch.b.get(world); - while (list != null && !list.isEmpty() && world.getTime() - ((BlockRedstoneTorch.RedstoneUpdateInfo) list.get(0)).b > 60L) { - list.remove(0); @@ -29,15 +29,15 @@ index 5b0028a78..429f26ed5 100644 // CraftBukkit start org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager(); -@@ -179,7 +187,7 @@ public class BlockRedstoneTorch extends BlockTorch { - static class RedstoneUpdateInfo { +@@ -169,7 +177,7 @@ public class BlockRedstoneTorch extends BlockTorch { + public static class RedstoneUpdateInfo { - BlockPosition a; -- long b; -+ long b; final long getTime() { return this.b; } // Paper - OBFHELPER + private final BlockPosition a; +- private final long b; ++ private final long b; final long getTime() { return this.b; } // Paper - OBFHELPER public RedstoneUpdateInfo(BlockPosition blockposition, long i) { this.a = blockposition; -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0138-Ensure-Chunks-never-ever-load-async.patch b/Spigot-Server-Patches/0125-Ensure-Chunks-never-ever-load-async.patch similarity index 83% rename from Spigot-Server-Patches/0138-Ensure-Chunks-never-ever-load-async.patch rename to Spigot-Server-Patches/0125-Ensure-Chunks-never-ever-load-async.patch index 36dab276bf..9b0bb41a15 100644 --- a/Spigot-Server-Patches/0138-Ensure-Chunks-never-ever-load-async.patch +++ b/Spigot-Server-Patches/0125-Ensure-Chunks-never-ever-load-async.patch @@ -1,4 +1,4 @@ -From 5cdfaa0f565fc0d8893a906291c4501a2a8149a6 Mon Sep 17 00:00:00 2001 +From 3f8a86086738570a1913027002282e9644e5a40c Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 27 May 2016 21:41:26 -0400 Subject: [PATCH] Ensure Chunks never ever load async @@ -27,20 +27,18 @@ index 7b7a3d01b..9aaca21a7 100644 public static void queueChunkLoad(World world, ChunkRegionLoader loader, ChunkProviderServer provider, int x, int z, Runnable runnable) { diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -index b5efb9c3f..ef9529add 100644 +index 52a8c48fa..a4fcdbe04 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -@@ -35,8 +35,8 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider Date: Sat, 28 May 2016 16:54:03 +0200 Subject: [PATCH] Add server-name parameter diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index f95da9e26..d565a720f 100644 +index d9059129d..aad208f47 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -134,6 +134,14 @@ public class Main { @@ -24,5 +24,5 @@ index f95da9e26..d565a720f 100644 }; -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/Spigot-Server-Patches/0127-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch similarity index 92% rename from Spigot-Server-Patches/0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch rename to Spigot-Server-Patches/0127-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch index 5915d34ceb..d5eebb51ae 100644 --- a/Spigot-Server-Patches/0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch +++ b/Spigot-Server-Patches/0127-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch @@ -1,4 +1,4 @@ -From 123b1e86e327f1cd628aaa8e9110b27b2147b3a5 Mon Sep 17 00:00:00 2001 +From 0d6099080531c44b5b9c4c310bf9a18c2da8b4c6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 31 May 2016 22:53:50 -0400 Subject: [PATCH] Only send Dragon/Wither Death sounds to same world @@ -6,11 +6,11 @@ Subject: [PATCH] Only send Dragon/Wither Death sounds to same world Also fix view distance lookup diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 0f94d2f0a..a8cc6b61a 100644 +index 24cce6c03..e5f064577 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -573,8 +573,12 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo - if (this.bH == 1) { + if (this.bO == 1) { // CraftBukkit start - Use relative location for far away sounds // this.world.a(1028, new BlockPosition(this), 0); - int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; @@ -25,10 +25,10 @@ index 0f94d2f0a..a8cc6b61a 100644 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 97cf75b9f..967852605 100644 +index e9d9ec239..28f524468 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -210,8 +210,12 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -199,8 +199,12 @@ public class EntityWither extends EntityMonster implements IRangedEntity { // CraftBukkit start - Use relative location for far away sounds // this.world.a(1023, new BlockPosition(this), 0); @@ -44,5 +44,5 @@ index 97cf75b9f..967852605 100644 double deltaZ = this.locZ - player.locZ; double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; -- -2.18.0 +2.17.1 diff --git a/Spigot-Server-Patches/0141-Fix-FallingBlocks-being-stuck-on-fences.patch b/Spigot-Server-Patches/0141-Fix-FallingBlocks-being-stuck-on-fences.patch deleted file mode 100644 index dc5af96913..0000000000 --- a/Spigot-Server-Patches/0141-Fix-FallingBlocks-being-stuck-on-fences.patch +++ /dev/null @@ -1,105 +0,0 @@ -From f9b319d2f07b629d7f0ffc68dc21d8226366fb58 Mon Sep 17 00:00:00 2001 -From: Martin Panzer -Date: Fri, 3 Jun 2016 23:13:39 +0200 -Subject: [PATCH] Fix FallingBlocks being stuck on fences - -Fallingblocks would previously only check if directly beneath them a block exists. They also -hover on top of the 1.5 block tall hitbox of fences during these check. This -resulted in them always thinking they would be on air. - -We now first check, if if we are already on the ground. -if not, we check if the falling block is inside of the hitbox of the block at y - 1. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 06acdaaf0..600e603bd 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -334,4 +334,9 @@ public class PaperWorldConfig { - preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false); - log("Prevent TNT from moving in water: " + preventTntFromMovingInWater); - } -+ -+ public boolean altFallingBlockOnGround; -+ private void altFallingBlockOnGround() { -+ altFallingBlockOnGround = getBoolean("use-alternate-fallingblock-onGround-detection", false); -+ } - } -diff --git a/src/main/java/net/minecraft/server/BlockFalling.java b/src/main/java/net/minecraft/server/BlockFalling.java -index 674395756..1086e3117 100644 ---- a/src/main/java/net/minecraft/server/BlockFalling.java -+++ b/src/main/java/net/minecraft/server/BlockFalling.java -@@ -71,6 +71,12 @@ public class BlockFalling extends Block { - return block == Blocks.FIRE || material == Material.AIR || material == Material.WATER || material == Material.LAVA; - } - -+ // Paper start - OBFHELPER -+ public static boolean canMoveThrough(IBlockData blockdata) { -+ return BlockFalling.x(blockdata); -+ } -+ // Paper end -+ - public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {} - - public void a_(World world, BlockPosition blockposition) {} -diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index abdc2dea9..59acc9088 100644 ---- a/src/main/java/net/minecraft/server/EntityFallingBlock.java -+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java -@@ -3,6 +3,7 @@ package net.minecraft.server; - import com.google.common.collect.Lists; - import java.util.ArrayList; - import java.util.Iterator; -+import java.util.List; - import javax.annotation.Nullable; - - import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit -@@ -120,10 +121,10 @@ public class EntityFallingBlock extends Entity { - } - } else { - IBlockData iblockdata = this.world.getType(blockposition); -- -- if (!flag1 && BlockFalling.x(this.world.getType(new BlockPosition(this.locX, this.locY - 0.009999999776482582D, this.locZ)))) { -+ -+ if (!isOnGround()) { - this.onGround = false; -- // return; // CraftBukkit -+ if (this.world.paperConfig.altFallingBlockOnGround) return; // Paper - } - - this.motX *= 0.699999988079071D; -@@ -179,6 +180,32 @@ public class EntityFallingBlock extends Entity { - } - } - -+ // Paper start -+ private boolean isOnGround() { -+ BlockPosition where = new BlockPosition(this.locX, this.locY - 0.009999999776482582D, this.locZ); -+ boolean cannotMoveThrough = !BlockFalling.canMoveThrough(this.world.getType(where)); -+ if (!this.world.paperConfig.altFallingBlockOnGround) return cannotMoveThrough; -+ -+ if (cannotMoveThrough) { -+ return true; -+ } -+ -+ IBlockData blockData = this.world.getType(where.down()); -+ if (BlockFalling.canMoveThrough(blockData)) { -+ return false; -+ } -+ -+ List list = new ArrayList<>(); -+ addCollisions(blockData, getWorld(), where, this.getBoundingBox(), list, this); -+ return list.size() > 0; -+ } -+ -+ // OBFHELPER -+ private void addCollisions(IBlockData blockData, World world, BlockPosition where, AxisAlignedBB collider, List list, Entity entity) { -+ blockData.a(world, where, collider, list, entity, false); -+ } -+ // Paper end -+ - public void e(float f, float f1) { - Block block = this.block.getBlock(); - --- -2.18.0 - diff --git a/Spigot-Server-Patches/0142-Make-entities-look-for-hoppers.patch b/Spigot-Server-Patches/0142-Make-entities-look-for-hoppers.patch deleted file mode 100644 index 0670abef06..0000000000 --- a/Spigot-Server-Patches/0142-Make-entities-look-for-hoppers.patch +++ /dev/null @@ -1,383 +0,0 @@ -From b882250f89918c9a9e256def49d0d5b92d7e8916 Mon Sep 17 00:00:00 2001 -From: Techcable -Date: Sat, 18 Jun 2016 01:01:37 -0500 -Subject: [PATCH] Make entities look for hoppers - -Every tick hoppers try and find an block-inventory to extract from. -If no tile entity is above the hopper (which there often isn't) it will do a bounding box search for minecart chests and minecart hoppers. -If it can't find an inventory, it will then look for a dropped item, which is another bounding box search. -This patch eliminates that expensive check by having dropped items and minecart hoppers/chests look for hoppers instead. -Hoppers are tile entities meaning you can do a simple tile entity lookup to find the nearest hopper in range. -Pushing out of hoppers causes a bouding box lookup, which this patch replaces with a tile entity lookup. - -This patch may causes a decrease in the performance of dropped items, which is why it can be disabled in the configuration. - -diff --git a/src/main/java/com/destroystokyo/paper/HopperPusher.java b/src/main/java/com/destroystokyo/paper/HopperPusher.java -new file mode 100644 -index 000000000..52457e3d8 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/HopperPusher.java -@@ -0,0 +1,60 @@ -+package com.destroystokyo.paper; -+ -+import net.minecraft.server.AxisAlignedBB; -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.MCUtil; -+import net.minecraft.server.TileEntityHopper; -+import net.minecraft.server.World; -+ -+public interface HopperPusher { -+ -+ default TileEntityHopper findHopper() { -+ BlockPosition pos = new BlockPosition(getX(), getY(), getZ()); -+ int startX = pos.getX() - 1; -+ int endX = pos.getX() + 1; -+ int startY = Math.max(0, pos.getY() - 1); -+ int endY = Math.min(255, pos.getY() + 1); -+ int startZ = pos.getZ() - 1; -+ int endZ = pos.getZ() + 1; -+ BlockPosition.PooledBlockPosition adjacentPos = BlockPosition.PooledBlockPosition.aquire(); -+ for (int x = startX; x <= endX; x++) { -+ for (int y = startY; y <= endY; y++) { -+ for (int z = startZ; z <= endZ; z++) { -+ adjacentPos.setValues(x, y, z); -+ TileEntityHopper hopper = MCUtil.getHopper(getWorld(), adjacentPos); -+ if (hopper == null) continue; // Avoid playing with the bounding boxes, if at all possible -+ AxisAlignedBB hopperBoundingBox = hopper.getHopperLookupBoundingBox(); -+ /* -+ * Check if the entity's bounding box intersects with the hopper's lookup box. -+ * This operation doesn't work both ways! -+ * Make sure you check if the entity's box intersects the hopper's box, not vice versa! -+ */ -+ AxisAlignedBB boundingBox = this.getBoundingBox().shrink(0.1); // Imitate vanilla behavior -+ if (boundingBox.intersects(hopperBoundingBox)) { -+ return hopper; -+ } -+ } -+ } -+ } -+ adjacentPos.free(); -+ return null; -+ } -+ -+ boolean acceptItem(TileEntityHopper hopper); -+ -+ default boolean tryPutInHopper() { -+ if (!getWorld().paperConfig.isHopperPushBased) return false; -+ TileEntityHopper hopper = findHopper(); -+ return hopper != null && hopper.canAcceptItems() && acceptItem(hopper); -+ } -+ -+ AxisAlignedBB getBoundingBox(); -+ -+ World getWorld(); -+ -+ double getX(); -+ -+ double getY(); -+ -+ double getZ(); -+} -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 600e603bd..ce43e7bb7 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -339,4 +339,9 @@ public class PaperWorldConfig { - private void altFallingBlockOnGround() { - altFallingBlockOnGround = getBoolean("use-alternate-fallingblock-onGround-detection", false); - } -+ -+ public boolean isHopperPushBased; -+ private void isHopperPushBased() { -+ isHopperPushBased = getBoolean("hopper.push-based", false); -+ } - } -diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java -index 1eb9c2da8..c88b76a79 100644 ---- a/src/main/java/net/minecraft/server/AxisAlignedBB.java -+++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java -@@ -235,6 +235,7 @@ public class AxisAlignedBB { - } - } - -+ public final boolean intersects(AxisAlignedBB intersecting) { return this.c(intersecting); } // Paper - OBFHELPER - public boolean c(AxisAlignedBB axisalignedbb) { - return this.a(axisalignedbb.a, axisalignedbb.b, axisalignedbb.c, axisalignedbb.d, axisalignedbb.e, axisalignedbb.f); - } -diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 008ed206d..b3c1f550c 100644 ---- a/src/main/java/net/minecraft/server/BlockPosition.java -+++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -250,6 +250,7 @@ public class BlockPosition extends BaseBlockPosition { - super(i, j, k); - } - -+ public static BlockPosition.PooledBlockPosition aquire() { return s(); } // Paper - OBFHELPER - public static BlockPosition.PooledBlockPosition s() { - return e(0, 0, 0); - } -@@ -276,6 +277,7 @@ public class BlockPosition extends BaseBlockPosition { - return new BlockPosition.PooledBlockPosition(i, j, k); - } - -+ public void free() { t(); } // Paper - OBFHELPER - public void t() { - List list = BlockPosition.PooledBlockPosition.g; - -@@ -393,6 +395,7 @@ public class BlockPosition extends BaseBlockPosition { - return this.d; - } - -+ public void setValues(int x, int y, int z) { c(x, y, z); } // Paper - OBFHELPER - public BlockPosition.MutableBlockPosition c(int i, int j, int k) { - this.b = i; - this.c = j; -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index cb9ef622c..c675a6e16 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -80,6 +80,19 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper - public double locX; - public double locY; - public double locZ; -+ // Paper start - getters to implement HopperPusher -+ public double getX() { -+ return locX; -+ } -+ -+ public double getY() { -+ return locY; -+ } -+ -+ public double getZ() { -+ return locZ; -+ } -+ // Paper end - public double motX; - public double motY; - public double motZ; -diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 4d3aef96b..6593fc633 100644 ---- a/src/main/java/net/minecraft/server/EntityItem.java -+++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -8,8 +8,15 @@ import org.apache.logging.log4j.Logger; - import org.bukkit.event.entity.EntityPickupItemEvent; - import org.bukkit.event.player.PlayerPickupItemEvent; - // CraftBukkit end -+import com.destroystokyo.paper.HopperPusher; // Paper - --public class EntityItem extends Entity { -+// Paper start - implement HopperPusher -+public class EntityItem extends Entity implements HopperPusher { -+ @Override -+ public boolean acceptItem(TileEntityHopper hopper) { -+ return TileEntityHopper.putDropInInventory(null, hopper, this); -+ } -+// Paper end - - private static final Logger b = LogManager.getLogger(); - private static final DataWatcherObject c = DataWatcher.a(EntityItem.class, DataWatcherRegistry.f); -@@ -59,6 +66,7 @@ public class EntityItem extends Entity { - this.die(); - } else { - super.B_(); -+ if (tryPutInHopper()) return; // Paper - // CraftBukkit start - Use wall time for pickup and despawn timers - int elapsedTicks = MinecraftServer.currentTick - this.lastTick; - if (this.pickupDelay != 32767) this.pickupDelay -= elapsedTicks; -@@ -146,6 +154,7 @@ public class EntityItem extends Entity { - // Spigot start - copied from above - @Override - public void inactiveTick() { -+ if (tryPutInHopper()) return; // Paper - // 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/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -index 50d7d34b8..15f392d23 100644 ---- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java -+++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -@@ -7,6 +7,7 @@ import javax.annotation.Nullable; - import java.util.List; - import org.bukkit.Location; - -+import com.destroystokyo.paper.HopperPusher; // Paper - import com.destroystokyo.paper.loottable.CraftLootableInventoryData; // Paper - import com.destroystokyo.paper.loottable.CraftLootableInventory; // Paper - import com.destroystokyo.paper.loottable.LootableInventory; // Paper -@@ -15,7 +16,25 @@ import org.bukkit.entity.HumanEntity; - import org.bukkit.inventory.InventoryHolder; - // CraftBukkit end - --public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable, CraftLootableInventory { // Paper -+// Paper start - push into hoppers -+public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable, CraftLootableInventory, HopperPusher { // Paper - CraftLootableInventory -+ @Override -+ public boolean acceptItem(TileEntityHopper hopper) { -+ return TileEntityHopper.acceptItem(hopper, this); -+ } -+ -+ @Override -+ public void B_() { -+ super.B_(); -+ tryPutInHopper(); -+ } -+ -+ @Override -+ public void inactiveTick() { -+ super.inactiveTick(); -+ tryPutInHopper(); -+ } -+ // Paper end - - private NonNullList items; - private boolean b; -diff --git a/src/main/java/net/minecraft/server/IHopper.java b/src/main/java/net/minecraft/server/IHopper.java -index 804215a1c..e830d8390 100644 ---- a/src/main/java/net/minecraft/server/IHopper.java -+++ b/src/main/java/net/minecraft/server/IHopper.java -@@ -4,9 +4,9 @@ public interface IHopper extends IInventory { - - World getWorld(); - -- double E(); -+ double E(); default double getX() { return E(); } // Paper - OBFHELPER - -- double F(); -+ double F(); default double getY() { return F(); } // Paper - OBFHELPER - -- double G(); -+ double G(); default double getZ() { return G(); } // Paper - OBFHELPER - } -diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index 985513511..e9315f2d5 100644 ---- a/src/main/java/net/minecraft/server/TileEntityHopper.java -+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java -@@ -126,6 +126,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi - } - - private boolean o() { -+ mayAcceptItems = false; // Paper - at the beginning of a tick, assume we can't accept items - if (this.world != null && !this.world.isClientSide) { - if (!this.J() && BlockHopper.f(this.v())) { - boolean flag = false; -@@ -135,6 +136,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi - } - - if (!this.r()) { -+ mayAcceptItems = true; // Paper - flag this hopper to be able to accept items - flag = a((IHopper) this) || flag; - } - -@@ -150,6 +152,14 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi - } - } - -+ // Paper start -+ private boolean mayAcceptItems = false; -+ -+ public boolean canAcceptItems() { -+ return mayAcceptItems; -+ } -+ // Paper end -+ - private boolean p() { - Iterator iterator = this.items.iterator(); - -@@ -300,8 +310,15 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi - return true; - } - -+ // Paper start - split methods, and only do entity lookup if in pull mode - public static boolean a(IHopper ihopper) { -- IInventory iinventory = b(ihopper); -+ IInventory iinventory = getInventory(ihopper, !(ihopper instanceof TileEntityHopper) || !ihopper.getWorld().paperConfig.isHopperPushBased); -+ -+ return acceptItem(ihopper, iinventory); -+ } -+ -+ public static boolean acceptItem(IHopper ihopper, IInventory iinventory) { -+ // Paper end - - if (iinventory != null) { - EnumDirection enumdirection = EnumDirection.DOWN; -@@ -332,8 +349,8 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi - } - } - } -- } else { -- Iterator iterator = a(ihopper.getWorld(), ihopper.E(), ihopper.F(), ihopper.G()).iterator(); -+ } else if (!ihopper.getWorld().paperConfig.isHopperPushBased || !(ihopper instanceof TileEntityHopper)) { // Paper - only search for entities in 'pull mode' -+ Iterator iterator = a(ihopper.getWorld(), ihopper.E(), ihopper.F(), ihopper.G()).iterator(); // Change getHopperLookupBoundingBox() if this ever changes - - while (iterator.hasNext()) { - EntityItem entityitem = (EntityItem) iterator.next(); -@@ -397,6 +414,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi - return false; - } - -+ public static boolean putDropInInventory(IInventory iinventory, IInventory iinventory1, EntityItem entityitem) { return a(iinventory, iinventory1, entityitem); } // Paper - OBFHELPER - public static boolean a(IInventory iinventory, IInventory iinventory1, EntityItem entityitem) { - boolean flag = false; - -@@ -500,18 +518,44 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi - private IInventory I() { - EnumDirection enumdirection = BlockHopper.b(this.v()); - -- return b(this.getWorld(), this.E() + (double) enumdirection.getAdjacentX(), this.F() + (double) enumdirection.getAdjacentY(), this.G() + (double) enumdirection.getAdjacentZ()); -+ // Paper start - don't search for entities in push mode -+ World world = getWorld(); -+ return getInventory(world, this.E() + (double) enumdirection.getAdjacentX(), this.F() + (double) enumdirection.getAdjacentY(), this.G() + (double) enumdirection.getAdjacentZ(), !world.paperConfig.isHopperPushBased); -+ // Paper end - } - -- public static IInventory b(IHopper ihopper) { -- return b(ihopper.getWorld(), ihopper.E(), ihopper.F() + 1.0D, ihopper.G()); -+ // Paper start - add option to search for entities -+ public static IInventory b(IHopper hopper) { -+ return getInventory(hopper, true); -+ } -+ -+ public static IInventory getInventory(IHopper ihopper, boolean searchForEntities) { -+ return getInventory(ihopper.getWorld(), ihopper.E(), ihopper.F() + 1.0D, ihopper.G(), searchForEntities); -+ // Paper end - } - - public static List a(World world, double d0, double d1, double d2) { -- return world.a(EntityItem.class, new AxisAlignedBB(d0 - 0.5D, d1, d2 - 0.5D, d0 + 0.5D, d1 + 1.5D, d2 + 0.5D), IEntitySelector.a); -+ return world.a(EntityItem.class, new AxisAlignedBB(d0 - 0.5D, d1, d2 - 0.5D, d0 + 0.5D, d1 + 1.5D, d2 + 0.5D), IEntitySelector.a); // Change getHopperLookupBoundingBox(double, double, double) if the bounding box calculation is ever changed -+ } -+ -+ // Paper start -+ public AxisAlignedBB getHopperLookupBoundingBox() { -+ return getHopperLookupBoundingBox(this.getX(), this.getY(), this.getZ()); - } - -+ private static AxisAlignedBB getHopperLookupBoundingBox(double d0, double d1, double d2) { -+ // Change this if a(World, double, double, double) above ever changes -+ return new AxisAlignedBB(d0 - 0.5D, d1, d2 - 0.5D, d0 + 0.5D, d1 + 1.5D, d2 + 0.5D); -+ } -+ // Paper end -+ -+ // Paper start - add option to searchForEntities - public static IInventory b(World world, double d0, double d1, double d2) { -+ return getInventory(world, d0, d1, d2, true); -+ } -+ -+ public static IInventory getInventory(World world, double d0, double d1, double d2, boolean searchForEntities) { -+ // Paper end - Object object = null; - int i = MathHelper.floor(d0); - int j = MathHelper.floor(d1); -@@ -531,7 +575,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi - } - } - -- if (object == null) { -+ if (object == null && searchForEntities) { // Paper - only if searchForEntities - List list = world.getEntities((Entity) null, new AxisAlignedBB(d0 - 0.5D, d1 - 0.5D, d2 - 0.5D, d0 + 0.5D, d1 + 0.5D, d2 + 0.5D), IEntitySelector.c); - - if (!list.isEmpty()) { --- -2.18.0 - diff --git a/Spigot-Server-Patches/0144-Toggleable-Elytra-Wall-Damage.patch b/Spigot-Server-Patches/0144-Toggleable-Elytra-Wall-Damage.patch deleted file mode 100644 index dd6939ac53..0000000000 --- a/Spigot-Server-Patches/0144-Toggleable-Elytra-Wall-Damage.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 516394ea692192adfd455d9671c2bc9427e9c4c0 Mon Sep 17 00:00:00 2001 -From: Jadon Fowler -Date: Sat, 18 Jun 2016 23:13:59 -0700 -Subject: [PATCH] Toggleable Elytra Wall Damage - -Instead of calculating the damage taken from hitting a wall, you can -disable it in the config. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index e35e72e8b..1b9eb7f45 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -358,4 +358,9 @@ public class PaperWorldConfig { - private void skipEntityTickingInChunksScheduledForUnload() { - skipEntityTickingInChunksScheduledForUnload = getBoolean("skip-entity-ticking-in-chunks-scheduled-for-unload", skipEntityTickingInChunksScheduledForUnload); - } -+ -+ public boolean elytraHitWallDamage = true; -+ private void elytraHitWallDamage() { -+ elytraHitWallDamage = getBoolean("elytra-hit-wall-damage", true); -+ } - } -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 4b6bb38ae..dda6219a7 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1739,6 +1739,7 @@ public abstract class EntityLiving extends Entity { - this.motY = 0.30000001192092896D; - } - } else if (this.cP()) { -+ if (world.paperConfig.elytraHitWallDamage) { // Paper start - Toggleable Elytra Wall Damage - if (this.motY > -0.5D) { - this.fallDistance = 1.0F; - } -@@ -1788,6 +1789,7 @@ public abstract class EntityLiving extends Entity { - this.damageEntity(DamageSource.FLY_INTO_WALL, f8); - } - } -+ } // Paper end - Elyta Wall Damage if statement - - if (this.onGround && !this.world.isClientSide) { - if (getFlag(7) && !CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) // CraftBukkit --- -2.18.0 - diff --git a/Spigot-Server-Patches/0123-SPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patch b/removed/0123-SPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patch similarity index 100% rename from Spigot-Server-Patches/0123-SPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patch rename to removed/0123-SPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patch diff --git a/Spigot-Server-Patches/0130-Do-not-mark-chunks-as-active-for-neighbor-updates.patch b/removed/0130-Do-not-mark-chunks-as-active-for-neighbor-updates.patch similarity index 100% rename from Spigot-Server-Patches/0130-Do-not-mark-chunks-as-active-for-neighbor-updates.patch rename to removed/0130-Do-not-mark-chunks-as-active-for-neighbor-updates.patch diff --git a/Spigot-Server-Patches/0269-Optimize-Hoppers.patch b/removed/0269-Optimize-Hoppers.patch similarity index 100% rename from Spigot-Server-Patches/0269-Optimize-Hoppers.patch rename to removed/0269-Optimize-Hoppers.patch diff --git a/work/Bukkit b/work/Bukkit index 55a3379d9b..1d21dc022e 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 55a3379d9bcd38efb5c4f4d0db8bcee39db853df +Subproject commit 1d21dc022e7e6905ef64f54b165e7559dfa40ade diff --git a/work/CraftBukkit b/work/CraftBukkit index 8fbc72b714..1fccb89501 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 8fbc72b714a5051c6df8f05ac97528d747f1bdeb +Subproject commit 1fccb8950186caae273e45f1b08ebe2797214293 diff --git a/work/Spigot b/work/Spigot index 6505f06b35..1d0aef704b 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 6505f06b355d5f1ea0fff2d0e8edbd60b2f75354 +Subproject commit 1d0aef704b8cca70ab2c71dbabad4a09b91287e3