diff --git a/Spigot-Server-Patches/0178-Prevent-Pathfinding-out-of-World-Border.patch b/Spigot-Server-Patches/0159-Prevent-Pathfinding-out-of-World-Border.patch similarity index 88% rename from Spigot-Server-Patches/0178-Prevent-Pathfinding-out-of-World-Border.patch rename to Spigot-Server-Patches/0159-Prevent-Pathfinding-out-of-World-Border.patch index b507bc7b09..9a4814ce93 100644 --- a/Spigot-Server-Patches/0178-Prevent-Pathfinding-out-of-World-Border.patch +++ b/Spigot-Server-Patches/0159-Prevent-Pathfinding-out-of-World-Border.patch @@ -1,4 +1,4 @@ -From 6aa8b24934a87152a920c31909f7e63199336589 Mon Sep 17 00:00:00 2001 +From a320a06499b1e0c8089eaaa36fcbd1a8f71f7d09 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 19 Dec 2016 23:07:42 -0500 Subject: [PATCH] Prevent Pathfinding out of World Border @@ -6,10 +6,10 @@ Subject: [PATCH] Prevent Pathfinding out of World Border This prevents Entities from trying to run outside of the World Border diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 3ac6f84d3..935b2e81e 100644 +index 0c5215657..05e0545fd 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -69,6 +69,7 @@ public abstract class NavigationAbstract { +@@ -73,6 +73,7 @@ public abstract class NavigationAbstract { @Nullable public PathEntity b(BlockPosition blockposition) { @@ -17,7 +17,7 @@ index 3ac6f84d3..935b2e81e 100644 if (!this.b()) { return null; } else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { -@@ -95,6 +96,7 @@ public abstract class NavigationAbstract { +@@ -99,6 +100,7 @@ public abstract class NavigationAbstract { return null; } else { BlockPosition blockposition = new BlockPosition(entity); @@ -26,7 +26,7 @@ index 3ac6f84d3..935b2e81e 100644 if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { return this.c; diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 9038d52eb..632eb1c9d 100644 +index 4763c30a8..ec5386fd5 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -29,7 +29,7 @@ public class WorldBorder { diff --git a/Spigot-Server-Patches/0179-Bound-Treasure-Maps-to-World-Border.patch b/Spigot-Server-Patches/0160-Bound-Treasure-Maps-to-World-Border.patch similarity index 65% rename from Spigot-Server-Patches/0179-Bound-Treasure-Maps-to-World-Border.patch rename to Spigot-Server-Patches/0160-Bound-Treasure-Maps-to-World-Border.patch index fd701ea42b..5905f1c0e1 100644 --- a/Spigot-Server-Patches/0179-Bound-Treasure-Maps-to-World-Border.patch +++ b/Spigot-Server-Patches/0160-Bound-Treasure-Maps-to-World-Border.patch @@ -1,4 +1,4 @@ -From 9140c809a2ab87aaccef774be18f66a6e83113d2 Mon Sep 17 00:00:00 2001 +From 6a37edaf0197147075c033b77c864f8d3de94a07 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 20 Dec 2016 15:15:11 -0500 Subject: [PATCH] Bound Treasure Maps to World Border @@ -11,21 +11,19 @@ that is outside happens to be closer, but unreachable, yet another reachable one is in border that would of been missed. diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index 34fd7edfe..e8263baa4 100644 +index 263ea953a..8b8b468f3 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -236,6 +236,9 @@ public abstract class StructureGenerator extends WorldGenBase { +@@ -124,6 +124,7 @@ public abstract class StructureGenerator - WorldGenBase.a(world.getSeed(), random, l2, i3); - random.nextInt(); -+ -+ if (!world.getWorldBorder().isChunkInBounds(l2, i3)) { continue; } // Paper -+ - if (structuregenerator.a(l2, i3)) { - if (!flag1 || !world.b(l2, i3)) { - return new BlockPosition((l2 << 4) + 8, 64, (i3 << 4) + 8); + if (flag || flag1) { + ChunkCoordIntPair chunkcoordintpair = this.a(chunkgenerator, seededrandom, j, k, i1, j1); ++ if (!world.getWorldBorder().isChunkInBounds(chunkcoordintpair.x, chunkcoordintpair.z)) { continue; } // Paper + StructureStart structurestart = this.a(world, chunkgenerator, seededrandom, chunkcoordintpair.a()); + + if (structurestart != StructureGenerator.a) { diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 632eb1c9d..1bb172bbf 100644 +index ec5386fd5..08424a88b 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -33,6 +33,18 @@ public class WorldBorder { @@ -45,7 +43,7 @@ index 632eb1c9d..1bb172bbf 100644 + // Paper end + public boolean isInBounds(ChunkCoordIntPair chunkcoordintpair) { - return (double) chunkcoordintpair.e() > this.b() && (double) chunkcoordintpair.c() < this.d() && (double) chunkcoordintpair.f() > this.c() && (double) chunkcoordintpair.d() < this.e(); + return (double) chunkcoordintpair.f() > this.b() && (double) chunkcoordintpair.d() < this.d() && (double) chunkcoordintpair.g() > this.c() && (double) chunkcoordintpair.e() < this.e(); } -- 2.18.0 diff --git a/Spigot-Server-Patches/0180-Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/0161-Configurable-Cartographer-Treasure-Maps.patch similarity index 69% rename from Spigot-Server-Patches/0180-Configurable-Cartographer-Treasure-Maps.patch rename to Spigot-Server-Patches/0161-Configurable-Cartographer-Treasure-Maps.patch index 24cace5bc6..26e94a7f42 100644 --- a/Spigot-Server-Patches/0180-Configurable-Cartographer-Treasure-Maps.patch +++ b/Spigot-Server-Patches/0161-Configurable-Cartographer-Treasure-Maps.patch @@ -1,4 +1,4 @@ -From 0a8b200ed814c2a3f9b5758defb1ea16ed685839 Mon Sep 17 00:00:00 2001 +From 08a801e72f6cac422d809de13137806bfec8e3ea Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 20 Dec 2016 15:26:27 -0500 Subject: [PATCH] Configurable Cartographer Treasure Maps @@ -9,10 +9,10 @@ Also allow turning off treasure maps all together as they can eat up Map ID's which are limited in quantity. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 4b9bf3b4f..2ba3bcb8e 100644 +index f64a5ef35..5df8b1143 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -398,4 +398,14 @@ public class PaperWorldConfig { +@@ -333,4 +333,14 @@ public class PaperWorldConfig { Bukkit.getLogger().warning("Spawn Egg and Armor Stand NBT filtering disabled, this is a potential security risk"); } } @@ -28,19 +28,17 @@ index 4b9bf3b4f..2ba3bcb8e 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 9d201b14e..57fcc3c05 100644 +index abfd9adbd..dcc14aa11 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -783,7 +783,8 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { +@@ -755,6 +755,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { public void a(IMerchant imerchant, MerchantRecipeList merchantrecipelist, Random random) { int i = this.a.a(random); - World world = imerchant.u_(); -- BlockPosition blockposition = world.a(this.b, imerchant.v_(), true); + World world = imerchant.getWorld(); + if (!world.paperConfig.enableTreasureMaps) return; //Paper -+ BlockPosition blockposition = world.a(this.b, imerchant.v_(), world.paperConfig.treasureMapsAlreadyDiscovered); // Paper - pass false to return first structure, regardless of if its been discovered. true returns only undiscovered. + BlockPosition blockposition = world.a(this.b, imerchant.getPosition(), 100); if (blockposition != null) { - ItemStack itemstack = ItemWorldMap.a(world, (double) blockposition.getX(), (double) blockposition.getZ(), (byte) 2, true, true); -- 2.18.0 diff --git a/Spigot-Server-Patches/0162-Optimize-ItemStack.isEmpty.patch b/Spigot-Server-Patches/0162-Optimize-ItemStack.isEmpty.patch new file mode 100644 index 0000000000..adb42fe687 --- /dev/null +++ b/Spigot-Server-Patches/0162-Optimize-ItemStack.isEmpty.patch @@ -0,0 +1,23 @@ +From 928e3728f86fc9571a913643714c8af71344bf93 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 21 Dec 2016 03:48:29 -0500 +Subject: [PATCH] Optimize ItemStack.isEmpty() + +Remove hashMap lookup every check, simplify code to remove ternary + +diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java +index 70f2dcc9e..be6205275 100644 +--- a/src/main/java/net/minecraft/server/ItemStack.java ++++ b/src/main/java/net/minecraft/server/ItemStack.java +@@ -134,7 +134,7 @@ public final class ItemStack { + } + + public boolean isEmpty() { +- return this == ItemStack.a ? true : (this.getItem() != null && this.getItem() != Items.AIR ? this.count <= 0 : true); ++ return this == ItemStack.a || this.item == null || this.item == Items.AIR || this.count <= 0; // Paper + } + + public ItemStack cloneAndSubtract(int i) { +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0182-Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-Server-Patches/0163-Add-API-methods-to-control-if-armour-stands-can-move.patch similarity index 84% rename from Spigot-Server-Patches/0182-Add-API-methods-to-control-if-armour-stands-can-move.patch rename to Spigot-Server-Patches/0163-Add-API-methods-to-control-if-armour-stands-can-move.patch index 2550cee9ac..360d4dd816 100644 --- a/Spigot-Server-Patches/0182-Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/Spigot-Server-Patches/0163-Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -1,23 +1,23 @@ -From 1a10e756e4f3d5cf2ff493fe92f97d14f86f8c17 Mon Sep 17 00:00:00 2001 +From 82856d9550300acb55b93cdb1b79913f19089673 Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 21 Dec 2016 11:47:25 -0600 Subject: [PATCH] Add API methods to control if armour stands can move diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index c9054fc91..ee3d37a71 100644 +index 4c615baea..52a1036fd 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -50,6 +50,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -44,6 +44,7 @@ public class EntityArmorStand extends EntityLiving { public Vector3f rightArmPose; public Vector3f leftLegPose; public Vector3f rightLegPose; + public boolean canMove = true; // Paper public EntityArmorStand(World world) { - super(world); -@@ -770,4 +771,13 @@ public class EntityArmorStand extends EntityLiving { - public boolean cS() { + super(EntityTypes.ARMOR_STAND, world); +@@ -755,4 +756,13 @@ public class EntityArmorStand extends EntityLiving { + public boolean de() { return false; } + diff --git a/Spigot-Server-Patches/0164-Add-option-to-remove-invalid-statistics.patch b/Spigot-Server-Patches/0164-Add-option-to-remove-invalid-statistics.patch new file mode 100644 index 0000000000..5743efbd20 --- /dev/null +++ b/Spigot-Server-Patches/0164-Add-option-to-remove-invalid-statistics.patch @@ -0,0 +1,47 @@ +From cb943190b9136ef3fc873e413a73ee7c45c5744b Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Tue, 20 Dec 2016 23:09:21 -0600 +Subject: [PATCH] Add option to remove invalid statistics + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index 459c86bce..ea6fcb39f 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -262,4 +262,13 @@ public class PaperConfig { + maxPlayerAutoSavePerTick = (playerAutoSaveRate == -1 || playerAutoSaveRate > 100) ? 10 : 20; + } + } ++ ++ public static boolean removeInvalidStatistics = false; ++ private static void removeInvalidStatistics() { ++ if (version < 12) { ++ boolean oldValue = getBoolean("remove-invalid-statistics", false); ++ set("settings.remove-invalid-statistics", oldValue); ++ } ++ removeInvalidStatistics = getBoolean("settings.remove-invalid-statistics", false); ++ } + } +diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java +index 172f72fd8..7ba12c23d 100644 +--- a/src/main/java/net/minecraft/server/ServerStatisticManager.java ++++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java +@@ -83,6 +83,7 @@ public class ServerStatisticManager extends StatisticManager { + try { + JsonReader jsonreader = new JsonReader(new StringReader(s)); + Throwable throwable = null; ++ java.util.List invalidStats = com.google.common.collect.Lists.newArrayList(); // Paper + + try { + jsonreader.setLenient(false); +@@ -118,6 +119,7 @@ public class ServerStatisticManager extends StatisticManager { + + if (statistic == null) { + ServerStatisticManager.b.warn("Invalid statistic in {}: Don\'t know what {} is", this.d, s2); ++ if (com.destroystokyo.paper.PaperConfig.removeInvalidStatistics) invalidStats.add(s2); // Paper + } else { + this.a.put(statistic, nbttagcompound2.getInt(s2)); + } +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0186-Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/0165-Properly-fix-item-duplication-bug.patch similarity index 79% rename from Spigot-Server-Patches/0186-Properly-fix-item-duplication-bug.patch rename to Spigot-Server-Patches/0165-Properly-fix-item-duplication-bug.patch index 6ae70642d2..482d7b5cdc 100644 --- a/Spigot-Server-Patches/0186-Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/0165-Properly-fix-item-duplication-bug.patch @@ -1,4 +1,4 @@ -From bc04820d56bdc51cd13c3a880d50dbac3850c65f Mon Sep 17 00:00:00 2001 +From 4a71e35c105f2d8c83b679090c6eceaed46b2c30 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Tue, 27 Dec 2016 01:57:57 +0000 Subject: [PATCH] Properly fix item duplication bug @@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index f8e289475..cce3f98da 100644 +index cf2a39384..c91caf578 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1500,7 +1500,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1531,7 +1531,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override protected boolean isFrozen() { @@ -19,16 +19,17 @@ index f8e289475..cce3f98da 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index cca1c6aa3..3f9e60171 100644 +index 53d3e9775..b69c194bb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2631,6 +2631,6 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -2499,7 +2499,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + } - // CraftBukkit start - Add "isDisconnected" method public final boolean isDisconnected() { - return !this.player.joining && !this.networkManager.isConnected(); + return (!this.player.joining && !this.networkManager.isConnected()) || this.processedDisconnect; // Paper } + // CraftBukkit end } -- 2.18.0 diff --git a/Spigot-Server-Patches/0187-String-based-Action-Bar-API.patch b/Spigot-Server-Patches/0166-String-based-Action-Bar-API.patch similarity index 94% rename from Spigot-Server-Patches/0187-String-based-Action-Bar-API.patch rename to Spigot-Server-Patches/0166-String-based-Action-Bar-API.patch index 38be1e3174..3a52d347a5 100644 --- a/Spigot-Server-Patches/0187-String-based-Action-Bar-API.patch +++ b/Spigot-Server-Patches/0166-String-based-Action-Bar-API.patch @@ -1,4 +1,4 @@ -From 4c172f93ecc6a820530393ef7551192a1d68f55f Mon Sep 17 00:00:00 2001 +From 34125d9dac2db4cc51b0411293a97f5070d81714 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 27 Dec 2016 15:02:42 -0500 Subject: [PATCH] String based Action Bar API @@ -62,10 +62,10 @@ index a4b0901cf..02940d697 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 98e9da59a..a9186b77a 100644 +index 7d4355439..3c1f02c18 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -169,6 +169,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -208,6 +208,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper start diff --git a/Spigot-Server-Patches/0188-Activation-Range-Improvements.patch b/Spigot-Server-Patches/0167-Activation-Range-Improvements.patch similarity index 69% rename from Spigot-Server-Patches/0188-Activation-Range-Improvements.patch rename to Spigot-Server-Patches/0167-Activation-Range-Improvements.patch index 0615e4f2ee..e56341a8b0 100644 --- a/Spigot-Server-Patches/0188-Activation-Range-Improvements.patch +++ b/Spigot-Server-Patches/0167-Activation-Range-Improvements.patch @@ -1,4 +1,4 @@ -From 3da653ac5594ecd2407621dc2d303c63816df5a4 Mon Sep 17 00:00:00 2001 +From d44c3c626673c4d10d9e15823fe3f7abadacfcb3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 27 Dec 2016 22:38:06 -0500 Subject: [PATCH] Activation Range Improvements @@ -6,44 +6,44 @@ Subject: [PATCH] Activation Range Improvements Fixes and adds new Immunities to improve gameplay behavior diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index 0c82c6f5b..9659a45ef 100644 +index e2e109511..34dcd01de 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java -@@ -10,6 +10,7 @@ public abstract class EntityCreature extends EntityInsentient { +@@ -6,6 +6,7 @@ import org.bukkit.event.entity.EntityUnleashEvent; + + public abstract class EntityCreature extends EntityInsentient { - public static final UUID bv = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); - public static final AttributeModifier bw = (new AttributeModifier(EntityCreature.bv, "Fleeing speed bonus", 2.0D, 2)).a(false); + public BlockPosition movingTarget = null; public BlockPosition getMovingTarget() { return movingTarget; } // Paper private BlockPosition a; private float b; - private final float c; + diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index dda6219a7..9e864864d 100644 +index b12c9e461..1b2e802ea 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -73,7 +73,7 @@ public abstract class EntityLiving extends Entity { - public float aQ; - public float aR; + public float aT; + public float aU; public EntityHuman killer; - protected int lastDamageByPlayerTime; + public int lastDamageByPlayerTime; // Paper - public - protected boolean aU; + protected boolean aX; protected int ticksFarFromPlayer; - protected float aW; + protected float aZ; diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index dbda68dd0..af49b7273 100644 +index 269857960..864ca3cc6 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java @@ -363,6 +363,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - return this.bM != null; + return this.bR != null; } -+ public boolean inCaravan() { return this.dW(); } // Paper - OBFHELPER - public boolean dW() { - return this.bL != null; ++ public boolean inCaravan() { return this.em(); } // Paper - OBFHELPER + public boolean em() { + return this.bQ != null; } diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java -index 83d9c43f3..1cb6652c2 100644 +index a146a8b45..a19853463 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoal.java +++ b/src/main/java/net/minecraft/server/PathfinderGoal.java @@ -18,7 +18,10 @@ public abstract class PathfinderGoal { @@ -59,44 +59,47 @@ index 83d9c43f3..1cb6652c2 100644 public void e() {} diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java -index e5b5e9887..e3781f3a8 100644 +index d5c08aa7c..fe6570c88 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java -@@ -2,12 +2,21 @@ package net.minecraft.server; +@@ -2,17 +2,24 @@ package net.minecraft.server; public abstract class PathfinderGoalGotoTarget extends PathfinderGoal { -- private final EntityCreature c; -+ private final EntityCreature c; public EntityCreature getEntity() { return c; } // Paper - OBFHELPER - private final double d; - protected int a; - private int e; - private int f; -- protected BlockPosition b; -+ protected BlockPosition b; public BlockPosition getTarget() { return b; } public void setTarget(BlockPosition pos) { this.b = pos; getEntity().movingTarget = pos != BlockPosition.ZERO ? pos : null; } // Paper - OBFHELPER -+ -+ // Paper start +- private final EntityCreature f; ++ private final EntityCreature f; public EntityCreature getEntity() { return f; } // Paper - OBFHELPER + public double a; + protected int b; + protected int c; + private int g; +- protected BlockPosition d; ++ protected BlockPosition d; public BlockPosition getTarget() { return d; } public void setTarget(BlockPosition pos) { this.d = pos; getEntity().movingTarget = pos != BlockPosition.ZERO ? pos : null; } // Paper - OBFHELPER + private boolean h; + private final int i; + private final int j; + public int e; + ++ // Paper start - activation range improvements + @Override + public void onTaskReset() { + super.onTaskReset(); + setTarget(BlockPosition.ZERO); + } + // Paper end -+ - private boolean g; - private final int h; - -@@ -69,7 +78,7 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal { - BlockPosition blockposition1 = blockposition.a(l, j - 1, i1); - - if (this.c.f(blockposition1) && this.a(this.c.world, blockposition1)) { -- this.b = blockposition1; -+ setTarget(blockposition1); // Paper + public PathfinderGoalGotoTarget(EntityCreature entitycreature, double d0, int i) { + this(entitycreature, d0, i, 1); + } +@@ -93,7 +100,7 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal { + for (int j1 = i1 < l && i1 > -l ? l : 0; j1 <= l; j1 = j1 > 0 ? -j1 : 1 - j1) { + blockposition_mutableblockposition.g(blockposition).d(i1, k - 1, j1); + if (this.f.f((BlockPosition) blockposition_mutableblockposition) && this.a(this.f.world, blockposition_mutableblockposition)) { +- this.d = blockposition_mutableblockposition; ++ setTarget(blockposition_mutableblockposition); // Paper return true; } } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index b79bf70f0..33ae73890 100644 +index e02647f80..cdbf769e7 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -20,6 +20,7 @@ import net.minecraft.server.EntityFireball; @@ -107,7 +110,7 @@ index b79bf70f0..33ae73890 100644 import net.minecraft.server.EntityMonster; import net.minecraft.server.EntityProjectile; import net.minecraft.server.EntitySheep; -@@ -210,18 +211,29 @@ public class ActivationRange +@@ -212,18 +213,29 @@ public class ActivationRange if ( entity instanceof EntityLiving ) { EntityLiving living = (EntityLiving) entity; @@ -140,16 +143,7 @@ index b79bf70f0..33ae73890 100644 if ( entity instanceof EntityAnimal ) { EntityAnimal animal = (EntityAnimal) entity; -@@ -251,7 +263,7 @@ public class ActivationRange - { - // Never safe to skip fireworks or entities not yet added to chunk - // PAIL: inChunk - boolean under datawatchers -- if ( !entity.aa || entity instanceof EntityFireworks ) { -+ if ( !entity.isAddedToChunk() || entity instanceof EntityFireworks ) { // Paper (use obf helper) - return true; - } - -@@ -275,10 +287,10 @@ public class ActivationRange +@@ -276,10 +288,10 @@ public class ActivationRange { isActive = false; } diff --git a/Spigot-Server-Patches/0189-Firework-API-s.patch b/Spigot-Server-Patches/0168-Firework-API-s.patch similarity index 81% rename from Spigot-Server-Patches/0189-Firework-API-s.patch rename to Spigot-Server-Patches/0168-Firework-API-s.patch index 23f2186578..4f509a30d8 100644 --- a/Spigot-Server-Patches/0189-Firework-API-s.patch +++ b/Spigot-Server-Patches/0168-Firework-API-s.patch @@ -1,11 +1,11 @@ -From 0596e4e92bdc6e00405b6a5604e55110229e5716 Mon Sep 17 00:00:00 2001 +From d7ce58b548fbbf9db858847057dc7e1d2ab961c7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 28 Dec 2016 01:18:33 -0500 Subject: [PATCH] Firework API's diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index 48cdef5db..bd0ec95f2 100644 +index 4c2cdd4bc..abf8799c4 100644 --- a/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java @@ -2,6 +2,8 @@ package net.minecraft.server; @@ -26,8 +26,8 @@ index 48cdef5db..bd0ec95f2 100644 + private EntityLiving e;public EntityLiving getBoostedEntity() { return e; } // Paper - OBFHELPER public EntityFireworks(World world) { - super(world); -@@ -203,6 +206,11 @@ public class EntityFireworks extends Entity { + super(EntityTypes.FIREWORK_ROCKET, world); +@@ -196,6 +199,11 @@ public class EntityFireworks extends Entity { if (!itemstack.isEmpty()) { nbttagcompound.set("FireworksItem", itemstack.save(new NBTTagCompound())); } @@ -39,9 +39,9 @@ index 48cdef5db..bd0ec95f2 100644 } -@@ -218,7 +226,11 @@ public class EntityFireworks extends Entity { - this.datawatcher.set(EntityFireworks.FIREWORK_ITEM, itemstack); - } +@@ -207,7 +215,11 @@ public class EntityFireworks extends Entity { + if (!itemstack.isEmpty()) { + this.datawatcher.set(EntityFireworks.FIREWORK_ITEM, itemstack); } - + // Paper start @@ -51,20 +51,20 @@ index 48cdef5db..bd0ec95f2 100644 + // Paper end } - public boolean bd() { + public boolean bk() { diff --git a/src/main/java/net/minecraft/server/ItemFireworks.java b/src/main/java/net/minecraft/server/ItemFireworks.java -index b0bb4aa23..44a997215 100644 +index 7b1d51e5a..b0863b4db 100644 --- a/src/main/java/net/minecraft/server/ItemFireworks.java +++ b/src/main/java/net/minecraft/server/ItemFireworks.java -@@ -9,6 +9,7 @@ public class ItemFireworks extends Item { - ItemStack itemstack = entityhuman.b(enumhand); - EntityFireworks entityfireworks = new EntityFireworks(world, (double) ((float) blockposition.getX() + f), (double) ((float) blockposition.getY() + f1), (double) ((float) blockposition.getZ() + f2), itemstack); +@@ -19,6 +19,7 @@ public class ItemFireworks extends Item { + ItemStack itemstack = itemactioncontext.getItemStack(); + EntityFireworks entityfireworks = new EntityFireworks(world, (double) ((float) blockposition.getX() + itemactioncontext.m()), (double) ((float) blockposition.getY() + itemactioncontext.n()), (double) ((float) blockposition.getZ() + itemactioncontext.o()), itemstack); + entityfireworks.spawningEntity = entityhuman.getUniqueID(); // Paper world.addEntity(entityfireworks); - if (!entityhuman.abilities.canInstantlyBuild) { - itemstack.subtract(1); -@@ -25,6 +26,7 @@ public class ItemFireworks extends Item { + itemstack.subtract(1); + } +@@ -33,6 +34,7 @@ public class ItemFireworks extends Item { if (!world.isClientSide) { EntityFireworks entityfireworks = new EntityFireworks(world, itemstack, entityhuman); @@ -73,10 +73,10 @@ index b0bb4aa23..44a997215 100644 if (!entityhuman.abilities.canInstantlyBuild) { itemstack.subtract(1); diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index e15c23367..82c2537b3 100644 +index e658816c2..0d69deb51 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java -@@ -106,7 +106,7 @@ public class NBTTagCompound extends NBTBase { +@@ -108,7 +108,7 @@ public class NBTTagCompound implements NBTBase { return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least")); } @@ -86,7 +86,7 @@ index e15c23367..82c2537b3 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java -index 99746b3c2..d4fbe31d6 100644 +index 7b3b20682..b39e33f4f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java @@ -1,6 +1,7 @@ diff --git a/Spigot-Server-Patches/0190-PlayerTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0169-PlayerTeleportEndGatewayEvent.patch similarity index 88% rename from Spigot-Server-Patches/0190-PlayerTeleportEndGatewayEvent.patch rename to Spigot-Server-Patches/0169-PlayerTeleportEndGatewayEvent.patch index 42d622faaf..32fe5edf30 100644 --- a/Spigot-Server-Patches/0190-PlayerTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/0169-PlayerTeleportEndGatewayEvent.patch @@ -1,4 +1,4 @@ -From 540ca9ec6094933c35bf034c50e44d1a59a88f07 Mon Sep 17 00:00:00 2001 +From 36ef4c96b2b0b383b236263c46315cddf4027b1d Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 31 Dec 2016 21:44:50 -0500 Subject: [PATCH] PlayerTeleportEndGatewayEvent @@ -6,10 +6,10 @@ Subject: [PATCH] PlayerTeleportEndGatewayEvent Allows you to access the Gateway being used in a teleport event diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index cfce9274a..ecbc48b0c 100644 +index bb9822799..c3d30dc94 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -@@ -124,7 +124,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick +@@ -126,7 +126,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick location.setPitch(player.getLocation().getPitch()); location.setYaw(player.getLocation().getYaw()); diff --git a/Spigot-Server-Patches/0191-ShulkerBox-Dupe-Prevention.patch b/Spigot-Server-Patches/0170-ShulkerBox-Dupe-Prevention.patch similarity index 61% rename from Spigot-Server-Patches/0191-ShulkerBox-Dupe-Prevention.patch rename to Spigot-Server-Patches/0170-ShulkerBox-Dupe-Prevention.patch index eff8804154..528274daa1 100644 --- a/Spigot-Server-Patches/0191-ShulkerBox-Dupe-Prevention.patch +++ b/Spigot-Server-Patches/0170-ShulkerBox-Dupe-Prevention.patch @@ -1,4 +1,4 @@ -From ae5bdca8944e22bbd51dd5c3a668844dc10297df Mon Sep 17 00:00:00 2001 +From 394e5e84f0310ea3992761cda1895646bbc1d24a Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 2 Jan 2017 16:32:56 -0500 Subject: [PATCH] ShulkerBox Dupe Prevention @@ -7,16 +7,16 @@ This ensures that Shulker Boxes can never drop their contents twice, and that the inventory is cleared incase it some how also got saved to the world. diff --git a/src/main/java/net/minecraft/server/BlockShulkerBox.java b/src/main/java/net/minecraft/server/BlockShulkerBox.java -index 8811eb3e3..74e2e448f 100644 +index a823e7073..37ec634f6 100644 --- a/src/main/java/net/minecraft/server/BlockShulkerBox.java +++ b/src/main/java/net/minecraft/server/BlockShulkerBox.java -@@ -112,6 +112,7 @@ public class BlockShulkerBox extends BlockTileEntity { +@@ -100,6 +100,7 @@ public class BlockShulkerBox extends BlockTileEntity { + } + + a(world, blockposition, itemstack); ++ tileentityshulkerbox.clear(); // Paper - This was intended to be called in Vanilla (is checked in the if statement above if has been called) - Fixes dupe issues } - - a(world, blockposition, itemstack); -+ tileentityshulkerbox.clear(); // Paper - This was intended to be called in Vanilla (is checked in the if statement above if has been called) - Fixes dupe issues } - world.updateAdjacentComparators(blockposition, iblockdata.getBlock()); -- 2.18.0 diff --git a/Spigot-Server-Patches/0192-Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/0171-Provide-E-TE-Chunk-count-stat-methods.patch similarity index 90% rename from Spigot-Server-Patches/0192-Provide-E-TE-Chunk-count-stat-methods.patch rename to Spigot-Server-Patches/0171-Provide-E-TE-Chunk-count-stat-methods.patch index 9ce226f78d..c81a147da0 100644 --- a/Spigot-Server-Patches/0192-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-Server-Patches/0171-Provide-E-TE-Chunk-count-stat-methods.patch @@ -1,4 +1,4 @@ -From 8ad93887128df82ddae370b8a6da958cf7b1ff7b Mon Sep 17 00:00:00 2001 +From d01eef55a17b0d2c9ebec24bec84ed17299ad4de Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 15:24:46 -0500 Subject: [PATCH] Provide E/TE/Chunk count stat methods @@ -7,10 +7,10 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 284dc6391..2e78cd8cf 100644 +index e516ec603..4fd6d3dbf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -78,6 +78,29 @@ public class CraftWorld implements World { +@@ -81,6 +81,29 @@ public class CraftWorld implements World { private int chunkLoadCount = 0; private int chunkGCTickCount; diff --git a/Spigot-Server-Patches/0193-Enforce-Sync-Player-Saves.patch b/Spigot-Server-Patches/0172-Enforce-Sync-Player-Saves.patch similarity index 81% rename from Spigot-Server-Patches/0193-Enforce-Sync-Player-Saves.patch rename to Spigot-Server-Patches/0172-Enforce-Sync-Player-Saves.patch index 0505d3570f..6840b79df1 100644 --- a/Spigot-Server-Patches/0193-Enforce-Sync-Player-Saves.patch +++ b/Spigot-Server-Patches/0172-Enforce-Sync-Player-Saves.patch @@ -1,4 +1,4 @@ -From 747e0616893e74e1c96216c04ab0e4462b675533 Mon Sep 17 00:00:00 2001 +From 2a5803386edd8ea650fe2d1da9363103c4058c1d Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 15:41:58 -0500 Subject: [PATCH] Enforce Sync Player Saves @@ -7,10 +7,10 @@ Saving players async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 23ed9efbf..c49711cad 100644 +index 1f2265231..e41850742 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1252,6 +1252,7 @@ public abstract class PlayerList { +@@ -1226,6 +1226,7 @@ public abstract class PlayerList { } public void savePlayers(Integer interval) { @@ -18,7 +18,7 @@ index 23ed9efbf..c49711cad 100644 long now = MinecraftServer.currentTick; MinecraftTimings.savePlayers.startTiming(); // Paper int numSaved = 0; // Paper -@@ -1263,6 +1264,7 @@ public abstract class PlayerList { +@@ -1237,6 +1238,7 @@ public abstract class PlayerList { } } MinecraftTimings.savePlayers.stopTiming(); // Paper diff --git a/Spigot-Server-Patches/0194-Enforce-Sync-Chunk-Unloads.patch b/Spigot-Server-Patches/0173-Enforce-Sync-Chunk-Unloads.patch similarity index 83% rename from Spigot-Server-Patches/0194-Enforce-Sync-Chunk-Unloads.patch rename to Spigot-Server-Patches/0173-Enforce-Sync-Chunk-Unloads.patch index ad9f2264dd..c1ba8e1a38 100644 --- a/Spigot-Server-Patches/0194-Enforce-Sync-Chunk-Unloads.patch +++ b/Spigot-Server-Patches/0173-Enforce-Sync-Chunk-Unloads.patch @@ -1,4 +1,4 @@ -From 246c986d5d4681c5ab7fb23a07b8e061d389ce8c Mon Sep 17 00:00:00 2001 +From 3007709ef27aefc2029b6501e852a56d0fcca914 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 16:06:44 -0500 Subject: [PATCH] Enforce Sync Chunk Unloads @@ -7,10 +7,10 @@ Unloading Chunks async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 2e78cd8cf..4ffe0d208 100644 +index 4fd6d3dbf..013c5b4cf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -245,6 +245,7 @@ public class CraftWorld implements World { +@@ -244,6 +244,7 @@ public class CraftWorld implements World { } private boolean unloadChunk0(int x, int z, boolean save) { @@ -18,7 +18,7 @@ index 2e78cd8cf..4ffe0d208 100644 net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkIfLoaded(x, z); if (chunk == null) { return true; -@@ -252,6 +253,7 @@ public class CraftWorld implements World { +@@ -251,6 +252,7 @@ public class CraftWorld implements World { // If chunk had previously been queued to save, must do save to avoid loss of that data return world.getChunkProviderServer().unloadChunk(chunk, chunk.mustSave || save); diff --git a/Spigot-Server-Patches/0195-Don-t-allow-entities-to-ride-themselves-572.patch b/Spigot-Server-Patches/0174-Don-t-allow-entities-to-ride-themselves-572.patch similarity index 73% rename from Spigot-Server-Patches/0195-Don-t-allow-entities-to-ride-themselves-572.patch rename to Spigot-Server-Patches/0174-Don-t-allow-entities-to-ride-themselves-572.patch index 09b189e532..a1b7ccd976 100644 --- a/Spigot-Server-Patches/0195-Don-t-allow-entities-to-ride-themselves-572.patch +++ b/Spigot-Server-Patches/0174-Don-t-allow-entities-to-ride-themselves-572.patch @@ -1,19 +1,19 @@ -From 977e13e598af25e22f19ad88220a047723a12193 Mon Sep 17 00:00:00 2001 +From 9e606fa80e1d93abf95a23b48e459a04e9d6e67e Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Sun, 8 Jan 2017 04:31:36 +0000 Subject: [PATCH] Don't allow entities to ride themselves - #572 diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b6711dcfa..e7f63c927 100644 +index eb2a693af..b47bf9738 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1981,6 +1981,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -2075,6 +2075,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } protected void o(Entity entity) { + if (entity == this) throw new IllegalArgumentException("Entities cannot become a passenger of themselves"); // Paper - issue 572 - if (entity.bJ() != this) { + if (entity.getVehicle() != this) { throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)"); } else { -- diff --git a/Spigot-Server-Patches/0196-Fix-block-break-desync.patch b/Spigot-Server-Patches/0175-Fix-block-break-desync.patch similarity index 82% rename from Spigot-Server-Patches/0196-Fix-block-break-desync.patch rename to Spigot-Server-Patches/0175-Fix-block-break-desync.patch index fa15a2055b..3d04412893 100644 --- a/Spigot-Server-Patches/0196-Fix-block-break-desync.patch +++ b/Spigot-Server-Patches/0175-Fix-block-break-desync.patch @@ -1,14 +1,14 @@ -From 6b0a93e2ddfdb13b7aff806e071e79173d20b13b Mon Sep 17 00:00:00 2001 +From 1d07c47c26d62a65101a2a873e4737f94f975b86 Mon Sep 17 00:00:00 2001 From: Michael Himing Date: Sun, 8 Jan 2017 18:50:35 +1100 Subject: [PATCH] Fix block break desync diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 4f8865d61..802008b4e 100644 +index b69c194bb..25e3d6423 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -868,6 +868,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1144,6 +1144,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { double d3 = d0 * d0 + d1 * d1 + d2 * d2; if (d3 > 36.0D) { @@ -18,5 +18,5 @@ index 4f8865d61..802008b4e 100644 } else if (blockposition.getY() >= this.minecraftServer.getMaxBuildHeight()) { return; -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0176-Assign-the-World-in-WorldGenStronghold.patch b/Spigot-Server-Patches/0176-Assign-the-World-in-WorldGenStronghold.patch new file mode 100644 index 0000000000..a10661895a --- /dev/null +++ b/Spigot-Server-Patches/0176-Assign-the-World-in-WorldGenStronghold.patch @@ -0,0 +1,22 @@ +From eb5e873163442ce0fe19f3f1d9563c834542fd5d Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Sat, 14 Jan 2017 01:22:07 -0600 +Subject: [PATCH] Assign the World in WorldGenStronghold + + +diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java +index 8b285bdd4..b6e60e9df 100644 +--- a/src/main/java/net/minecraft/server/WorldGenStronghold.java ++++ b/src/main/java/net/minecraft/server/WorldGenStronghold.java +@@ -80,7 +80,7 @@ public class WorldGenStronghold extends StructureGenerator Date: Tue, 19 Dec 2017 16:31:46 -0500 Subject: [PATCH] ExperienceOrbs API for Reason/Source/Triggering player @@ -8,10 +8,10 @@ Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too. diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 352310960..3e2f52647 100644 +index ff110c8e9..d95587c8c 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -388,13 +388,13 @@ public class Block { +@@ -473,13 +473,13 @@ public class Block implements IMaterial { } } @@ -28,7 +28,7 @@ index 352310960..3e2f52647 100644 } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index a8cc6b61a..c925de971 100644 +index e5f064577..e237c5dc1 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -618,7 +618,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo @@ -41,10 +41,10 @@ index a8cc6b61a..c925de971 100644 } diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index bf5f1f0e8..d567ad4a5 100644 +index 3c888d601..79d80596d 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -@@ -15,9 +15,54 @@ public class EntityExperienceOrb extends Entity { +@@ -15,9 +15,59 @@ public class EntityExperienceOrb extends Entity { public int value; private EntityHuman targetPlayer; private int targetTime; @@ -86,13 +86,17 @@ index bf5f1f0e8..d567ad4a5 100644 + } + nbttagcompound.set("Paper.ExpData", comp); + } + + public EntityExperienceOrb(World world, double d0, double d1, double d2, int i) { ++ this(world, d0, d1, d2, i, null, null); ++ } ++ + public EntityExperienceOrb(World world, double d0, double d1, double d2, int i, org.bukkit.entity.ExperienceOrb.SpawnReason reason, Entity triggerId) { + this(world, d0, d1, d2, i, reason, triggerId, null); + } - -- public EntityExperienceOrb(World world, double d0, double d1, double d2, int i) { ++ + public EntityExperienceOrb(World world, double d0, double d1, double d2, int i, org.bukkit.entity.ExperienceOrb.SpawnReason reason, Entity triggerId, Entity sourceId) { - super(world); + super(EntityTypes.EXPERIENCE_ORB, world); + this.sourceEntityId = sourceId != null ? sourceId.getUniqueID() : null; + this.triggerEntityId = triggerId != null ? triggerId.getUniqueID() : null; + this.spawnReason = reason != null ? reason : org.bukkit.entity.ExperienceOrb.SpawnReason.UNKNOWN; @@ -100,7 +104,7 @@ index bf5f1f0e8..d567ad4a5 100644 this.setSize(0.5F, 0.5F); this.setPosition(d0, d1, d2); this.yaw = (float) (Math.random() * 360.0D); -@@ -149,12 +194,14 @@ public class EntityExperienceOrb extends Entity { +@@ -156,12 +206,14 @@ public class EntityExperienceOrb extends Entity { nbttagcompound.setShort("Health", (short) this.d); nbttagcompound.setShort("Age", (short) this.b); nbttagcompound.setShort("Value", (short) this.value); @@ -116,10 +120,10 @@ index bf5f1f0e8..d567ad4a5 100644 public void d(EntityHuman entityhuman) { diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 6ac89d1e3..177d8582f 100644 +index 7440e4a2a..895254c15 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -458,7 +458,7 @@ public class EntityFishingHook extends Entity { +@@ -467,7 +467,7 @@ public class EntityFishingHook extends Entity { this.world.addEntity(entityitem); // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop() if (playerFishEvent.getExpToDrop() > 0) { @@ -127,12 +131,12 @@ index 6ac89d1e3..177d8582f 100644 + this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, playerFishEvent.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.FISHING, this.owner, this)); // Paper } // CraftBukkit end - Item item = itemstack.getItem(); + if (itemstack1.getItem().a(TagsItem.G)) { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 9e864864d..38c043375 100644 +index 1b2e802ea..3a38f384e 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -347,7 +347,8 @@ public abstract class EntityLiving extends Entity { +@@ -352,7 +352,8 @@ public abstract class EntityLiving extends Entity { int j = EntityExperienceOrb.getOrbValue(i); i -= j; @@ -143,10 +147,10 @@ index 9e864864d..38c043375 100644 this.expToDrop = 0; // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java -index 0255986fd..e14f614f5 100644 +index a5e1939e0..e73dba09a 100644 --- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java +++ b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java -@@ -40,7 +40,7 @@ public class EntityThrownExpBottle extends EntityProjectile { +@@ -36,7 +36,7 @@ public class EntityThrownExpBottle extends EntityProjectile { int j = EntityExperienceOrb.getOrbValue(i); i -= j; @@ -156,10 +160,10 @@ index 0255986fd..e14f614f5 100644 this.die(); diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 57fcc3c05..a9c4ab10d 100644 +index dcc14aa11..0a9d9fd26 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -437,7 +437,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { +@@ -411,7 +411,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { } if (merchantrecipe.j()) { @@ -169,23 +173,23 @@ index 57fcc3c05..a9c4ab10d 100644 if (this.tradingPlayer instanceof EntityPlayer) { diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java -index 059671b54..444792ea0 100644 +index 4a128f707..b87096467 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java @@ -122,7 +122,7 @@ public class PathfinderGoalBreed extends PathfinderGoal { - if (this.a.getGameRules().getBoolean("doMobLoot")) { + if (this.b.getGameRules().getBoolean("doMobLoot")) { // CraftBukkit start - use event experience if (experience > 0) { -- this.a.addEntity(new EntityExperienceOrb(this.a, this.animal.locX, this.animal.locY, this.animal.locZ, experience)); -+ this.a.addEntity(new EntityExperienceOrb(this.a, this.animal.locX, this.animal.locY, this.animal.locZ, experience, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer, entityageable)); // Paper +- this.b.addEntity(new EntityExperienceOrb(this.b, this.animal.locX, this.animal.locY, this.animal.locZ, experience)); ++ this.b.addEntity(new EntityExperienceOrb(this.b, this.animal.locX, this.animal.locY, this.animal.locZ, experience, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer, entityageable)); // Paper } // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index a1689c065..a49b5c81a 100644 +index 33b508014..e34198e40 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java -@@ -383,7 +383,7 @@ public class PlayerInteractManager { +@@ -384,7 +384,7 @@ public class PlayerInteractManager { // CraftBukkit start - Drop event experience if (flag && event != null) { @@ -195,10 +199,10 @@ index a1689c065..a49b5c81a 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/SlotFurnaceResult.java b/src/main/java/net/minecraft/server/SlotFurnaceResult.java -index 1dcf967a1..ed394f7a5 100644 +index 998662d9e..6b4eb7f05 100644 --- a/src/main/java/net/minecraft/server/SlotFurnaceResult.java +++ b/src/main/java/net/minecraft/server/SlotFurnaceResult.java -@@ -7,7 +7,7 @@ import org.bukkit.event.inventory.FurnaceExtractEvent; +@@ -9,7 +9,7 @@ import org.bukkit.event.inventory.FurnaceExtractEvent; public class SlotFurnaceResult extends Slot { @@ -207,20 +211,20 @@ index 1dcf967a1..ed394f7a5 100644 private int b; public SlotFurnaceResult(EntityHuman entityhuman, IInventory iinventory, int i, int j, int k) { -@@ -71,7 +71,7 @@ public class SlotFurnaceResult extends Slot { - while (i > 0) { - j = EntityExperienceOrb.getOrbValue(i); - i -= j; -- this.a.world.addEntity(new EntityExperienceOrb(this.a.world, this.a.locX, this.a.locY + 0.5D, this.a.locZ + 0.5D, j)); -+ this.a.world.addEntity(new EntityExperienceOrb(this.a.world, this.a.locX, this.a.locY + 0.5D, this.a.locZ + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.FURNACE, getPlayer())); // Paper +@@ -85,7 +85,7 @@ public class SlotFurnaceResult extends Slot { + while (i > 0) { + j = EntityExperienceOrb.getOrbValue(i); + i -= j; +- this.a.world.addEntity(new EntityExperienceOrb(this.a.world, this.a.locX, this.a.locY + 0.5D, this.a.locZ + 0.5D, j)); ++ this.a.world.addEntity(new EntityExperienceOrb(this.a.world, this.a.locX, this.a.locY + 0.5D, this.a.locZ + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.FURNACE, getPlayer())); // Paper + } } - } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4ffe0d208..568a50ec4 100644 +index 013c5b4cf..817e29474 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1218,7 +1218,7 @@ public class CraftWorld implements World { +@@ -1240,7 +1240,7 @@ public class CraftWorld implements World { } else if (TNTPrimed.class.isAssignableFrom(clazz)) { entity = new EntityTNTPrimed(world, x, y, z, null); } else if (ExperienceOrb.class.isAssignableFrom(clazz)) { diff --git a/Spigot-Server-Patches/0181-Optimize-ItemStack.isEmpty.patch b/Spigot-Server-Patches/0181-Optimize-ItemStack.isEmpty.patch deleted file mode 100644 index 46c1a262b4..0000000000 --- a/Spigot-Server-Patches/0181-Optimize-ItemStack.isEmpty.patch +++ /dev/null @@ -1,31 +0,0 @@ -From a1b931dcc9fc5937954696bacf2349dcc5b9d57a Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 21 Dec 2016 03:48:29 -0500 -Subject: [PATCH] Optimize ItemStack.isEmpty() - -Remove hashMap lookup every check, simplify code to remove ternary - -diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 5047a57e9..736686bed 100644 ---- a/src/main/java/net/minecraft/server/ItemStack.java -+++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -144,9 +144,15 @@ public final class ItemStack { - this.F(); - } - -+ // Paper start - optimize isEmpty -+ private static Item airItem; - public boolean isEmpty() { -- return this == ItemStack.a ? true : (this.item != null && this.item != Item.getItemOf(Blocks.AIR) ? (this.count <= 0 ? true : this.damage < -32768 || this.damage > '\uffff') : true); -+ if (airItem == null) { -+ airItem = Item.REGISTRY.get(new MinecraftKey("air")); -+ } -+ return this == ItemStack.a || this.item == null || this.item == airItem || (this.count <= 0 || (this.damage < -32768 || this.damage > '\uffff')); - } -+ // Paper end - - public static void a(DataConverterManager dataconvertermanager) { - dataconvertermanager.a(DataConverterTypes.ITEM_INSTANCE, (DataInspector) (new DataInspectorBlockEntity())); --- -2.18.0 - diff --git a/Spigot-Server-Patches/0177-Vanished-players-don-t-have-rights.patch b/removed/0177-Vanished-players-don-t-have-rights.patch similarity index 100% rename from Spigot-Server-Patches/0177-Vanished-players-don-t-have-rights.patch rename to removed/0177-Vanished-players-don-t-have-rights.patch diff --git a/Spigot-Server-Patches/0183-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/removed/0183-Option-to-prevent-armor-stands-from-doing-entity-loo.patch similarity index 100% rename from Spigot-Server-Patches/0183-Option-to-prevent-armor-stands-from-doing-entity-loo.patch rename to removed/0183-Option-to-prevent-armor-stands-from-doing-entity-loo.patch diff --git a/Spigot-Server-Patches/0184-Add-option-to-remove-invalid-statistics.patch b/removed/0184-Add-option-to-remove-invalid-statistics.patch similarity index 100% rename from Spigot-Server-Patches/0184-Add-option-to-remove-invalid-statistics.patch rename to removed/0184-Add-option-to-remove-invalid-statistics.patch diff --git a/Spigot-Server-Patches/0185-IllegalPacketEvent.patch b/removed/0185-IllegalPacketEvent.patch similarity index 100% rename from Spigot-Server-Patches/0185-IllegalPacketEvent.patch rename to removed/0185-IllegalPacketEvent.patch diff --git a/Spigot-Server-Patches/0197-Assign-the-World-in-WorldGenStronghold.patch b/removed/0197-Assign-the-World-in-WorldGenStronghold.patch similarity index 100% rename from Spigot-Server-Patches/0197-Assign-the-World-in-WorldGenStronghold.patch rename to removed/0197-Assign-the-World-in-WorldGenStronghold.patch diff --git a/work/CraftBukkit b/work/CraftBukkit index b4bff6fc3d..a71d06a0c8 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit b4bff6fc3d3f80a7e297624f5d9dbf3ec7d6f6aa +Subproject commit a71d06a0c8426f7d1d23f9e76ea6cdf47b666db5 diff --git a/work/Spigot b/work/Spigot index 1d0aef704b..11bdb291b3 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 1d0aef704b8cca70ab2c71dbabad4a09b91287e3 +Subproject commit 11bdb291b30fed321b346668a4b5e4ddf45229b6