diff --git a/Spigot-API-Patches/0001-POM-changes.patch b/Spigot-API-Patches/0001-POM-changes.patch index 6bcb2032b5..eae4c84962 100644 --- a/Spigot-API-Patches/0001-POM-changes.patch +++ b/Spigot-API-Patches/0001-POM-changes.patch @@ -1,11 +1,11 @@ -From 78932fdd2a280f8bc6eb8cd540dbb14c9413fcd6 Mon Sep 17 00:00:00 2001 +From 3a25a0e5c49a62778583bf33ec87e41053a1989f Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 00:16:08 +0100 Subject: [PATCH] POM changes diff --git a/pom.xml b/pom.xml -index f06c89c1..97c13752 100644 +index 117a7f8cf..03894ccf3 100644 --- a/pom.xml +++ b/pom.xml @@ -3,29 +3,35 @@ @@ -21,7 +21,7 @@ index f06c89c1..97c13752 100644 + + + paper-api - 1.13-R0.1-SNAPSHOT + 1.13.1-R0.1-SNAPSHOT jar - Spigot-API diff --git a/Spigot-API-Patches/0035-LootTable-API.patch b/Spigot-API-Patches/0035-LootTable-API.patch index fcb1aead7e..0b5b027c4e 100644 --- a/Spigot-API-Patches/0035-LootTable-API.patch +++ b/Spigot-API-Patches/0035-LootTable-API.patch @@ -1,4 +1,4 @@ -From 74dcc240e66bd353b4e94b30769b8dec97ef41ea Mon Sep 17 00:00:00 2001 +From d1fe144a1457bb44d3e453bf5add1a93aea47d4a Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 1 May 2016 15:19:49 -0400 Subject: [PATCH] LootTable API @@ -10,105 +10,6 @@ auto replenish for a player. Provides methods to determine players looted state for an object -diff --git a/src/main/java/com/destroystokyo/paper/loottable/Lootable.java b/src/main/java/com/destroystokyo/paper/loottable/Lootable.java -new file mode 100644 -index 000000000..7dd3955b5 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/Lootable.java -@@ -0,0 +1,93 @@ -+package com.destroystokyo.paper.loottable; -+ -+import org.bukkit.Bukkit; -+import org.bukkit.NamespacedKey; -+import org.bukkit.loot.LootTable; -+ -+/** -+ * Defines an object that has a Loot Table and seed associated with it. -+ *

-+ * How the Loot Table and seed are used may vary based on Minecraft Versions -+ * and what type of object is using the Loot Table -+ * -+ * @deprecated Use {@link org.bukkit.loot.Lootable} -+ */ -+@Deprecated -+public interface Lootable extends org.bukkit.loot.Lootable { -+ -+ /** -+ * Gets the name of the Loot Table to be used in the World Folder -+ * -+ * @return The name, or null if no loot table exists -+ * @deprecated Use {@link org.bukkit.loot.Lootable#getLootTable()} -+ */ -+ @Deprecated -+ default String getLootTableName() { -+ LootTable lootTable = getLootTable(); -+ return lootTable != null && lootTable.getKey() != null ? lootTable.getKey().toString() : null; -+ } -+ -+ /** -+ * Sets the name of the Loot Table to be used in the World Folder -+ * Will use a random seed (0) -+ * -+ * @param name name in either foo or minecraft:foo format -+ * @return The previous Loot Table before the change -+ * @deprecated Use {@link org.bukkit.loot.Lootable#setLootTable(LootTable)} -+ */ -+ @Deprecated -+ default String setLootTable(String name) { -+ return setLootTable(name, 0); -+ } -+ -+ /** -+ * Sets the name of the Loot Table to be used in the World Folder -+ * Uses supplied Seed -+ * -+ * @param name name in either foo or minecraft:foo format -+ * @param seed seed for the loot table. If 0, seed will be random -+ * @return The previous Loot Table before the change -+ * @deprecated Use {@link org.bukkit.loot.Lootable#setSeed(long)} -+ */ -+ @Deprecated -+ default String setLootTable(String name, long seed) { -+ String prev = getLootTableName(); -+ LootTable lootTable = Bukkit.getLootTable(NamespacedKey.minecraft(name)); -+ setLootTable(lootTable, seed); -+ return prev; -+ } -+ -+ /** -+ * Gets the current seed associated to the Loot Table on this object -+ * -+ * @return The seed, or 0 for random -+ * @deprecated Use {@link org.bukkit.loot.Lootable#getSeed()} -+ */ -+ @Deprecated -+ default long getLootTableSeed() { -+ return getSeed(); -+ } -+ -+ /** -+ * Changes the current seed associated with the Loot Table on this object. -+ *

-+ * The seed will have no affect if this object does not have a Loot Table -+ * associated with it. -+ * -+ * @param seed The seed to use, or 0 for random -+ * @return The previous seed -+ * @throws IllegalStateException If called when this object does not have a loot table -+ * @deprecated Use {@link org.bukkit.loot.Lootable#setSeed(long)} -+ */ -+ @Deprecated -+ default long setLootTableSeed(long seed) { -+ final String lootTableName = getLootTableName(); -+ if (lootTableName == null) { -+ throw new IllegalStateException("This object does not currently have a Loot Table."); -+ } -+ -+ long prev = getSeed(); -+ setSeed(seed); -+ return prev; -+ } -+} diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableBlockInventory.java new file mode 100644 index 000000000..9095df616 @@ -153,13 +54,14 @@ index 000000000..a389f74c6 +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java new file mode 100644 -index 000000000..cde999ef4 +index 000000000..2fc3e8a1c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java -@@ -0,0 +1,111 @@ +@@ -0,0 +1,112 @@ +package com.destroystokyo.paper.loottable; + +import org.bukkit.entity.Player; ++import org.bukkit.loot.Lootable; + +import java.util.UUID; + @@ -449,10 +351,10 @@ index 9ea403e6f..238d118f7 100644 +public interface StorageMinecart extends Minecart, InventoryHolder, LootableEntityInventory { // Paper } diff --git a/src/main/java/org/bukkit/loot/Lootable.java b/src/main/java/org/bukkit/loot/Lootable.java -index f4b3d0215..98a472055 100644 +index f4b3d0215..9f1c830f4 100644 --- a/src/main/java/org/bukkit/loot/Lootable.java +++ b/src/main/java/org/bukkit/loot/Lootable.java -@@ -33,6 +33,31 @@ public interface Lootable { +@@ -33,6 +33,34 @@ public interface Lootable { */ LootTable getLootTable(); @@ -463,7 +365,10 @@ index f4b3d0215..98a472055 100644 + * @param table the Loot Table this {@link org.bukkit.block.Container} or {@link org.bukkit.entity.Mob} will have. + * @param seed the seed to used to generate loot. Default is 0. + */ -+ void setLootTable(LootTable table, long seed); ++ default void setLootTable(LootTable table, long seed) { ++ setLootTable(table); ++ setSeed(seed); ++ } + + /** + * Returns whether or not this object has a Loot Table diff --git a/Spigot-API-Patches/0097-Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-API-Patches/0097-Expand-World.spawnParticle-API-and-add-Builder.patch index 2b6cb92f8a..44dce67906 100644 --- a/Spigot-API-Patches/0097-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-API-Patches/0097-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -1,4 +1,4 @@ -From e831b67f4b5d0f76e11013e2557b6caa23810b78 Mon Sep 17 00:00:00 2001 +From 17a5dac03ee24a1868c0e0555a175c17d2f45220 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 29 Aug 2017 23:58:48 -0400 Subject: [PATCH] Expand World.spawnParticle API and add Builder @@ -464,7 +464,7 @@ index 4d0acaf5b..255efab76 100644 * Options which can be applied to redstone dust particles - a particle * color and size. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index f9d8b14c6..5630c624a 100644 +index 0fb55b071..a8d97c519 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -1742,7 +1742,57 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -524,8 +524,8 @@ index f9d8b14c6..5630c624a 100644 + // Paper end + - // Spigot start - public class Spigot + /** + * Spawns the particle (the number of times specified by count) -- 2.18.0 diff --git a/Spigot-API-Patches/0107-Add-SentientNPC-Interface-to-Entities.patch b/Spigot-API-Patches/0107-Add-SentientNPC-Interface-to-Entities.patch deleted file mode 100644 index 7ea1c5e341..0000000000 --- a/Spigot-API-Patches/0107-Add-SentientNPC-Interface-to-Entities.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 271f251dfa394ddcfa8ff6364ab1eeabfc84aa89 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sat, 16 Jun 2018 13:41:00 -0400 -Subject: [PATCH] Add SentientNPC Interface to Entities - -Used to determine ACTUAL Living NPC's. Spigot mistakenly inversed the conditions for LivingEntity, and -used LivingEntity for Insentient Entities, and named the actual EntityLiving class EntityInsentient. - -This should of all been inversed on the implementation side. To make matters worse, Spigot never -exposed the differentiator that there are entities with AI that are not sentient/alive such as -Armor stands and Players are the only things that do not implement the REAL EntityLiving class (named Insentient internally) - -This interface lets you identify NPC entities capable of sentience, and able to move about and react to the world. - -diff --git a/src/main/java/com/destroystokyo/paper/entity/SentientNPC.java b/src/main/java/com/destroystokyo/paper/entity/SentientNPC.java -new file mode 100644 -index 000000000..cb8de4629 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/entity/SentientNPC.java -@@ -0,0 +1,34 @@ -+/* -+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+package com.destroystokyo.paper.entity; -+ -+import org.bukkit.entity.Mob; -+ -+ -+/** -+ * @deprecated Upstream has added this API. Use {@link Mob}. Will be removed in 1.13.1 -+ */ -+@Deprecated -+public interface SentientNPC extends Mob { -+} -diff --git a/src/main/java/org/bukkit/entity/Ambient.java b/src/main/java/org/bukkit/entity/Ambient.java -index 613830a74..4ad71c825 100644 ---- a/src/main/java/org/bukkit/entity/Ambient.java -+++ b/src/main/java/org/bukkit/entity/Ambient.java -@@ -3,4 +3,4 @@ package org.bukkit.entity; - /** - * Represents an ambient mob - */ --public interface Ambient extends Mob {} -+public interface Ambient extends Mob, com.destroystokyo.paper.entity.SentientNPC {} // Paper {} -diff --git a/src/main/java/org/bukkit/entity/Creature.java b/src/main/java/org/bukkit/entity/Creature.java -index 6c9c5e85e..c796c4dc2 100644 ---- a/src/main/java/org/bukkit/entity/Creature.java -+++ b/src/main/java/org/bukkit/entity/Creature.java -@@ -4,4 +4,4 @@ package org.bukkit.entity; - * Represents a Creature. Creatures are non-intelligent monsters or animals - * which have very simple abilities. - */ --public interface Creature extends Mob {} -+public interface Creature extends Mob, com.destroystokyo.paper.entity.SentientNPC {} // Paper -diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java -index 4ea0e44e7..8f200e6c4 100644 ---- a/src/main/java/org/bukkit/entity/EnderDragon.java -+++ b/src/main/java/org/bukkit/entity/EnderDragon.java -@@ -3,7 +3,7 @@ package org.bukkit.entity; - /** - * Represents an Ender Dragon - */ --public interface EnderDragon extends ComplexLivingEntity { -+public interface EnderDragon extends ComplexLivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper - - /** - * Represents a phase or action that an Ender Dragon can perform. -diff --git a/src/main/java/org/bukkit/entity/Flying.java b/src/main/java/org/bukkit/entity/Flying.java -index 580ce18bf..45840ee1f 100644 ---- a/src/main/java/org/bukkit/entity/Flying.java -+++ b/src/main/java/org/bukkit/entity/Flying.java -@@ -3,4 +3,4 @@ package org.bukkit.entity; - /** - * Represents a Flying Entity. - */ --public interface Flying extends Mob {} -+public interface Flying extends Mob, com.destroystokyo.paper.entity.SentientNPC {} // Paper -diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java -index 1119e26e2..46d03d29d 100644 ---- a/src/main/java/org/bukkit/entity/Slime.java -+++ b/src/main/java/org/bukkit/entity/Slime.java -@@ -3,7 +3,7 @@ package org.bukkit.entity; - /** - * Represents a Slime. - */ --public interface Slime extends Mob { -+public interface Slime extends Mob, com.destroystokyo.paper.entity.SentientNPC { // Paper - - /** - * @return The size of the slime --- -2.18.0 - diff --git a/Spigot-API-Patches/0108-Make-shield-blocking-delay-configurable.patch b/Spigot-API-Patches/0107-Make-shield-blocking-delay-configurable.patch similarity index 94% rename from Spigot-API-Patches/0108-Make-shield-blocking-delay-configurable.patch rename to Spigot-API-Patches/0107-Make-shield-blocking-delay-configurable.patch index 448909c2e6..a03e8cf2d6 100644 --- a/Spigot-API-Patches/0108-Make-shield-blocking-delay-configurable.patch +++ b/Spigot-API-Patches/0107-Make-shield-blocking-delay-configurable.patch @@ -1,4 +1,4 @@ -From 9063aa95f7e636b7ac6f7ef498185e41deeaa694 Mon Sep 17 00:00:00 2001 +From 2b271de495531cdde7b4cdfa4ad11470e9f749a7 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 16 Jun 2018 01:17:39 -0500 Subject: [PATCH] Make shield blocking delay configurable diff --git a/Spigot-API-Patches/0109-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-API-Patches/0108-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch similarity index 94% rename from Spigot-API-Patches/0109-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch rename to Spigot-API-Patches/0108-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index e98fe3ce6c..fbd3e81c17 100644 --- a/Spigot-API-Patches/0109-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-API-Patches/0108-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -1,4 +1,4 @@ -From 15994adb8231b553c5bd352326141857af8bfb25 Mon Sep 17 00:00:00 2001 +From 8f0a17d0053904bba6193e2f4d7c46931eb4d966 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 15 Jun 2013 19:52:04 -0400 Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API @@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API Adds ability to get what arrow was shot, and control if it should be consumed. diff --git a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java -index f8c91a13..c9eb75aa 100644 +index f8c91a13b..c9eb75aa7 100644 --- a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java @@ -16,9 +16,28 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { diff --git a/Spigot-API-Patches/0110-Add-getNearbyXXX-methods-to-Location.patch b/Spigot-API-Patches/0109-Add-getNearbyXXX-methods-to-Location.patch similarity index 99% rename from Spigot-API-Patches/0110-Add-getNearbyXXX-methods-to-Location.patch rename to Spigot-API-Patches/0109-Add-getNearbyXXX-methods-to-Location.patch index ce20a7c058..03197e4c6f 100644 --- a/Spigot-API-Patches/0110-Add-getNearbyXXX-methods-to-Location.patch +++ b/Spigot-API-Patches/0109-Add-getNearbyXXX-methods-to-Location.patch @@ -1,4 +1,4 @@ -From 98993bdab959f99ca850a5ab7b767a5b56547688 Mon Sep 17 00:00:00 2001 +From 0291e3afa5c7bacac717ad667112822f628a515b Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 18 Jun 2018 00:41:46 -0500 Subject: [PATCH] Add "getNearbyXXX" methods to Location diff --git a/Spigot-API-Patches/0111-PlayerReadyArrowEvent.patch b/Spigot-API-Patches/0110-PlayerReadyArrowEvent.patch similarity index 98% rename from Spigot-API-Patches/0111-PlayerReadyArrowEvent.patch rename to Spigot-API-Patches/0110-PlayerReadyArrowEvent.patch index cc960c36c5..7133276508 100644 --- a/Spigot-API-Patches/0111-PlayerReadyArrowEvent.patch +++ b/Spigot-API-Patches/0110-PlayerReadyArrowEvent.patch @@ -1,4 +1,4 @@ -From c0279c1b26a29b6acc35b2c45bd53ed2f0253e1d Mon Sep 17 00:00:00 2001 +From 0e7cded0791f40a007dcdef8b10c24120e255050 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 18 Jun 2018 01:09:27 -0400 Subject: [PATCH] PlayerReadyArrowEvent diff --git a/Spigot-API-Patches/0112-Add-EntityKnockbackByEntityEvent.patch b/Spigot-API-Patches/0111-Add-EntityKnockbackByEntityEvent.patch similarity index 97% rename from Spigot-API-Patches/0112-Add-EntityKnockbackByEntityEvent.patch rename to Spigot-API-Patches/0111-Add-EntityKnockbackByEntityEvent.patch index ecc2171740..4ff7399394 100644 --- a/Spigot-API-Patches/0112-Add-EntityKnockbackByEntityEvent.patch +++ b/Spigot-API-Patches/0111-Add-EntityKnockbackByEntityEvent.patch @@ -1,4 +1,4 @@ -From 04ec5bec611967cfad7bb9c1b811cb4bc7b0623f Mon Sep 17 00:00:00 2001 +From 3b6b6156f219653c4c0f1edcb490998333852b72 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Mon, 18 Jun 2018 15:40:39 +0200 Subject: [PATCH] Add EntityKnockbackByEntityEvent diff --git a/Spigot-API-Patches/0113-Expand-Explosions-API.patch b/Spigot-API-Patches/0112-Expand-Explosions-API.patch similarity index 98% rename from Spigot-API-Patches/0113-Expand-Explosions-API.patch rename to Spigot-API-Patches/0112-Expand-Explosions-API.patch index f6fd6beda9..cbdef13eab 100644 --- a/Spigot-API-Patches/0113-Expand-Explosions-API.patch +++ b/Spigot-API-Patches/0112-Expand-Explosions-API.patch @@ -1,4 +1,4 @@ -From eb5718c051248c4902e979e9ff35028a9356ed1b Mon Sep 17 00:00:00 2001 +From aa05ec03ec60e2126c5c0389044b6532d7790a99 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 16:24:42 -0500 Subject: [PATCH] Expand Explosions API @@ -98,7 +98,7 @@ index 162a76e8b..056a4d6bb 100644 @Override public boolean equals(Object obj) { diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 5630c624a..ef3a2f2d2 100644 +index a8d97c519..1df38ba9d 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -890,6 +890,102 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0114-ItemStack-API-additions-for-quantity-flags-lore.patch b/Spigot-API-Patches/0113-ItemStack-API-additions-for-quantity-flags-lore.patch similarity index 98% rename from Spigot-API-Patches/0114-ItemStack-API-additions-for-quantity-flags-lore.patch rename to Spigot-API-Patches/0113-ItemStack-API-additions-for-quantity-flags-lore.patch index db1dc0138d..e448952f94 100644 --- a/Spigot-API-Patches/0114-ItemStack-API-additions-for-quantity-flags-lore.patch +++ b/Spigot-API-Patches/0113-ItemStack-API-additions-for-quantity-flags-lore.patch @@ -1,11 +1,11 @@ -From 60260cf74059c80402f6caba78347c9e7b297ec2 Mon Sep 17 00:00:00 2001 +From 7f8a8f71328288fcd226a13f93e8f97b7f5f5a59 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 22 Jun 2018 22:59:18 -0400 Subject: [PATCH] ItemStack API additions for quantity/flags/lore diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 972b945d..526ff166 100644 +index 972b945d3..526ff1666 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -2,7 +2,9 @@ package org.bukkit.inventory; diff --git a/Spigot-API-Patches/0115-LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-API-Patches/0114-LivingEntity-Hand-Raised-Item-Use-API.patch similarity index 96% rename from Spigot-API-Patches/0115-LivingEntity-Hand-Raised-Item-Use-API.patch rename to Spigot-API-Patches/0114-LivingEntity-Hand-Raised-Item-Use-API.patch index 45a66066b4..c79becc732 100644 --- a/Spigot-API-Patches/0115-LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-API-Patches/0114-LivingEntity-Hand-Raised-Item-Use-API.patch @@ -1,4 +1,4 @@ -From 60e287c651b9a42aea4798a5e3ece6265622222b Mon Sep 17 00:00:00 2001 +From eb524154c7e3ef486d64f2b1f84ab77b4a6c00fb Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 29 Jun 2018 00:19:19 -0400 Subject: [PATCH] LivingEntity Hand Raised/Item Use API diff --git a/Spigot-API-Patches/0116-RangedEntity-API.patch b/Spigot-API-Patches/0115-RangedEntity-API.patch similarity index 96% rename from Spigot-API-Patches/0116-RangedEntity-API.patch rename to Spigot-API-Patches/0115-RangedEntity-API.patch index 0fd37972a8..babbf91b76 100644 --- a/Spigot-API-Patches/0116-RangedEntity-API.patch +++ b/Spigot-API-Patches/0115-RangedEntity-API.patch @@ -1,4 +1,4 @@ -From 38a264062d9f7e239ee60eff8bd198197e8b77e8 Mon Sep 17 00:00:00 2001 +From 294bb2b4e77686af5ff006e185603ee6afd1a4d5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 26 Jun 2018 21:34:40 -0400 Subject: [PATCH] RangedEntity API @@ -8,15 +8,16 @@ and to perform an attack. diff --git a/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java new file mode 100644 -index 000000000..ded25f214 +index 000000000..8234de28f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java -@@ -0,0 +1,29 @@ +@@ -0,0 +1,30 @@ +package com.destroystokyo.paper.entity; + +import org.bukkit.entity.LivingEntity; ++import org.bukkit.entity.Mob; + -+public interface RangedEntity extends SentientNPC { ++public interface RangedEntity extends Mob { + /** + * Attack the specified entity using a ranged attack. + * diff --git a/Spigot-API-Patches/0117-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch b/Spigot-API-Patches/0116-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch similarity index 95% rename from Spigot-API-Patches/0117-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch rename to Spigot-API-Patches/0116-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch index afc86048ed..659ae1ae27 100644 --- a/Spigot-API-Patches/0117-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch +++ b/Spigot-API-Patches/0116-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch @@ -1,4 +1,4 @@ -From daa7931f24c915c80bcd1783f63ef11db9a0f232 Mon Sep 17 00:00:00 2001 +From 2bf0516d4ec180c0bbd9f50c67f205a99b8c08ca Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Sat, 30 Jun 2018 05:45:04 +0200 Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the @@ -6,7 +6,7 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the diff --git a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java -index 35f4148b..db105e76 100644 +index 35f4148bb..db105e764 100644 --- a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java +++ b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java @@ -12,6 +12,7 @@ public class ProjectileHitEvent extends EntityEvent { diff --git a/Spigot-API-Patches/0118-Add-World.getEntity-UUID-API.patch b/Spigot-API-Patches/0117-Add-World.getEntity-UUID-API.patch similarity index 89% rename from Spigot-API-Patches/0118-Add-World.getEntity-UUID-API.patch rename to Spigot-API-Patches/0117-Add-World.getEntity-UUID-API.patch index de91f94f1f..acfe404713 100644 --- a/Spigot-API-Patches/0118-Add-World.getEntity-UUID-API.patch +++ b/Spigot-API-Patches/0117-Add-World.getEntity-UUID-API.patch @@ -1,11 +1,11 @@ -From c0c64949e3296c8076656d6fab742b57a71299d3 Mon Sep 17 00:00:00 2001 +From b751eab97b7a040cf6b8d47c94a2ee90f02cd5bf Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Tue, 3 Jul 2018 16:07:16 +0200 Subject: [PATCH] Add World.getEntity(UUID) API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index ef3a2f2d2..860e4374f 100644 +index 1df38ba9d..5e6cb56ab 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -690,6 +690,16 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0119-InventoryCloseEvent-Reason-API.patch b/Spigot-API-Patches/0118-InventoryCloseEvent-Reason-API.patch similarity index 97% rename from Spigot-API-Patches/0119-InventoryCloseEvent-Reason-API.patch rename to Spigot-API-Patches/0118-InventoryCloseEvent-Reason-API.patch index 0458e267a9..e19344eb50 100644 --- a/Spigot-API-Patches/0119-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-API-Patches/0118-InventoryCloseEvent-Reason-API.patch @@ -1,4 +1,4 @@ -From c2bc9239b19e43b8ef8d3a4c82aee6d692732b20 Mon Sep 17 00:00:00 2001 +From 620b05a03d9f8250536ca98235324946057337f5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 3 Jul 2018 21:52:52 -0400 Subject: [PATCH] InventoryCloseEvent Reason API diff --git a/Spigot-API-Patches/0120-Entity-getChunk-API.patch b/Spigot-API-Patches/0119-Entity-getChunk-API.patch similarity index 90% rename from Spigot-API-Patches/0120-Entity-getChunk-API.patch rename to Spigot-API-Patches/0119-Entity-getChunk-API.patch index 5e22b5b52c..bc381ca72b 100644 --- a/Spigot-API-Patches/0120-Entity-getChunk-API.patch +++ b/Spigot-API-Patches/0119-Entity-getChunk-API.patch @@ -1,4 +1,4 @@ -From 5b4f6eb2598e8b89c0c3ba00b1f8f7af18ed9a36 Mon Sep 17 00:00:00 2001 +From 3692eca40551e4d7768b31aafc8e9da88ab680c3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 02:25:48 -0400 Subject: [PATCH] Entity#getChunk API @@ -6,7 +6,7 @@ Subject: [PATCH] Entity#getChunk API Get the chunk the entity is currently registered to diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 4548c95b..573a6918 100644 +index 4548c95b9..573a69184 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -1,5 +1,6 @@ diff --git a/Spigot-API-Patches/0121-Vex-getSummoner-API.patch b/Spigot-API-Patches/0120-Vex-getSummoner-API.patch similarity index 63% rename from Spigot-API-Patches/0121-Vex-getSummoner-API.patch rename to Spigot-API-Patches/0120-Vex-getSummoner-API.patch index bb98170e43..1825b03e8e 100644 --- a/Spigot-API-Patches/0121-Vex-getSummoner-API.patch +++ b/Spigot-API-Patches/0120-Vex-getSummoner-API.patch @@ -1,4 +1,4 @@ -From a3edf0217f3ee13041788a8800b618804700be4b Mon Sep 17 00:00:00 2001 +From d3bc8ae26091d52609c73bcd0e6d97f71724aa16 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 15:29:21 -0400 Subject: [PATCH] Vex#getSummoner API @@ -6,14 +6,10 @@ Subject: [PATCH] Vex#getSummoner API Get's the Mob that summoned this Vex diff --git a/src/main/java/org/bukkit/entity/Vex.java b/src/main/java/org/bukkit/entity/Vex.java -index a2f2fcaec..734683763 100644 +index a2f2fcaec..d395e405d 100644 --- a/src/main/java/org/bukkit/entity/Vex.java +++ b/src/main/java/org/bukkit/entity/Vex.java -@@ -1,6 +1,18 @@ - package org.bukkit.entity; - -+import com.destroystokyo.paper.entity.SentientNPC; -+ +@@ -3,4 +3,10 @@ package org.bukkit.entity; /** * Represents a Vex. */ @@ -21,11 +17,7 @@ index a2f2fcaec..734683763 100644 +public interface Vex extends Monster { + /** + * @return What Entity (most likely an Evoker, but not guaranteed) summoned this Vex -+ * @deprecated Use {@link #getSummoner()} + */ -+ @Deprecated -+ default SentientNPC getOwner() { return (SentientNPC) getSummoner(); } // Paper -+ + Mob getSummoner(); // Paper + +} diff --git a/Spigot-API-Patches/0122-Add-an-asterisk-to-legacy-API-plugins.patch b/Spigot-API-Patches/0121-Add-an-asterisk-to-legacy-API-plugins.patch similarity index 94% rename from Spigot-API-Patches/0122-Add-an-asterisk-to-legacy-API-plugins.patch rename to Spigot-API-Patches/0121-Add-an-asterisk-to-legacy-API-plugins.patch index 35dda386fc..524eccd2d8 100644 --- a/Spigot-API-Patches/0122-Add-an-asterisk-to-legacy-API-plugins.patch +++ b/Spigot-API-Patches/0121-Add-an-asterisk-to-legacy-API-plugins.patch @@ -1,4 +1,4 @@ -From 91f71ba5b2acd3e4d2c1723aacb8d5b74dd97ed3 Mon Sep 17 00:00:00 2001 +From e90f5e3a1992b807e97829fc570ce25f05b7811c Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 19 Jul 2018 15:07:02 -0500 Subject: [PATCH] Add an asterisk to legacy API plugins @@ -7,7 +7,7 @@ Not here to name and shame, only so server admins can be aware of which plugins have and haven't been updated. diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 33cad901..aff1d8e9 100644 +index 33cad9015..aff1d8e9b 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -66,4 +66,10 @@ public interface UnsafeValues { @@ -22,7 +22,7 @@ index 33cad901..aff1d8e9 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -index b1d384e8..72c0c0bc 100644 +index b1d384e82..72c0c0bc6 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -38,7 +38,14 @@ public class PluginsCommand extends BukkitCommand { @@ -42,7 +42,7 @@ index b1d384e8..72c0c0bc 100644 StringBuilder pluginList = new StringBuilder(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 3cff01b6..2b9aad0a 100644 +index 3cff01b6b..2b9aad0a7 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -303,7 +303,14 @@ public final class JavaPluginLoader implements PluginLoader { diff --git a/Spigot-API-Patches/0123-Use-specific-1.13-versioning-branch-build-name.patch b/Spigot-API-Patches/0122-Use-specific-1.13-versioning-branch-build-name.patch similarity index 95% rename from Spigot-API-Patches/0123-Use-specific-1.13-versioning-branch-build-name.patch rename to Spigot-API-Patches/0122-Use-specific-1.13-versioning-branch-build-name.patch index d2d9fa7379..35633e74ea 100644 --- a/Spigot-API-Patches/0123-Use-specific-1.13-versioning-branch-build-name.patch +++ b/Spigot-API-Patches/0122-Use-specific-1.13-versioning-branch-build-name.patch @@ -1,11 +1,11 @@ -From 104243eb412fa6c00f206d6ea2102ffa5090ee74 Mon Sep 17 00:00:00 2001 +From bbb9cf97e9b7033826d511f51950b79c2741fe10 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 19 Jul 2018 17:32:47 -0500 Subject: [PATCH] Use specific 1.13 versioning branch/build name diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -index c45faf4c..7041085c 100644 +index c45faf4cb..7041085c3 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java @@ -266,7 +266,7 @@ public class VersionCommand extends BukkitCommand { diff --git a/Spigot-API-Patches/0124-Add-async-chunk-load-API.patch b/Spigot-API-Patches/0123-Add-async-chunk-load-API.patch similarity index 97% rename from Spigot-API-Patches/0124-Add-async-chunk-load-API.patch rename to Spigot-API-Patches/0123-Add-async-chunk-load-API.patch index 02ac5b36aa..04b3228c93 100644 --- a/Spigot-API-Patches/0124-Add-async-chunk-load-API.patch +++ b/Spigot-API-Patches/0123-Add-async-chunk-load-API.patch @@ -1,11 +1,11 @@ -From 2b95e12f292000685d4475a372dbcb4e2c275db2 Mon Sep 17 00:00:00 2001 +From b242c5647547578b7d9d41871ce3e6f9a3e07931 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 17:43:33 -0600 Subject: [PATCH] Add async chunk load API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 550c26be..121033e9 100644 +index 5e6cb56ab..dbbcfec99 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -137,6 +137,78 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0125-EnderDragon-Events.patch b/Spigot-API-Patches/0124-EnderDragon-Events.patch similarity index 98% rename from Spigot-API-Patches/0125-EnderDragon-Events.patch rename to Spigot-API-Patches/0124-EnderDragon-Events.patch index c11c7465fd..4dde928181 100644 --- a/Spigot-API-Patches/0125-EnderDragon-Events.patch +++ b/Spigot-API-Patches/0124-EnderDragon-Events.patch @@ -1,4 +1,4 @@ -From 26ef852d4a6f4ec05a5795b377f92196e8097267 Mon Sep 17 00:00:00 2001 +From 5820519ee336a827ab94afff4c21d4e8c51bc7aa Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jul 2018 01:51:05 -0500 Subject: [PATCH] EnderDragon Events diff --git a/Spigot-API-Patches/0126-PlayerLaunchProjectileEvent.patch b/Spigot-API-Patches/0125-PlayerLaunchProjectileEvent.patch similarity index 96% rename from Spigot-API-Patches/0126-PlayerLaunchProjectileEvent.patch rename to Spigot-API-Patches/0125-PlayerLaunchProjectileEvent.patch index a0a254ddcf..4af340d849 100644 --- a/Spigot-API-Patches/0126-PlayerLaunchProjectileEvent.patch +++ b/Spigot-API-Patches/0125-PlayerLaunchProjectileEvent.patch @@ -1,4 +1,4 @@ -From 3db04f9ed8d1b8c20bbdb9b8bd1273568f68e9dc Mon Sep 17 00:00:00 2001 +From c485f341e92f90206dba384bf59f0e7ae09b30ef Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jul 2018 03:10:50 -0500 Subject: [PATCH] PlayerLaunchProjectileEvent @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerLaunchProjectileEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java new file mode 100644 -index 00000000..d2b244a4 +index 000000000..d2b244a41 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java @@ -0,0 +1,78 @@ diff --git a/Spigot-API-Patches/0127-PlayerElytraBoostEvent.patch b/Spigot-API-Patches/0126-PlayerElytraBoostEvent.patch similarity index 96% rename from Spigot-API-Patches/0127-PlayerElytraBoostEvent.patch rename to Spigot-API-Patches/0126-PlayerElytraBoostEvent.patch index 6548f22bd2..f7c4ee3d2d 100644 --- a/Spigot-API-Patches/0127-PlayerElytraBoostEvent.patch +++ b/Spigot-API-Patches/0126-PlayerElytraBoostEvent.patch @@ -1,4 +1,4 @@ -From 431affd0e59e92ea462d7e56791ec22af7f3b9cc Mon Sep 17 00:00:00 2001 +From d9fb4116f080c9844659b75a518d3b7708b3f665 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jul 2018 01:59:53 -0500 Subject: [PATCH] PlayerElytraBoostEvent @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerElytraBoostEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java new file mode 100644 -index 00000000..cecb2182 +index 000000000..cecb2182c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java @@ -0,0 +1,80 @@ diff --git a/Spigot-API-Patches/0128-EntityTransformedEvent.patch b/Spigot-API-Patches/0127-EntityTransformedEvent.patch similarity index 96% rename from Spigot-API-Patches/0128-EntityTransformedEvent.patch rename to Spigot-API-Patches/0127-EntityTransformedEvent.patch index c6f7e86871..89743a4f1d 100644 --- a/Spigot-API-Patches/0128-EntityTransformedEvent.patch +++ b/Spigot-API-Patches/0127-EntityTransformedEvent.patch @@ -1,4 +1,4 @@ -From 7fafe644546eddc8321b487ee8a03974274877ba Mon Sep 17 00:00:00 2001 +From 2450564e1365b81ba112638f20f937caf306e003 Mon Sep 17 00:00:00 2001 From: Anthony MacAllister Date: Thu, 26 Jul 2018 15:28:53 -0400 Subject: [PATCH] EntityTransformedEvent @@ -6,7 +6,7 @@ Subject: [PATCH] EntityTransformedEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java new file mode 100644 -index 00000000..d9e5cab9 +index 000000000..d9e5cab95 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java @@ -0,0 +1,85 @@ diff --git a/Spigot-API-Patches/0129-Allow-disabling-armour-stand-ticking.patch b/Spigot-API-Patches/0128-Allow-disabling-armour-stand-ticking.patch similarity index 91% rename from Spigot-API-Patches/0129-Allow-disabling-armour-stand-ticking.patch rename to Spigot-API-Patches/0128-Allow-disabling-armour-stand-ticking.patch index 8595e6bd23..e79c2069d2 100644 --- a/Spigot-API-Patches/0129-Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-API-Patches/0128-Allow-disabling-armour-stand-ticking.patch @@ -1,11 +1,11 @@ -From 69a19d5e994e31333804ece1cae5f8c302e4a3cb Mon Sep 17 00:00:00 2001 +From 474a840b2cdb4bd68afd54e9d5cd97f7195c58f6 Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 15 Aug 2018 01:26:03 -0700 Subject: [PATCH] Allow disabling armour stand ticking diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index 099da6ce..859f166f 100644 +index 099da6ce1..859f166fb 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -275,5 +275,21 @@ public interface ArmorStand extends LivingEntity { diff --git a/Spigot-API-Patches/0130-SkeletonHorse-Additions.patch b/Spigot-API-Patches/0129-SkeletonHorse-Additions.patch similarity index 94% rename from Spigot-API-Patches/0130-SkeletonHorse-Additions.patch rename to Spigot-API-Patches/0129-SkeletonHorse-Additions.patch index 31063dde1c..a915c3ad0f 100644 --- a/Spigot-API-Patches/0130-SkeletonHorse-Additions.patch +++ b/Spigot-API-Patches/0129-SkeletonHorse-Additions.patch @@ -1,4 +1,4 @@ -From d902c51da3d4b662256480ff4f1e308483cae199 Mon Sep 17 00:00:00 2001 +From e7af83191e6add9b98b5233a119f4fe20e0b2393 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 27 Jul 2018 22:36:17 -0500 Subject: [PATCH] SkeletonHorse Additions @@ -6,7 +6,7 @@ Subject: [PATCH] SkeletonHorse Additions diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java new file mode 100644 -index 00000000..55bae018 +index 000000000..55bae018e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java @@ -0,0 +1,43 @@ @@ -54,7 +54,7 @@ index 00000000..55bae018 +} + diff --git a/src/main/java/org/bukkit/entity/SkeletonHorse.java b/src/main/java/org/bukkit/entity/SkeletonHorse.java -index b2c6b6a8..ba998346 100644 +index b2c6b6a86..ba9983463 100644 --- a/src/main/java/org/bukkit/entity/SkeletonHorse.java +++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java @@ -3,4 +3,12 @@ package org.bukkit.entity; diff --git a/Spigot-API-Patches/0131-Expand-Location-Manipulation-API.patch b/Spigot-API-Patches/0130-Expand-Location-Manipulation-API.patch similarity index 95% rename from Spigot-API-Patches/0131-Expand-Location-Manipulation-API.patch rename to Spigot-API-Patches/0130-Expand-Location-Manipulation-API.patch index c63f4659ff..9dd99c4e10 100644 --- a/Spigot-API-Patches/0131-Expand-Location-Manipulation-API.patch +++ b/Spigot-API-Patches/0130-Expand-Location-Manipulation-API.patch @@ -1,4 +1,4 @@ -From 6208bf2ad33541e3b5c47c286e8b6c8ab95e5fe5 Mon Sep 17 00:00:00 2001 +From 14ac1162650971ca6854d13efe2a4d4b13f28243 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 25 Jul 2018 01:36:07 -0400 Subject: [PATCH] Expand Location Manipulation API @@ -6,7 +6,7 @@ Subject: [PATCH] Expand Location Manipulation API Adds set(x, y, z), add(base, x, y, z), subtract(base, x, y, z); diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 056a4d6b..8dcb15fb 100644 +index 056a4d6bb..8dcb15fb8 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -503,6 +503,51 @@ public class Location implements Cloneable, ConfigurationSerializable { diff --git a/Spigot-API-Patches/0132-Expand-ArmorStand-API.patch b/Spigot-API-Patches/0131-Expand-ArmorStand-API.patch similarity index 97% rename from Spigot-API-Patches/0132-Expand-ArmorStand-API.patch rename to Spigot-API-Patches/0131-Expand-ArmorStand-API.patch index 249adf546b..2219a329ee 100644 --- a/Spigot-API-Patches/0132-Expand-ArmorStand-API.patch +++ b/Spigot-API-Patches/0131-Expand-ArmorStand-API.patch @@ -1,4 +1,4 @@ -From a309fe5f1304a0cfe9478215164836a8401e9728 Mon Sep 17 00:00:00 2001 +From 71390973372ce416105b11f6c390e5f4f4caa46b Mon Sep 17 00:00:00 2001 From: willies952002 Date: Thu, 26 Jul 2018 02:22:44 -0400 Subject: [PATCH] Expand ArmorStand API @@ -8,7 +8,7 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index 859f166f..eda4873d 100644 +index 859f166fb..eda4873d5 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -1,5 +1,6 @@ diff --git a/Spigot-API-Patches/0133-AnvilDamageEvent.patch b/Spigot-API-Patches/0132-AnvilDamageEvent.patch similarity index 97% rename from Spigot-API-Patches/0133-AnvilDamageEvent.patch rename to Spigot-API-Patches/0132-AnvilDamageEvent.patch index 8d493ff57d..bcd8840073 100644 --- a/Spigot-API-Patches/0133-AnvilDamageEvent.patch +++ b/Spigot-API-Patches/0132-AnvilDamageEvent.patch @@ -1,4 +1,4 @@ -From 47e09a364611c02aefca7ef0c5af889f7fad8103 Mon Sep 17 00:00:00 2001 +From 13eb6bc73408696497c7884114e1ce0fbb0b8ad3 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 20 Jul 2018 23:36:55 -0500 Subject: [PATCH] AnvilDamageEvent @@ -6,7 +6,7 @@ Subject: [PATCH] AnvilDamageEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java new file mode 100644 -index 00000000..fd3c5c02 +index 000000000..fd3c5c02e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java @@ -0,0 +1,139 @@ diff --git a/Spigot-API-Patches/0134-Add-hand-to-bucket-events.patch b/Spigot-API-Patches/0133-Add-hand-to-bucket-events.patch similarity index 96% rename from Spigot-API-Patches/0134-Add-hand-to-bucket-events.patch rename to Spigot-API-Patches/0133-Add-hand-to-bucket-events.patch index 69e967d887..d678f9e557 100644 --- a/Spigot-API-Patches/0134-Add-hand-to-bucket-events.patch +++ b/Spigot-API-Patches/0133-Add-hand-to-bucket-events.patch @@ -1,11 +1,11 @@ -From 74d80f95381c61a23d2c4f37adbded04b89c0e39 Mon Sep 17 00:00:00 2001 +From efea6dce832fdacd6d244e7ee4e1e484fba0fc4b Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Thu, 2 Aug 2018 08:44:20 -0500 Subject: [PATCH] Add hand to bucket events diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java -index 8fb121a9..7b9596f3 100644 +index 8fb121a91..7b9596f30 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java @@ -5,6 +5,7 @@ import org.bukkit.block.Block; @@ -30,7 +30,7 @@ index 8fb121a9..7b9596f3 100644 public HandlerList getHandlers() { return handlers; diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java -index 56584687..3dbe428b 100644 +index 56584687f..3dbe428ba 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java @@ -5,6 +5,7 @@ import org.bukkit.block.Block; @@ -82,7 +82,7 @@ index 56584687..3dbe428b 100644 return cancelled; } diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java -index 94e042a3..884b9240 100644 +index 94e042a36..884b9240b 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java @@ -5,6 +5,7 @@ import org.bukkit.block.Block; diff --git a/Spigot-API-Patches/0135-Add-TNTPrimeEvent.patch b/Spigot-API-Patches/0134-Add-TNTPrimeEvent.patch similarity index 97% rename from Spigot-API-Patches/0135-Add-TNTPrimeEvent.patch rename to Spigot-API-Patches/0134-Add-TNTPrimeEvent.patch index d457a96e88..47ce68feca 100644 --- a/Spigot-API-Patches/0135-Add-TNTPrimeEvent.patch +++ b/Spigot-API-Patches/0134-Add-TNTPrimeEvent.patch @@ -1,4 +1,4 @@ -From 10885923bec70e8f6fa0b112d2946e1409f15f47 Mon Sep 17 00:00:00 2001 +From 073febfd9105d18df169603b4a61e2e4168d2f61 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Sun, 15 Jul 2018 22:17:55 +0300 Subject: [PATCH] Add TNTPrimeEvent @@ -6,7 +6,7 @@ Subject: [PATCH] Add TNTPrimeEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java new file mode 100644 -index 00000000..2ae8826b +index 000000000..2ae8826bb --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java @@ -0,0 +1,108 @@ diff --git a/Spigot-API-Patches/0136-Provide-Chunk-Coordinates-as-a-Long-API.patch b/Spigot-API-Patches/0135-Provide-Chunk-Coordinates-as-a-Long-API.patch similarity index 93% rename from Spigot-API-Patches/0136-Provide-Chunk-Coordinates-as-a-Long-API.patch rename to Spigot-API-Patches/0135-Provide-Chunk-Coordinates-as-a-Long-API.patch index 5a639a53d3..969c12b461 100644 --- a/Spigot-API-Patches/0136-Provide-Chunk-Coordinates-as-a-Long-API.patch +++ b/Spigot-API-Patches/0135-Provide-Chunk-Coordinates-as-a-Long-API.patch @@ -1,4 +1,4 @@ -From b812737b929851249cbbf6c0877d7064ec321c1d Mon Sep 17 00:00:00 2001 +From 0fbb9998c0c90bc1b064047ebf73bf3dc658f53e Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 4 Aug 2018 19:37:35 -0400 Subject: [PATCH] Provide Chunk Coordinates as a Long API @@ -7,7 +7,7 @@ Allows you to easily access the chunks X/z as a long, and a method to look up by the long key too. diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java -index 079b9feb..c75bce07 100644 +index 079b9febe..c75bce07a 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -23,6 +23,15 @@ public interface Chunk { @@ -27,7 +27,7 @@ index 079b9feb..c75bce07 100644 * Gets the world containing this chunk * diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index ba300c29..f84f151a 100644 +index dbbcfec99..724088ec0 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -137,6 +137,21 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0137-Make-EnderDragon-extend-Mob.patch b/Spigot-API-Patches/0136-Make-EnderDragon-extend-Mob.patch similarity index 59% rename from Spigot-API-Patches/0137-Make-EnderDragon-extend-Mob.patch rename to Spigot-API-Patches/0136-Make-EnderDragon-extend-Mob.patch index 7d0dc88cb9..ad94904845 100644 --- a/Spigot-API-Patches/0137-Make-EnderDragon-extend-Mob.patch +++ b/Spigot-API-Patches/0136-Make-EnderDragon-extend-Mob.patch @@ -1,19 +1,19 @@ -From 88e2b4663b6c865344ab4ebe4ca003567ddc1a47 Mon Sep 17 00:00:00 2001 +From ed7d0f408935b95da80451a70b122ab3cf835fdf Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 10 Aug 2018 22:08:34 -0400 Subject: [PATCH] Make EnderDragon extend Mob diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java -index 8f200e6c..dad0b314 100644 +index 4ea0e44e7..fa115c091 100644 --- a/src/main/java/org/bukkit/entity/EnderDragon.java +++ b/src/main/java/org/bukkit/entity/EnderDragon.java @@ -3,7 +3,7 @@ package org.bukkit.entity; /** * Represents an Ender Dragon */ --public interface EnderDragon extends ComplexLivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper -+public interface EnderDragon extends ComplexLivingEntity, com.destroystokyo.paper.entity.SentientNPC, org.bukkit.entity.Mob { // Paper - add Mob +-public interface EnderDragon extends ComplexLivingEntity { ++public interface EnderDragon extends ComplexLivingEntity, org.bukkit.entity.Mob { // Paper - add Mob /** * Represents a phase or action that an Ender Dragon can perform. diff --git a/Spigot-API-Patches/0138-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/Spigot-API-Patches/0137-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch similarity index 90% rename from Spigot-API-Patches/0138-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch rename to Spigot-API-Patches/0137-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index b2128ce23a..8b004f0a30 100644 --- a/Spigot-API-Patches/0138-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/Spigot-API-Patches/0137-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -1,11 +1,11 @@ -From eb7265ba1975febbd4b3abb77bc1e9111ea86090 Mon Sep 17 00:00:00 2001 +From 74245bc30b8c36c2b82410d4d0d431b4dfe27d47 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 15 Aug 2018 01:04:58 -0400 Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java -index c75bce07..dc847340 100644 +index c75bce07a..dc847340f 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -76,12 +76,24 @@ public interface Chunk { diff --git a/Spigot-API-Patches/0139-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch b/Spigot-API-Patches/0138-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch similarity index 90% rename from Spigot-API-Patches/0139-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch rename to Spigot-API-Patches/0138-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch index deb26bf8d4..6bab2d39f5 100644 --- a/Spigot-API-Patches/0139-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch +++ b/Spigot-API-Patches/0138-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch @@ -1,11 +1,11 @@ -From 70f55e69ebfa66c2d67f4b2a8ec0e5224bb180f4 Mon Sep 17 00:00:00 2001 +From 256b7fef647517de52871c256951b0fc5338a045 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 15 Aug 2018 01:19:37 -0400 Subject: [PATCH] Don't use snapshots for Timings Tile Entity reports diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java -index c2c2fb83..769facd8 100644 +index c2c2fb838..769facd80 100644 --- a/src/main/java/co/aikar/timings/TimingHistory.java +++ b/src/main/java/co/aikar/timings/TimingHistory.java @@ -118,7 +118,7 @@ public class TimingHistory { diff --git a/Spigot-API-Patches/0140-Allow-Blocks-to-be-accessed-via-a-long-key.patch b/Spigot-API-Patches/0139-Allow-Blocks-to-be-accessed-via-a-long-key.patch similarity index 97% rename from Spigot-API-Patches/0140-Allow-Blocks-to-be-accessed-via-a-long-key.patch rename to Spigot-API-Patches/0139-Allow-Blocks-to-be-accessed-via-a-long-key.patch index 33323e77ef..5a24ea4c67 100644 --- a/Spigot-API-Patches/0140-Allow-Blocks-to-be-accessed-via-a-long-key.patch +++ b/Spigot-API-Patches/0139-Allow-Blocks-to-be-accessed-via-a-long-key.patch @@ -1,4 +1,4 @@ -From 743e46cd7844b3927e0d4ed1b59261103aebfd70 Mon Sep 17 00:00:00 2001 +From dfd4a59ebe47a520514648a63e00a977c945239b Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 14 Aug 2018 21:42:10 -0700 Subject: [PATCH] Allow Blocks to be accessed via a long key @@ -49,7 +49,7 @@ index 8dcb15fb8..7e1ee875e 100644 * @return A new location where X/Y/Z are the center of the block */ diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index f84f151ad..3170a0746 100644 +index 724088ec0..d4bfbad33 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -73,6 +73,37 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0141-Slime-Pathfinder-Events.patch b/Spigot-API-Patches/0140-Slime-Pathfinder-Events.patch similarity index 95% rename from Spigot-API-Patches/0141-Slime-Pathfinder-Events.patch rename to Spigot-API-Patches/0140-Slime-Pathfinder-Events.patch index 5ba0fc9097..7384e7289d 100644 --- a/Spigot-API-Patches/0141-Slime-Pathfinder-Events.patch +++ b/Spigot-API-Patches/0140-Slime-Pathfinder-Events.patch @@ -1,4 +1,4 @@ -From 8acf7e358366fd537cdb0c354d8dc8777f254195 Mon Sep 17 00:00:00 2001 +From fedc9ca19069cd19407283544fc28ebba41f47b8 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 24 Aug 2018 08:18:27 -0500 Subject: [PATCH] Slime Pathfinder Events @@ -6,7 +6,7 @@ Subject: [PATCH] Slime Pathfinder Events diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java new file mode 100644 -index 00000000..f5a3ca3b +index 000000000..f5a3ca3b0 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java @@ -0,0 +1,37 @@ @@ -49,7 +49,7 @@ index 00000000..f5a3ca3b +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java new file mode 100644 -index 00000000..356bcca8 +index 000000000..356bcca8b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java @@ -0,0 +1,49 @@ @@ -104,7 +104,7 @@ index 00000000..356bcca8 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java new file mode 100644 -index 00000000..7c99fb53 +index 000000000..7c99fb538 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java @@ -0,0 +1,16 @@ @@ -126,7 +126,7 @@ index 00000000..7c99fb53 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java new file mode 100644 -index 00000000..7c96e326 +index 000000000..7c96e3268 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java @@ -0,0 +1,29 @@ @@ -161,7 +161,7 @@ index 00000000..7c96e326 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java new file mode 100644 -index 00000000..e55d208c +index 000000000..e55d208c6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java @@ -0,0 +1,16 @@ @@ -182,10 +182,10 @@ index 00000000..e55d208c + } +} diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java -index 46d03d29..8bd18406 100644 +index 1119e26e2..c4791f95d 100644 --- a/src/main/java/org/bukkit/entity/Slime.java +++ b/src/main/java/org/bukkit/entity/Slime.java -@@ -14,4 +14,20 @@ public interface Slime extends Mob, com.destroystokyo.paper.entity.SentientNPC { +@@ -14,4 +14,20 @@ public interface Slime extends Mob { * @param sz The new size of the slime. */ public void setSize(int sz); diff --git a/Spigot-API-Patches/0142-isChunkGenerated-API.patch b/Spigot-API-Patches/0141-isChunkGenerated-API.patch similarity index 94% rename from Spigot-API-Patches/0142-isChunkGenerated-API.patch rename to Spigot-API-Patches/0141-isChunkGenerated-API.patch index bd8c2ba78e..7c690f01d0 100644 --- a/Spigot-API-Patches/0142-isChunkGenerated-API.patch +++ b/Spigot-API-Patches/0141-isChunkGenerated-API.patch @@ -1,4 +1,4 @@ -From 1d78f754a14a5159a408adc552b3f04f2ccef37c Mon Sep 17 00:00:00 2001 +From c817dcae2757a7cb848d2ed0f65e607db9d3883e Mon Sep 17 00:00:00 2001 From: cswhite2000 <18whitechristop@gmail.com> Date: Tue, 21 Aug 2018 19:39:46 -0700 Subject: [PATCH] isChunkGenerated API @@ -6,7 +6,7 @@ Subject: [PATCH] isChunkGenerated API Resolves #1329 diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 7e1ee875..9457832b 100644 +index 7e1ee875e..9457832bc 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -9,6 +9,7 @@ import org.bukkit.util.NumberConversions; @@ -34,7 +34,7 @@ index 7e1ee875..9457832b 100644 /** * Sets the position of this Location and returns itself diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 3170a074..4fd4f997 100644 +index d4bfbad33..53764fae6 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -181,6 +181,26 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0143-Add-source-block-to-BlockPhysicsEvent.patch b/Spigot-API-Patches/0142-Add-source-block-to-BlockPhysicsEvent.patch similarity index 94% rename from Spigot-API-Patches/0143-Add-source-block-to-BlockPhysicsEvent.patch rename to Spigot-API-Patches/0142-Add-source-block-to-BlockPhysicsEvent.patch index aedd55cb4e..e8a915df2e 100644 --- a/Spigot-API-Patches/0143-Add-source-block-to-BlockPhysicsEvent.patch +++ b/Spigot-API-Patches/0142-Add-source-block-to-BlockPhysicsEvent.patch @@ -1,11 +1,11 @@ -From ec28d0096abe5a6c16d25d2853b4e488f0290f53 Mon Sep 17 00:00:00 2001 +From a924b59822d15436017aaa9ab10288a06f7e5263 Mon Sep 17 00:00:00 2001 From: Sotr Date: Thu, 23 Aug 2018 16:14:25 +0800 Subject: [PATCH] Add source block to BlockPhysicsEvent diff --git a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java -index 5e47eabe..9d9e4712 100644 +index 5e47eabe8..9d9e4712b 100644 --- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java @@ -29,10 +29,34 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable { diff --git a/Spigot-Server-Patches/0001-POM-Changes.patch b/Spigot-Server-Patches/0001-POM-Changes.patch index 559b1f089d..5694bd2067 100644 --- a/Spigot-Server-Patches/0001-POM-Changes.patch +++ b/Spigot-Server-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From 6842476267fe66eaac1bffd41ef47e5e82cf4964 Mon Sep 17 00:00:00 2001 +From b66f17991abf9f3df03862b742227841741b1d22 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 29 Feb 2016 20:40:33 -0600 Subject: [PATCH] POM Changes diff --git a/pom.xml b/pom.xml -index 5d398f7cb..09b4ddf19 100644 +index f1f0c20a52..17c3baaec9 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,11 @@ @@ -16,7 +16,7 @@ index 5d398f7cb..09b4ddf19 100644 - spigot + paper jar - 1.13-R0.1-SNAPSHOT + 1.13.1-R0.1-SNAPSHOT - Spigot - http://www.spigotmc.org + Paper @@ -91,7 +91,7 @@ index 5d398f7cb..09b4ddf19 100644 -@@ -138,11 +125,12 @@ +@@ -138,11 +125,13 @@ maven-jar-plugin 2.4 @@ -101,11 +101,12 @@ index 5d398f7cb..09b4ddf19 100644 org.bukkit.craftbukkit.Main CraftBukkit - ${spigot.desc}${craftbukkit.desc} ++ + ${describe} ${maven.build.timestamp} Bukkit ${api.version} -@@ -182,19 +170,22 @@ +@@ -182,19 +171,22 @@ shade @@ -136,7 +137,7 @@ index 5d398f7cb..09b4ddf19 100644 org.bukkit.craftbukkit org.bukkit.craftbukkit.v${minecraft_version} -@@ -220,18 +211,6 @@ +@@ -220,18 +212,6 @@ org.apache.maven.plugins maven-compiler-plugin 3.7.0 @@ -155,7 +156,7 @@ index 5d398f7cb..09b4ddf19 100644 org.apache.maven.plugins -@@ -250,6 +229,11 @@ +@@ -250,6 +230,11 @@ development @@ -168,7 +169,7 @@ index 5d398f7cb..09b4ddf19 100644 diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 93046379d..674096cab 100644 +index 93046379d0..674096cab1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java @@ -11,7 +11,7 @@ public final class Versioning { diff --git a/Spigot-Server-Patches/0002-Paper-config-files.patch b/Spigot-Server-Patches/0002-Paper-config-files.patch index c10b918909..54ecc0f115 100644 --- a/Spigot-Server-Patches/0002-Paper-config-files.patch +++ b/Spigot-Server-Patches/0002-Paper-config-files.patch @@ -1,4 +1,4 @@ -From cb37d1deb3834306189988414d2c44bd0593dfc1 Mon Sep 17 00:00:00 2001 +From 2ebf973ac944be514fab4ba6124b066c221a05ef Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 29 Feb 2016 21:02:09 -0600 Subject: [PATCH] Paper config files @@ -6,7 +6,7 @@ Subject: [PATCH] Paper config files diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java new file mode 100644 -index 0000000000..e8f7b7292d +index 0000000000..961966e169 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -0,0 +1,237 @@ @@ -239,7 +239,7 @@ index 0000000000..e8f7b7292d + + MinecraftServer console = MinecraftServer.getServer(); + com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); -+ for (WorldServer world : console.worlds) { ++ for (WorldServer world : console.getWorlds()) { + world.paperConfig.init(); + } + console.server.reloadCount++; @@ -432,7 +432,7 @@ index 0000000000..104abab84b +} diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java new file mode 100644 -index 0000000000..b8a6161d84 +index 0000000000..a738657394 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +1,67 @@ @@ -493,7 +493,7 @@ index 0000000000..b8a6161d84 + return (float) getDouble(path, (double) def); + } + -+ private List getList(String path, T def) { ++ private List getList(String path, List def) { + config.addDefault("world-settings.default." + path, def); + return (List) config.getList("world-settings." + worldName + "." + path, config.getList("world-settings.default." + path)); + } @@ -504,7 +504,7 @@ index 0000000000..b8a6161d84 + } +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 5ff1e96861..3706e44a34 100644 +index 38720a87da..efa738d4ec 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -192,6 +192,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -519,7 +519,7 @@ index 5ff1e96861..3706e44a34 100644 DedicatedServer.LOGGER.info("Generating keypair"); this.a(MinecraftEncryption.b()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 55bf00be93..a1050912bc 100644 +index ef9f0e8834..8997cf84a4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -135,9 +135,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { @@ -536,7 +536,7 @@ index 55bf00be93..a1050912bc 100644 public boolean impulse; public int portalCooldown; diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index ad3f891999..ca2a14d7ac 100644 +index c6434ec371..17bfa356f1 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -2,6 +2,8 @@ package net.minecraft.server; @@ -547,8 +547,8 @@ index ad3f891999..ca2a14d7ac 100644 +import java.util.Set; import java.util.UUID; import java.util.function.Function; - import javax.annotation.Nullable; -@@ -323,4 +325,10 @@ public class EntityTypes { + import java.util.stream.Stream; +@@ -333,4 +335,10 @@ public class EntityTypes { return new EntityTypes(this.a, this.b, this.c, this.d, type); } } @@ -560,10 +560,10 @@ index ad3f891999..ca2a14d7ac 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 73bd5e1d74..e1cf1e579a 100644 +index 8d69cea10e..028678379a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -127,6 +127,8 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -134,6 +134,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc private int tickPosition; public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot @@ -572,27 +572,27 @@ index 73bd5e1d74..e1cf1e579a 100644 public final SpigotTimings.WorldTimingsHandler timings; // Spigot private boolean guardEntityList; // Spigot public static boolean haveWeSilencedAPhysicsCrash; -@@ -149,6 +151,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -156,6 +158,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - protected World(IDataManager idatamanager, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag, ChunkGenerator gen, org.bukkit.World.Environment env) { + protected World(IDataManager idatamanager, @Nullable PersistentCollection persistentcollection, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag, ChunkGenerator gen, org.bukkit.World.Environment env) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot + this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6ee7c56ada..ed3c23b74e 100644 +index 77cb857989..46a9ff9482 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -745,6 +745,7 @@ public final class CraftServer implements Server { +@@ -746,6 +746,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot + com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper - for (WorldServer world : console.worlds) { + for (WorldServer world : console.getWorlds()) { world.worldData.setDifficulty(difficulty); world.setSpawnFlags(monsters, animals); -@@ -760,6 +761,7 @@ public final class CraftServer implements Server { +@@ -761,6 +762,7 @@ public final class CraftServer implements Server { world.ticksPerMonsterSpawns = this.getTicksPerMonsterSpawns(); } world.spigotConfig.init(); // Spigot @@ -600,7 +600,7 @@ index 6ee7c56ada..ed3c23b74e 100644 } pluginManager.clearPlugins(); -@@ -767,6 +769,7 @@ public final class CraftServer implements Server { +@@ -768,6 +770,7 @@ public final class CraftServer implements Server { resetRecipes(); reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot @@ -608,7 +608,7 @@ index 6ee7c56ada..ed3c23b74e 100644 overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -1874,4 +1877,26 @@ public final class CraftServer implements Server { +@@ -1894,4 +1897,26 @@ public final class CraftServer implements Server { { return spigot; } diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch index 8a9bdc41a8..89f475df50 100644 --- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch @@ -1,11 +1,24 @@ -From 6691919def0c0a2eb8baccb043701888ab8b2044 Mon Sep 17 00:00:00 2001 +From 35b1f286830c7abfb00224e808b8b2cab705bf56 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 30 Mar 2016 19:36:20 -0400 Subject: [PATCH] MC Dev fixes +diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java +index c3e990bdff..e2a7b4be2c 100644 +--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java ++++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java +@@ -93,7 +93,7 @@ public class BaseBlockPosition implements Comparable { + return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); + } + +- public int compareTo(Object object) { ++ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix + return this.l((BaseBlockPosition) object); + } + } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 002da2a19..9f3aa2459 100644 +index 002da2a191..9f3aa24590 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -150,7 +150,7 @@ public class BlockPosition extends BaseBlockPosition { @@ -59,7 +72,7 @@ index 002da2a19..9f3aa2459 100644 } diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index 650ef1475..35aea4829 100644 +index 650ef14758..35aea4829f 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -15,7 +15,7 @@ public class ChunkSection { @@ -72,7 +85,7 @@ index 650ef1475..35aea4829 100644 if (flag) { this.skyLight = new NibbleArray(); diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 20b1bc1b4..030ec8704 100644 +index 20b1bc1b48..030ec87047 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -75,14 +75,14 @@ public class DataPaletteBlock implements DataPaletteExpandable { @@ -111,7 +124,7 @@ index 20b1bc1b4..030ec8704 100644 datapalettehash.a(nbttaglist); DataBits databits = new DataBits(i, 4096, along); diff --git a/src/main/java/net/minecraft/server/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/DedicatedPlayerList.java -index 4997255c7..a5545bd4c 100644 +index 1b91759cb2..ba1e38f8e0 100644 --- a/src/main/java/net/minecraft/server/DedicatedPlayerList.java +++ b/src/main/java/net/minecraft/server/DedicatedPlayerList.java @@ -135,8 +135,4 @@ public class DedicatedPlayerList extends PlayerList { @@ -124,7 +137,7 @@ index 4997255c7..a5545bd4c 100644 - } } diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java -index a661789c1..785a1a218 100644 +index cd883e8529..bb1d00e440 100644 --- a/src/main/java/net/minecraft/server/DefinedStructure.java +++ b/src/main/java/net/minecraft/server/DefinedStructure.java @@ -88,7 +88,7 @@ public class DefinedStructure { @@ -179,7 +192,7 @@ index a661789c1..785a1a218 100644 public Iterator iterator() { diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 188d49d82..854ad49b6 100644 +index 188d49d820..854ad49b6c 100644 --- a/src/main/java/net/minecraft/server/EnumDirection.java +++ b/src/main/java/net/minecraft/server/EnumDirection.java @@ -255,7 +255,7 @@ public enum EnumDirection implements INamable { @@ -243,7 +256,7 @@ index 188d49d82..854ad49b6 100644 } diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java -index 8f06c5848..4361b2cee 100644 +index 8f06c58485..4361b2cee5 100644 --- a/src/main/java/net/minecraft/server/LocaleLanguage.java +++ b/src/main/java/net/minecraft/server/LocaleLanguage.java @@ -34,7 +34,7 @@ public class LocaleLanguage { @@ -255,8 +268,26 @@ index 8f06c5848..4361b2cee 100644 } this.e = SystemUtils.b(); +diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java +index 3cd5045636..3d501aee30 100644 +--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java ++++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java +@@ -85,11 +85,11 @@ public abstract class LootSelectorEntry { + return jsonobject; + } + +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { ++ public JsonElement serialize(LootSelectorEntry object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix + return this.a((LootSelectorEntry) object, type, jsonserializationcontext); + } + +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { ++ public LootSelectorEntry deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix + return this.a(jsonelement, type, jsondeserializationcontext); + } + } diff --git a/src/main/java/net/minecraft/server/MathHelper.java b/src/main/java/net/minecraft/server/MathHelper.java -index 86585a13f..f52b9c6f0 100644 +index 28fb88dade..5329102dd7 100644 --- a/src/main/java/net/minecraft/server/MathHelper.java +++ b/src/main/java/net/minecraft/server/MathHelper.java @@ -8,7 +8,7 @@ import java.util.function.IntPredicate; @@ -268,8 +299,121 @@ index 86585a13f..f52b9c6f0 100644 for (int i = 0; i < afloat.length; ++i) { afloat[i] = (float) Math.sin((double) i * 3.141592653589793D * 2.0D / 65536.0D); } +diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java +index 8170a84280..e21e60b003 100644 +--- a/src/main/java/net/minecraft/server/NBTBase.java ++++ b/src/main/java/net/minecraft/server/NBTBase.java +@@ -20,7 +20,7 @@ public interface NBTBase { + + byte getTypeId(); + +- static default NBTBase createTag(byte b0) { ++ static NBTBase createTag(byte b0) { // Paper - decompile fix + switch (b0) { + case 0: + return new NBTTagEnd(); +@@ -66,7 +66,7 @@ public interface NBTBase { + } + } + +- static default String n(int i) { ++ static String n(int i) { // Paper - decompile fix + switch (i) { + case 0: + return "TAG_End"; +diff --git a/src/main/java/net/minecraft/server/NBTList.java b/src/main/java/net/minecraft/server/NBTList.java +index 1a81d8e5f6..057c2077a0 100644 +--- a/src/main/java/net/minecraft/server/NBTList.java ++++ b/src/main/java/net/minecraft/server/NBTList.java +@@ -13,7 +13,7 @@ public abstract class NBTList extends AbstractList impleme + } + + public T set(int i, T t0) { +- NBTBase nbtbase = this.get(i); ++ T nbtbase = this.get(i); // Paper - decompile fix + + this.a(i, t0); + return nbtbase; +@@ -25,11 +25,5 @@ public abstract class NBTList extends AbstractList impleme + + public abstract void b(int i); + +- public Object set(int i, Object object) { +- return this.set(i, (NBTBase) object); +- } +- +- public Object get(int i) { +- return this.get(i); +- } ++ public abstract NBTList clone(); // Paper - decompile fix + } +diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java +index 11ffa6c342..5d61cf70bc 100644 +--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java ++++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java +@@ -66,7 +66,8 @@ public class NBTTagByteArray extends NBTList { + return stringbuilder.append(']').toString(); + } + +- public NBTBase clone() { ++ @Override ++ public NBTTagByteArray clone() { // Paper - decompile fix + byte[] abyte = new byte[this.data.length]; + + System.arraycopy(this.data, 0, abyte, 0, this.data.length); +diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java +index f5c9b97d5c..d121ad4f7a 100644 +--- a/src/main/java/net/minecraft/server/NBTTagIntArray.java ++++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java +@@ -132,7 +132,7 @@ public class NBTTagIntArray extends NBTList { + return this.a(i); + } + +- public NBTBase clone() { ++ public NBTTagIntArray clone() { // Paper - decompile fix + return this.c(); + } + } +diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java +index b3c944d701..a8280acf94 100644 +--- a/src/main/java/net/minecraft/server/NBTTagList.java ++++ b/src/main/java/net/minecraft/server/NBTTagList.java +@@ -14,7 +14,7 @@ import org.apache.logging.log4j.Logger; + public class NBTTagList extends NBTList { + + private static final Logger f = LogManager.getLogger(); +- private List list = Lists.newArrayList(); ++ public List list = Lists.newArrayList(); // Paper + private byte type = 0; + + public NBTTagList() {} +@@ -294,23 +294,7 @@ public class NBTTagList extends NBTList { + return this.type; + } + +- public NBTBase clone() { ++ public NBTTagList clone() { + return this.c(); + } +- +- public Object remove(int i) { +- return this.remove(i); +- } +- +- public Object set(int i, Object object) { +- return this.set(i, (NBTBase) object); +- } +- +- public Object get(int i) { +- return this.get(i); +- } +- +- public boolean add(Object object) { +- return this.add((NBTBase) object); +- } + } diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 824e68b50..584a86c11 100644 +index 528eb255ec..541435d3e5 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -65,7 +65,7 @@ public class ProtoChunk implements IChunkAccess { @@ -279,7 +423,7 @@ index 824e68b50..584a86c11 100644 - return block == null || block.getBlockData().isAir(); + return block == null || ((Block) block).getBlockData().isAir(); // Paper - decompile fix }; - RegistryBlocks registryblocks = Block.REGISTRY; + IRegistry iregistry = IRegistry.BLOCK; @@ -325,8 +325,8 @@ public class ProtoChunk implements IChunkAccess { } @@ -317,8 +461,30 @@ index 824e68b50..584a86c11 100644 return new BitSet(65536); }); } +diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java +index ef332d6517..7cc7eb7735 100644 +--- a/src/main/java/net/minecraft/server/RegistryBlockID.java ++++ b/src/main/java/net/minecraft/server/RegistryBlockID.java +@@ -8,7 +8,7 @@ import java.util.Iterator; + import java.util.List; + import javax.annotation.Nullable; + +-public class RegistryBlockID implements Registry { ++public class RegistryBlockID implements Registry { // Paper - decompile fix + + private int a; + private final IdentityHashMap b; +@@ -27,7 +27,7 @@ public class RegistryBlockID implements Registry { + this.b.put(t0, Integer.valueOf(i)); + + while (this.c.size() <= i) { +- this.c.add((Object) null); ++ this.c.add(null); // Paper - decompile fix + } + + this.c.set(i, t0); diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java -index 3b8f6ec16..bde5714dd 100644 +index 3b8f6ec167..bde5714dd6 100644 --- a/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java @@ -6,7 +6,7 @@ import java.util.Arrays; @@ -358,8 +524,54 @@ index 3b8f6ec16..bde5714dd 100644 this.e = 0; this.f = 0; +diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java +index 2179664a0c..d7e1ecc031 100644 +--- a/src/main/java/net/minecraft/server/ServerPing.java ++++ b/src/main/java/net/minecraft/server/ServerPing.java +@@ -102,11 +102,11 @@ public class ServerPing { + return jsonobject; + } + +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { ++ public JsonElement serialize(ServerPing object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix + return this.a((ServerPing) object, type, jsonserializationcontext); + } + +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { ++ public ServerPing deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix + return this.a(jsonelement, type, jsondeserializationcontext); + } + } +@@ -147,11 +147,11 @@ public class ServerPing { + return jsonobject; + } + +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { ++ public JsonElement serialize(ServerPing.ServerData object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix + return this.a((ServerPing.ServerData) object, type, jsonserializationcontext); + } + +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { ++ public ServerPing.ServerData deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix + return this.a(jsonelement, type, jsondeserializationcontext); + } + } +@@ -235,11 +235,11 @@ public class ServerPing { + return jsonobject; + } + +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { ++ public JsonElement serialize(ServerPing.ServerPingPlayerSample object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix + return this.a((ServerPing.ServerPingPlayerSample) object, type, jsonserializationcontext); + } + +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { ++ public ServerPing.ServerPingPlayerSample deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix + return this.a(jsonelement, type, jsondeserializationcontext); + } + } diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java -index 43596cb2d..3faf74a22 100644 +index 43596cb2d5..3faf74a22f 100644 --- a/src/main/java/net/minecraft/server/ShapeDetector.java +++ b/src/main/java/net/minecraft/server/ShapeDetector.java @@ -171,7 +171,7 @@ public class ShapeDetector { @@ -372,10 +584,10 @@ index 43596cb2d..3faf74a22 100644 } } diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java -index 4b5463cca..53c9f2188 100644 +index 0b3141d3e7..700900256b 100644 --- a/src/main/java/net/minecraft/server/VoxelShape.java +++ b/src/main/java/net/minecraft/server/VoxelShape.java -@@ -67,7 +67,7 @@ public abstract class VoxelShape { +@@ -69,7 +69,7 @@ public abstract class VoxelShape { ArrayList arraylist = Lists.newArrayList(); this.b((d0, d1, d2, d3, d4, d5) -> { diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch index 536c19ade9..e832df7562 100644 --- a/Spigot-Server-Patches/0004-MC-Utils.patch +++ b/Spigot-Server-Patches/0004-MC-Utils.patch @@ -1,35 +1,23 @@ -From b78498d654658ee40447dbcbef775b255505987f Mon Sep 17 00:00:00 2001 +From 909c0b4ade17b19a8f79bd39ca8a28d0ae7c1027 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:55:47 -0400 Subject: [PATCH] MC Utils -diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index c3e990bd..e2a7b4be 100644 ---- a/src/main/java/net/minecraft/server/BaseBlockPosition.java -+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java -@@ -93,7 +93,7 @@ public class BaseBlockPosition implements Comparable { - return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); - } - -- public int compareTo(Object object) { -+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix - return this.l((BaseBlockPosition) object); - } - } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 9f3aa245..7dbea909 100644 +index 9f3aa24590..ca5c56c2b6 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -10,7 +10,6 @@ import org.apache.logging.log4j.Logger; +@@ -10,7 +10,7 @@ import org.apache.logging.log4j.Logger; @Immutable public class BlockPosition extends BaseBlockPosition { - private static final Logger b = LogManager.getLogger(); ++ //private static final Logger b = LogManager.getLogger(); // Paper - variable name conflict, logger isn't used public static final BlockPosition ZERO = new BlockPosition(0, 0, 0); private static final int c = 1 + MathHelper.e(MathHelper.c(30000000)); private static final int d = BlockPosition.c; -@@ -45,6 +44,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -45,6 +45,7 @@ public class BlockPosition extends BaseBlockPosition { return d0 == 0.0D && d1 == 0.0D && d2 == 0.0D ? this : new BlockPosition((double) this.getX() + d0, (double) this.getY() + d1, (double) this.getZ() + d2); } @@ -37,7 +25,7 @@ index 9f3aa245..7dbea909 100644 public BlockPosition a(int i, int j, int k) { return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k); } -@@ -385,6 +385,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -385,6 +386,7 @@ public class BlockPosition extends BaseBlockPosition { return this.d; } @@ -45,7 +33,7 @@ index 9f3aa245..7dbea909 100644 public BlockPosition.MutableBlockPosition c(int i, int j, int k) { this.b = i; this.c = j; -@@ -392,6 +393,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -392,6 +394,7 @@ public class BlockPosition extends BaseBlockPosition { return this; } @@ -54,19 +42,19 @@ index 9f3aa245..7dbea909 100644 return this.c(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 03c96de9..2d06202d 100644 +index 542b2aaf4d..35cb5ca575 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -28,7 +28,7 @@ import com.google.common.collect.Lists; // CraftBukkit public class Chunk implements IChunkAccess { - private static final Logger e = LogManager.getLogger(); + private static final Logger d = LogManager.getLogger(); - public static final ChunkSection a = null; + public static final ChunkSection a = null; public static final ChunkSection EMPTY_CHUNK_SECTION = Chunk.a; // Paper - OBFHELPER private final ChunkSection[] sections; - private final BiomeBase[] g; - private final boolean[] h; -@@ -693,6 +693,7 @@ public class Chunk implements IChunkAccess { + private final BiomeBase[] f; + private final boolean[] g; +@@ -692,6 +692,7 @@ public class Chunk implements IChunkAccess { return this.a(blockposition, Chunk.EnumTileEntityState.CHECK); } @@ -75,7 +63,7 @@ index 03c96de9..2d06202d 100644 public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index 00a530c5..2947d9ff 100644 +index 34586bca65..b0c004b1f2 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java @@ -24,6 +24,8 @@ public class ChunkCoordIntPair { @@ -88,10 +76,10 @@ index 00a530c5..2947d9ff 100644 return (long) i & 4294967295L | ((long) j & 4294967295L) << 32; } diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index 5d9118da..8b50ec53 100644 +index 3b6b3b9a99..22af9c1885 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -@@ -15,7 +15,7 @@ import org.apache.logging.log4j.Logger; +@@ -16,7 +16,7 @@ import org.apache.logging.log4j.Logger; public class ChunkTaskScheduler extends Scheduler { private static final Logger b = LogManager.getLogger(); @@ -101,7 +89,7 @@ index 5d9118da..8b50ec53 100644 private final IChunkLoader e; private final IAsyncTaskHandler f; diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index d24ec3d5..9e83610f 100644 +index d24ec3d53c..9e83610f1a 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -60,6 +60,7 @@ public class DataBits { @@ -113,7 +101,7 @@ index d24ec3d5..9e83610f 100644 return this.a; } diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java -index dae40b9c..0be0b0ef 100644 +index dae40b9cde..0be0b0ef51 100644 --- a/src/main/java/net/minecraft/server/DataPalette.java +++ b/src/main/java/net/minecraft/server/DataPalette.java @@ -4,8 +4,10 @@ import javax.annotation.Nullable; @@ -128,7 +116,7 @@ index dae40b9c..0be0b0ef 100644 T a(int i); diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 030ec870..575f9b55 100644 +index 030ec87047..575f9b5587 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -9,7 +9,7 @@ import java.util.stream.Collectors; @@ -170,7 +158,7 @@ index 030ec870..575f9b55 100644 this.b(); packetdataserializer.writeByte(this.i); diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index b3475676..ceed50d8 100644 +index 2c6fbd1d6f..3790039f18 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -6,6 +6,7 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -182,7 +170,7 @@ index b3475676..ceed50d8 100644 private float b; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 514c9515..5b339975 100644 +index fd050c5f32..91c4785889 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -122,6 +122,7 @@ public abstract class EntityLiving extends Entity { @@ -194,7 +182,7 @@ index 514c9515..5b339975 100644 @Override public float getBukkitYaw() { diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java -index 494ce0bc..04c3756e 100644 +index 96e0122150..a3449e9a8d 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -206,7 +194,7 @@ index 494ce0bc..04c3756e 100644 super(entitytypes, world); this.b_ = 5; diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index ca2a14d7..9a513b4e 100644 +index 17bfa356f1..5c1ab6a0b6 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -3,6 +3,7 @@ package net.minecraft.server; @@ -217,18 +205,17 @@ index ca2a14d7..9a513b4e 100644 import java.util.Set; import java.util.UUID; import java.util.function.Function; -@@ -121,9 +122,20 @@ public class EntityTypes { +@@ -123,9 +124,20 @@ public class EntityTypes { public static EntityTypes a(String s, EntityTypes.a entitytypes_a) { EntityTypes entitytypes = entitytypes_a.a(s); -- EntityTypes.REGISTRY.a(new MinecraftKey(s), entitytypes); + // Paper start + if (clsToKeyMap == null ) clsToKeyMap = new java.util.HashMap<>(); + if (clsToTypeMap == null ) clsToTypeMap = new java.util.HashMap<>(); + + MinecraftKey key = new MinecraftKey(s); + Class entityClass = entitytypes_a.getEntityClass(); -+ EntityTypes.REGISTRY.a(key, entitytypes); + IRegistry.ENTITY_TYPE.a(new MinecraftKey(s), entitytypes); // CraftBukkit - decompile error + clsToKeyMap.put(entityClass, key); + clsToTypeMap.put(entityClass, org.bukkit.entity.EntityType.fromName(s)); return entitytypes; @@ -239,7 +226,7 @@ index ca2a14d7..9a513b4e 100644 @Nullable public static MinecraftKey getName(EntityTypes entitytypes) { -@@ -277,7 +289,7 @@ public class EntityTypes { +@@ -287,7 +299,7 @@ public class EntityTypes { public static class a { @@ -248,8 +235,17 @@ index ca2a14d7..9a513b4e 100644 private final Function b; private boolean c = true; private boolean d = true; +@@ -338,7 +350,7 @@ public class EntityTypes { + + // Paper start + public static Set getEntityNameList() { +- return REGISTRY.keySet(); ++ return IRegistry.ENTITY_TYPE.keySet(); + } + // Paper end + } diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 359979cc..0c54eaa5 100644 +index c54275bc2f..318c4204df 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -26,6 +26,7 @@ import org.bukkit.TreeType; @@ -278,30 +274,12 @@ index 359979cc..0c54eaa5 100644 public void setTag(@Nullable NBTTagCompound nbttagcompound) { this.tag = nbttagcompound; } -diff --git a/src/main/java/net/minecraft/server/LotoSelectorEntry.java b/src/main/java/net/minecraft/server/LotoSelectorEntry.java -index a540167d..add61886 100644 ---- a/src/main/java/net/minecraft/server/LotoSelectorEntry.java -+++ b/src/main/java/net/minecraft/server/LotoSelectorEntry.java -@@ -85,11 +85,11 @@ public abstract class LotoSelectorEntry { - return jsonobject; - } - -- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(LotoSelectorEntry object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix - return this.a((LotoSelectorEntry) object, type, jsonserializationcontext); - } - -- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public LotoSelectorEntry deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); - } - } diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java new file mode 100644 -index 00000000..70cdc3f1 +index 0000000000..9f9341c98f --- /dev/null +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -0,0 +1,292 @@ +@@ -0,0 +1,296 @@ +package net.minecraft.server; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; @@ -540,6 +518,10 @@ index 00000000..70cdc3f1 + return new Location(entity.getWorld().getWorld(), entity.locX, entity.locY, entity.locZ); + } + ++ public static org.bukkit.block.Block toBukkitBlock(World world, BlockPosition pos) { ++ return world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); ++ } ++ + public static BlockPosition toBlockPosition(Location loc) { + return new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); + } @@ -594,70 +576,8 @@ index 00000000..70cdc3f1 + return null; + } +} -diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java -index 8170a842..e21e60b0 100644 ---- a/src/main/java/net/minecraft/server/NBTBase.java -+++ b/src/main/java/net/minecraft/server/NBTBase.java -@@ -20,7 +20,7 @@ public interface NBTBase { - - byte getTypeId(); - -- static default NBTBase createTag(byte b0) { -+ static NBTBase createTag(byte b0) { // Paper - decompile fix - switch (b0) { - case 0: - return new NBTTagEnd(); -@@ -66,7 +66,7 @@ public interface NBTBase { - } - } - -- static default String n(int i) { -+ static String n(int i) { // Paper - decompile fix - switch (i) { - case 0: - return "TAG_End"; -diff --git a/src/main/java/net/minecraft/server/NBTList.java b/src/main/java/net/minecraft/server/NBTList.java -index 1a81d8e5..057c2077 100644 ---- a/src/main/java/net/minecraft/server/NBTList.java -+++ b/src/main/java/net/minecraft/server/NBTList.java -@@ -13,7 +13,7 @@ public abstract class NBTList extends AbstractList impleme - } - - public T set(int i, T t0) { -- NBTBase nbtbase = this.get(i); -+ T nbtbase = this.get(i); // Paper - decompile fix - - this.a(i, t0); - return nbtbase; -@@ -25,11 +25,5 @@ public abstract class NBTList extends AbstractList impleme - - public abstract void b(int i); - -- public Object set(int i, Object object) { -- return this.set(i, (NBTBase) object); -- } -- -- public Object get(int i) { -- return this.get(i); -- } -+ public abstract NBTList clone(); // Paper - decompile fix - } -diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java -index 11ffa6c3..3ff3a298 100644 ---- a/src/main/java/net/minecraft/server/NBTTagByteArray.java -+++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java -@@ -66,7 +66,8 @@ public class NBTTagByteArray extends NBTList { - return stringbuilder.append(']').toString(); - } - -- public NBTBase clone() { -+ @Override -+ public NBTTagByteArray clone() { - byte[] abyte = new byte[this.data.length]; - - System.arraycopy(this.data, 0, abyte, 0, this.data.length); diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index 7fc9b5ff..e658816c 100644 +index 7fc9b5ff32..e658816c24 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java @@ -24,7 +24,7 @@ public class NBTTagCompound implements NBTBase { @@ -690,61 +610,10 @@ index 7fc9b5ff..e658816c 100644 - - public NBTBase clone() { - return this.clone(); -- } - } -diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java -index f5c9b97d..d121ad4f 100644 ---- a/src/main/java/net/minecraft/server/NBTTagIntArray.java -+++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java -@@ -132,7 +132,7 @@ public class NBTTagIntArray extends NBTList { - return this.a(i); - } - -- public NBTBase clone() { -+ public NBTTagIntArray clone() { // Paper - decompile fix - return this.c(); - } - } -diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index b3c944d7..a8280acf 100644 ---- a/src/main/java/net/minecraft/server/NBTTagList.java -+++ b/src/main/java/net/minecraft/server/NBTTagList.java -@@ -14,7 +14,7 @@ import org.apache.logging.log4j.Logger; - public class NBTTagList extends NBTList { - - private static final Logger f = LogManager.getLogger(); -- private List list = Lists.newArrayList(); -+ public List list = Lists.newArrayList(); // Paper - private byte type = 0; - - public NBTTagList() {} -@@ -294,23 +294,7 @@ public class NBTTagList extends NBTList { - return this.type; - } - -- public NBTBase clone() { -+ public NBTTagList clone() { - return this.c(); - } -- -- public Object remove(int i) { -- return this.remove(i); -- } -- -- public Object set(int i, Object object) { -- return this.set(i, (NBTBase) object); -- } -- -- public Object get(int i) { -- return this.get(i); -- } -- -- public boolean add(Object object) { -- return this.add((NBTBase) object); - } } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 0afaea81..26da8972 100644 +index 0afaea8109..26da897243 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -44,7 +44,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -785,7 +654,7 @@ index 0afaea81..26da8972 100644 public QueuedPacket(Packet packet, @Nullable GenericFutureListener> genericfuturelistener) { this.a = packet; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index d04afceb..a63a5811 100644 +index d04afceb70..a63a5811d6 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf { @@ -797,7 +666,7 @@ index d04afceb..a63a5811 100644 for (int j = 1; j < 5; ++j) { if ((i & -1 << j * 7) == 0) { diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 1aa36156..ae95fdf9 100644 +index a8363f47b3..33436ac65b 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -13,7 +13,7 @@ public class PacketPlayOutMapChunk implements Packet { @@ -818,10 +687,10 @@ index 1aa36156..ae95fdf9 100644 int j = 0; ChunkSection[] achunksection = chunk.getSections(); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 0618962e..42e0630e 100644 +index 43bd6aba9d..7dee734a70 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -66,9 +66,9 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -68,9 +68,9 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private final MinecraftServer minecraftServer; public EntityPlayer player; private int e; @@ -835,28 +704,10 @@ index 0618962e..42e0630e 100644 private volatile int chatThrottle; private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java -index ef332d65..a804a67e 100644 +index 7cc7eb7735..a804a67e16 100644 --- a/src/main/java/net/minecraft/server/RegistryBlockID.java +++ b/src/main/java/net/minecraft/server/RegistryBlockID.java -@@ -8,7 +8,7 @@ import java.util.Iterator; - import java.util.List; - import javax.annotation.Nullable; - --public class RegistryBlockID implements Registry { -+public class RegistryBlockID implements Registry { // Paper - decompile fix - - private int a; - private final IdentityHashMap b; -@@ -27,7 +27,7 @@ public class RegistryBlockID implements Registry { - this.b.put(t0, Integer.valueOf(i)); - - while (this.c.size() <= i) { -- this.c.add((Object) null); -+ this.c.add(null); // Paper - decompile fix - } - - this.c.set(i, t0); -@@ -56,6 +56,7 @@ public class RegistryBlockID implements Registry { +@@ -56,6 +56,7 @@ public class RegistryBlockID implements Registry { // Paper - decompile fix return Iterators.filter(this.c.iterator(), Predicates.notNull()); } @@ -864,52 +715,6 @@ index ef332d65..a804a67e 100644 public int a() { return this.b.size(); } -diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index 2179664a..d7e1ecc0 100644 ---- a/src/main/java/net/minecraft/server/ServerPing.java -+++ b/src/main/java/net/minecraft/server/ServerPing.java -@@ -102,11 +102,11 @@ public class ServerPing { - return jsonobject; - } - -- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(ServerPing object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix - return this.a((ServerPing) object, type, jsonserializationcontext); - } - -- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public ServerPing deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); - } - } -@@ -147,11 +147,11 @@ public class ServerPing { - return jsonobject; - } - -- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(ServerPing.ServerData object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix - return this.a((ServerPing.ServerData) object, type, jsonserializationcontext); - } - -- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public ServerPing.ServerData deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); - } - } -@@ -235,11 +235,11 @@ public class ServerPing { - return jsonobject; - } - -- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(ServerPing.ServerPingPlayerSample object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix - return this.a((ServerPing.ServerPingPlayerSample) object, type, jsonserializationcontext); - } - -- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public ServerPing.ServerPingPlayerSample deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); - } - } -- -2.14.1.windows.1 +2.18.0 diff --git a/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch b/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch index 5e9b2e045b..f80be64e5f 100644 --- a/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch +++ b/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch @@ -1,4 +1,4 @@ -From 4bffc6c4381b8f560de9b87dae45060fa43bf997 Mon Sep 17 00:00:00 2001 +From 914ca3a9a21de489bc689e6d0331e626f2b255e7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 01:40:13 -0400 Subject: [PATCH] Add MinecraftKey Information to Objects @@ -6,7 +6,7 @@ Subject: [PATCH] Add MinecraftKey Information to Objects Stores the reference to the objects respective MinecraftKey diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index e8f7b7292..7ff8e70b2 100644 +index e8f7b7292d..7ff8e70b24 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -171,7 +171,7 @@ public class PaperCommand extends Command { @@ -19,7 +19,7 @@ index e8f7b7292..7ff8e70b2 100644 MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a1050912b..7e691baf9 100644 +index 8997cf84a4..044f7b5aa0 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -46,7 +46,7 @@ import org.bukkit.event.entity.EntityPortalEvent; @@ -40,7 +40,7 @@ index a1050912b..7e691baf9 100644 private int id; public boolean j; public final List passengers; -@@ -1763,12 +1763,29 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { +@@ -1758,12 +1758,29 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { return true; } @@ -75,20 +75,20 @@ index a1050912b..7e691baf9 100644 protected abstract void a(NBTTagCompound nbttagcompound); diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 9a513b4e3..fa268f354 100644 +index 5c1ab6a0b6..cd411a1423 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -238,6 +238,7 @@ public class EntityTypes { +@@ -240,6 +240,7 @@ public class EntityTypes { } } + public boolean isPersistable() { return a(); } // Paper - OBFHELPER public boolean a() { - return this.aV; + return this.aU; } diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java new file mode 100644 -index 000000000..743142d03 +index 0000000000..743142d030 --- /dev/null +++ b/src/main/java/net/minecraft/server/KeyedObject.java @@ -0,0 +1,9 @@ @@ -102,7 +102,7 @@ index 000000000..743142d03 + } +} diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 8a0453245..5ca7fef51 100644 +index 62b6e6eb38..7390061bf0 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -7,11 +7,11 @@ import org.apache.logging.log4j.Logger; @@ -147,5 +147,5 @@ index 8a0453245..5ca7fef51 100644 public World getWorld() { return this.world; -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index 203efcde0c..77b9792b85 100644 --- a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -1,4 +1,4 @@ -From 9194ef5bb3a3499c930324ad6b4451399c8d84fa Mon Sep 17 00:00:00 2001 +From 67a6288644176621a491a96d0d283fe92ee3f6c7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 02:10:36 -0400 Subject: [PATCH] Store reference to current Chunk for Entity and Block @@ -8,19 +8,19 @@ This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 2d06202da..8d9aa271a 100644 +index 35cb5ca575..85f33c140e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -33,7 +33,7 @@ public class Chunk implements IChunkAccess { - private final BiomeBase[] g; - private final boolean[] h; - private final Map i; -- private boolean j; -+ private boolean j; public boolean isLoaded() { return j; } // Paper - OBFHELPER + private final BiomeBase[] f; + private final boolean[] g; + private final Map h; +- private boolean i; ++ private boolean i;public boolean isLoaded() { return i; } // Paper - OBFHELPER public final World world; public final Map heightMap; public final int locX; -@@ -63,7 +63,30 @@ public class Chunk implements IChunkAccess { +@@ -62,7 +62,30 @@ public class Chunk implements IChunkAccess { // CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking private int neighbors = 0x1 << 12; public long chunkKey; @@ -51,16 +51,16 @@ index 2d06202da..8d9aa271a 100644 public boolean areNeighborsLoaded(final int radius) { switch (radius) { case 2: -@@ -94,7 +117,7 @@ public class Chunk implements IChunkAccess { - this.h = new boolean[256]; - this.i = Maps.newHashMap(); +@@ -93,7 +116,7 @@ public class Chunk implements IChunkAccess { + this.g = new boolean[256]; + this.h = Maps.newHashMap(); this.heightMap = Maps.newHashMap(); - this.tileEntities = Maps.newHashMap(); + this.tileEntities = new TileEntityHashMap(); // Paper + this.p = Maps.newHashMap(); this.q = Maps.newHashMap(); - this.r = Maps.newHashMap(); - this.s = new ShortList[16]; -@@ -646,6 +669,9 @@ public class Chunk implements IChunkAccess { + this.r = new ShortList[16]; +@@ -645,6 +668,9 @@ public class Chunk implements IChunkAccess { entity.af = k; entity.ag = this.locZ; this.entitySlices[k].add(entity); @@ -70,7 +70,7 @@ index 2d06202da..8d9aa271a 100644 } public void a(HeightMap.Type heightmap_type, long[] along) { -@@ -664,8 +690,12 @@ public class Chunk implements IChunkAccess { +@@ -663,8 +689,12 @@ public class Chunk implements IChunkAccess { if (i >= this.entitySlices.length) { i = this.entitySlices.length - 1; } @@ -85,7 +85,7 @@ index 2d06202da..8d9aa271a 100644 } public boolean c(BlockPosition blockposition) { -@@ -829,6 +859,7 @@ public class Chunk implements IChunkAccess { +@@ -830,6 +860,7 @@ public class Chunk implements IChunkAccess { } } // Spigot End @@ -94,7 +94,7 @@ index 2d06202da..8d9aa271a 100644 // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 7e691baf9..19109ee1d 100644 +index 044f7b5aa0..591ae114cf 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -134,7 +134,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -106,7 +106,7 @@ index 7e691baf9..19109ee1d 100644 public int ae; public int getChunkX() { return ae; } // Paper - OBFHELPER public int af; public int getChunkY() { return af; } // Paper - OBFHELPER public int ag; public int getChunkZ() { return ag; } // Paper - OBFHELPER -@@ -1764,6 +1764,39 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1759,6 +1759,39 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // Paper start @@ -147,7 +147,7 @@ index 7e691baf9..19109ee1d 100644 private String entityKeyString; diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 5ca7fef51..9361667c3 100644 +index 7390061bf0..c69209497b 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -41,6 +41,15 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -167,7 +167,7 @@ index 5ca7fef51..9361667c3 100644 @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index b542b17fd..9fc7ac8c0 100644 +index b542b17fd0..9fc7ac8c02 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -9,6 +9,7 @@ import java.util.UUID; @@ -192,5 +192,5 @@ index b542b17fd..9fc7ac8c0 100644 /** * Order is *EXTREMELY* important -- keep it right! =D -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch b/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch index c888a54ca5..0874696ceb 100644 --- a/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch +++ b/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch @@ -1,4 +1,4 @@ -From cfcc186292e5c96e42aa2588663c3e9ff49c0e34 Mon Sep 17 00:00:00 2001 +From 3e64fc7d6db1a903430d4313f4da4d84173428c4 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 02:13:59 -0400 Subject: [PATCH] Store counts for each Entity/Block Entity Type @@ -6,10 +6,10 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type Opens door for future patches to optimize performance diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7837f1024c..24a2ec4b4a 100644 +index 85f33c140e..bcafd86fb8 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -64,15 +64,19 @@ public class Chunk implements IChunkAccess { +@@ -63,15 +63,19 @@ public class Chunk implements IChunkAccess { private int neighbors = 0x1 << 12; public long chunkKey; // Paper start @@ -29,7 +29,7 @@ index 7837f1024c..24a2ec4b4a 100644 } return replaced; } -@@ -82,6 +86,7 @@ public class Chunk implements IChunkAccess { +@@ -81,6 +85,7 @@ public class Chunk implements IChunkAccess { TileEntity removed = super.remove(key); if (removed != null) { removed.setCurrentChunk(null); @@ -37,7 +37,7 @@ index 7837f1024c..24a2ec4b4a 100644 } return removed; } -@@ -671,6 +676,7 @@ public class Chunk implements IChunkAccess { +@@ -670,6 +675,7 @@ public class Chunk implements IChunkAccess { this.entitySlices[k].add(entity); // Paper start entity.setCurrentChunk(this); @@ -45,7 +45,7 @@ index 7837f1024c..24a2ec4b4a 100644 // Paper end } -@@ -695,6 +701,7 @@ public class Chunk implements IChunkAccess { +@@ -694,6 +700,7 @@ public class Chunk implements IChunkAccess { return; } entity.setCurrentChunk(null); diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch index cd1f744b9a..92a100de43 100644 --- a/Spigot-Server-Patches/0009-Timings-v2.patch +++ b/Spigot-Server-Patches/0009-Timings-v2.patch @@ -1,4 +1,4 @@ -From 145b2523893f196854951df2dbbcbd9a46aca84b Mon Sep 17 00:00:00 2001 +From b78abc658c7bb0dfd27c6ad4b701005462f2c7d5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Mar 2016 04:00:11 -0600 Subject: [PATCH] Timings v2 @@ -135,192 +135,6 @@ index 0000000000..4f624e39c7 + return Timings.ofSafe("## Packet - " + packet.getClass().getSimpleName(), packetProcessTimer); + } +} -diff --git a/src/main/java/co/aikar/timings/TimedChunkGenerator.java b/src/main/java/co/aikar/timings/TimedChunkGenerator.java -new file mode 100644 -index 0000000000..0bb63600f3 ---- /dev/null -+++ b/src/main/java/co/aikar/timings/TimedChunkGenerator.java -@@ -0,0 +1,180 @@ -+/* -+ * This file is licensed under the MIT License (MIT). -+ * -+ * Copyright (c) 2014-2016 Daniel Ennis -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to deal -+ * in the Software without restriction, including without limitation the rights -+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -+ * copies of the Software, and to permit persons to whom the Software is -+ * furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -+ * THE SOFTWARE. -+ */ -+ -+package co.aikar.timings; -+ -+import net.minecraft.server.BiomeBase; -+import net.minecraft.server.BiomeBase.BiomeMeta; -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.Chunk; -+import net.minecraft.server.EnumCreatureType; -+import net.minecraft.server.GeneratorSettings; -+import net.minecraft.server.IChunkAccess; -+import net.minecraft.server.RegionLimitedWorldAccess; -+import net.minecraft.server.StructureGenerator; -+import net.minecraft.server.StructureStart; -+import net.minecraft.server.World; -+import net.minecraft.server.WorldChunkManager; -+import net.minecraft.server.WorldGenFeatureConfiguration; -+import net.minecraft.server.WorldGenStage; -+import net.minecraft.server.WorldServer; -+import org.bukkit.Location; -+import org.bukkit.craftbukkit.generator.InternalChunkGenerator; -+import org.bukkit.generator.BlockPopulator; -+ -+import javax.annotation.Nullable; -+import java.util.List; -+import java.util.Random; -+ -+import it.unimi.dsi.fastutil.longs.Long2ObjectMap; -+import it.unimi.dsi.fastutil.longs.LongSet; -+ -+// TODO: timing handlers -+public class TimedChunkGenerator extends InternalChunkGenerator { -+ private final WorldServer world; -+ private final InternalChunkGenerator timedGenerator; -+ -+ public TimedChunkGenerator(WorldServer worldServer, InternalChunkGenerator gen) { -+ world = worldServer; -+ timedGenerator = gen; -+ } -+ -+ -+ @Override -+ public ChunkData generateChunkData(org.bukkit.World world, Random random, int x, int z, BiomeGrid biome) { -+ return timedGenerator.generateChunkData(world, random, x, z, biome); -+ } -+ -+ @Override -+ public boolean canSpawn(org.bukkit.World world, int x, int z) { -+ return timedGenerator.canSpawn(world, x, z); -+ } -+ -+ @Override -+ public List getDefaultPopulators(org.bukkit.World world) { -+ return timedGenerator.getDefaultPopulators(world); -+ } -+ -+ @Override -+ public Location getFixedSpawnLocation(org.bukkit.World world, Random random) { -+ return timedGenerator.getFixedSpawnLocation(world, random); -+ } -+ /* -+ @Override -+ public Chunk getOrCreateChunk(int i, int j) { -+ try (Timing ignored = world.timings.chunkGeneration.startTiming()) { -+ return timedGenerator.getOrCreateChunk(i, j); -+ } -+ } -+ */ -+ -+ @Override -+ public void createChunk(IChunkAccess ichunkaccess) { -+ try (Timing ignored = world.timings.chunkGeneration.startTiming()) { -+ timedGenerator.createChunk(ichunkaccess); -+ } -+ } -+ -+ @Override -+ public void addFeatures(RegionLimitedWorldAccess regionlimitedworldaccess, WorldGenStage.Features worldgenstage_features) { -+ timedGenerator.addFeatures(regionlimitedworldaccess, worldgenstage_features); -+ } -+ -+ @Override -+ public void addDecorations(RegionLimitedWorldAccess regionlimitedworldaccess) { -+ timedGenerator.addDecorations(regionlimitedworldaccess); -+ } -+ -+ @Override -+ public void addMobs(RegionLimitedWorldAccess regionlimitedworldaccess) { -+ timedGenerator.addMobs(regionlimitedworldaccess); -+ } -+ -+ @Override -+ public List getMobsFor(EnumCreatureType enumcreaturetype, BlockPosition blockposition) { -+ return timedGenerator.getMobsFor(enumcreaturetype, blockposition); -+ } -+ -+ @Nullable -+ @Override -+ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition, int i) { -+ return timedGenerator.findNearestMapFeature(world, s, blockposition, i); -+ } -+ -+ @Override -+ public GeneratorSettings getSettings() { -+ return timedGenerator.getSettings(); -+ } -+ -+ @Override -+ public int a(World world, boolean flag, boolean flag1) { -+ return timedGenerator.a(world, flag, flag1); -+ } -+ -+ @Override -+ public WorldChunkManager getWorldChunkManager() { -+ return timedGenerator.getWorldChunkManager(); -+ } -+ -+ @Override -+ public long getSeed() { -+ return timedGenerator.getSeed(); -+ } -+ -+ @Override -+ public int getSpawnHeight() { -+ return timedGenerator.getSpawnHeight(); -+ } -+ -+ @Override -+ public int e() { -+ return timedGenerator.e(); -+ } -+ -+ @Override -+ public World getWorld() { -+ return timedGenerator.getWorld(); -+ } -+ -+ @Override -+ public Long2ObjectMap getStructureCache(StructureGenerator structuregenerator) { -+ return timedGenerator.getStructureCache(structuregenerator); -+ } -+ -+ @Override -+ public Long2ObjectMap getStructureStartCache(StructureGenerator structuregenerator) { -+ return timedGenerator.getStructureStartCache(structuregenerator); -+ } -+ -+ @Nullable -+ @Override -+ public WorldGenFeatureConfiguration getFeatureConfiguration(BiomeBase biomebase, StructureGenerator structuregenerator) { -+ return timedGenerator.getFeatureConfiguration(biomebase, structuregenerator); -+ } -+ -+ @Override -+ public boolean canSpawnStructure(BiomeBase biomebase, StructureGenerator structuregenerator) { -+ return timedGenerator.canSpawnStructure(biomebase, structuregenerator); -+ } -+} diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java new file mode 100644 index 0000000000..145cb274b0 @@ -476,17 +290,14 @@ index d2efcca80a..4812da0dac 100644 + } } diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 9e298f1216..a0c9fc617a 100644 +index 8811dbc9b3..7818a3b6a7 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -28,8 +28,16 @@ public class Block implements IMaterial { - private IBlockData blockData; - protected final boolean o; - private final boolean p; -- @Nullable -- private String name; -+ @Nullable // Paper start -+ public String name; +@@ -23,6 +23,15 @@ public class Block implements IMaterial { + protected final boolean i; + protected final SoundEffectType stepSound; + protected final Material material; ++ // Paper start + public co.aikar.timings.Timing timing; + public co.aikar.timings.Timing getTiming() { + if (timing == null) { @@ -495,11 +306,11 @@ index 9e298f1216..a0c9fc617a 100644 + return timing; + } + // Paper end - private static final ThreadLocal> r = ThreadLocal.withInitial(() -> { - Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap = new Object2ByteLinkedOpenHashMap(200) { - protected void rehash(int i) {} + protected final MaterialMapColor l; + private final float frictionFactor; + protected final BlockStateList blockStateList; diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index 027b7cce98..4e51bd301a 100644 +index e3d1761b49..fbebd4591c 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -14,6 +14,7 @@ public class ChunkMap extends Long2ObjectOpenHashMap { @@ -530,27 +341,38 @@ index 027b7cce98..4e51bd301a 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 00cd8d8cea..aabdc9e2f0 100644 +index 9e805c5d22..0034956af9 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -122,14 +122,13 @@ public class ChunkProviderServer implements IChunkProvider { - if (chunk != null) { +@@ -90,7 +90,7 @@ public class ChunkProviderServer implements IChunkProvider { + } + + if (flag) { +- try { ++ try (co.aikar.timings.Timing timing = world.timings.syncChunkLoadTimer.startTiming()) { // Paper + // CraftBukkit - decompile error + chunk = this.chunkLoader.a(this.world, i, j, (chunk1) -> { + chunk1.setLastSaved(this.world.getTime()); +@@ -106,8 +106,7 @@ public class ChunkProviderServer implements IChunkProvider { + this.asyncTaskHandler.postToMainThread(chunk::addEntities); return chunk; - } else { + } else if (flag1) { - try { - world.timings.syncChunkLoadTimer.startTiming(); // Spigot -+ try (co.aikar.timings.Timing timing = world.timings.chunkGeneration.startTiming()) { -+ ; // Spigot - chunk = (Chunk) this.generateChunk(i, j).get(); - return chunk; - } catch (ExecutionException | InterruptedException interruptedexception) { - throw this.a(i, j, (Throwable) interruptedexception); ++ try (co.aikar.timings.Timing timing = world.timings.chunkGeneration.startTiming()) { // Paper + this.batchScheduler.b(); + this.batchScheduler.a(new ChunkCoordIntPair(i, j)); + CompletableFuture completablefuture = this.batchScheduler.c(); // CraftBukkit - decompile error +@@ -116,7 +115,7 @@ public class ChunkProviderServer implements IChunkProvider { + } catch (RuntimeException runtimeexception) { + throw this.a(i, j, (Throwable) runtimeexception); } - finally { world.timings.syncChunkLoadTimer.stopTiming(); } // Spigot ++ // finally { world.timings.syncChunkLoadTimer.stopTiming(); } // Spigot // Paper + } else { + return null; } - } - -@@ -232,7 +231,7 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -206,7 +205,7 @@ public class ChunkProviderServer implements IChunkProvider { } public void saveChunk(IChunkAccess ichunkaccess, boolean unloaded) { // Spigot @@ -560,7 +382,7 @@ index 00cd8d8cea..aabdc9e2f0 100644 this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot } catch (IOException ioexception) { diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 88301ee61e..5001fd11dc 100644 +index df07b2b889..f969c036f3 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -1,5 +1,6 @@ @@ -570,7 +392,7 @@ index 88301ee61e..5001fd11dc 100644 import com.google.common.collect.Maps; import com.mojang.datafixers.DataFixTypes; import com.mojang.datafixers.DataFixer; -@@ -690,7 +691,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -678,7 +679,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { public void loadEntities(NBTTagCompound nbttagcompound, Chunk chunk) { NBTTagList nbttaglist = nbttagcompound.getList("Entities", 10); World world = chunk.getWorld(); @@ -579,7 +401,7 @@ index 88301ee61e..5001fd11dc 100644 for (int i = 0; i < nbttaglist.size(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompound(i); -@@ -699,8 +700,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -687,8 +688,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { chunk.f(true); } @@ -588,18 +410,18 @@ index 88301ee61e..5001fd11dc 100644 NBTTagList nbttaglist1 = nbttagcompound.getList("TileEntities", 10); for (int j = 0; j < nbttaglist1.size(); ++j) { -@@ -717,8 +716,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -705,8 +704,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } } } - world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot - world.timings.syncChunkLoadTileTicksTimer.startTiming(); // Spigot - if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.I() instanceof TickListServer) { - ((TickListServer) world.I()).a(nbttagcompound.getList("TileTicks", 10)); -@@ -727,7 +724,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.H() instanceof TickListServer) { - ((TickListServer) world.H()).a(nbttagcompound.getList("LiquidTicks", 10)); + if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.J() instanceof TickListServer) { + ((TickListServer) world.J()).a(nbttagcompound.getList("TileTicks", 10)); +@@ -715,7 +712,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.I() instanceof TickListServer) { + ((TickListServer) world.I()).a(nbttagcompound.getList("LiquidTicks", 10)); } - world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot + world.timings.chunkLoadLevelTimer.stopTiming(); // Spigot @@ -607,7 +429,7 @@ index 88301ee61e..5001fd11dc 100644 } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 3706e44a34..bf1fffcfee 100644 +index efa738d4ec..dabad6b055 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -29,7 +29,7 @@ import org.apache.logging.log4j.Level; @@ -622,7 +444,7 @@ index 3706e44a34..bf1fffcfee 100644 @@ -443,7 +443,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } - public void aW() { + public void aU() { - SpigotTimings.serverCommandTimer.startTiming(); // Spigot + MinecraftTimings.serverCommandTimer.startTiming(); // Spigot while (!this.serverCommandQueue.isEmpty()) { @@ -636,7 +458,7 @@ index 3706e44a34..bf1fffcfee 100644 + MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot } - public boolean S() { + public boolean Q() { @@ -708,7 +708,20 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer return remoteControlCommandListener.getMessages(); } @@ -660,7 +482,7 @@ index 3706e44a34..bf1fffcfee 100644 return waitable.get(); } catch (java.util.concurrent.ExecutionException e) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 19109ee1dd..7c238d728b 100644 +index 591ae114cf..ec5c9fd735 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender; @@ -682,7 +504,7 @@ index 19109ee1dd..7c238d728b 100644 // Spigot start public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -541,7 +542,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -536,7 +537,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public void move(EnumMoveType enummovetype, double d0, double d1, double d2) { @@ -690,7 +512,7 @@ index 19109ee1dd..7c238d728b 100644 if (this.noclip) { this.a(this.getBoundingBox().d(d0, d1, d2)); this.recalcPosition(); -@@ -890,7 +890,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -886,7 +886,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.world.methodProfiler.e(); } @@ -699,7 +521,7 @@ index 19109ee1dd..7c238d728b 100644 protected float ab() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 5b33997529..1722855ac5 100644 +index 91c4785889..8a41a1dca8 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -32,7 +32,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -711,7 +533,7 @@ index 5b33997529..1722855ac5 100644 public abstract class EntityLiving extends Entity { -@@ -1985,7 +1985,6 @@ public abstract class EntityLiving extends Entity { +@@ -2020,7 +2020,6 @@ public abstract class EntityLiving extends Entity { } public void tick() { @@ -719,7 +541,7 @@ index 5b33997529..1722855ac5 100644 super.tick(); this.cV(); this.o(); -@@ -2059,9 +2058,7 @@ public abstract class EntityLiving extends Entity { +@@ -2094,9 +2093,7 @@ public abstract class EntityLiving extends Entity { } } @@ -729,7 +551,7 @@ index 5b33997529..1722855ac5 100644 double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f = (float) (d0 * d0 + d1 * d1); -@@ -2137,8 +2134,6 @@ public abstract class EntityLiving extends Entity { +@@ -2172,8 +2169,6 @@ public abstract class EntityLiving extends Entity { } else { this.bv = 0; } @@ -738,7 +560,7 @@ index 5b33997529..1722855ac5 100644 } protected float e(float f, float f1) { -@@ -2208,7 +2203,6 @@ public abstract class EntityLiving extends Entity { +@@ -2243,7 +2238,6 @@ public abstract class EntityLiving extends Entity { } this.world.methodProfiler.a("ai"); @@ -746,7 +568,7 @@ index 5b33997529..1722855ac5 100644 if (this.isFrozen()) { this.bg = false; this.bh = 0.0F; -@@ -2219,7 +2213,6 @@ public abstract class EntityLiving extends Entity { +@@ -2254,7 +2248,6 @@ public abstract class EntityLiving extends Entity { this.doTick(); this.world.methodProfiler.e(); } @@ -754,7 +576,7 @@ index 5b33997529..1722855ac5 100644 this.world.methodProfiler.e(); this.world.methodProfiler.a("jump"); -@@ -2244,9 +2237,7 @@ public abstract class EntityLiving extends Entity { +@@ -2279,9 +2272,7 @@ public abstract class EntityLiving extends Entity { this.n(); AxisAlignedBB axisalignedbb = this.getBoundingBox(); @@ -764,7 +586,7 @@ index 5b33997529..1722855ac5 100644 this.world.methodProfiler.e(); this.world.methodProfiler.a("push"); if (this.bw > 0) { -@@ -2254,9 +2245,7 @@ public abstract class EntityLiving extends Entity { +@@ -2289,9 +2280,7 @@ public abstract class EntityLiving extends Entity { this.a(axisalignedbb, this.getBoundingBox()); } @@ -806,7 +628,7 @@ index ae31935c48..70c9b1f50c 100644 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1a59a6a1f2..ce4bf0a68f 100644 +index 2c69e68276..0ebe754619 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1,5 +1,6 @@ @@ -815,8 +637,8 @@ index 1a59a6a1f2..ce4bf0a68f 100644 +import co.aikar.timings.Timings; import com.google.common.base.Stopwatch; import com.google.common.collect.Lists; - import com.google.common.collect.Queues; -@@ -62,8 +63,8 @@ import org.bukkit.Bukkit; + import com.google.common.collect.Maps; +@@ -66,8 +67,8 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.Main; // CraftBukkit end @@ -826,7 +648,7 @@ index 1a59a6a1f2..ce4bf0a68f 100644 public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStatistics, ICommandListener, Runnable { -@@ -599,6 +600,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -616,6 +617,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } // CraftBukkit end MinecraftServer.LOGGER.info("Stopping server"); @@ -834,16 +656,16 @@ index 1a59a6a1f2..ce4bf0a68f 100644 // CraftBukkit start if (this.server != null) { this.server.disablePlugins(); -@@ -805,7 +807,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - public void u() {} +@@ -817,7 +819,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + public void t() {} - protected void v() { + protected void a(BooleanSupplier booleansupplier) { - SpigotTimings.serverTickTimer.startTiming(); // Spigot + co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot long i = SystemUtils.c(); -@@ -832,7 +834,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -844,7 +846,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit @@ -851,7 +673,7 @@ index 1a59a6a1f2..ce4bf0a68f 100644 this.methodProfiler.a("save"); this.s.savePlayers(); // Spigot Start -@@ -847,7 +848,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -859,7 +860,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // this.saveChunks(true); // Spigot End this.methodProfiler.e(); @@ -859,7 +681,7 @@ index 1a59a6a1f2..ce4bf0a68f 100644 } this.methodProfiler.a("snooper"); -@@ -868,14 +868,14 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -880,14 +880,14 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati this.methodProfiler.e(); org.spigotmc.WatchdogThread.tick(); // Spigot this.slackActivityAccountant.tickEnded(l); // Spigot @@ -868,7 +690,7 @@ index 1a59a6a1f2..ce4bf0a68f 100644 + co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper } - public void w() { + public void b(BooleanSupplier booleansupplier) { - SpigotTimings.schedulerTimer.startTiming(); // Spigot + MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Paper this.server.getScheduler().mainThreadHeartbeat(this.ticks); // CraftBukkit @@ -878,8 +700,8 @@ index 1a59a6a1f2..ce4bf0a68f 100644 this.methodProfiler.a("jobs"); FutureTask futuretask; -@@ -883,26 +883,27 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - while ((futuretask = (FutureTask) this.g.poll()) != null) { +@@ -895,26 +895,27 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + while ((futuretask = (FutureTask) this.f.poll()) != null) { SystemUtils.a(futuretask, MinecraftServer.LOGGER); } + MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper @@ -913,16 +735,16 @@ index 1a59a6a1f2..ce4bf0a68f 100644 // Send time updates to everyone, it will get the right time from the world the player is in. if (this.ticks % 20 == 0) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) { -@@ -910,7 +911,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -922,7 +923,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(entityplayer.world.getTime(), entityplayer.getPlayerTime(), entityplayer.world.getGameRules().getBoolean("doDaylightCycle"))); // Add support for per player time } } - SpigotTimings.timeUpdateTimer.stopTiming(); // Spigot + MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot - int i; - -@@ -969,9 +970,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + // WorldServer worldserver; // CraftBukkit - dropped down + long i; +@@ -981,29 +982,27 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati this.methodProfiler.e(); this.methodProfiler.a("tracker"); @@ -932,7 +754,6 @@ index 1a59a6a1f2..ce4bf0a68f 100644 this.methodProfiler.e(); this.methodProfiler.e(); } -@@ -980,20 +979,19 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } this.methodProfiler.c("connection"); @@ -948,11 +769,11 @@ index 1a59a6a1f2..ce4bf0a68f 100644 - SpigotTimings.playerListTimer.stopTiming(); // Spigot + MinecraftTimings.playerListTimer.stopTiming(); // Spigot this.methodProfiler.c("tickables"); -- + - SpigotTimings.tickablesTimer.startTiming(); // Spigot + MinecraftTimings.tickablesTimer.startTiming(); // Spigot - for (i = 0; i < this.l.size(); ++i) { - ((ITickable) this.l.get(i)).Y_(); + for (int j = 0; j < this.k.size(); ++j) { + ((ITickable) this.k.get(j)).Y_(); } - SpigotTimings.tickablesTimer.stopTiming(); // Spigot + MinecraftTimings.tickablesTimer.stopTiming(); // Spigot @@ -1054,10 +875,10 @@ index ac6d8cc6e6..d975c2ccf1 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 42e0630e60..5d42cfe81c 100644 +index 7dee734a70..37284fae4d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -57,6 +57,7 @@ import org.bukkit.inventory.CraftingInventory; +@@ -59,6 +59,7 @@ import org.bukkit.inventory.CraftingInventory; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.InventoryView; import org.bukkit.util.NumberConversions; @@ -1065,7 +886,7 @@ index 42e0630e60..5d42cfe81c 100644 // CraftBukkit end public class PlayerConnection implements PacketListenerPlayIn, ITickable { -@@ -1615,7 +1616,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1625,7 +1626,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { // CraftBukkit end private void handleCommand(String s) { @@ -1074,7 +895,7 @@ index 42e0630e60..5d42cfe81c 100644 // CraftBukkit start - whole method if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getName() + " issued server command: " + s); -@@ -1626,7 +1627,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1636,7 +1637,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { this.server.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1083,7 +904,7 @@ index 42e0630e60..5d42cfe81c 100644 return; } -@@ -1639,7 +1640,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1649,7 +1650,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; } finally { @@ -1116,7 +937,7 @@ index 889b32287e..69da194f52 100644 throw CancelledPacketHandleException.INSTANCE; } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index e476d3433b..9cef6b9af6 100644 +index ead9697e65..26df2ff32f 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1,5 +1,6 @@ @@ -1126,7 +947,7 @@ index e476d3433b..9cef6b9af6 100644 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1179,10 +1180,11 @@ public abstract class PlayerList { +@@ -1173,10 +1174,11 @@ public abstract class PlayerList { } public void savePlayers() { @@ -1194,7 +1015,7 @@ index a07895935e..ee5c2421bb 100644 } diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 9361667c3b..0d54513a44 100644 +index c69209497b..68ac014aab 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -4,12 +4,13 @@ import javax.annotation.Nullable; @@ -1214,7 +1035,7 @@ index 9361667c3b..0d54513a44 100644 private final TileEntityTypes e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER protected World world; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e1cf1e579a..3cb7c1d540 100644 +index 028678379a..c3c435cab9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1,5 +1,6 @@ @@ -1223,8 +1044,8 @@ index e1cf1e579a..3cb7c1d540 100644 +import co.aikar.timings.Timings; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; - import java.util.ArrayList; -@@ -20,13 +21,13 @@ import com.google.common.collect.Maps; + import it.unimi.dsi.fastutil.longs.LongSet; +@@ -26,13 +27,13 @@ import com.google.common.collect.Maps; import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.block.BlockState; @@ -1239,7 +1060,7 @@ index e1cf1e579a..3cb7c1d540 100644 import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -@@ -129,7 +130,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -136,7 +137,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper @@ -1248,7 +1069,7 @@ index e1cf1e579a..3cb7c1d540 100644 private boolean guardEntityList; // Spigot public static boolean haveWeSilencedAPhysicsCrash; public static String blockLocation; -@@ -197,7 +198,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -205,7 +206,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc }); this.getServer().addWorld(this.world); // CraftBukkit end @@ -1257,7 +1078,7 @@ index e1cf1e579a..3cb7c1d540 100644 this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } -@@ -1110,6 +1111,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1123,6 +1124,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } this.methodProfiler.c("remove"); @@ -1265,7 +1086,7 @@ index e1cf1e579a..3cb7c1d540 100644 this.entityList.removeAll(this.g); int j; -@@ -1130,6 +1132,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1143,6 +1145,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.g.clear(); this.p_(); @@ -1273,7 +1094,7 @@ index e1cf1e579a..3cb7c1d540 100644 this.methodProfiler.c("regular"); CrashReportSystemDetails crashreportsystemdetails1; -@@ -1139,6 +1142,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1152,6 +1155,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc timings.entityTick.startTiming(); // Spigot guardEntityList = true; // Spigot // CraftBukkit start - Use field for loop variable @@ -1281,7 +1102,7 @@ index e1cf1e579a..3cb7c1d540 100644 int entitiesThisCycle = 0; if (tickPosition < 0) tickPosition = 0; for (entityLimiter.initTick(); -@@ -1160,10 +1164,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1173,10 +1177,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.methodProfiler.a("tick"); if (!entity.dead && !(entity instanceof EntityPlayer)) { try { @@ -1295,7 +1116,7 @@ index e1cf1e579a..3cb7c1d540 100644 crashreport1 = CrashReport.a(throwable1, "Ticking entity"); crashreportsystemdetails1 = crashreport1.a("Entity being ticked"); entity.appendEntityCrashDetails(crashreportsystemdetails1); -@@ -1288,6 +1293,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1301,6 +1306,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } timings.tileEntityPending.stopTiming(); // Spigot @@ -1303,7 +1124,7 @@ index e1cf1e579a..3cb7c1d540 100644 this.methodProfiler.e(); this.methodProfiler.e(); } -@@ -1346,7 +1352,6 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1359,7 +1365,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } // CraftBukkit end @@ -1311,7 +1132,7 @@ index e1cf1e579a..3cb7c1d540 100644 entity.N = entity.locX; entity.O = entity.locY; entity.P = entity.locZ; -@@ -1354,6 +1359,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1367,6 +1372,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.lastPitch = entity.pitch; if (flag && entity.inChunk) { ++entity.ticksLived; @@ -1319,7 +1140,7 @@ index e1cf1e579a..3cb7c1d540 100644 if (entity.isPassenger()) { entity.aH(); } else { -@@ -1417,8 +1423,6 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1430,8 +1436,6 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } } @@ -1329,7 +1150,7 @@ index e1cf1e579a..3cb7c1d540 100644 public boolean a(@Nullable Entity entity, VoxelShape voxelshape) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 2c6f6de4ce..f032ecab64 100644 +index c276c259ae..badec349b7 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -1,5 +1,6 @@ @@ -1339,21 +1160,21 @@ index 2c6f6de4ce..f032ecab64 100644 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.util.concurrent.ListenableFuture; -@@ -70,7 +71,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - RegistryBlocks registryblocks1 = Block.REGISTRY; // CraftBukkit - decompile error +@@ -71,7 +72,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + IRegistry iregistry1 = IRegistry.BLOCK; // CraftBukkit - decompile error - Block.REGISTRY.getClass(); -- this.nextTickListBlock = new TickListServer<>(this, predicate, function, registryblocks1::get, this::b); // CraftBukkit - decompile error -+ this.nextTickListBlock = new TickListServer<>(this, predicate, function, registryblocks1::get, this::b, "Blocks"); // CraftBukkit - decompile error // Paper - Timings v2 - Predicate predicate2 = (fluidtype) -> { + IRegistry.BLOCK.getClass(); +- this.nextTickListBlock = new TickListServer<>(this, predicate, function, iregistry1::getOrDefault, this::b); // CraftBukkit - decompile error ++ this.nextTickListBlock = new TickListServer<>(this, predicate, function, iregistry1::getOrDefault, this::b, "Blocks"); // CraftBukkit - decompile error // Paper - Timings v2 + Predicate predicate2 = (fluidtype) -> { // CraftBukkit - decompile error return fluidtype == null || fluidtype == FluidTypes.a; }; -@@ -79,7 +80,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - function = registryblocks::b; - RegistryBlocks registryblocks2 = FluidType.c; // CraftBukkit - decompile error - FluidType.c.getClass(); -- this.nextTickListFluid = new TickListServer<>(this, predicate2, function, registryblocks2::get, this::a); // CraftBukkit - decompile error -+ this.nextTickListFluid = new TickListServer<>(this, predicate2, function, registryblocks2::get, this::a, "Fluids"); // CraftBukkit - decompile error // Paper - Timings v2 +@@ -80,7 +81,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + function = iregistry::getKey; + IRegistry iregistry2 = IRegistry.FLUID; // CraftBukkit - decompile error + IRegistry.FLUID.getClass(); +- this.nextTickListFluid = new TickListServer<>(this, predicate2, function, iregistry2::getOrDefault, this::a); // CraftBukkit - decompile error ++ this.nextTickListFluid = new TickListServer<>(this, predicate2, function, iregistry2::getOrDefault, this::a, "Fluids"); // CraftBukkit - decompile error // Paper - Timings v2 this.siegeManager = new VillageSiege(this); this.d = new ObjectLinkedOpenHashSet(); this.server = minecraftserver; @@ -1363,13 +1184,13 @@ index 2c6f6de4ce..f032ecab64 100644 this.methodProfiler.c("tickPending"); - timings.doTickPending.startTiming(); // Spigot + timings.scheduledBlocks.startTiming(); // Paper - this.p(); + this.q(); - timings.doTickPending.stopTiming(); // Spigot + timings.scheduledBlocks.stopTiming(); // Paper this.methodProfiler.c("tickBlocks"); - timings.doTickTiles.startTiming(); // Spigot + timings.chunkTicks.startTiming(); // Paper - this.l(); + this.n_(); - timings.doTickTiles.stopTiming(); // Spigot + timings.chunkTicks.stopTiming(); // Paper this.methodProfiler.c("chunkMap"); @@ -1392,18 +1213,9 @@ index 2c6f6de4ce..f032ecab64 100644 } this.methodProfiler.e(); -@@ -717,7 +719,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - gen = new org.bukkit.craftbukkit.generator.NormalChunkGenerator(this, this.getSeed()); - } - -- return new ChunkProviderServer(this, ichunkloader, gen, this.server); -+ return new ChunkProviderServer(this, ichunkloader, new co.aikar.timings.TimedChunkGenerator(this, gen), this.server); // Paper - // CraftBukkit end - } - @@ -869,6 +871,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - if (chunkproviderserver.e()) { + if (chunkproviderserver.d()) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit + timings.worldSave.startTiming(); // Paper if (iprogressupdate != null) { @@ -1417,7 +1229,7 @@ index 2c6f6de4ce..f032ecab64 100644 chunkproviderserver.a(flag); + timings.worldSaveChunks.stopTiming(); // Paper // CraftBukkit - ArrayList -> Collection - Collection arraylist = chunkproviderserver.a(); + java.util.Collection arraylist = chunkproviderserver.a(); Iterator iterator = arraylist.iterator(); @@ -890,7 +895,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { chunkproviderserver.unload(chunk); @@ -1434,21 +1246,21 @@ index 2c6f6de4ce..f032ecab64 100644 protected void a() throws ExceptionWorldConflict { + timings.worldSaveLevel.startTiming(); // Paper this.checkSession(); - WorldServer[] aworldserver = this.server.worldServer; - int i = aworldserver.length; -@@ -933,6 +939,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - this.worldData.c(this.server.aR().c()); + Iterator iterator = this.server.getWorlds().iterator(); + +@@ -932,6 +938,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + this.worldData.c(this.server.aP().c()); this.dataManager.saveWorldData(this.worldData, this.server.getPlayerList().t()); - this.worldMaps.a(); + this.h().a(); + timings.worldSaveLevel.stopTiming(); // Paper } // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ed3c23b74e..a4112c54ea 100644 +index 46a9ff9482..9ba50a2daa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1847,12 +1847,31 @@ public final class CraftServer implements Server { +@@ -1867,12 +1867,31 @@ public final class CraftServer implements Server { private final Spigot spigot = new Spigot() { @@ -1697,7 +1509,7 @@ index 413dd35f06..52a8c48fa4 100644 public void callStage3(QueuedChunk queuedChunk, Chunk chunk, Runnable runnable) throws RuntimeException { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 390fd92738..563e90d4dc 100644 +index 9f78f2c4ae..b8bdcb6b74 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1715,6 +1715,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0015-Allow-for-toggling-of-spawn-chunks.patch b/Spigot-Server-Patches/0015-Allow-for-toggling-of-spawn-chunks.patch index 062238e95d..206e56a3ea 100644 --- a/Spigot-Server-Patches/0015-Allow-for-toggling-of-spawn-chunks.patch +++ b/Spigot-Server-Patches/0015-Allow-for-toggling-of-spawn-chunks.patch @@ -1,11 +1,11 @@ -From 71c3064807448910dfda790cbc35d23fc2f4dae3 Mon Sep 17 00:00:00 2001 +From f53a589e0196b116fe888b7cdadc4d356f122ba6 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 3 Mar 2016 03:53:43 -0600 Subject: [PATCH] Allow for toggling of spawn chunks diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 02f7e506e..cef0c47ac 100644 +index 02f7e506e3..cef0c47ac7 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -108,4 +108,10 @@ public class PaperWorldConfig { @@ -20,10 +20,10 @@ index 02f7e506e..cef0c47ac 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 562a85b72..6ca7a2069 100644 +index c3c435cab9..30a46a50fb 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -199,6 +199,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -207,6 +207,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.getServer().addWorld(this.world); // CraftBukkit end timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings diff --git a/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch index d4ed1cd00a..70a0d7ca7a 100644 --- a/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -1,11 +1,11 @@ -From 12112e5c3e7cc51ef4a93b606052097a421c0896 Mon Sep 17 00:00:00 2001 +From 5b4305e22c82f4e10966cb8a0682ac1467972358 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 1 Mar 2016 14:14:15 -0600 Subject: [PATCH] Drop falling block and tnt entities at the specified height diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index cef0c47ac..38a697e1b 100644 +index cef0c47ac7..38a697e1b7 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -114,4 +114,14 @@ public class PaperWorldConfig { @@ -24,10 +24,10 @@ index cef0c47ac..38a697e1b 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 7c238d728..334f7403f 100644 +index ec5c9fd735..15b6067aab 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1867,6 +1867,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1862,6 +1862,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.a(itemstack, 0.0F); } @@ -36,7 +36,7 @@ index 7c238d728..334f7403f 100644 public EntityItem a(ItemStack itemstack, float f) { if (itemstack.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index e7e7d57c4..5e01aa0f8 100644 +index 01045058ce..25960cff2a 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -86,6 +86,17 @@ public class EntityFallingBlock extends Entity { @@ -58,7 +58,7 @@ index e7e7d57c4..5e01aa0f8 100644 blockposition = new BlockPosition(this); boolean flag = this.block.getBlock() instanceof BlockConcretePowder; diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 7edc02852..5ceb3f206 100644 +index 7edc028527..5ceb3f2068 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -57,6 +57,13 @@ public class EntityTNTPrimed extends Entity { @@ -76,5 +76,5 @@ index 7edc02852..5ceb3f206 100644 this.motY *= 0.9800000190734863D; this.motZ *= 0.9800000190734863D; -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index f5559bc61a..173441174d 100644 --- a/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -1,4 +1,4 @@ -From a23e0846cb2432daf8507b2f154c35f709946c77 Mon Sep 17 00:00:00 2001 +From ecb394dbc65b8055e6ad852c4544a8a396f94577 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 14:32:43 -0600 Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang @@ -25,10 +25,10 @@ index 220ca7bca0..eb4b08be46 100644 } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ce4bf0a68f..c72bdd29d1 100644 +index 0ebe754619..8dc922ccd0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1205,7 +1205,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -1209,7 +1209,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } public String getServerModName() { @@ -38,10 +38,10 @@ index ce4bf0a68f..c72bdd29d1 100644 public CrashReport b(CrashReport crashreport) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a4112c54ea..567af5b9fa 100644 +index 9ba50a2daa..6414f3d6b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -154,7 +154,7 @@ import org.bukkit.event.server.TabCompleteEvent; +@@ -155,7 +155,7 @@ import org.bukkit.event.server.TabCompleteEvent; import net.md_5.bungee.api.chat.BaseComponent; public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch b/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch index d2828224fd..49018f2a68 100644 --- a/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch @@ -1,11 +1,11 @@ -From ed167340cd2c4dc93a1daf5e1f56c15ef3de5956 Mon Sep 17 00:00:00 2001 +From aee8a7585f861c88ebca81c869f19e645de71abb Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Tue, 1 Mar 2016 14:47:52 -0600 Subject: [PATCH] Player affects spawning API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index c5bc976c79..ca14080ccd 100644 +index 72477ec9ad..63f78924cb 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -72,6 +72,9 @@ public abstract class EntityHuman extends EntityLiving { @@ -19,7 +19,7 @@ index c5bc976c79..ca14080ccd 100644 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 98b28e8573..0cfda190bc 100644 +index d4e688d4c0..ec06f4badb 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -619,7 +619,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -32,11 +32,11 @@ index 98b28e8573..0cfda190bc 100644 double d1 = entityhuman.locY - this.locY; double d2 = entityhuman.locZ - this.locZ; diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java -index 75040a0f21..683191c4a8 100644 +index 850569f6b7..f958bd5bac 100644 --- a/src/main/java/net/minecraft/server/EntitySilverfish.java +++ b/src/main/java/net/minecraft/server/EntitySilverfish.java @@ -96,7 +96,7 @@ public class EntitySilverfish extends EntityMonster { - if (super.a(generatoraccess)) { + if (super.a(generatoraccess, flag)) { EntityHuman entityhuman = generatoraccess.b(this, 5.0D); - return entityhuman == null; @@ -45,7 +45,7 @@ index 75040a0f21..683191c4a8 100644 return false; } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index e54dcaa994..b12e767db9 100644 +index cbdd2431fd..9e24b77ad1 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -37,7 +37,7 @@ public final class SpawnerCreature { @@ -58,10 +58,10 @@ index e54dcaa994..b12e767db9 100644 j = MathHelper.floor(entityhuman.locZ / 16.0D); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 38d169cc14..d0516b0885 100644 +index 30a46a50fb..dc49d9917e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -28,6 +28,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData; +@@ -34,6 +34,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.craftbukkit.util.LongHashSet; // Paper @@ -69,17 +69,17 @@ index 38d169cc14..d0516b0885 100644 import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -@@ -2422,7 +2423,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2432,7 +2433,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -- if (IEntitySelector.e.test(entityhuman)) { -+ if (IEntitySelector.e.test(entityhuman) && entityhuman.affectsSpawning) { // Paper - Affects Spawning API +- if (IEntitySelector.f.test(entityhuman)) { ++ if (IEntitySelector.f.test(entityhuman) && entityhuman.affectsSpawning) { // Paper - Affects Spawning API double d4 = entityhuman.d(d0, d1, d2); if (d3 < 0.0D || d4 < d3 * d3) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 563e90d4dc..cfea81bf78 100644 +index b8bdcb6b74..91e585048a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1628,7 +1628,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch b/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch index 741bf00d81..ddc61cf234 100644 --- a/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch +++ b/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch @@ -1,14 +1,14 @@ -From ea2724d8433bd98200623fc0b3b9c6e9c9a4f406 Mon Sep 17 00:00:00 2001 +From d221792884ce8965482fa88f3e5b5374a300964a Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 1 Mar 2016 15:08:03 -0600 Subject: [PATCH] Remove invalid mob spawner tile entities diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 0a0d04cf6..adf3dee2e 100644 +index bcafd86fb8..8507392628 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -774,6 +774,10 @@ public class Chunk implements IChunkAccess { +@@ -773,6 +773,10 @@ public class Chunk implements IChunkAccess { tileentity.z(); this.tileEntities.put(blockposition, tileentity); // CraftBukkit start diff --git a/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch index a039d081df..9013a8dded 100644 --- a/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch @@ -1,4 +1,4 @@ -From 03261a6b50ee347b4be1165cead324e26e363737 Mon Sep 17 00:00:00 2001 +From d966e6583b4b867cac3037e053195d2cac50e5f0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 Mar 2016 23:09:29 -0600 Subject: [PATCH] Further improve server tick loop @@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c72bdd29d1..687250c639 100644 +index 8dc922ccd0..e8c3dcc244 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -142,7 +142,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -145,7 +145,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati public org.bukkit.command.ConsoleCommandSender console; public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; public ConsoleReader reader; @@ -24,35 +24,37 @@ index c72bdd29d1..687250c639 100644 public final Thread primaryThread; public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; -@@ -150,10 +150,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - public CommandDispatcher vanillaCommandDispatcher; - // CraftBukkit end +@@ -155,7 +155,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // Spigot start -- public static final int TPS = 20; -- public static final int TICK_TIME = 1000000000 / TPS; + public static final int TPS = 20; + public static final int TICK_TIME = 1000000000 / TPS; - private static final int SAMPLE_INTERVAL = 100; -- public final double[] recentTps = new double[ 3 ]; ++ private static final int SAMPLE_INTERVAL = 20; // Paper + public final double[] recentTps = new double[ 3 ]; public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant(); // Spigot end - -@@ -676,12 +672,54 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.isRunning = false; +@@ -685,7 +685,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } -- // Spigot Start -- private static double calcTps(double avg, double exp, double tps) -- { -- return ( avg * exp ) + ( tps * ( 1 - exp ) ); + private boolean aT() { +- return SystemUtils.b() < this.aa; ++ return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own + } + + // Spigot Start +@@ -693,6 +693,53 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + { + return ( avg * exp ) + ( tps * ( 1 - exp ) ); + } ++ + // Paper start - Further improve server tick loop -+ private static final int TPS = 20; + private static final long SEC_IN_NANO = 1000000000; -+ public static final long TICK_TIME = SEC_IN_NANO / TPS; + private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L; -+ private static final int SAMPLE_INTERVAL = 20; ++ private long lastTick = 0; ++ private long catchupTime = 0; + public final RollingAverage tps1 = new RollingAverage(60); + public final RollingAverage tps5 = new RollingAverage(60 * 5); + public final RollingAverage tps15 = new RollingAverage(60 * 15); -+ public double[] recentTps = new double[3]; // Paper - Fine have your darn compat with bad plugins + + public static class RollingAverage { + private final int size; @@ -89,18 +91,18 @@ index c72bdd29d1..687250c639 100644 + public double getAverage() { + return total / time; + } - } -- // Spigot End ++ } + // Paper End + // Spigot End public void run() { - try { -@@ -693,29 +731,46 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -705,29 +752,47 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // Spigot start Arrays.fill( recentTps, 20 ); - long lastTick = System.nanoTime(), catchupTime = 0, curTime, wait, tickSection = lastTick, tickCount = 1; -+ long start = System.nanoTime(), lastTick = start - TICK_TIME, catchupTime = 0, curTime, wait, tickSection = start; // Paper - Further improve server tick loop ++ long start = System.nanoTime(), curTime, wait, tickSection = start; // Paper - Further improve server tick loop ++ lastTick = start - TICK_TIME; // Paper while (this.isRunning) { curTime = System.nanoTime(); - wait = TICK_TIME - (curTime - lastTick) - catchupTime; @@ -151,14 +153,14 @@ index c72bdd29d1..687250c639 100644 - MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit + //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time - this.v(); + this.a(this::aT); this.aa += 50L; // Spigot end diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 567af5b9fa..1c003a3898 100644 +index 6414f3d6b0..f066af3fe5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1844,6 +1844,17 @@ public final class CraftServer implements Server { +@@ -1864,6 +1864,17 @@ public final class CraftServer implements Server { return CraftMagicNumbers.INSTANCE; } diff --git a/Spigot-Server-Patches/0023-Entity-Origin-API.patch b/Spigot-Server-Patches/0023-Entity-Origin-API.patch index ec5407dfb1..1341519f88 100644 --- a/Spigot-Server-Patches/0023-Entity-Origin-API.patch +++ b/Spigot-Server-Patches/0023-Entity-Origin-API.patch @@ -1,11 +1,11 @@ -From 580473495d8bc3798ec58d731342c35d82c5a306 Mon Sep 17 00:00:00 2001 +From 461fec266464fc475ee8800bed57be571fcd9670 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 334f7403f..106cf19d8 100644 +index 15b6067aab..02ac5c4c0c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -162,6 +162,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -16,7 +16,7 @@ index 334f7403f..106cf19d8 100644 // Spigot start public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -1607,6 +1608,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1603,6 +1604,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } } @@ -28,7 +28,7 @@ index 334f7403f..106cf19d8 100644 return nbttagcompound; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT"); -@@ -1749,6 +1755,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1744,6 +1750,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end @@ -42,7 +42,7 @@ index 334f7403f..106cf19d8 100644 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded"); -@@ -1824,6 +1837,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1819,6 +1832,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke protected abstract void b(NBTTagCompound nbttagcompound); @@ -51,7 +51,7 @@ index 334f7403f..106cf19d8 100644 NBTTagList nbttaglist = new NBTTagList(); double[] adouble1 = adouble; diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 5e01aa0f8..33bc46b05 100644 +index 25960cff2a..1fb912eb0d 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -249,6 +249,14 @@ public class EntityFallingBlock extends Entity { @@ -70,7 +70,7 @@ index 5e01aa0f8..33bc46b05 100644 public void a(boolean flag) { diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 5ceb3f206..87f3205f8 100644 +index 5ceb3f2068..87f3205f82 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -109,6 +109,14 @@ public class EntityTNTPrimed extends Entity { @@ -89,7 +89,7 @@ index 5ceb3f206..87f3205f8 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index a8280acf9..38dd8f17a 100644 +index a8280acf94..38dd8f17a6 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java @@ -182,6 +182,7 @@ public class NBTTagList extends NBTList { @@ -101,10 +101,10 @@ index a8280acf9..38dd8f17a 100644 if (i >= 0 && i < this.list.size()) { NBTBase nbtbase = (NBTBase) this.list.get(i); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d0516b088..6bb52c7d4 100644 +index dc49d9917e..be2feb441d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -951,6 +951,12 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -961,6 +961,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int j = MathHelper.floor(entity.locZ / 16.0D); boolean flag = entity.attachedToPlayer; @@ -118,7 +118,7 @@ index d0516b088..6bb52c7d4 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 9fc7ac8c0..249d8115e 100644 +index 9fc7ac8c02..249d8115e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -787,4 +787,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -135,5 +135,5 @@ index 9fc7ac8c0..249d8115e 100644 + // Paper end } -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0024-Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/0024-Prevent-tile-entity-and-entity-crashes.patch index 9469b961c1..21acdfadf5 100644 --- a/Spigot-Server-Patches/0024-Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/0024-Prevent-tile-entity-and-entity-crashes.patch @@ -1,15 +1,15 @@ -From c8f9332ef5ecab31fc5d053393788f0701dd4397 Mon Sep 17 00:00:00 2001 +From 26889dd272c3420365e44b69a9b52eb1e876fdc4 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 Mar 2016 23:52:34 -0600 Subject: [PATCH] Prevent tile entity and entity crashes diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 0d54513a4..d8d519143 100644 +index 68ac014aab..c5212417c6 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -178,7 +178,12 @@ public abstract class TileEntity implements KeyedObject { // Paper - return TileEntityTypes.a.b(this.C()) + " // " + this.getClass().getCanonicalName(); + return IRegistry.BLOCK_ENTITY_TYPE.getKey(this.C()) + " // " + this.getClass().getCanonicalName(); }); if (this.world != null) { - CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock()); @@ -23,10 +23,10 @@ index 0d54513a4..d8d519143 100644 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6bb52c7d4..ada8376e8 100644 +index be2feb441d..0b38093f91 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1177,10 +1177,12 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1190,10 +1190,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.tickTimer.stopTiming(); // Paper } catch (Throwable throwable1) { entity.tickTimer.stopTiming(); @@ -43,7 +43,7 @@ index 6bb52c7d4..ada8376e8 100644 } } -@@ -1243,10 +1245,13 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1256,10 +1258,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc ((ITickable) tileentity).Y_(); this.methodProfiler.e(); } catch (Throwable throwable2) { diff --git a/Spigot-Server-Patches/0025-Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/0025-Configurable-top-of-nether-void-damage.patch index ddbc324dee..19534ea55b 100644 --- a/Spigot-Server-Patches/0025-Configurable-top-of-nether-void-damage.patch +++ b/Spigot-Server-Patches/0025-Configurable-top-of-nether-void-damage.patch @@ -1,11 +1,11 @@ -From 7c9730ec3c04293e069dc8a489a3e3f370fb7a26 Mon Sep 17 00:00:00 2001 +From d80b7a127cccc204af74b7d87ee289ff70515d67 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 23:58:50 -0600 Subject: [PATCH] Configurable top of nether void damage diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 38a697e1b..68898d624 100644 +index 38a697e1b7..68898d624f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -124,4 +124,10 @@ public class PaperWorldConfig { @@ -20,7 +20,7 @@ index 38a697e1b..68898d624 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 106cf19d8..c7acd0629 100644 +index 02ac5c4c0c..f6cdff0ef9 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -462,9 +462,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -54,7 +54,7 @@ index 106cf19d8..c7acd0629 100644 protected void E() { if (this.portalCooldown > 0) { --this.portalCooldown; -@@ -530,6 +544,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -525,6 +539,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.fireTicks = 0; } @@ -63,7 +63,7 @@ index 106cf19d8..c7acd0629 100644 this.die(); } diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index 6e48cf475..4644d7efe 100644 +index 025158675f..932fbff7c7 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java @@ -201,9 +201,15 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT @@ -83,5 +83,5 @@ index 6e48cf475..4644d7efe 100644 int i; -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0026-Check-online-mode-before-converting-and-renaming-pla.patch b/Spigot-Server-Patches/0026-Check-online-mode-before-converting-and-renaming-pla.patch index 7ba1d5947f..82b85eca4e 100644 --- a/Spigot-Server-Patches/0026-Check-online-mode-before-converting-and-renaming-pla.patch +++ b/Spigot-Server-Patches/0026-Check-online-mode-before-converting-and-renaming-pla.patch @@ -1,14 +1,14 @@ -From 08717b8b84b939304bea31bc003e1ee04a3d30fc Mon Sep 17 00:00:00 2001 +From e46af66d39e91ea1e7ebf40c9e48fb40b2dfe506 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 2 Mar 2016 00:03:55 -0600 Subject: [PATCH] Check online mode before converting and renaming player data diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index a5157269c..a562e1e46 100644 +index ee28e4d401..0fd6efec0b 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -169,7 +169,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { +@@ -166,7 +166,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { File file = new File(this.playerDir, entityhuman.bu() + ".dat"); // Spigot Start boolean usingWrongFile = false; diff --git a/Spigot-Server-Patches/0028-Lighting-Queue.patch b/Spigot-Server-Patches/0028-Lighting-Queue.patch index 21185f8d2d..ddd8695dc4 100644 --- a/Spigot-Server-Patches/0028-Lighting-Queue.patch +++ b/Spigot-Server-Patches/0028-Lighting-Queue.patch @@ -1,4 +1,4 @@ -From bd3f0e313c51ef6862f1a954ad030883532ed4d0 Mon Sep 17 00:00:00 2001 +From f8ed7cd4c678343912efeb6d8e785f1be0b92c5f Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 2 Mar 2016 00:52:31 -0600 Subject: [PATCH] Lighting Queue @@ -28,7 +28,7 @@ index 145cb274b0..eff9dcf54f 100644 public static Timing getTickList(WorldServer worldserver, String timingsType) { diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 68898d624f..4b36a0f053 100644 +index 39d565db1f..f0d1ae630e 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -130,4 +130,10 @@ public class PaperWorldConfig { @@ -43,10 +43,10 @@ index 68898d624f..4b36a0f053 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 849d8de69b..01401c4447 100644 +index 8507392628..d2412624e1 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -91,6 +91,7 @@ public class Chunk implements IChunkAccess { +@@ -90,6 +90,7 @@ public class Chunk implements IChunkAccess { return removed; } } @@ -54,7 +54,7 @@ index 849d8de69b..01401c4447 100644 // Paper end public boolean areNeighborsLoaded(final int radius) { switch (radius) { -@@ -281,6 +282,13 @@ public class Chunk implements IChunkAccess { +@@ -280,6 +281,13 @@ public class Chunk implements IChunkAccess { private void g(boolean flag) { this.world.methodProfiler.a("recheckGaps"); if (this.world.areChunksLoaded(new BlockPosition(this.locX * 16 + 8, 0, this.locZ * 16 + 8), 16)) { @@ -67,8 +67,8 @@ index 849d8de69b..01401c4447 100644 + // Paper end for (int i = 0; i < 16; ++i) { for (int j = 0; j < 16; ++j) { - if (this.h[i + j * 16]) { -@@ -524,6 +532,7 @@ public class Chunk implements IChunkAccess { + if (this.g[i + j * 16]) { +@@ -523,6 +531,7 @@ public class Chunk implements IChunkAccess { if (flag1) { this.initLighting(); } else { @@ -76,7 +76,7 @@ index 849d8de69b..01401c4447 100644 int i1 = iblockdata.b(this.world, blockposition); int j1 = iblockdata1.b(this.world, blockposition); -@@ -531,6 +540,7 @@ public class Chunk implements IChunkAccess { +@@ -530,6 +539,7 @@ public class Chunk implements IChunkAccess { if (i1 != j1 && (i1 < j1 || this.getBrightness(EnumSkyBlock.SKY, blockposition) > 0 || this.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 0)) { this.c(i, k); } @@ -84,8 +84,8 @@ index 849d8de69b..01401c4447 100644 } TileEntity tileentity; -@@ -1299,6 +1309,16 @@ public class Chunk implements IChunkAccess { - return this.E == 8; +@@ -1300,6 +1310,16 @@ public class Chunk implements IChunkAccess { + return this.D == 8; } + // Paper start @@ -102,10 +102,10 @@ index 849d8de69b..01401c4447 100644 IMMEDIATE, QUEUED, CHECK; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index aabdc9e2f0..d025d949e3 100644 +index 0034956af9..1379b574ef 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -333,6 +333,7 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -314,6 +314,7 @@ public class ChunkProviderServer implements IChunkProvider { return false; } save = event.isSaveChunk(); @@ -114,11 +114,11 @@ index aabdc9e2f0..d025d949e3 100644 // Update neighbor counts for (int x = -2; x < 3; x++) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6fbf841f06..9dc9668c45 100644 +index e8c3dcc244..c47f56ed8d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -864,7 +864,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - protected void v() { +@@ -886,7 +886,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + protected void a(BooleanSupplier booleansupplier) { co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot - long i = SystemUtils.c(); @@ -126,7 +126,7 @@ index 6fbf841f06..9dc9668c45 100644 ++this.ticks; if (this.S) { -@@ -922,6 +922,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -944,6 +944,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati this.methodProfiler.e(); this.methodProfiler.e(); org.spigotmc.WatchdogThread.tick(); // Spigot @@ -136,7 +136,7 @@ index 6fbf841f06..9dc9668c45 100644 } diff --git a/src/main/java/net/minecraft/server/PaperLightingQueue.java b/src/main/java/net/minecraft/server/PaperLightingQueue.java new file mode 100644 -index 0000000000..345cd58240 +index 0000000000..60562f1fd2 --- /dev/null +++ b/src/main/java/net/minecraft/server/PaperLightingQueue.java @@ -0,0 +1,92 @@ @@ -159,7 +159,7 @@ index 0000000000..345cd58240 + final long maxTickTime = MAX_TIME - (startTime - curTime); + + START: -+ for (World world : MinecraftServer.getServer().worlds) { ++ for (World world : MinecraftServer.getServer().getWorlds()) { + if (!world.paperConfig.queueLightUpdates) { + continue; + } @@ -233,10 +233,10 @@ index 0000000000..345cd58240 + } +} diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ada8376e8c..776882ba4f 100644 +index 0b38093f91..93d1449750 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -325,7 +325,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -335,7 +335,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (iblockdata2.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata2.e() != iblockdata1.e()) { this.methodProfiler.a("checkLight"); diff --git a/Spigot-Server-Patches/0029-Configurable-end-credits.patch b/Spigot-Server-Patches/0029-Configurable-end-credits.patch index 25a25ba8b2..8a617ba9a6 100644 --- a/Spigot-Server-Patches/0029-Configurable-end-credits.patch +++ b/Spigot-Server-Patches/0029-Configurable-end-credits.patch @@ -1,4 +1,4 @@ -From e017ff95e08c7717f7bc428735b97eacfa48f9cd Mon Sep 17 00:00:00 2001 +From 07cd7c6cb6ebf9dabf473e6f87e56756bb943d51 Mon Sep 17 00:00:00 2001 From: DoctorDark Date: Wed, 16 Mar 2016 02:21:39 -0500 Subject: [PATCH] Configurable end credits @@ -20,25 +20,25 @@ index 4b36a0f053..53921b381e 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3a04cac5c9..2dc70ffbf0 100644 +index 3112ee5453..9f23c0d2c2 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -62,7 +62,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - private long cv = SystemUtils.b(); - private Entity cw; +@@ -61,7 +61,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + private long cu = SystemUtils.b(); + private Entity cv; public boolean worldChangeInvuln; -- private boolean cy; -+ private boolean cy; private void setHasSeenCredits(boolean has) { this.cy = has; } // Paper - OBFHELPER - private final RecipeBookServer cz; - private Vec3D cA; - private int cB; -@@ -634,6 +634,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +- private boolean cx; ++ private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER + private final RecipeBookServer cy; + private Vec3D cz; + private int cA; +@@ -648,6 +648,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.world.kill(this); if (!this.viewingCredits) { this.viewingCredits = true; + if (world.paperConfig.disableEndCredits) this.setHasSeenCredits(true); // Paper - Toggle to always disable end credits - this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cy ? 0.0F : 1.0F)); - this.cy = true; + this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cx ? 0.0F : 1.0F)); + this.cx = true; } -- 2.18.0 diff --git a/Spigot-Server-Patches/0030-Fix-lag-from-explosions-processing-dead-entities.patch b/Spigot-Server-Patches/0030-Fix-lag-from-explosions-processing-dead-entities.patch index 30b68399bc..e1da712c4a 100644 --- a/Spigot-Server-Patches/0030-Fix-lag-from-explosions-processing-dead-entities.patch +++ b/Spigot-Server-Patches/0030-Fix-lag-from-explosions-processing-dead-entities.patch @@ -1,14 +1,14 @@ -From 9b56f5d637b6d50dc41d75c71e609141ae9174a7 Mon Sep 17 00:00:00 2001 +From 75395ac93dd5164936ba8c355b41edd55a8a1483 Mon Sep 17 00:00:00 2001 From: Iceee Date: Wed, 2 Mar 2016 01:39:52 -0600 Subject: [PATCH] Fix lag from explosions processing dead entities diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 37e6e5922..6b9f6c956 100644 +index e5ba6eddd3..439d7ef40c 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -110,7 +110,14 @@ public class Explosion { +@@ -111,7 +111,14 @@ public class Explosion { int i1 = MathHelper.floor(this.posY + (double) f3 + 1.0D); int j1 = MathHelper.floor(this.posZ - (double) f3 - 1.0D); int k1 = MathHelper.floor(this.posZ + (double) f3 + 1.0D); diff --git a/Spigot-Server-Patches/0031-Optimize-explosions.patch b/Spigot-Server-Patches/0031-Optimize-explosions.patch index 45e40840dd..35f3414717 100644 --- a/Spigot-Server-Patches/0031-Optimize-explosions.patch +++ b/Spigot-Server-Patches/0031-Optimize-explosions.patch @@ -1,4 +1,4 @@ -From de1dc6533183312e946c2138dc81c82ce73a9def Mon Sep 17 00:00:00 2001 +From 4c8a9a911c8fa1fbd7920c736e653b5dc3976cb8 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 2 Mar 2016 11:59:48 -0600 Subject: [PATCH] Optimize explosions @@ -10,7 +10,7 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 53921b381..ae4a7cb09 100644 +index aa2f5414b0..bd1ac77aef 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -142,4 +142,10 @@ public class PaperWorldConfig { @@ -25,10 +25,10 @@ index 53921b381..ae4a7cb09 100644 + } } diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index e558a3a57..18c55402d 100644 +index 439d7ef40c..e440d6d631 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -136,7 +136,7 @@ public class Explosion { +@@ -137,7 +137,7 @@ public class Explosion { d8 /= d11; d9 /= d11; d10 /= d11; @@ -37,7 +37,7 @@ index e558a3a57..18c55402d 100644 double d13 = (1.0D - d7) * d12; // CraftBukkit start -@@ -312,4 +312,85 @@ public class Explosion { +@@ -313,4 +313,85 @@ public class Explosion { public List getBlocks() { return this.blocks; } @@ -124,22 +124,22 @@ index e558a3a57..18c55402d 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1ac8d61cd..96d31f874 100644 +index c47f56ed8d..bdc779ef3b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1029,6 +1029,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -1051,6 +1051,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati worldserver.getTracker().updatePlayers(); this.methodProfiler.e(); this.methodProfiler.e(); + worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions } + } - // this.f[i][this.ticks % 100] = SystemUtils.c() - j; // CraftBukkit diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c40ecbc0c..1ca3eef11 100644 +index 93d1449750..9e192b7c04 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -18,6 +18,7 @@ import org.apache.logging.log4j.Logger; +@@ -24,6 +24,7 @@ import org.apache.logging.log4j.Logger; // CraftBukkit start import com.google.common.collect.Maps; @@ -147,7 +147,7 @@ index c40ecbc0c..1ca3eef11 100644 import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.block.BlockState; -@@ -138,6 +139,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -145,6 +146,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; private int tileTickPosition; diff --git a/Spigot-Server-Patches/0032-Add-player-view-distance-API.patch b/Spigot-Server-Patches/0032-Add-player-view-distance-API.patch index ee5885d43b..3824835cd3 100644 --- a/Spigot-Server-Patches/0032-Add-player-view-distance-API.patch +++ b/Spigot-Server-Patches/0032-Add-player-view-distance-API.patch @@ -1,14 +1,14 @@ -From 45c7985fc49421f76238abbef111ffa5997b7270 Mon Sep 17 00:00:00 2001 +From 8cf00241b984108b5fa89837e961d8c767833922 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 2 Mar 2016 14:35:27 -0600 Subject: [PATCH] Add player view distance API diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 2dc70ffbf0..b66df45bde 100644 +index 9f23c0d2c2..b44d056651 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -72,6 +72,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -71,6 +71,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public boolean f; public int ping; public boolean viewingCredits; @@ -203,7 +203,7 @@ index d975c2ccf1..6ece565c51 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 15023a4563..43b27ea7c2 100644 +index 8ecef3ff96..3cc16b6923 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1641,6 +1641,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0033-Disable-explosion-knockback.patch b/Spigot-Server-Patches/0033-Disable-explosion-knockback.patch index 8bfd1d490e..4f3a0b3d2b 100644 --- a/Spigot-Server-Patches/0033-Disable-explosion-knockback.patch +++ b/Spigot-Server-Patches/0033-Disable-explosion-knockback.patch @@ -1,4 +1,4 @@ -From 2e59841e1c882aa53a07a65e704833c05aaab624 Mon Sep 17 00:00:00 2001 +From f66b7805e8b3749a50b005653714f54c6d93a214 Mon Sep 17 00:00:00 2001 From: Sudzzy Date: Wed, 2 Mar 2016 14:48:03 -0600 Subject: [PATCH] Disable explosion knockback @@ -19,39 +19,39 @@ index ae4a7cb097..f2f45ae4a6 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1722855ac5..af595bf2bc 100644 +index 8a41a1dca8..dd216c64e9 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1005,6 +1005,7 @@ public abstract class EntityLiving extends Entity { - } +@@ -1006,6 +1006,7 @@ public abstract class EntityLiving extends Entity { } + } + boolean knockbackCancelled = world.paperConfig.disableExplosionKnockback && damagesource.isExplosion() && this instanceof EntityHuman; // Paper - Disable explosion knockback - if (flag1) { - if (flag) { - this.world.broadcastEntityEffect(this, (byte) 29); -@@ -1021,6 +1022,7 @@ public abstract class EntityLiving extends Entity { - b0 = 2; - } + if (flag1) { + if (flag) { + this.world.broadcastEntityEffect(this, (byte) 29); +@@ -1022,6 +1023,7 @@ public abstract class EntityLiving extends Entity { + b0 = 2; + } + if (!knockbackCancelled) // Paper - Disable explosion knockback - this.world.broadcastEntityEffect(this, b0); - } - -@@ -1044,6 +1046,8 @@ public abstract class EntityLiving extends Entity { - } + this.world.broadcastEntityEffect(this, b0); } +@@ -1045,6 +1047,8 @@ public abstract class EntityLiving extends Entity { + } + } + + if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback + - if (this.getHealth() <= 0.0F) { - if (!this.e(damagesource)) { - SoundEffect soundeffect = this.cs(); + if (this.getHealth() <= 0.0F) { + if (!this.e(damagesource)) { + SoundEffect soundeffect = this.cs(); diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 18c55402d9..7c676f9f34 100644 +index e440d6d631..3521d9e10c 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -152,7 +152,7 @@ public class Explosion { +@@ -153,7 +153,7 @@ public class Explosion { double d14 = d13; if (entity instanceof EntityLiving) { @@ -60,7 +60,7 @@ index 18c55402d9..7c676f9f34 100644 } entity.motX += d8 * d14; -@@ -161,7 +161,7 @@ public class Explosion { +@@ -162,7 +162,7 @@ public class Explosion { if (entity instanceof EntityHuman) { EntityHuman entityhuman = (EntityHuman) entity; diff --git a/Spigot-Server-Patches/0039-Configurable-container-update-tick-rate.patch b/Spigot-Server-Patches/0039-Configurable-container-update-tick-rate.patch index 48febbbd93..bb0654da06 100644 --- a/Spigot-Server-Patches/0039-Configurable-container-update-tick-rate.patch +++ b/Spigot-Server-Patches/0039-Configurable-container-update-tick-rate.patch @@ -1,4 +1,4 @@ -From 481e2235aad6d8ad72f169278fbb3da2f4a379a0 Mon Sep 17 00:00:00 2001 +From 3ddade42184d1b9996b47cf251dd031f40beb530 Mon Sep 17 00:00:00 2001 From: Sudzzy Date: Wed, 2 Mar 2016 23:34:44 -0600 Subject: [PATCH] Configurable container update tick rate @@ -19,10 +19,10 @@ index 59bd3e28f0..f8d2aae082 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index b66df45bde..0b1c5ca475 100644 +index b44d056651..a9b08dcb0e 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -81,6 +81,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -80,6 +80,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.viewDistance = viewDistance; } // Paper end @@ -30,7 +30,7 @@ index b66df45bde..0b1c5ca475 100644 // CraftBukkit start public String displayName; -@@ -344,7 +345,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -343,7 +344,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { --this.noDamageTicks; } diff --git a/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch b/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch index f6ea2f8a2d..27c4da636b 100644 --- a/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch +++ b/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch @@ -1,14 +1,14 @@ -From b75dfb48523ff1f251bdce49dce849ad921b53d1 Mon Sep 17 00:00:00 2001 +From e7d0420983298221e86f3959e98a9acd7cbcc059 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 2 Mar 2016 23:45:17 -0600 Subject: [PATCH] Disable spigot tick limiters diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 4a6e3c403..aed5e4330 100644 +index 9e192b7c04..8b90b13d15 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1154,10 +1154,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1167,10 +1167,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit start - Use field for loop variable co.aikar.timings.TimingHistory.entityTicks += this.entityList.size(); // Paper int entitiesThisCycle = 0; @@ -23,7 +23,7 @@ index 4a6e3c403..aed5e4330 100644 tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0; entity = (Entity) this.entityList.get(this.tickPosition); // CraftBukkit end -@@ -1221,9 +1221,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1234,9 +1234,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // Spigot start // Iterator iterator = this.tileEntityListTick.iterator(); int tilesThisCycle = 0; diff --git a/Spigot-Server-Patches/0045-Ensure-commands-are-not-ran-async.patch b/Spigot-Server-Patches/0045-Ensure-commands-are-not-ran-async.patch index 707bf17240..935990f30f 100644 --- a/Spigot-Server-Patches/0045-Ensure-commands-are-not-ran-async.patch +++ b/Spigot-Server-Patches/0045-Ensure-commands-are-not-ran-async.patch @@ -1,4 +1,4 @@ -From 92075bd693c6b7c695b63e21d5570a9c952c8984 Mon Sep 17 00:00:00 2001 +From 0aab182446c577dec9f7bec0dc0973ea874945b7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Mar 2016 01:17:12 -0600 Subject: [PATCH] Ensure commands are not ran async @@ -14,10 +14,10 @@ big slowdown in execution but throwing an exception at same time to raise awaren that it is happening so that plugin authors can fix their code to stop executing commands async. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 5d42cfe81c..dc38e4e043 100644 +index 37284fae4d..3257f41713 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1548,6 +1548,29 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1558,6 +1558,29 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } if (!async && s.startsWith("/")) { @@ -48,10 +48,10 @@ index 5d42cfe81c..dc38e4e043 100644 } else if (this.player.getChatFlags() == EntityHuman.EnumChatVisibility.SYSTEM) { // Do nothing, this is coming from a plugin diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 1c003a3898..d9cba38080 100644 +index f066af3fe5..e047d68f3e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -691,6 +691,29 @@ public final class CraftServer implements Server { +@@ -692,6 +692,29 @@ public final class CraftServer implements Server { Validate.notNull(commandLine, "CommandLine cannot be null"); org.spigotmc.AsyncCatcher.catchOp( "command dispatch" ); // Spigot diff --git a/Spigot-Server-Patches/0046-All-chunks-are-slime-spawn-chunks-toggle.patch b/Spigot-Server-Patches/0046-All-chunks-are-slime-spawn-chunks-toggle.patch index 34dd25e029..ae58fd8ef3 100644 --- a/Spigot-Server-Patches/0046-All-chunks-are-slime-spawn-chunks-toggle.patch +++ b/Spigot-Server-Patches/0046-All-chunks-are-slime-spawn-chunks-toggle.patch @@ -1,11 +1,11 @@ -From 8d686401dc81d0556b8c9157171301b1b0661901 Mon Sep 17 00:00:00 2001 +From 53637e35e4d08e9a4d50f0c1b2416fb12097d3f2 Mon Sep 17 00:00:00 2001 From: vemacs Date: Thu, 3 Mar 2016 01:19:22 -0600 Subject: [PATCH] All chunks are slime spawn chunks toggle diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index d91b48b0a..7d1f6cde9 100644 +index d91b48b0ae..7d1f6cde94 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -178,4 +178,9 @@ public class PaperWorldConfig { @@ -19,18 +19,18 @@ index d91b48b0a..7d1f6cde9 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index 31e066b54..eeaf98e82 100644 +index 9e0df95607..238f3c7926 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -252,7 +252,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { } ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition); -- boolean flag = SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot -+ boolean flag = world.paperConfig.allChunksAreSlimeChunks || SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper - add allChunksAreSlime +- boolean flag1 = SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot ++ boolean flag1 = world.paperConfig.allChunksAreSlimeChunks || SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper - add allChunksAreSlime - if (this.random.nextInt(10) == 0 && flag && this.locY < 40.0D) { - return super.a(generatoraccess); + if (this.random.nextInt(10) == 0 && flag1 && this.locY < 40.0D) { + return super.a(generatoraccess, flag); -- 2.18.0 diff --git a/Spigot-Server-Patches/0048-Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/0048-Avoid-hopper-searches-if-there-are-no-items.patch index 1a986f5834..ae8a9aba13 100644 --- a/Spigot-Server-Patches/0048-Avoid-hopper-searches-if-there-are-no-items.patch +++ b/Spigot-Server-Patches/0048-Avoid-hopper-searches-if-there-are-no-items.patch @@ -1,4 +1,4 @@ -From 09dde82aeb83b408f1256e9ce7fefde0ced411ba Mon Sep 17 00:00:00 2001 +From 1df9f23dc917c635bee6505b3ea3d08e0179f328 Mon Sep 17 00:00:00 2001 From: CullanP Date: Thu, 3 Mar 2016 02:13:38 -0600 Subject: [PATCH] Avoid hopper searches if there are no items @@ -14,10 +14,10 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear Combined, this adds up a lot. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 01401c4447..57ebd1e77a 100644 +index d2412624e1..ef09ac7873 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -92,6 +92,10 @@ public class Chunk implements IChunkAccess { +@@ -91,6 +91,10 @@ public class Chunk implements IChunkAccess { } } final PaperLightingQueue.LightingQueue lightingQueue = new PaperLightingQueue.LightingQueue(this); @@ -28,7 +28,7 @@ index 01401c4447..57ebd1e77a 100644 // Paper end public boolean areNeighborsLoaded(final int radius) { switch (radius) { -@@ -685,6 +689,11 @@ public class Chunk implements IChunkAccess { +@@ -684,6 +688,11 @@ public class Chunk implements IChunkAccess { entity.ag = this.locZ; this.entitySlices[k].add(entity); // Paper start @@ -40,7 +40,7 @@ index 01401c4447..57ebd1e77a 100644 entity.setCurrentChunk(this); entityCounts.increment(entity.getMinecraftKeyString()); // Paper end -@@ -710,6 +719,11 @@ public class Chunk implements IChunkAccess { +@@ -709,6 +718,11 @@ public class Chunk implements IChunkAccess { if (!this.entitySlices[i].remove(entity)) { return; } @@ -52,7 +52,7 @@ index 01401c4447..57ebd1e77a 100644 entity.setCurrentChunk(null); entityCounts.decrement(entity.getMinecraftKeyString()); // Paper end -@@ -910,6 +924,15 @@ public class Chunk implements IChunkAccess { +@@ -911,6 +925,15 @@ public class Chunk implements IChunkAccess { if (!this.entitySlices[k].isEmpty()) { Iterator iterator = this.entitySlices[k].iterator(); @@ -68,7 +68,7 @@ index 01401c4447..57ebd1e77a 100644 while (iterator.hasNext()) { Entity entity1 = (Entity) iterator.next(); -@@ -946,7 +969,18 @@ public class Chunk implements IChunkAccess { +@@ -947,7 +970,18 @@ public class Chunk implements IChunkAccess { i = MathHelper.clamp(i, 0, this.entitySlices.length - 1); j = MathHelper.clamp(j, 0, this.entitySlices.length - 1); diff --git a/Spigot-Server-Patches/0049-Expose-server-CommandMap.patch b/Spigot-Server-Patches/0049-Expose-server-CommandMap.patch index 62394050b9..7d1d54541d 100644 --- a/Spigot-Server-Patches/0049-Expose-server-CommandMap.patch +++ b/Spigot-Server-Patches/0049-Expose-server-CommandMap.patch @@ -1,14 +1,14 @@ -From d517d0ead223fc0a5da5f4c77692abf9ee5203d0 Mon Sep 17 00:00:00 2001 +From 8bee6fed99116e8b3f4119b9e2c82c1d2cf0f30d Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 3 Mar 2016 02:15:57 -0600 Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d9cba38080..5230867326 100644 +index e047d68f3e..6a7bdb9ab6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1589,6 +1589,7 @@ public final class CraftServer implements Server { +@@ -1609,6 +1609,7 @@ public final class CraftServer implements Server { return helpMap; } diff --git a/Spigot-Server-Patches/0051-Player-Tab-List-and-Title-APIs.patch b/Spigot-Server-Patches/0051-Player-Tab-List-and-Title-APIs.patch index 99310228b5..00e832e992 100644 --- a/Spigot-Server-Patches/0051-Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-Server-Patches/0051-Player-Tab-List-and-Title-APIs.patch @@ -1,45 +1,11 @@ -From 5e67ca7f673b8643db71ce3c7923352e31be10b1 Mon Sep 17 00:00:00 2001 +From 5e5577be71456db68a07895d330eb51ef93d542a Mon Sep 17 00:00:00 2001 From: Techcable Date: Thu, 3 Mar 2016 02:32:10 -0600 Subject: [PATCH] Player Tab List and Title APIs -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java -index d7c583a71..7096799c5 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java -@@ -6,6 +6,7 @@ public class PacketPlayOutPlayerListHeaderFooter implements Packet { @@ -77,7 +43,7 @@ index 7b18c1640..900bd8357 100644 if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 02d2c00c0..0beb10f82 100644 +index 3cc16b6923..eceba690af 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,6 @@ @@ -87,17 +53,15 @@ index 02d2c00c0..0beb10f82 100644 import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.io.BaseEncoding; -@@ -203,6 +204,85 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -203,6 +204,83 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } + // Paper start + @Override + public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) { -+ PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter(); -+ packet.header = header; -+ packet.footer = footer; -+ getHandle().playerConnection.sendPacket(packet); ++ setPlayerListHeader(header == null ? null : net.md_5.bungee.chat.ComponentSerializer.toString(header)); ++ setPlayerListFooter(footer == null ? null : net.md_5.bungee.chat.ComponentSerializer.toString(footer)); + } + + @Override diff --git a/Spigot-Server-Patches/0053-Change-implementation-of-tile-entity-removal-list.patch b/Spigot-Server-Patches/0053-Change-implementation-of-tile-entity-removal-list.patch index 3546ca508c..27b5a9c5ec 100644 --- a/Spigot-Server-Patches/0053-Change-implementation-of-tile-entity-removal-list.patch +++ b/Spigot-Server-Patches/0053-Change-implementation-of-tile-entity-removal-list.patch @@ -1,40 +1,28 @@ -From 03080d8f95d78cbce3ab4467477b14185dcdcc88 Mon Sep 17 00:00:00 2001 +From 5a524473ad69a38c362a3f2fc90811f9d2ffe8ba Mon Sep 17 00:00:00 2001 From: Joseph Hirschfeld Date: Thu, 3 Mar 2016 02:39:54 -0600 Subject: [PATCH] Change implementation of (tile)entity removal list diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index aed5e4330..f6d7070de 100644 +index 8b90b13d15..9fb87914ff 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -35,7 +35,10 @@ import org.bukkit.event.block.BlockPhysicsEvent; - import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; - import org.bukkit.generator.ChunkGenerator; - // CraftBukkit end -- -+// Paper start -+import java.util.Set; -+import com.google.common.collect.Sets; -+// Paper end - public abstract class World implements GeneratorAccess, IIBlockAccess, AutoCloseable { - - protected static final Logger e = LogManager.getLogger(); -@@ -67,11 +70,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -73,11 +73,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } }; // Spigot end - protected final List g = Lists.newArrayList(); -+ protected final Set g = Sets.newHashSet(); // Paper ++ protected final Set g = com.google.common.collect.Sets.newHashSet(); // Paper public final List tileEntityList = Lists.newArrayList(); public final List tileEntityListTick = Lists.newArrayList(); private final List c = Lists.newArrayList(); - private final List tileEntityListUnload = Lists.newArrayList(); -+ private final Set tileEntityListUnload = Sets.newHashSet(); // Paper ++ private final Set tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper public final List players = Lists.newArrayList(); public final List k = Lists.newArrayList(); protected final IntHashMap entitiesById = new IntHashMap(); -@@ -1125,20 +1128,20 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1138,20 +1138,20 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.entityList.removeAll(this.g); int j; diff --git a/Spigot-Server-Patches/0054-Add-configurable-portal-search-radius.patch b/Spigot-Server-Patches/0054-Add-configurable-portal-search-radius.patch index be54590595..a666e78ae8 100644 --- a/Spigot-Server-Patches/0054-Add-configurable-portal-search-radius.patch +++ b/Spigot-Server-Patches/0054-Add-configurable-portal-search-radius.patch @@ -1,11 +1,11 @@ -From c75d946dc9c6bf4a6fae51cbe0ef7bf3e4b506ad Mon Sep 17 00:00:00 2001 +From 34714cc6991d2727f764745fdae5a08c88a8e87f Mon Sep 17 00:00:00 2001 From: Joseph Hirschfeld Date: Thu, 3 Mar 2016 02:46:17 -0600 Subject: [PATCH] Add configurable portal search radius diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 7d1f6cde9..c98286999 100644 +index 7d1f6cde94..c982869995 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -183,4 +183,9 @@ public class PaperWorldConfig { @@ -19,7 +19,7 @@ index 7d1f6cde9..c98286999 100644 + } } diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index 0cb1eeb68..402d8d7d6 100644 +index 73d5b4d625..5e899e05cf 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -13,7 +13,7 @@ import org.bukkit.util.Vector; @@ -41,10 +41,10 @@ index 0cb1eeb68..402d8d7d6 100644 return false; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java -index 1d5dce10e..7ca2617a8 100644 +index d4639c8221..e1eb3aa0f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java -@@ -11,7 +11,7 @@ public class CraftTravelAgent extends PortalTravelAgent implements TravelAgent { +@@ -12,7 +12,7 @@ public class CraftTravelAgent extends PortalTravelAgent implements TravelAgent { public static TravelAgent DEFAULT = null; diff --git a/Spigot-Server-Patches/0055-Add-velocity-warnings.patch b/Spigot-Server-Patches/0055-Add-velocity-warnings.patch index 48cc4388ec..076ea895cd 100644 --- a/Spigot-Server-Patches/0055-Add-velocity-warnings.patch +++ b/Spigot-Server-Patches/0055-Add-velocity-warnings.patch @@ -1,14 +1,14 @@ -From 50d67616ec3a1650dfe76984418cfbe1cadaf22a Mon Sep 17 00:00:00 2001 +From 3adf13e17f92b08fbb27e257a72a0b0627ce6a89 Mon Sep 17 00:00:00 2001 From: Joseph Hirschfeld Date: Thu, 3 Mar 2016 02:48:12 -0600 Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 5230867326..53adc9e1a0 100644 +index 6a7bdb9ab6..bd99aa72c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -191,6 +191,7 @@ public final class CraftServer implements Server { +@@ -192,6 +192,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; diff --git a/Spigot-Server-Patches/0056-Configurable-inter-world-teleportation-safety.patch b/Spigot-Server-Patches/0056-Configurable-inter-world-teleportation-safety.patch index f51da3e93b..78fe7639ab 100644 --- a/Spigot-Server-Patches/0056-Configurable-inter-world-teleportation-safety.patch +++ b/Spigot-Server-Patches/0056-Configurable-inter-world-teleportation-safety.patch @@ -1,4 +1,4 @@ -From 3f536bfd455a44b15393e44e9798065e38949ed3 Mon Sep 17 00:00:00 2001 +From 4a30598e11988808422e02822c399e739869d129 Mon Sep 17 00:00:00 2001 From: Sudzzy Date: Thu, 3 Mar 2016 02:50:31 -0600 Subject: [PATCH] Configurable inter-world teleportation safety @@ -16,7 +16,7 @@ The wanted destination was on top of the emerald block however the player ended This only is the case if the player is teleporting between worlds. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index c98286999..4a2d29674 100644 +index c982869995..4a2d296746 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -188,4 +188,9 @@ public class PaperWorldConfig { @@ -30,10 +30,10 @@ index c98286999..4a2d29674 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 90cb2d277..8b3c2d287 100644 +index 4320efaef5..9f2c7d3f45 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -798,7 +798,7 @@ public abstract class PlayerList { +@@ -792,7 +792,7 @@ public abstract class PlayerList { exitWorld.getTravelAgent().adjustExit(entityplayer, exit, velocity); entityplayer.worldChangeInvuln = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds @@ -43,10 +43,10 @@ index 90cb2d277..8b3c2d287 100644 entityplayer.getBukkitEntity().setVelocity(velocity); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0beb10f82..59e60923b 100644 +index 8db92714ea..86f485e6ff 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -703,7 +703,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -701,7 +701,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (fromWorld == toWorld) { entity.playerConnection.teleport(to); } else { diff --git a/Spigot-Server-Patches/0057-Add-exception-reporting-event.patch b/Spigot-Server-Patches/0057-Add-exception-reporting-event.patch index 04a4fc3e45..452048ee4b 100644 --- a/Spigot-Server-Patches/0057-Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/0057-Add-exception-reporting-event.patch @@ -1,4 +1,4 @@ -From e5d5c2bc2903a9b5d5399f3a709c2737560ee32b Mon Sep 17 00:00:00 2001 +From 5e1e6450f4fda96b2b9ab63bd59a16dad95fba6e Mon Sep 17 00:00:00 2001 From: Joseph Hirschfeld Date: Thu, 3 Mar 2016 03:15:41 -0600 Subject: [PATCH] Add exception reporting event @@ -6,7 +6,7 @@ Subject: [PATCH] Add exception reporting event diff --git a/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java new file mode 100644 -index 000000000..93397188b +index 0000000000..93397188b7 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java @@ -0,0 +1,38 @@ @@ -50,7 +50,7 @@ index 000000000..93397188b +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index ea7d82f09..ec43c2659 100644 +index ef09ac7873..1131a092af 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -1,5 +1,6 @@ @@ -60,16 +60,7 @@ index ea7d82f09..ec43c2659 100644 import com.google.common.collect.Maps; import com.google.common.collect.Queues; import com.google.common.collect.Sets; -@@ -24,6 +25,8 @@ import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; - - import com.google.common.collect.Lists; // CraftBukkit -+import org.bukkit.Server; // CraftBukkit -+import org.bukkit.craftbukkit.util.CraftMagicNumbers; // Paper - - public class Chunk implements IChunkAccess { - -@@ -427,6 +430,7 @@ public class Chunk implements IChunkAccess { +@@ -426,6 +427,7 @@ public class Chunk implements IChunkAccess { return this.getBlockData(i, j, k).b(this.world, new BlockPosition(i, j, k)); } @@ -77,7 +68,7 @@ index ea7d82f09..ec43c2659 100644 public IBlockData getType(BlockPosition blockposition) { return this.getBlockData(blockposition.getX(), blockposition.getY(), blockposition.getZ()); } -@@ -803,10 +807,15 @@ public class Chunk implements IChunkAccess { +@@ -802,10 +804,15 @@ public class Chunk implements IChunkAccess { this.tileEntities.remove(blockposition); // Paper end } else { @@ -89,7 +80,7 @@ index ea7d82f09..ec43c2659 100644 + ServerInternalException e = new ServerInternalException( + "Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + + tileentity.position.getY() + "," + tileentity.position.getZ() -+ + " (" + CraftMagicNumbers.getMaterial(getBlockData(blockposition).getBlock()) + ") where there was no entity tile!\n" + ++ + " (" + getBlockData(blockposition) + ") where there was no entity tile!\n" + + "Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); + e.printStackTrace(); + ServerInternalException.reportInternalException(e); @@ -98,10 +89,10 @@ index ea7d82f09..ec43c2659 100644 } } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index d025d949e..0e04d6598 100644 +index 1379b574ef..6b041f06e4 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -17,6 +17,7 @@ import java.util.concurrent.ExecutionException; +@@ -15,6 +15,7 @@ import java.util.function.BooleanSupplier; import java.util.function.Consumer; import java.util.function.Function; import javax.annotation.Nullable; @@ -109,20 +100,7 @@ index d025d949e..0e04d6598 100644 import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -225,7 +226,11 @@ public class ChunkProviderServer implements IChunkProvider { - try { - // this.chunkLoader.a(this.world, chunk); // Spigot - } catch (Exception exception) { -- ChunkProviderServer.a.error("Couldn\'t save entities", exception); -+ // Paper start -+ String msg = "Couldn\'t save entities"; -+ ChunkProviderServer.a.error(msg, exception); -+ ServerInternalException.reportInternalException(exception); -+ // Paper end - } - - } -@@ -235,9 +240,14 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -209,9 +210,14 @@ public class ChunkProviderServer implements IChunkProvider { ichunkaccess.setLastSaved(this.world.getTime()); this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot } catch (IOException ioexception) { @@ -140,7 +118,7 @@ index d025d949e..0e04d6598 100644 } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index 33e5aaf2c..f13534917 100644 +index 1d830dff64..58d971cf20 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -1,5 +1,6 @@ @@ -166,35 +144,8 @@ index 33e5aaf2c..f13534917 100644 } } // CraftBukkit end -diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java -index 6b5600ba5..72f386720 100644 ---- a/src/main/java/net/minecraft/server/PersistentCollection.java -+++ b/src/main/java/net/minecraft/server/PersistentCollection.java -@@ -1,5 +1,6 @@ - package net.minecraft.server; - -+import com.destroystokyo.paper.exception.ServerInternalException; - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; - import com.mojang.datafixers.DataFixTypes; -@@ -74,6 +75,7 @@ public class PersistentCollection { - nbttagcompound = GameProfileSerializer.a(this.c.i(), DataFixTypes.SAVED_DATA, nbttagcompound1, j, i); - } catch (Throwable throwable1) { - throwable = throwable1; -+ ServerInternalException.reportInternalException(throwable1); // Paper - throw throwable1; - } finally { - if (fileinputstream != null) { -@@ -131,6 +133,7 @@ public class PersistentCollection { - } - } catch (Exception exception) { - exception.printStackTrace(); -+ ServerInternalException.reportInternalException(exception); // Paper - } - - } diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 31899549d..cc7cad8be 100644 +index 31899549d5..cc7cad8be4 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -1,5 +1,6 @@ @@ -221,7 +172,7 @@ index 31899549d..cc7cad8be 100644 } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 0e91aeec3..ff473a263 100644 +index d18921271f..e5115863ec 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -1,5 +1,6 @@ @@ -231,7 +182,7 @@ index 0e91aeec3..ff473a263 100644 import com.google.common.collect.Maps; import java.io.DataInputStream; import java.io.DataOutputStream; -@@ -69,6 +70,7 @@ public class RegionFileCache { +@@ -71,6 +72,7 @@ public class RegionFileCache { } } catch (IOException ioexception) { ioexception.printStackTrace(); @@ -240,7 +191,7 @@ index 0e91aeec3..ff473a263 100644 } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index b12e767db..342a15db5 100644 +index 9e24b77ad1..f32191c5a2 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -10,6 +10,7 @@ import org.apache.logging.log4j.LogManager; @@ -268,7 +219,7 @@ index b12e767db..342a15db5 100644 } diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java -index 4ff243dab..67b2e41c7 100644 +index e649d662ae..560edb523f 100644 --- a/src/main/java/net/minecraft/server/VillageSiege.java +++ b/src/main/java/net/minecraft/server/VillageSiege.java @@ -1,5 +1,7 @@ @@ -288,7 +239,7 @@ index 4ff243dab..67b2e41c7 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f6d7070de..e0fe05a0b 100644 +index 9fb87914ff..879f2fe844 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1,6 +1,8 @@ @@ -299,8 +250,8 @@ index f6d7070de..e0fe05a0b 100644 +import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; - import java.util.ArrayList; -@@ -1183,8 +1185,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + import it.unimi.dsi.fastutil.longs.LongSet; +@@ -1193,8 +1195,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } catch (Throwable throwable1) { entity.tickTimer.stopTiming(); // Paper start - Prevent tile entity and entity crashes @@ -312,7 +263,7 @@ index f6d7070de..e0fe05a0b 100644 entity.dead = true; continue; // Paper end -@@ -1249,8 +1253,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1259,8 +1263,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.methodProfiler.e(); } catch (Throwable throwable2) { // Paper start - Prevent tile entity and entity crashes @@ -324,8 +275,20 @@ index f6d7070de..e0fe05a0b 100644 tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); continue; +diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java +index 65931bfb5f..625335c60f 100644 +--- a/src/main/java/net/minecraft/server/WorldPersistentData.java ++++ b/src/main/java/net/minecraft/server/WorldPersistentData.java +@@ -138,6 +138,7 @@ public class WorldPersistentData { + + nbttagcompound = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound1, j, i); + } catch (Throwable throwable1) { ++ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable1); // Paper + throwable = throwable1; + throw throwable1; + } finally { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 93b9134d6..26753fac5 100644 +index 93b9134d6e..26753fac5e 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -15,6 +15,9 @@ import java.util.concurrent.atomic.AtomicReference; diff --git a/Spigot-Server-Patches/0059-Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/0059-Disable-Scoreboards-for-non-players-by-default.patch index 745936ea79..3bc20cba32 100644 --- a/Spigot-Server-Patches/0059-Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/0059-Disable-Scoreboards-for-non-players-by-default.patch @@ -1,4 +1,4 @@ -From dec40f5aae3382fb517071d54d4580616f3dd847 Mon Sep 17 00:00:00 2001 +From 318ea0ac3b760220892f620d0218a490fcd390b5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 8 Mar 2016 23:25:45 -0500 Subject: [PATCH] Disable Scoreboards for non players by default @@ -25,10 +25,10 @@ index 4a2d296746..2b25da0465 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c7acd06298..27020c7e29 100644 +index f6cdff0ef9..9e1c427fcc 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2248,6 +2248,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2243,6 +2243,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @Nullable public ScoreboardTeamBase be() { @@ -37,7 +37,7 @@ index c7acd06298..27020c7e29 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index af595bf2bc..5363a2c704 100644 +index dd216c64e9..ed6f5e70f3 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -538,6 +538,7 @@ public abstract class EntityLiving extends Entity { diff --git a/Spigot-Server-Patches/0061-Complete-resource-pack-API.patch b/Spigot-Server-Patches/0061-Complete-resource-pack-API.patch index 60cb9669dd..b8c144649a 100644 --- a/Spigot-Server-Patches/0061-Complete-resource-pack-API.patch +++ b/Spigot-Server-Patches/0061-Complete-resource-pack-API.patch @@ -1,11 +1,11 @@ -From c7c1c0f7149429b16ae5919c8af00d870192266a Mon Sep 17 00:00:00 2001 +From d82d48df94d3dac694ab0f224e66da617ae13c17 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sat, 4 Apr 2015 23:17:52 -0400 Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9827e08b7d..5b045dc2a9 100644 +index 86f485e6ff..b56bb9d531 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -128,6 +128,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -19,7 +19,7 @@ index 9827e08b7d..5b045dc2a9 100644 public CraftPlayer(CraftServer server, EntityPlayer entity) { super(server, entity); -@@ -1741,6 +1745,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1739,6 +1743,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().server.getCommandDispatcher().a(getHandle()); } diff --git a/Spigot-Server-Patches/0062-Chunk-save-queue-improvements.patch b/Spigot-Server-Patches/0062-Chunk-save-queue-improvements.patch index 533bfbc04c..f85aded2df 100644 --- a/Spigot-Server-Patches/0062-Chunk-save-queue-improvements.patch +++ b/Spigot-Server-Patches/0062-Chunk-save-queue-improvements.patch @@ -1,4 +1,4 @@ -From c8b51eeedd60beed4dc70db20bba967b5f60e48e Mon Sep 17 00:00:00 2001 +From 0d3a01c3188c4dbdccdb1b700707e790777a5968 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 4 Mar 2016 18:18:37 -0600 Subject: [PATCH] Chunk save queue improvements @@ -26,7 +26,7 @@ Then finally, Sleeping will by default be removed, but due to known issues with But if sleeps are to remain enabled, we at least lower the sleep interval so it doesn't have as much negative impact. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index d48ef7e85..280cfd553 100644 +index 0d68ffd75a..fd00c320ce 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -208,4 +208,10 @@ public class PaperConfig { @@ -41,10 +41,10 @@ index d48ef7e85..280cfd553 100644 + } } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 5001fd11d..b247d5f07 100644 +index f969c036f3..2b0a088a6a 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -25,6 +25,7 @@ import java.util.function.Consumer; +@@ -22,6 +22,7 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; import javax.annotation.Nullable; @@ -52,7 +52,7 @@ index 5001fd11d..b247d5f07 100644 import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; // Spigot start -@@ -34,8 +35,21 @@ import org.spigotmc.SupplierUtils; +@@ -31,6 +32,19 @@ import org.spigotmc.SupplierUtils; public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -66,16 +66,13 @@ index 5001fd11d..b247d5f07 100644 + this.compoundSupplier = compoundSupplier; + } + } -+ private ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); ++ final private ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); + // Paper end + private static final Logger a = LogManager.getLogger(); -- private final Object2ObjectMap> b = Object2ObjectMaps.synchronize(new Object2ObjectLinkedOpenHashMap()); // Spigot -+ private final Object2ObjectMap> b = new Object2ObjectLinkedOpenHashMap(); // Spigot // Paper - remove synchronized + private final Map> b = Maps.newHashMap(); private final File c; - private final DataFixer d; - private PersistentStructureLegacy e; -@@ -298,8 +312,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -305,8 +319,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } }; } @@ -86,74 +83,64 @@ index 5001fd11d..b247d5f07 100644 // Spigot end } catch (Exception exception) { ChunkRegionLoader.a.error("Failed to save chunk", exception); -@@ -308,18 +322,22 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -315,7 +329,10 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } - protected synchronized void a(ChunkCoordIntPair chunkcoordintpair, Supplier nbttagcompound) { // Spigot -+ queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements - this.b.put(chunkcoordintpair, nbttagcompound); + protected void a(ChunkCoordIntPair chunkcoordintpair, Supplier nbttagcompound) { // Spigot +- this.b.put(chunkcoordintpair, nbttagcompound); ++ synchronized (this.queue) { // Paper - synchronize while modifying the map ++ queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements ++ this.b.put(chunkcoordintpair, nbttagcompound); ++ } FileIOThread.a().a(this); } -- public synchronized boolean a() { -+ public boolean a() { // Paper - remove synchronized - // CraftBukkit start - return this.processSaveQueueEntry(false); +@@ -325,19 +342,18 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } -- private synchronized boolean processSaveQueueEntry(boolean logCompletion) { -- Iterator>> iter = this.b.entrySet().iterator(); // Spigot -- if (!iter.hasNext()) { -+ private boolean processSaveQueueEntry(boolean logCompletion) { // Paper - dont synchronize during save -+ // CraftBukkit start + private boolean processSaveQueueEntry(boolean logCompletion) { +- Iterator iterator = this.b.entrySet().iterator(); +- if (!iterator.hasNext()) { + // Paper start - Chunk queue improvements + QueuedChunk chunk = queue.poll(); + if (chunk == null) { + // Paper - end - if (logCompletion) { - // CraftBukkit end + if (logCompletion) { // CraftBukkit ChunkRegionLoader.a.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.c.getName()); -@@ -327,17 +345,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } return false; } else { -- // CraftBukkit start -- Map.Entry> entry = iter.next(); // Spigot -- ChunkCoordIntPair chunkcoordintpair = entry.getKey(); -- Supplier value = entry.getValue(); // Spigot -- // CraftBukkit end +- Entry entry = (Entry) iterator.next(); +- +- iterator.remove(); +- ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) entry.getKey(); +- Supplier nbttagcompound = (Supplier) entry.getValue(); // Spigot + ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements ++ Supplier nbttagcompound = chunk.compoundSupplier; // Spigot // Paper - boolean flag; + if (nbttagcompound == null) { + return true; +@@ -346,6 +362,14 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + // CraftBukkit start + RegionFileCache.write(this.c, chunkcoordintpair.x, chunkcoordintpair.z, SupplierUtils.getIfExists(nbttagcompound)); // Spigot - try { - // NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.get(chunkcoordintpair); // CraftBukkit -- NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(value); // Spigot -+ NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(chunk.compoundSupplier); // Spigot // Paper - - if (nbttagcompound != null) { - try { -@@ -349,7 +363,14 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - - flag = true; - } finally { -- this.b.remove(chunkcoordintpair, value); // CraftBukkit // Spigot -+ // Paper start - only synchronize here -+ synchronized (this) { -+ // This will not equal if a newer version is still pending - wait until newest is saved to remove -+ if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { -+ this.b.remove(chunkcoordintpair); ++ // Paper start remove from map only if this was the latest version of the chunk ++ synchronized (this.queue) { ++ // This will not equal if a newer version is still pending - wait until newest is saved to remove ++ if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { ++ this.b.remove(chunkcoordintpair); ++ } + } -+ } -+ // Paper start - } - - return flag; ++ // Paper end + /* + NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); + dataoutputstream.close(); diff --git a/src/main/java/net/minecraft/server/FileIOThread.java b/src/main/java/net/minecraft/server/FileIOThread.java -index 34312667a..549fab9a5 100644 +index 8c3537ab8d..170c239b77 100644 --- a/src/main/java/net/minecraft/server/FileIOThread.java +++ b/src/main/java/net/minecraft/server/FileIOThread.java -@@ -43,11 +43,12 @@ public class FileIOThread implements Runnable { +@@ -47,11 +47,12 @@ public class FileIOThread implements Runnable { ++this.e; } diff --git a/Spigot-Server-Patches/0063-Chunk-Save-Reattempt.patch b/Spigot-Server-Patches/0063-Chunk-Save-Reattempt.patch index b115bd7efd..ad9fd7fa02 100644 --- a/Spigot-Server-Patches/0063-Chunk-Save-Reattempt.patch +++ b/Spigot-Server-Patches/0063-Chunk-Save-Reattempt.patch @@ -1,34 +1,12 @@ -From cd1396b77d29f151316d181df8ce104bd61c5974 Mon Sep 17 00:00:00 2001 +From 63f3b781dc0ddb6de219759f112f4d18cae510a5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 4 Mar 2013 23:46:10 -0500 Subject: [PATCH] Chunk Save Reattempt We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks. -diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index b247d5f07..f007af2e1 100644 ---- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java -+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -354,11 +354,16 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(chunk.compoundSupplier); // Spigot // Paper - - if (nbttagcompound != null) { -+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { // Paper - try { - this.b(chunkcoordintpair, nbttagcompound); -+ laste = null; break; // Paper - } catch (Exception exception) { -- ChunkRegionLoader.a.error("Failed to save chunk", exception); -+ //ChunkRegionLoader.a.error("Failed to save chunk", exception); // Paper -+ laste = exception; // Paper - } -+ try {Thread.sleep(10);} catch (InterruptedException e) {e.printStackTrace();} } // Paper -+ if (laste != null) { com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste); MinecraftServer.LOGGER.error("Failed to save chunk", laste); } // Paper - } - - flag = true; diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index cc7cad8be..b8b514c87 100644 +index cc7cad8be4..b8b514c874 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -238,8 +238,7 @@ public class RegionFile { @@ -41,6 +19,40 @@ index cc7cad8be..b8b514c87 100644 } } +diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java +index e5115863ec..2217adf99c 100644 +--- a/src/main/java/net/minecraft/server/RegionFileCache.java ++++ b/src/main/java/net/minecraft/server/RegionFileCache.java +@@ -95,11 +95,29 @@ public class RegionFileCache { + + @Nullable + public static synchronized void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { ++ int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper + RegionFile regionfile = a(file, i, j); + + DataOutputStream dataoutputstream = regionfile.c(i & 31, j & 31); + NBTCompressedStreamTools.a(nbttagcompound, (java.io.DataOutput) dataoutputstream); + dataoutputstream.close(); ++ // Paper start ++ laste = null; break; // Paper ++ } catch (Exception exception) { ++ //ChunkRegionLoader.a.error("Failed to save chunk", exception); // Paper ++ laste = exception; // Paper ++ } ++ try { ++ Thread.sleep(10); ++ } catch (InterruptedException e) { ++ e.printStackTrace(); ++ } ++ } ++ if (laste != null) { ++ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste); ++ MinecraftServer.LOGGER.error("Failed to save chunk", laste); ++ } ++ // Paper end + } + + public static synchronized boolean chunkExists(File file, int i, int j) { -- 2.18.0 diff --git a/Spigot-Server-Patches/0064-Default-loading-permissions.yml-before-plugins.patch b/Spigot-Server-Patches/0064-Default-loading-permissions.yml-before-plugins.patch index 91ec6a97e6..1873ad1e73 100644 --- a/Spigot-Server-Patches/0064-Default-loading-permissions.yml-before-plugins.patch +++ b/Spigot-Server-Patches/0064-Default-loading-permissions.yml-before-plugins.patch @@ -1,4 +1,4 @@ -From 6edc5b87fee0f325dfaa092a9f370179b57abfbd Mon Sep 17 00:00:00 2001 +From 9970b4b70fa0d3caf070bd3f2fcf1df6da43678f Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Mar 2016 13:17:38 -0400 Subject: [PATCH] Default loading permissions.yml before plugins @@ -30,10 +30,10 @@ index fd00c320ce..620f23f4f0 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 53adc9e1a0..b68af1c285 100644 +index bd99aa72c4..8d059d75ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -332,6 +332,7 @@ public final class CraftServer implements Server { +@@ -333,6 +333,7 @@ public final class CraftServer implements Server { if (type == PluginLoadOrder.STARTUP) { helpMap.clear(); helpMap.initializeGeneralTopics(); @@ -41,7 +41,7 @@ index 53adc9e1a0..b68af1c285 100644 } Plugin[] plugins = pluginManager.getPlugins(); -@@ -349,7 +350,7 @@ public final class CraftServer implements Server { +@@ -350,7 +351,7 @@ public final class CraftServer implements Server { setVanillaCommands(false); // Spigot end commandMap.registerServerAliases(); diff --git a/Spigot-Server-Patches/0065-Allow-Reloading-of-Custom-Permissions.patch b/Spigot-Server-Patches/0065-Allow-Reloading-of-Custom-Permissions.patch index 3bd67dd9de..e3b196036c 100644 --- a/Spigot-Server-Patches/0065-Allow-Reloading-of-Custom-Permissions.patch +++ b/Spigot-Server-Patches/0065-Allow-Reloading-of-Custom-Permissions.patch @@ -1,4 +1,4 @@ -From 31f99b0faa647c2f3dc0ba0a34aa710eb043aaf4 Mon Sep 17 00:00:00 2001 +From fb5423ad6bb093fea6bec62755ca086657c4004b Mon Sep 17 00:00:00 2001 From: William Date: Fri, 18 Mar 2016 03:30:17 -0400 Subject: [PATCH] Allow Reloading of Custom Permissions @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b68af1c285..f70629a868 100644 +index 8d059d75ac..eacee4036e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1954,5 +1954,23 @@ public final class CraftServer implements Server { +@@ -1974,5 +1974,23 @@ public final class CraftServer implements Server { return false; } } diff --git a/Spigot-Server-Patches/0066-Remove-Metadata-on-reload.patch b/Spigot-Server-Patches/0066-Remove-Metadata-on-reload.patch index d4bda0058d..f259235798 100644 --- a/Spigot-Server-Patches/0066-Remove-Metadata-on-reload.patch +++ b/Spigot-Server-Patches/0066-Remove-Metadata-on-reload.patch @@ -1,4 +1,4 @@ -From 98015c22852bc9ced6426fe6f8b716db1e00280f Mon Sep 17 00:00:00 2001 +From 956f4df222506ca586b2bfcef871bf851bb8733f Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Mar 2016 13:50:14 -0400 Subject: [PATCH] Remove Metadata on reload @@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive This will remove metadata on reload so it does not crash everything if a plugin uses it. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f70629a868..7ad009c073 100644 +index eacee4036e..272e127735 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -789,8 +789,18 @@ public final class CraftServer implements Server { +@@ -790,8 +790,18 @@ public final class CraftServer implements Server { world.paperConfig.init(); // Paper } diff --git a/Spigot-Server-Patches/0068-Handle-Item-Meta-Inconsistencies.patch b/Spigot-Server-Patches/0068-Handle-Item-Meta-Inconsistencies.patch index 9063ac05d0..06b2b52f28 100644 --- a/Spigot-Server-Patches/0068-Handle-Item-Meta-Inconsistencies.patch +++ b/Spigot-Server-Patches/0068-Handle-Item-Meta-Inconsistencies.patch @@ -1,4 +1,4 @@ -From 9bdf8e39bf667d1c03da11f40e49c01a74539abe Mon Sep 17 00:00:00 2001 +From 651f454a03f6caa23e015e054b66bcb7b57d087c Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 28 May 2015 23:00:19 -0400 Subject: [PATCH] Handle Item Meta Inconsistencies @@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the ItemMeta API equivalents, and should deprecate the old API's. diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 0c54eaa52..c7ef9c689 100644 +index 318c4204df..56787ed25c 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -7,6 +7,8 @@ import com.mojang.brigadier.StringReader; @@ -70,7 +70,7 @@ index 0c54eaa52..c7ef9c689 100644 public IChatBaseComponent getName() { @@ -651,6 +671,7 @@ public final class ItemStack { - nbttagcompound.setString("id", String.valueOf(Enchantment.enchantments.b(enchantment))); + nbttagcompound.setString("id", String.valueOf(IRegistry.ENCHANTMENT.getKey(enchantment))); nbttagcompound.setShort("lvl", (short) ((byte) i)); nbttaglist.add((NBTBase) nbttagcompound); + processEnchantOrder(nbttagcompound); // Paper @@ -78,7 +78,7 @@ index 0c54eaa52..c7ef9c689 100644 public boolean hasEnchantments() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index f4672b9a4..8c0409797 100644 +index ef4c49f1ff..69425e838f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -4,6 +4,7 @@ import static org.bukkit.craftbukkit.inventory.CraftMetaItem.ENCHANTMENTS; @@ -201,7 +201,7 @@ index f4672b9a4..8c0409797 100644 static Map getEnchantments(net.minecraft.server.ItemStack item) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 1fe5ddcd5..1d3333fd7 100644 +index 3db06bed2c..3fd2088039 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -8,12 +8,14 @@ import java.lang.reflect.Constructor; diff --git a/Spigot-Server-Patches/0069-Configurable-Non-Player-Arrow-Despawn-Rate.patch b/Spigot-Server-Patches/0069-Configurable-Non-Player-Arrow-Despawn-Rate.patch index c94e467873..34d56ae6c4 100644 --- a/Spigot-Server-Patches/0069-Configurable-Non-Player-Arrow-Despawn-Rate.patch +++ b/Spigot-Server-Patches/0069-Configurable-Non-Player-Arrow-Despawn-Rate.patch @@ -1,4 +1,4 @@ -From 97b7c45703828056ac98602df86d699dd14efa52 Mon Sep 17 00:00:00 2001 +From 6e22f788fdc7627d53014e39fc83e9810d82ab64 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Mar 2016 15:12:22 -0400 Subject: [PATCH] Configurable Non Player Arrow Despawn Rate @@ -24,10 +24,10 @@ index 6f96627a2e..0de3007392 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index e16c8e8d98..75445b00dc 100644 +index b0f93d9cf5..c24225892f 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -258,7 +258,7 @@ public abstract class EntityArrow extends Entity implements IProjectile { +@@ -262,7 +262,7 @@ public abstract class EntityArrow extends Entity implements IProjectile { protected void f() { ++this.despawnCounter; diff --git a/Spigot-Server-Patches/0070-Add-World-Util-Methods.patch b/Spigot-Server-Patches/0070-Add-World-Util-Methods.patch index 33b38f59c1..760b94ecae 100644 --- a/Spigot-Server-Patches/0070-Add-World-Util-Methods.patch +++ b/Spigot-Server-Patches/0070-Add-World-Util-Methods.patch @@ -1,4 +1,4 @@ -From c896d823498f07c8b105f0f84936ff10cbf6736a Mon Sep 17 00:00:00 2001 +From 486b51b81a7ca05e4cdd916e72e92986452a7acb Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Mar 2016 20:16:03 -0400 Subject: [PATCH] Add World Util Methods @@ -6,10 +6,10 @@ Subject: [PATCH] Add World Util Methods Methods that can be used for other patches to help improve logic. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index eb6f900c39..ef6a54bcae 100644 +index 1131a092af..d86b925f0d 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -635,6 +635,7 @@ public class Chunk implements IChunkAccess { +@@ -632,6 +632,7 @@ public class Chunk implements IChunkAccess { } } @@ -18,25 +18,25 @@ index eb6f900c39..ef6a54bcae 100644 return this.a(blockposition, i, this.world.o().g()); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e0fe05a0b1..72c0c92ec1 100644 +index 879f2fe844..fd6f070417 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -81,7 +81,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -84,7 +84,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public final List k = Lists.newArrayList(); protected final IntHashMap entitiesById = new IntHashMap(); - private final long G = 16777215L; -- private int H; -+ private int H; public int getSkylightSubtracted() { return this.H; } public void setSkylightSubtracted(int value) { this.H = value;} // Paper - OBFHELPER + private final long F = 16777215L; +- private int G; ++ private int G; public int getSkylightSubtracted() { return this.G; } public void setSkylightSubtracted(int value) { this.G = value;} // Paper - OBFHELPER protected int m = (new Random()).nextInt(); protected final int n = 1013904223; protected float o; -@@ -273,6 +273,63 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -274,6 +274,77 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return this.getType(blockposition).isAir(); } + // Paper start + public Chunk getChunkIfLoaded(BlockPosition blockposition) { -+ return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); ++ return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); + } + // test if meets light level, return faster + // logic copied from below @@ -89,6 +89,20 @@ index e0fe05a0b1..72c0c92ec1 100644 + } + return null; + } ++ public Block getBlockIfLoaded(BlockPosition blockposition) { ++ IBlockData type = getTypeIfLoaded(blockposition); ++ if (type == null) { ++ return null; ++ } ++ return type.getBlock(); ++ } ++ public Material getMaterialIfLoaded(BlockPosition blockposition) { ++ IBlockData type = getTypeIfLoaded(blockposition); ++ if (type == null) { ++ return null; ++ } ++ return type.getBlock().material; ++ } + // Paper end + public Chunk getChunkAtWorldCoords(BlockPosition blockposition) { diff --git a/Spigot-Server-Patches/0071-Optimized-Light-Level-Comparisons.patch b/Spigot-Server-Patches/0071-Optimized-Light-Level-Comparisons.patch index 318656a42f..c4357a9cbf 100644 --- a/Spigot-Server-Patches/0071-Optimized-Light-Level-Comparisons.patch +++ b/Spigot-Server-Patches/0071-Optimized-Light-Level-Comparisons.patch @@ -1,4 +1,4 @@ -From eacfdadd2d81da65924f23d25f0f08a0e94179b4 Mon Sep 17 00:00:00 2001 +From 9bea77a9d0eb0bba8a3c97c3782630e66e802bd5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Mar 2016 21:22:56 -0400 Subject: [PATCH] Optimized Light Level Comparisons @@ -8,7 +8,7 @@ Use an optimized method to test if a block position meets a desired light level. This method benefits from returning as soon as the desired light level matches. diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java -index b392846aa0..c64e6c197e 100644 +index 1506c9ede0..6ae6fc3ecb 100644 --- a/src/main/java/net/minecraft/server/BlockCrops.java +++ b/src/main/java/net/minecraft/server/BlockCrops.java @@ -44,7 +44,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement @@ -21,7 +21,7 @@ index b392846aa0..c64e6c197e 100644 if (i < this.e()) { diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java -index 723e5c9b44..e24fb17366 100644 +index 42478d1fed..7426d14cbf 100644 --- a/src/main/java/net/minecraft/server/BlockSapling.java +++ b/src/main/java/net/minecraft/server/BlockSapling.java @@ -30,7 +30,7 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen @@ -34,7 +34,7 @@ index 723e5c9b44..e24fb17366 100644 world.captureTreeGeneration = true; // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java -index 0192f93864..334c42d0d8 100644 +index 4fc8c5d3c6..0fc39bb9fb 100644 --- a/src/main/java/net/minecraft/server/BlockStem.java +++ b/src/main/java/net/minecraft/server/BlockStem.java @@ -27,7 +27,7 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { @@ -47,20 +47,20 @@ index 0192f93864..334c42d0d8 100644 if (random.nextInt((int) ((100.0F / (this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier)) * (25.0F / f)) + 1) == 0) { // Spigot diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java -index 04c3756ea3..e0e5ba539c 100644 +index a3449e9a8d..5f60bf04e6 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -65,9 +65,18 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { if (this.world.getBrightness(EnumSkyBlock.SKY, blockposition) > this.random.nextInt(32)) { return false; } else { -- int i = this.world.X() ? this.world.d(blockposition, 10) : this.world.getLightLevel(blockposition); +- int i = this.world.Y() ? this.world.d(blockposition, 10) : this.world.getLightLevel(blockposition); - - return i <= this.random.nextInt(8); + // Paper start - optimized light check, returns faster + boolean passes; -+ if (this.world.X()) { -+ int orig = world.getSkylightSubtracted(); ++ if (this.world.Y()) { ++ final int orig = world.getSkylightSubtracted(); + world.setSkylightSubtracted(10); + passes = !this.world.isLightLevel(blockposition, this.random.nextInt(8)); + world.setSkylightSubtracted(orig); @@ -73,17 +73,17 @@ index 04c3756ea3..e0e5ba539c 100644 } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 5c1bde19c5..2818ded921 100644 +index 1ab3072cc3..e5170bff5b 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -262,7 +262,7 @@ public class EntityZombie extends EntityMonster { +@@ -263,7 +263,7 @@ public class EntityZombie extends EntityMonster { int j1 = j + MathHelper.nextInt(this.random, 7, 40) * MathHelper.nextInt(this.random, -1, 1); int k1 = k + MathHelper.nextInt(this.random, 7, 40) * MathHelper.nextInt(this.random, -1, 1); - if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) { + if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && !this.world.isLightLevel(new BlockPosition(i1, j1, k1), 10)) { // Paper entityzombie.setPosition((double) i1, (double) j1, (double) k1); - if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.b((Entity) entityzombie, entityzombie.getBoundingBox()) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()) && !this.world.containsLiquid(entityzombie.getBoundingBox())) { + if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a_(entityzombie, entityzombie.getBoundingBox()) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()) && !this.world.containsLiquid(entityzombie.getBoundingBox())) { this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit -- 2.18.0 diff --git a/Spigot-Server-Patches/0072-Pass-world-to-Village-creation.patch b/Spigot-Server-Patches/0072-Pass-world-to-Village-creation.patch index cfa00ebf91..f47750e693 100644 --- a/Spigot-Server-Patches/0072-Pass-world-to-Village-creation.patch +++ b/Spigot-Server-Patches/0072-Pass-world-to-Village-creation.patch @@ -1,4 +1,4 @@ -From ea8fdac269a25dbe9984c82bbe321a61a079f16e Mon Sep 17 00:00:00 2001 +From 4bf18616eaab7071c7f2b337dd9195d419103f4e Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 19 Mar 2016 15:16:54 -0400 Subject: [PATCH] Pass world to Village creation @@ -6,10 +6,10 @@ Subject: [PATCH] Pass world to Village creation fixes NPE bug #95 diff --git a/src/main/java/net/minecraft/server/PersistentVillage.java b/src/main/java/net/minecraft/server/PersistentVillage.java -index c09326636c..3219ccca40 100644 +index 98c6bbc183..7a9fb97530 100644 --- a/src/main/java/net/minecraft/server/PersistentVillage.java +++ b/src/main/java/net/minecraft/server/PersistentVillage.java -@@ -234,7 +234,7 @@ public class PersistentVillage extends PersistentBase { +@@ -237,7 +237,7 @@ public class PersistentVillage extends PersistentBase { for (int i = 0; i < nbttaglist.size(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompound(i); @@ -19,7 +19,7 @@ index c09326636c..3219ccca40 100644 village.a(nbttagcompound1); this.villages.add(village); diff --git a/src/main/java/net/minecraft/server/Village.java b/src/main/java/net/minecraft/server/Village.java -index e742cbe120..dfcabb83a1 100644 +index f87e8e05af..bda67faefe 100644 --- a/src/main/java/net/minecraft/server/Village.java +++ b/src/main/java/net/minecraft/server/Village.java @@ -24,7 +24,7 @@ public class Village { diff --git a/Spigot-Server-Patches/0073-Custom-replacement-for-eaten-items.patch b/Spigot-Server-Patches/0073-Custom-replacement-for-eaten-items.patch index 8b285330fe..e0bd665053 100644 --- a/Spigot-Server-Patches/0073-Custom-replacement-for-eaten-items.patch +++ b/Spigot-Server-Patches/0073-Custom-replacement-for-eaten-items.patch @@ -1,14 +1,14 @@ -From daf02c8da838148c6d5e145c4b89c8d64063168d Mon Sep 17 00:00:00 2001 +From 74df9791b9e08039c1dd88ae4f8557114b1de854 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sun, 21 Jun 2015 15:07:20 -0400 Subject: [PATCH] Custom replacement for eaten items diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 5363a2c704..03c6c77a60 100644 +index ed6f5e70f3..442981f938 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2564,12 +2564,13 @@ public abstract class EntityLiving extends Entity { +@@ -2599,12 +2599,13 @@ public abstract class EntityLiving extends Entity { protected void q() { if (!this.activeItem.isEmpty() && this.isHandRaised()) { @@ -23,7 +23,7 @@ index 5363a2c704..03c6c77a60 100644 world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { -@@ -2584,9 +2585,20 @@ public abstract class EntityLiving extends Entity { +@@ -2619,9 +2620,20 @@ public abstract class EntityLiving extends Entity { itemstack = this.activeItem.a(this.world, this); } diff --git a/Spigot-Server-Patches/0074-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/Spigot-Server-Patches/0074-handle-NaN-health-absorb-values-and-repair-bad-data.patch index 24ccfb2783..80c88096e9 100644 --- a/Spigot-Server-Patches/0074-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/Spigot-Server-Patches/0074-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -1,11 +1,11 @@ -From 31531d85e46c9c7c17eecd323aec769aa572cabb Mon Sep 17 00:00:00 2001 +From 78a9c971819c0eb757da00c04b27847e7826c7be Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 27 Sep 2015 01:18:02 -0400 Subject: [PATCH] handle NaN health/absorb values and repair bad data diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 03c6c77a60..2d80f4e3e9 100644 +index 442981f938..edd2ffa394 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -499,7 +499,13 @@ public abstract class EntityLiving extends Entity { @@ -34,7 +34,7 @@ index 03c6c77a60..2d80f4e3e9 100644 // CraftBukkit start - Handle scaled health if (this instanceof EntityPlayer) { org.bukkit.craftbukkit.entity.CraftPlayer player = ((EntityPlayer) this).getBukkitEntity(); -@@ -2429,7 +2439,7 @@ public abstract class EntityLiving extends Entity { +@@ -2464,7 +2474,7 @@ public abstract class EntityLiving extends Entity { } public void setAbsorptionHearts(float f) { @@ -44,10 +44,10 @@ index 03c6c77a60..2d80f4e3e9 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1f716013ac..be29f85a05 100644 +index b56bb9d531..f4d06a9465 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1552,6 +1552,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1550,6 +1550,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/Spigot-Server-Patches/0078-Don-t-teleport-dead-entities.patch b/Spigot-Server-Patches/0078-Don-t-teleport-dead-entities.patch index f5e347945d..075464e6f7 100644 --- a/Spigot-Server-Patches/0078-Don-t-teleport-dead-entities.patch +++ b/Spigot-Server-Patches/0078-Don-t-teleport-dead-entities.patch @@ -1,4 +1,4 @@ -From 968690c2207317f77f0b933b4a12d4c712de3c20 Mon Sep 17 00:00:00 2001 +From ccf9807fc0d57beb06724b3ede46c76296837330 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 22 Mar 2016 00:55:23 -0400 Subject: [PATCH] Don't teleport dead entities @@ -7,10 +7,10 @@ Had some issue with this in past, and this is the vanilla logic. Potentially an old CB change that's no longer needed. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 07172d3dd8..53ef6b0ed6 100644 +index 90960bd0b8..5ab98cbcf1 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2565,7 +2565,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2558,7 +2558,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public Entity teleportTo(Location exit, boolean portal) { @@ -18,7 +18,7 @@ index 07172d3dd8..53ef6b0ed6 100644 + if (!this.dead) { // Paper WorldServer worldserver = ((CraftWorld) getBukkitEntity().getLocation().getWorld()).getHandle(); WorldServer worldserver1 = ((CraftWorld) exit.getWorld()).getHandle(); - int i = worldserver1.dimension; + DimensionManager dimensionmanager = worldserver1.dimension; -- 2.18.0 diff --git a/Spigot-Server-Patches/0080-Configurable-spawn-chances-for-skeleton-horses.patch b/Spigot-Server-Patches/0080-Configurable-spawn-chances-for-skeleton-horses.patch index ad2a004d9d..b1586d88ea 100644 --- a/Spigot-Server-Patches/0080-Configurable-spawn-chances-for-skeleton-horses.patch +++ b/Spigot-Server-Patches/0080-Configurable-spawn-chances-for-skeleton-horses.patch @@ -1,36 +1,39 @@ -From c186b41eb75af263e81c093dc4bc3a7db435a8ab Mon Sep 17 00:00:00 2001 +From 1371b24db386bfe8ce9a0cadbf71a118ad9bb4da Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 22 Mar 2016 12:04:28 -0500 Subject: [PATCH] Configurable spawn chances for skeleton horses diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0de3007392..c2c33d75bf 100644 +index 0de3007392..b05277067a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -212,4 +212,9 @@ public class PaperWorldConfig { +@@ -212,4 +212,12 @@ public class PaperWorldConfig { } log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate); } + + public double skeleHorseSpawnChance; + private void skeleHorseSpawnChance() { -+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state ++ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); ++ if (skeleHorseSpawnChance < 0) { ++ skeleHorseSpawnChance = 0.01D; // Vanilla value ++ } + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index dd09ab20e7..ecee3b4064 100644 +index 1188184f13..253019d89b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -498,7 +498,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -497,7 +497,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + blockposition = this.a(new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15))); if (this.isRainingAt(blockposition)) { DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); +- boolean flag2 = this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D; ++ boolean flag2 = this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper -- if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D) { -+ if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) { + if (flag2) { EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this); - - entityhorseskeleton.s(true); -- 2.18.0 diff --git a/Spigot-Server-Patches/0081-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/0081-Optimize-isValidLocation-getType-and-getBlockData-fo.patch index ab49dfd88e..96a02a99d6 100644 --- a/Spigot-Server-Patches/0081-Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/Spigot-Server-Patches/0081-Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -1,4 +1,4 @@ -From 42f660596a1ac2e6830fb330b21147014495a687 Mon Sep 17 00:00:00 2001 +From fab7f2c8c325f68616b896713a552c7336180264 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Mar 2016 02:07:55 -0600 Subject: [PATCH] Optimize isValidLocation, getType and getBlockData for inling @@ -31,10 +31,10 @@ index e2a7b4be2c..58f8b4b720 100644 public BaseBlockPosition(int i, int j, int k) { this.a = i; diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7dbea90902..252e00e166 100644 +index ca5c56c2b6..42e5e9ad8f 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -341,6 +341,16 @@ public class BlockPosition extends BaseBlockPosition { +@@ -342,6 +342,16 @@ public class BlockPosition extends BaseBlockPosition { protected int b; protected int c; protected int d; @@ -52,17 +52,18 @@ index 7dbea90902..252e00e166 100644 public MutableBlockPosition() { this(0, 0, 0); diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index ef6a54bcae..4b440c7077 100644 +index d86b925f0d..30dc4fb6df 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -430,12 +430,24 @@ public class Chunk implements IChunkAccess { +@@ -427,12 +427,24 @@ public class Chunk implements IChunkAccess { return this.getBlockData(i, j, k).b(this.world, new BlockPosition(i, j, k)); } - public IBlockData getBlockData(BlockPosition blockposition) { return getType(blockposition); } // Paper +- public IBlockData getType(BlockPosition blockposition) { + // Paper start - Optimize getBlockData to reduce instructions -+ public IBlockData getBlockData(BlockPosition pos) { return getBlockData(pos.getX(), pos.getY(), pos.getZ()); } // Paper - public IBlockData getType(BlockPosition blockposition) { ++ public final IBlockData getBlockData(BlockPosition pos) { return getBlockData(pos.getX(), pos.getY(), pos.getZ()); } // Paper ++ public final IBlockData getType(BlockPosition blockposition) { return this.getBlockData(blockposition.getX(), blockposition.getY(), blockposition.getZ()); } @@ -79,7 +80,7 @@ index ef6a54bcae..4b440c7077 100644 + + public IBlockData getBlockData_unused(int i, int j, int k) { + // Paper end - if (this.world.R() == WorldType.DEBUG_ALL_BLOCK_STATES) { + if (this.world.S() == WorldType.DEBUG_ALL_BLOCK_STATES) { IBlockData iblockdata = null; diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java @@ -96,10 +97,10 @@ index 35aea4829f..233cbb6d60 100644 private NibbleArray skyLight; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 72c0c92ec1..1df7528949 100644 +index fd6f070417..45b0880607 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -262,11 +262,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -263,11 +263,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public static boolean isValidLocation(BlockPosition blockposition) { @@ -113,7 +114,7 @@ index 72c0c92ec1..1df7528949 100644 } public boolean isEmpty(BlockPosition blockposition) { -@@ -280,7 +280,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -281,7 +281,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // test if meets light level, return faster // logic copied from below public boolean isLightLevel(BlockPosition blockposition, int level) { @@ -122,7 +123,7 @@ index 72c0c92ec1..1df7528949 100644 if (this.getType(blockposition).c(this, blockposition)) { int sky = getSkylightSubtracted(); if (this.getLightLevel(blockposition.up(), sky) >= level) { -@@ -324,7 +324,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -325,7 +325,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit end Chunk chunk = this.getChunkIfLoaded(blockposition); if (chunk != null) { @@ -131,16 +132,16 @@ index 72c0c92ec1..1df7528949 100644 } return null; } -@@ -359,7 +359,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -380,7 +380,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return true; } // CraftBukkit end - if (k(blockposition)) { -+ if (blockposition.isInvalidYLocation()) { // Paper ++ if (blockposition.isInvalidYLocation()) { // Paper return false; } else if (!this.isClientSide && this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) { return false; -@@ -680,11 +680,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -701,11 +701,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc blockposition = new BlockPosition(blockposition.getX(), 0, blockposition.getZ()); } @@ -154,7 +155,7 @@ index 72c0c92ec1..1df7528949 100644 if (this.isLoaded(blockposition)) { this.getChunkAtWorldCoords(blockposition).a(enumskyblock, blockposition, i); this.m(blockposition); -@@ -711,7 +711,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -732,7 +732,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } // CraftBukkit end @@ -163,7 +164,7 @@ index 72c0c92ec1..1df7528949 100644 return Blocks.VOID_AIR.getBlockData(); } else { Chunk chunk = this.getChunkAtWorldCoords(blockposition); -@@ -721,7 +721,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -742,7 +742,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public Fluid b(BlockPosition blockposition) { @@ -172,7 +173,7 @@ index 72c0c92ec1..1df7528949 100644 return FluidTypes.a.i(); } else { Chunk chunk = this.getChunkAtWorldCoords(blockposition); -@@ -1779,7 +1779,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1803,7 +1803,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public Map capturedTileEntities = Maps.newHashMap(); @Nullable public TileEntity getTileEntity(BlockPosition blockposition) { @@ -181,7 +182,7 @@ index 72c0c92ec1..1df7528949 100644 return null; } else { // CraftBukkit start -@@ -1820,7 +1820,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1844,7 +1844,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { @@ -190,7 +191,7 @@ index 72c0c92ec1..1df7528949 100644 if (tileentity != null && !tileentity.x()) { // CraftBukkit start if (captureBlockStates) { -@@ -1881,7 +1881,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1905,7 +1905,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public boolean p(BlockPosition blockposition) { @@ -198,7 +199,7 @@ index 72c0c92ec1..1df7528949 100644 + if (blockposition.isInvalidYLocation()) { // Paper return false; } else { - Chunk chunk = this.chunkProvider.getLoadedChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4); + Chunk chunk = this.chunkProvider.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4, false, false); -- 2.18.0 diff --git a/Spigot-Server-Patches/0083-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch b/Spigot-Server-Patches/0083-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch index 4a631c94e9..b0e55b48fd 100644 --- a/Spigot-Server-Patches/0083-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch +++ b/Spigot-Server-Patches/0083-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch @@ -1,4 +1,4 @@ -From 47b1de18f9769b9514bdfa76a274b617af51a8a8 Mon Sep 17 00:00:00 2001 +From ad72279171cbc841b7cc23ea948ff03cb2963b80 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 19:55:45 -0400 Subject: [PATCH] Option to disable BlockPhysicsEvent for Redstone @@ -11,12 +11,12 @@ Defaulting this to false will provide substantial performance improvement by saving millions of event calls on redstone heavy servers. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index c2c33d75bf..b3b3baddc0 100644 +index b05277067a..5f3156af60 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -217,4 +217,9 @@ public class PaperWorldConfig { - private void skeleHorseSpawnChance() { - skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state +@@ -220,4 +220,9 @@ public class PaperWorldConfig { + skeleHorseSpawnChance = 0.01D; // Vanilla value + } } + + public boolean firePhysicsEventForRedstone = false; @@ -25,10 +25,10 @@ index c2c33d75bf..b3b3baddc0 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1df7528949..87fd23c7f8 100644 +index 45b0880607..8f3b1d529a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -593,7 +593,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -614,7 +614,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc try { // CraftBukkit start CraftWorld world = ((WorldServer) this).getWorld(); @@ -38,10 +38,10 @@ index 1df7528949..87fd23c7f8 100644 this.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ecee3b4064..96002184bb 100644 +index 253019d89b..8f704a0e0b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -36,6 +36,7 @@ import org.bukkit.event.weather.LightningStrikeEvent; +@@ -37,6 +37,7 @@ import org.bukkit.event.weather.LightningStrikeEvent; public class WorldServer extends World implements IAsyncTaskHandler { private static final Logger a = LogManager.getLogger(); diff --git a/Spigot-Server-Patches/0084-Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-Server-Patches/0084-Entity-AddTo-RemoveFrom-World-Events.patch index fad5bb29c9..1812af11ae 100644 --- a/Spigot-Server-Patches/0084-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-Server-Patches/0084-Entity-AddTo-RemoveFrom-World-Events.patch @@ -1,14 +1,14 @@ -From 3c1a47e5259a7de1ea0fa2e0d6cfbdda0e3990ba Mon Sep 17 00:00:00 2001 +From 23dbf833e038bf5d565bba44919c95322ef55e3e Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:32:58 -0400 Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 87fd23c7f8..83955fdd81 100644 +index 8f3b1d529a..7f39a321db 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1048,6 +1048,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1069,6 +1069,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } entity.valid = true; // CraftBukkit @@ -16,7 +16,7 @@ index 87fd23c7f8..83955fdd81 100644 } protected void c(Entity entity) { -@@ -1055,6 +1056,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1076,6 +1077,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc ((IWorldAccess) this.v.get(i)).b(entity); } diff --git a/Spigot-Server-Patches/0085-Configurable-Chunk-Inhabited-Timer.patch b/Spigot-Server-Patches/0085-Configurable-Chunk-Inhabited-Timer.patch index aabcfb1a11..23d6385035 100644 --- a/Spigot-Server-Patches/0085-Configurable-Chunk-Inhabited-Timer.patch +++ b/Spigot-Server-Patches/0085-Configurable-Chunk-Inhabited-Timer.patch @@ -1,4 +1,4 @@ -From eb14acc9a6e994a5003d6f2650bbb85b0605d937 Mon Sep 17 00:00:00 2001 +From 4faf295c8925f103c186ca0a838540d4c658c75a Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:46:14 -0400 Subject: [PATCH] Configurable Chunk Inhabited Timer @@ -9,10 +9,10 @@ aspects of vanilla gameplay to this factor. For people who want all chunks to be treated equally, you can disable the timer. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b3b3baddc0..613964ce04 100644 +index 5f3156af60..f62faf81e7 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -222,4 +222,9 @@ public class PaperWorldConfig { +@@ -225,4 +225,9 @@ public class PaperWorldConfig { private void firePhysicsEventForRedstone() { firePhysicsEventForRedstone = getBoolean("fire-physics-event-for-redstone", firePhysicsEventForRedstone); } @@ -23,24 +23,15 @@ index b3b3baddc0..613964ce04 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 4b440c7077..e8a943cf74 100644 +index 30dc4fb6df..0ef1a8c7d3 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -55,7 +55,7 @@ public class Chunk implements IChunkAccess { - private long lastSaved; - private boolean y; - private int z; -- private long A; -+ private long A; public long getInhabitedTime() { return A; } // Paper - OBFHELPER - private int B; - private final ConcurrentLinkedQueue C; - public boolean d; -@@ -1240,7 +1240,7 @@ public class Chunk implements IChunkAccess { +@@ -1239,7 +1239,7 @@ public class Chunk implements IChunkAccess { } public long m() { -- return this.A; -+ return world.paperConfig.useInhabitedTime ? getInhabitedTime() : 0; // Paper +- return this.z; ++ return world.paperConfig.useInhabitedTime ? this.z : 0; // Paper } public void b(long i) { diff --git a/Spigot-Server-Patches/0088-Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/0088-Sanitise-RegionFileCache-and-make-configurable.patch index 9bb4206219..39544e46db 100644 --- a/Spigot-Server-Patches/0088-Sanitise-RegionFileCache-and-make-configurable.patch +++ b/Spigot-Server-Patches/0088-Sanitise-RegionFileCache-and-make-configurable.patch @@ -1,4 +1,4 @@ -From 3c28cee211dd1246032623ac8b6c39a617213ad1 Mon Sep 17 00:00:00 2001 +From 50e9e6cf5da5ca1f8164d381866328dffc36fcd4 Mon Sep 17 00:00:00 2001 From: Antony Riley Date: Tue, 29 Mar 2016 08:22:55 +0300 Subject: [PATCH] Sanitise RegionFileCache and make configurable. @@ -25,7 +25,7 @@ index 620f23f4f0..a6042ca607 100644 + } } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index ff473a263f..3b8d01ea1a 100644 +index 2217adf99c..c0ab543b91 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -9,10 +9,12 @@ import java.io.IOException; @@ -53,9 +53,9 @@ index ff473a263f..3b8d01ea1a 100644 } RegionFile regionfile1 = new RegionFile(file2); -@@ -58,6 +60,22 @@ public class RegionFileCache { - } +@@ -60,6 +62,22 @@ public class RegionFileCache { } + // CraftBukkit end + // Paper Start + private static synchronized void trimCache() { diff --git a/Spigot-Server-Patches/0090-Do-not-load-chunks-for-light-checks.patch b/Spigot-Server-Patches/0090-Do-not-load-chunks-for-light-checks.patch index 063e67b6ce..74b06a4f59 100644 --- a/Spigot-Server-Patches/0090-Do-not-load-chunks-for-light-checks.patch +++ b/Spigot-Server-Patches/0090-Do-not-load-chunks-for-light-checks.patch @@ -1,4 +1,4 @@ -From a11649b5e8780aa5325a96eb2632b0b35d9156c0 Mon Sep 17 00:00:00 2001 +From 883ae24227ae7d3d77fb1cdf092799df76d9841e Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 31 Mar 2016 19:17:58 -0400 Subject: [PATCH] Do not load chunks for light checks @@ -7,10 +7,10 @@ Should only happen for blocks on the edge that uses neighbors light level (certain blocks). In that case, there will be 3-4 other neighbors to get a light level from. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 83955fdd81..dcc1d08b16 100644 +index 7f39a321db..c862f36628 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -636,6 +636,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -657,6 +657,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (blockposition.getY() >= 256) { blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); } diff --git a/Spigot-Server-Patches/0091-Add-PlayerUseUnknownEntityEvent.patch b/Spigot-Server-Patches/0091-Add-PlayerUseUnknownEntityEvent.patch index e59fc7b246..0064802970 100644 --- a/Spigot-Server-Patches/0091-Add-PlayerUseUnknownEntityEvent.patch +++ b/Spigot-Server-Patches/0091-Add-PlayerUseUnknownEntityEvent.patch @@ -1,4 +1,4 @@ -From d5dc1be98794dc8986745880f7a6ab802fbf8e93 Mon Sep 17 00:00:00 2001 +From 1a421550b37ed9ab1ebc5ce9982d279eb701db40 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sat, 2 Apr 2016 05:09:16 -0400 Subject: [PATCH] Add PlayerUseUnknownEntityEvent @@ -18,10 +18,10 @@ index 77440ac81f..8711462e16 100644 private Vec3D c; private EnumHand d; diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index dc38e4e043..90ab7f065f 100644 +index 3257f41713..096e4e0d8c 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1893,6 +1893,16 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1903,6 +1903,16 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } } } diff --git a/Spigot-Server-Patches/0093-Configurable-Grass-Spread-Tick-Rate.patch b/Spigot-Server-Patches/0093-Configurable-Grass-Spread-Tick-Rate.patch index 80a1ba47d9..373de7cb7c 100644 --- a/Spigot-Server-Patches/0093-Configurable-Grass-Spread-Tick-Rate.patch +++ b/Spigot-Server-Patches/0093-Configurable-Grass-Spread-Tick-Rate.patch @@ -1,14 +1,14 @@ -From ccb7c36c3b7bec200c4a6d5182f1bc8d8bc9632a Mon Sep 17 00:00:00 2001 +From 288d52655275ce5ae4920f64ee897a79a4f259a5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 3 Apr 2016 16:28:17 -0400 Subject: [PATCH] Configurable Grass Spread Tick Rate diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 613964ce04..bb1c1c57cc 100644 +index f62faf81e7..ee38eb8e05 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -227,4 +227,10 @@ public class PaperWorldConfig { +@@ -230,4 +230,10 @@ public class PaperWorldConfig { private void useInhabitedTime() { useInhabitedTime = getBoolean("use-chunk-inhabited-timer", true); } @@ -20,7 +20,7 @@ index 613964ce04..bb1c1c57cc 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java -index 6343fb1e0d..903e8241b8 100644 +index b0e08a3365..52ae980d37 100644 --- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java @@ -21,6 +21,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow { diff --git a/Spigot-Server-Patches/0094-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/0094-Configurable-Keep-Spawn-Loaded-range-per-world.patch index acdc8f51a5..860fae3a13 100644 --- a/Spigot-Server-Patches/0094-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/Spigot-Server-Patches/0094-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -1,4 +1,4 @@ -From 7d678dd4a34e22dd9c7990f22ca6bf3430ed30f3 Mon Sep 17 00:00:00 2001 +From 06f139752d453ae7c53b8b767654356879cda38c Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 13 Sep 2014 23:14:43 -0400 Subject: [PATCH] Configurable Keep Spawn Loaded range per world @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world This lets you disable it for some worlds and lower it for others. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index bb1c1c57cc..667a0dde8c 100644 +index ee38eb8e05..61e6dcb0ee 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -233,4 +233,10 @@ public class PaperWorldConfig { +@@ -236,4 +236,10 @@ public class PaperWorldConfig { grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate)); log("Grass Spread Tick Rate: " + grassUpdateRate); } @@ -21,10 +21,10 @@ index bb1c1c57cc..667a0dde8c 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8fa7f6e1bb..649fff95b0 100644 +index 090618a51c..3fe374acb2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -485,13 +485,21 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -489,13 +489,21 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati ArrayList arraylist = Lists.newArrayList(); Set set = Sets.newConcurrentHashSet(); @@ -48,7 +48,7 @@ index 8fa7f6e1bb..649fff95b0 100644 }); while (!completablefuture.isDone()) { -@@ -506,11 +514,11 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -510,11 +518,11 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati throw new RuntimeException(executionexception.getCause()); } catch (TimeoutException timeoutexception) { @@ -63,10 +63,10 @@ index 8fa7f6e1bb..649fff95b0 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index dcc1d08b16..4c33c331f0 100644 +index c862f36628..bbfa92e85f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -2836,8 +2836,9 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2868,8 +2868,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int k = i * 16 + 8 - blockposition.getX(); int l = j * 16 + 8 - blockposition.getZ(); boolean flag = true; @@ -76,13 +76,13 @@ index dcc1d08b16..4c33c331f0 100644 + return k >= -keepLoadedRange && k <= keepLoadedRange && l >= -keepLoadedRange && l <= keepLoadedRange && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory' // Paper - Re-add range var } - public void a(Packet packet) { + public LongSet ag() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7ad009c073..3861c63cb8 100644 +index 272e127735..89f6c77dbc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -992,7 +992,7 @@ public final class CraftServer implements Server { - System.out.println("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")"); +@@ -996,7 +996,7 @@ public final class CraftServer implements Server { + System.out.println("Preparing start region for level " + (console.worldServer.size() - 1) + " (Seed: " + internal.getSeed() + ")"); if (internal.getWorld().getKeepSpawnInMemory()) { - short short1 = 196; @@ -91,10 +91,10 @@ index 7ad009c073..3861c63cb8 100644 for (int j = -short1; j <= short1; j += 16) { for (int k = -short1; k <= short1; k += 16) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index cb80fce3b5..907791a5f1 100644 +index 132b21f8bc..9637c98994 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1281,8 +1281,9 @@ public class CraftWorld implements World { +@@ -1274,8 +1274,9 @@ public class CraftWorld implements World { int chunkCoordX = chunkcoordinates.getX() >> 4; int chunkCoordZ = chunkcoordinates.getZ() >> 4; // Cycle through the 25x25 Chunks around it to load/unload the chunks. diff --git a/Spigot-Server-Patches/0095-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/0095-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch index 550b9d1122..da28672047 100644 --- a/Spigot-Server-Patches/0095-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch +++ b/Spigot-Server-Patches/0095-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -1,14 +1,14 @@ -From 64e9589f1843077c2fa08b83ffe6b69e7941fed8 Mon Sep 17 00:00:00 2001 +From dd72bc7341350bed6ef8855f5bd89d99a4504a3c Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 3 Apr 2016 17:48:50 -0400 Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 4c33c331f0..e693b43a23 100644 +index bbfa92e85f..0cdebf702a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -551,6 +551,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -572,6 +572,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public void applyPhysics(BlockPosition blockposition, Block block) { diff --git a/Spigot-Server-Patches/0096-Don-t-spam-reload-spawn-chunks-in-nether-end.patch b/Spigot-Server-Patches/0096-Don-t-spam-reload-spawn-chunks-in-nether-end.patch index 91c9f3ddfe..d5af6f0123 100644 --- a/Spigot-Server-Patches/0096-Don-t-spam-reload-spawn-chunks-in-nether-end.patch +++ b/Spigot-Server-Patches/0096-Don-t-spam-reload-spawn-chunks-in-nether-end.patch @@ -1,31 +1,39 @@ -From dc943703d601afe8a65e5af90b9cac08fbbdf837 Mon Sep 17 00:00:00 2001 +From 662ab65f604cf092e448c87a514adb3150c11449 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Apr 2016 19:42:22 -0400 Subject: [PATCH] Don't spam reload spawn chunks in nether/end diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e693b43a23..e75ce9b4f5 100644 +index 0cdebf702a..8abe3cdd92 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -2832,6 +2832,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2864,6 +2864,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return this.K; } -+ public boolean shouldStayLoaded(int i, int j) { return g(i, j); } // Paper - OBFHELPER - public boolean g(int i, int j) { ++ public boolean isSpawnChunk(int i, int j) { return e(i, j); } // Paper - OBFHELPER + public boolean e(int i, int j) { BlockPosition blockposition = this.getSpawn(); int k = i * 16 + 8 - blockposition.getX(); +@@ -2880,6 +2881,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + return (LongSet) (forcedchunk != null ? LongSets.unmodifiable(forcedchunk.a()) : LongSets.EMPTY_SET); + } + ++ public boolean isForcedChunk(int i, int j) { return f(i, j); } // Paper - OBFHELPER + public boolean f(int i, int j) { + ForcedChunk forcedchunk = (ForcedChunk) this.a(this.worldProvider.getDimensionManager(), ForcedChunk::new, "chunks"); + diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java -index 6b62235e54..26ef3a41f2 100644 +index bca5e50d98..088e7306cb 100644 --- a/src/main/java/net/minecraft/server/WorldProvider.java +++ b/src/main/java/net/minecraft/server/WorldProvider.java @@ -69,7 +69,7 @@ public abstract class WorldProvider { public void l() {} public boolean a(int i, int j) { -- return true; -+ return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds +- return !this.b.f(i, j); ++ return !this.b.isSpawnChunk(i, j) && !this.b.isForcedChunk(i, j); // Paper - Use spawn chunks check for all worlds } protected abstract void m(); diff --git a/Spigot-Server-Patches/0098-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/Spigot-Server-Patches/0098-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch index b0e28edc3d..feacbd8dfb 100644 --- a/Spigot-Server-Patches/0098-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ b/Spigot-Server-Patches/0098-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -1,14 +1,14 @@ -From 0196b87208cca641f06a4503905e9623833eb756 Mon Sep 17 00:00:00 2001 +From f8cb909a7f2be0d60914177cfae16d1945845f96 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 6 Apr 2016 01:04:23 -0500 Subject: [PATCH] Option to use vanilla per-world scoreboard coloring on names diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 667a0dde8c..b6ef1d4378 100644 +index 61e6dcb0ee..56a25531b4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -239,4 +239,9 @@ public class PaperWorldConfig { +@@ -242,4 +242,9 @@ public class PaperWorldConfig { keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 8)) * 16); log( "Keep Spawn Loaded Range: " + (keepLoadedRange/16)); } @@ -19,10 +19,10 @@ index 667a0dde8c..b6ef1d4378 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 53ef6b0ed6..da1254f5e1 100644 +index 5ab98cbcf1..3fc9568663 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2260,6 +2260,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2255,6 +2255,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.getFlag(5); } @@ -31,10 +31,10 @@ index 53ef6b0ed6..da1254f5e1 100644 public ScoreboardTeamBase be() { if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 90ab7f065f..1ca3c87c7a 100644 +index 096e4e0d8c..cc72398715 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1622,7 +1622,15 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1632,7 +1632,15 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { return; } diff --git a/Spigot-Server-Patches/0099-Workaround-for-setting-passengers-on-players.patch b/Spigot-Server-Patches/0099-Workaround-for-setting-passengers-on-players.patch index 5f82e58e61..5d88a55ac6 100644 --- a/Spigot-Server-Patches/0099-Workaround-for-setting-passengers-on-players.patch +++ b/Spigot-Server-Patches/0099-Workaround-for-setting-passengers-on-players.patch @@ -1,4 +1,4 @@ -From 7d20dbe3b794e0c62991f9f38a0d598c6201e567 Mon Sep 17 00:00:00 2001 +From fa5133d699ea96ded87fd66e7c663658e7bf4cd9 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 10 Apr 2016 03:23:32 -0500 Subject: [PATCH] Workaround for setting passengers on players @@ -6,10 +6,10 @@ Subject: [PATCH] Workaround for setting passengers on players SPIGOT-1915 & GH-114 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index be29f85a05..a84f1a055c 100644 +index f4d06a9465..9a3e36f17f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -713,6 +713,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -711,6 +711,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return true; } diff --git a/Spigot-Server-Patches/0100-Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/0100-Remove-unused-World-Tile-Entity-List.patch index 885ebdf5ff..d3cc050b6b 100644 --- a/Spigot-Server-Patches/0100-Remove-unused-World-Tile-Entity-List.patch +++ b/Spigot-Server-Patches/0100-Remove-unused-World-Tile-Entity-List.patch @@ -1,4 +1,4 @@ -From 7b61d5fb71384b095cc802986071aca677e507cf Mon Sep 17 00:00:00 2001 +From 9159a08fd4bc3baaf9131c771e6f712a3e810414 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 13 Apr 2016 00:25:28 -0400 Subject: [PATCH] Remove unused World Tile Entity List @@ -6,19 +6,19 @@ Subject: [PATCH] Remove unused World Tile Entity List Massive hit to performance and it is completely unnecessary. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e75ce9b4f5..f314925b6b 100644 +index 8abe3cdd92..3ce6058d4c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -73,7 +73,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -76,7 +76,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc }; // Spigot end - protected final Set g = Sets.newHashSet(); // Paper + protected final Set g = com.google.common.collect.Sets.newHashSet(); // Paper - public final List tileEntityList = Lists.newArrayList(); + //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list public final List tileEntityListTick = Lists.newArrayList(); private final List c = Lists.newArrayList(); - private final Set tileEntityListUnload = Sets.newHashSet(); // Paper -@@ -1281,7 +1281,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + private final Set tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper +@@ -1305,7 +1305,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { this.tileEntityListTick.removeAll(this.tileEntityListUnload); @@ -27,7 +27,7 @@ index e75ce9b4f5..f314925b6b 100644 this.tileEntityListUnload.clear(); } -@@ -1334,7 +1334,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1358,7 +1358,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (tileentity.x()) { tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); @@ -36,7 +36,7 @@ index e75ce9b4f5..f314925b6b 100644 if (this.isLoaded(tileentity.getPosition())) { this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition()); } -@@ -1364,7 +1364,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1388,7 +1388,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); // CraftBukkit start // From above, don't screw this up - SPIGOT-1746 @@ -45,7 +45,7 @@ index e75ce9b4f5..f314925b6b 100644 this.a(tileentity1); } // CraftBukkit end -@@ -1384,9 +1384,9 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1408,9 +1408,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc protected void p_() {} public boolean a(TileEntity tileentity) { @@ -57,7 +57,7 @@ index e75ce9b4f5..f314925b6b 100644 this.tileEntityListTick.add(tileentity); } -@@ -1867,7 +1867,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1891,7 +1891,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } else { if (tileentity != null) { this.c.remove(tileentity); diff --git a/Spigot-Server-Patches/0102-Configurable-Player-Collision.patch b/Spigot-Server-Patches/0102-Configurable-Player-Collision.patch index 1de92d7cbf..306256a1b3 100644 --- a/Spigot-Server-Patches/0102-Configurable-Player-Collision.patch +++ b/Spigot-Server-Patches/0102-Configurable-Player-Collision.patch @@ -1,4 +1,4 @@ -From e1b199e4583897d7f4ae1afcb31174fb9fa70c6f Mon Sep 17 00:00:00 2001 +From 6a566069cdf12ba0a87144cc0f2da39bdbee1b82 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 13 Apr 2016 02:10:49 -0400 Subject: [PATCH] Configurable Player Collision @@ -19,14 +19,13 @@ index a6042ca607..9fe1311143 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 204cf4f648..67c60be6f7 100644 +index 3fe374acb2..b45cdcd09f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -418,6 +418,20 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -424,6 +424,19 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + this.a(this.getWorldServer(DimensionManager.OVERWORLD).worldMaps); + // CraftBukkit end - this.a(this.getDifficulty()); - this.g_(); -+ + // Paper start - Handle collideRule team for player collision toggle + final Scoreboard scoreboard = this.getScoreboard(); + final java.util.Collection toRemove = scoreboard.getTeams().stream().filter(team -> team.getName().startsWith("collideRule_")).map(ScoreboardTeam::getName).collect(java.util.stream.Collectors.toList()); @@ -35,7 +34,7 @@ index 204cf4f648..67c60be6f7 100644 + } + + if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) { -+ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + worlds.get(0).random.nextInt(), 16); ++ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + java.util.concurrent.ThreadLocalRandom.current().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 + } @@ -57,7 +56,7 @@ index a6aed2531f..575e3762b2 100644 packetdataserializer.a(this.c); packetdataserializer.a(this.d); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 7f324a9c0f..d0c547cc99 100644 +index 8121f8e40a..02dbb8c6c3 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -74,6 +74,7 @@ public abstract class PlayerList { @@ -73,7 +72,7 @@ index 7f324a9c0f..d0c547cc99 100644 entityplayer.syncInventory(); + // Paper start - Add to collideRule team if needed -+ final Scoreboard scoreboard = this.getServer().getWorldServer(0).getScoreboard(); ++ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam collideRuleTeam = scoreboard.getTeam(collideRuleTeamName); + if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getTeam() == null) { + scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeam); @@ -88,7 +87,7 @@ index 7f324a9c0f..d0c547cc99 100644 + // Paper start - Remove from collideRule team if needed + if (this.collideRuleTeamName != null) { -+ final Scoreboard scoreBoard = this.server.getWorldServer(0).getScoreboard(); ++ final Scoreboard scoreBoard = this.server.getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName); + if (entityplayer.getTeam() == team && team != null) { + scoreBoard.removePlayerFromTeam(entityplayer.getName(), team); @@ -99,14 +98,14 @@ index 7f324a9c0f..d0c547cc99 100644 this.savePlayerFile(entityplayer); if (entityplayer.isPassenger()) { Entity entity = entityplayer.getRootVehicle(); -@@ -1311,7 +1329,13 @@ public abstract class PlayerList { +@@ -1305,7 +1323,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().getWorldServer(0).getScoreboard(); ++ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam team = scoreboard.getTeam(this.collideRuleTeamName); + if (team != null) scoreboard.removeTeam(team); + } diff --git a/Spigot-Server-Patches/0104-Configurable-RCON-IP-address.patch b/Spigot-Server-Patches/0104-Configurable-RCON-IP-address.patch index 1368b350e3..0e0a9a83ef 100644 --- a/Spigot-Server-Patches/0104-Configurable-RCON-IP-address.patch +++ b/Spigot-Server-Patches/0104-Configurable-RCON-IP-address.patch @@ -1,4 +1,4 @@ -From bfb9f37286c82a166bde5dc26bff46a34572442d Mon Sep 17 00:00:00 2001 +From 511600f9b9163449450704bd92e49f97283903a6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 16 Apr 2016 00:39:33 -0400 Subject: [PATCH] Configurable RCON IP address @@ -6,7 +6,7 @@ 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 6f0176f6ff..c237f239f3 100644 +index f91da84ff9..3d831b358b 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 { @@ -15,7 +15,7 @@ index 6f0176f6ff..c237f239f3 100644 this.l = iminecraftserver.a("rcon.password", ""); - this.j = iminecraftserver.e(); + this.j = iminecraftserver.a("rcon.ip", ((DedicatedServer) iminecraftserver).getServerIp()); // Paper - this.i = iminecraftserver.f(); + this.i = iminecraftserver.e_(); if (0 == this.h) { this.h = this.i + 10; -- diff --git a/Spigot-Server-Patches/0106-Implement-PlayerLocaleChangeEvent.patch b/Spigot-Server-Patches/0106-Implement-PlayerLocaleChangeEvent.patch index 033bb36952..9f0d23b7e2 100644 --- a/Spigot-Server-Patches/0106-Implement-PlayerLocaleChangeEvent.patch +++ b/Spigot-Server-Patches/0106-Implement-PlayerLocaleChangeEvent.patch @@ -1,28 +1,28 @@ -From 5a49f6e007f3a538d3b09b0f3eebf6e1aa4080c7 Mon Sep 17 00:00:00 2001 +From ebbb27eee3f336821cdbf6db5796e3bf5ec04471 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 0b1c5ca475..e036716970 100644 +index a9b08dcb0e..68e71a2f9d 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -37,7 +37,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -36,7 +36,7 @@ import org.bukkit.inventory.MainHand; + public class EntityPlayer extends EntityHuman implements ICrafting { private static final Logger cc = LogManager.getLogger(); - private static final IChatBaseComponent cd = (new ChatMessage("multiplayer.message_not_delivered", new Object[0])).a(EnumChatFormat.RED); - public String locale = "en_us"; // CraftBukkit - lowercase + public String locale = null; // CraftBukkit - lowercase // Paper - default to null public PlayerConnection playerConnection; public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; -@@ -1241,12 +1241,19 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1259,12 +1259,19 @@ 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.b())) { -+ if (this.locale == null || !this.locale.equals(packetplayinsettings.b())) { // Paper - fix bug and check for null ++ if (this.locale == null || !this.locale.equals(packetplayinsettings.b())) { // Paper - check for null PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(getBukkitEntity(), packetplayinsettings.b()); this.server.server.getPluginManager().callEvent(event); } @@ -35,14 +35,14 @@ index 0b1c5ca475..e036716970 100644 + new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent(); + } + // Paper end - this.ct = packetplayinsettings.d(); - this.cu = packetplayinsettings.e(); + this.cs = packetplayinsettings.d(); + this.ct = packetplayinsettings.e(); this.getDataWatcher().set(EntityPlayer.bx, Byte.valueOf((byte) packetplayinsettings.f())); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 93e2a34fec..4475d3318b 100644 +index 9a3e36f17f..e98f344c52 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1725,8 +1725,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1723,8 +1723,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { @@ -55,7 +55,7 @@ index 93e2a34fec..4475d3318b 100644 } // Paper start -@@ -1815,7 +1817,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1813,7 +1815,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { diff --git a/Spigot-Server-Patches/0108-Add-ability-to-configure-frosted_ice-properties.patch b/Spigot-Server-Patches/0108-Add-ability-to-configure-frosted_ice-properties.patch index e124d318e8..dc8b2792ab 100644 --- a/Spigot-Server-Patches/0108-Add-ability-to-configure-frosted_ice-properties.patch +++ b/Spigot-Server-Patches/0108-Add-ability-to-configure-frosted_ice-properties.patch @@ -1,14 +1,14 @@ -From 569009f4f6ccf61ecf805a6e9c8e71331b8473cf Mon Sep 17 00:00:00 2001 +From b10a2ee44d33c6b5cd078b16becfba07f9b57fa3 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 b6ef1d4378..8d54af6bb7 100644 +index 56a25531b4..25a5333219 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -244,4 +244,14 @@ public class PaperWorldConfig { +@@ -247,4 +247,14 @@ public class PaperWorldConfig { private void useVanillaScoreboardColoring() { useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false); } @@ -24,7 +24,7 @@ index b6ef1d4378..8d54af6bb7 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index 1d5c24c7a7..77cf6b8e9b 100644 +index 39b3c88d64..302d420512 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java @@ -12,6 +12,7 @@ public class BlockIceFrost extends BlockIce { @@ -35,14 +35,12 @@ index 1d5c24c7a7..77cf6b8e9b 100644 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 { +@@ -27,7 +28,7 @@ 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 +- world.J().a(blockposition_b, this, MathHelper.nextInt(random, 20, 40)); ++ world.J().a(blockposition_b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay } } } catch (Throwable throwable1) { diff --git a/Spigot-Server-Patches/0109-remove-null-possibility-for-getServer-singleton.patch b/Spigot-Server-Patches/0109-remove-null-possibility-for-getServer-singleton.patch index 385a529a8b..bcc7857036 100644 --- a/Spigot-Server-Patches/0109-remove-null-possibility-for-getServer-singleton.patch +++ b/Spigot-Server-Patches/0109-remove-null-possibility-for-getServer-singleton.patch @@ -1,4 +1,4 @@ -From f45a5c9addc227e73e61f4afd6fe88ff3bf4f92c Mon Sep 17 00:00:00 2001 +From a20f6fbf3f0195fa60bd30183c8ce30674b3d57e 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,10 +6,10 @@ 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 67c60be6f7..b41e7badff 100644 +index c7791dd925..ea882e4b82 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -68,6 +68,7 @@ import co.aikar.timings.MinecraftTimings; // Paper +@@ -72,6 +72,7 @@ import co.aikar.timings.MinecraftTimings; // Paper public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStatistics, ICommandListener, Runnable { @@ -17,7 +17,7 @@ index 67c60be6f7..b41e7badff 100644 public static final Logger LOGGER = LogManager.getLogger(); public static final File a = new File("usercache.json"); public Convertable convertable; -@@ -154,6 +155,8 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -161,6 +162,8 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // Spigot end public MinecraftServer(OptionSet options, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { @@ -26,7 +26,7 @@ index 67c60be6f7..b41e7badff 100644 this.ac = new ResourceManager(EnumResourcePackType.SERVER_DATA); this.resourcePackRepository = new ResourcePackRepository(ResourcePackLoader::new); this.ag = new CraftingManager(); -@@ -1811,7 +1814,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -1820,7 +1823,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // CraftBukkit start @Deprecated public static MinecraftServer getServer() { diff --git a/Spigot-Server-Patches/0110-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/Spigot-Server-Patches/0110-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index 6c6de03534..06c1f64d2d 100644 --- a/Spigot-Server-Patches/0110-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/Spigot-Server-Patches/0110-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -1,4 +1,4 @@ -From 0fdb56f20d6b3b075cfafbdff871e27aedfe96cb Mon Sep 17 00:00:00 2001 +From 9b8549b5f833b30bec269a67c7335f5140ce545e Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 29 Apr 2016 20:02:00 -0400 Subject: [PATCH] Improve Maps (in item frames) performance and bug fixes @@ -13,7 +13,7 @@ custom renderers are in use, defaulting to the much simpler Vanilla system. Additionally, numerous issues to player position tracking on maps has been fixed. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index ca14080ccd..9814075d6d 100644 +index 63f78924cb..79233fe463 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -610,6 +610,12 @@ public abstract class EntityHuman extends EntityLiving { @@ -30,7 +30,7 @@ index ca14080ccd..9814075d6d 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 40e0bd7ce2..a04a06f3bf 100644 +index 63dfede645..cce2ce9397 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -90,7 +90,7 @@ public class EntityTrackerEntry { @@ -43,30 +43,30 @@ index 40e0bd7ce2..a04a06f3bf 100644 ItemStack itemstack = entityitemframe.getItem(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f314925b6b..7dae87199e 100644 +index 3ce6058d4c..8005b0c110 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1086,6 +1086,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - { - if ( iter.next().trackee == entity ) +@@ -1109,6 +1109,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc { -+ map.decorations.remove(entity.getUniqueID()); // Paper - iter.remove(); + if ( iter.next().trackee == entity ) + { ++ map.decorations.remove(entity.getDisplayName().getString()); // Paper + iter.remove(); + } } - } diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java -index c73ffc3bc2..14754bbeb2 100644 +index aa58e34c6f..f26b91b407 100644 --- a/src/main/java/net/minecraft/server/WorldMap.java +++ b/src/main/java/net/minecraft/server/WorldMap.java -@@ -29,6 +29,7 @@ public class WorldMap extends PersistentBase { - public final Map j = Maps.newHashMap(); // Spigot private -> public +@@ -30,6 +30,7 @@ public class WorldMap extends PersistentBase { private final Map k = Maps.newHashMap(); public Map decorations = Maps.newLinkedHashMap(); + private final Map l = Maps.newHashMap(); + private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper // CraftBukkit start public final CraftMapView mapView; -@@ -41,6 +42,7 @@ public class WorldMap extends PersistentBase { +@@ -42,6 +43,7 @@ public class WorldMap extends PersistentBase { // CraftBukkit start mapView = new CraftMapView(this); server = (CraftServer) org.bukkit.Bukkit.getServer(); @@ -74,15 +74,15 @@ index c73ffc3bc2..14754bbeb2 100644 // CraftBukkit end } -@@ -105,6 +107,7 @@ public class WorldMap extends PersistentBase { +@@ -107,6 +109,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 - } + NBTTagList nbttaglist1 = nbttagcompound.getList("frames", 10); -@@ -148,6 +151,7 @@ public class WorldMap extends PersistentBase { +@@ -169,6 +172,7 @@ public class WorldMap extends PersistentBase { return nbttagcompound; } @@ -90,16 +90,16 @@ index c73ffc3bc2..14754bbeb2 100644 public void a(EntityHuman entityhuman, ItemStack itemstack) { if (!this.j.containsKey(entityhuman)) { WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman); -@@ -361,6 +365,21 @@ public class WorldMap extends PersistentBase { +@@ -404,6 +408,21 @@ public class WorldMap extends PersistentBase { public class WorldMapHumanTracker { + // Paper start + private void addSeenPlayers(java.util.Collection icons) { + org.bukkit.entity.Player player = (org.bukkit.entity.Player) trackee.getBukkitEntity(); -+ WorldMap.this.decorations.forEach((uuid, mapIcon) -> { ++ WorldMap.this.decorations.forEach((name, mapIcon) -> { + // If this cursor is for a player check visibility with vanish system -+ org.bukkit.entity.Player other = org.bukkit.Bukkit.getPlayer(uuid); // Spigot ++ org.bukkit.entity.Player other = org.bukkit.Bukkit.getPlayerExact(name); // Spigot + if (other == null || player.canSee(other)) { + icons.add(mapIcon); + } @@ -112,7 +112,7 @@ index c73ffc3bc2..14754bbeb2 100644 public final EntityHuman trackee; private boolean d = true; private int e; -@@ -377,9 +396,12 @@ public class WorldMap extends PersistentBase { +@@ -420,9 +439,12 @@ public class WorldMap extends PersistentBase { @Nullable public Packet a(ItemStack itemstack) { // CraftBukkit start diff --git a/Spigot-Server-Patches/0111-LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/0111-LootTable-API-Replenishable-Lootables-Feature.patch index 11e0478ea6..18d37fedef 100644 --- a/Spigot-Server-Patches/0111-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/0111-LootTable-API-Replenishable-Lootables-Feature.patch @@ -1,4 +1,4 @@ -From fd6c2c49c3fa2bbf29d1ea1ec2c04d901a1060d6 Mon Sep 17 00:00:00 2001 +From f87b03b9d893ea3c081afef79107c62f14ca2407 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 8d54af6bb7..a3823408ca 100644 +index df2863ce1b..c2c4e16d13 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -254,4 +254,26 @@ public class PaperWorldConfig { +@@ -257,4 +257,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); } @@ -41,29 +41,11 @@ index 8d54af6bb7..a3823408ca 100644 + } + } } -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootable.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootable.java +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java new file mode 100644 -index 0000000000..36c36d158f +index 0000000000..d6fce3112e --- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootable.java -@@ -0,0 +1,12 @@ -+package com.destroystokyo.paper.loottable; -+ -+import net.minecraft.server.World; -+ -+interface CraftLootable extends Lootable { -+ -+ World getNMSWorld(); -+ -+ default org.bukkit.World getBukkitWorld() { -+ return getNMSWorld().getWorld(); -+ } -+} -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableBlockInventory.java -new file mode 100644 -index 0000000000..20d236c451 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableBlockInventory.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java @@ -0,0 +1,33 @@ +package com.destroystokyo.paper.loottable; + @@ -73,7 +55,7 @@ index 0000000000..20d236c451 +import org.bukkit.Chunk; +import org.bukkit.block.Block; + -+public interface CraftLootableBlockInventory extends LootableBlockInventory, CraftLootableInventory { ++public interface PaperLootableBlockInventory extends LootableBlockInventory, PaperLootableInventory { + + TileEntityLootable getTileEntity(); + @@ -94,22 +76,22 @@ index 0000000000..20d236c451 + } + + @Override -+ default CraftLootableInventoryData getLootableData() { -+ return getTileEntity().getLootableData(); ++ default PaperLootableInventoryData getLootableData() { ++ return getTileEntity().lootableData; + } +} -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableEntityInventory.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableEntityInventory.java +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java new file mode 100644 -index 0000000000..1150dee01e +index 0000000000..5e637782d5 --- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableEntityInventory.java -@@ -0,0 +1,31 @@ ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java +@@ -0,0 +1,28 @@ +package com.destroystokyo.paper.loottable; + +import net.minecraft.server.World; +import org.bukkit.entity.Entity; + -+public interface CraftLootableEntityInventory extends LootableEntityInventory, CraftLootableInventory { ++public interface PaperLootableEntityInventory extends LootableEntityInventory, PaperLootableInventory { + + net.minecraft.server.Entity getHandle(); + @@ -128,28 +110,34 @@ index 0000000000..1150dee01e + } + + @Override -+ default CraftLootableInventoryData getLootableData() { -+ if (getHandle() instanceof CraftLootableInventory) { -+ return ((CraftLootableInventory) getHandle()).getLootableData(); -+ } -+ return null; ++ default PaperLootableInventoryData getLootableData() { ++ return getHandle().lootableData; + } +} -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventory.java +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java new file mode 100644 -index 0000000000..b72232093b +index 0000000000..856843fc91 --- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventory.java -@@ -0,0 +1,62 @@ ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java +@@ -0,0 +1,71 @@ +package com.destroystokyo.paper.loottable; + ++import net.minecraft.server.World; ++import org.bukkit.loot.Lootable; ++ +import java.util.UUID; + -+public interface CraftLootableInventory extends CraftLootable, LootableInventory { ++public interface PaperLootableInventory extends LootableInventory, Lootable { + -+ CraftLootableInventoryData getLootableData(); ++ PaperLootableInventoryData getLootableData(); + LootableInventory getAPILootableInventory(); + ++ World getNMSWorld(); ++ ++ default org.bukkit.World getBukkitWorld() { ++ return getNMSWorld().getWorld(); ++ } ++ + @Override + default boolean isRefillEnabled() { + return getNMSWorld().paperConfig.autoReplenishLootables; @@ -203,11 +191,11 @@ index 0000000000..b72232093b + return getLootableData().setNextRefill(refillAt); + } +} -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java new file mode 100644 -index 0000000000..8547205456 +index 0000000000..6e17af86a0 --- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java @@ -0,0 +1,179 @@ +package com.destroystokyo.paper.loottable; + @@ -222,7 +210,7 @@ index 0000000000..8547205456 +import java.util.Random; +import java.util.UUID; + -+public class CraftLootableInventoryData { ++public class PaperLootableInventoryData { + + private static final Random RANDOM = new Random(); + @@ -230,9 +218,9 @@ index 0000000000..8547205456 + private long nextRefill = -1; + private int numRefills = 0; + private Map lootedPlayers; -+ private final CraftLootableInventory lootable; ++ private final PaperLootableInventory lootable; + -+ public CraftLootableInventoryData(CraftLootableInventory lootable) { ++ public PaperLootableInventoryData(PaperLootableInventory lootable) { + this.lootable = lootable; + } + @@ -302,7 +290,7 @@ index 0000000000..8547205456 + this.nextRefill = this.lastFill + (min + RANDOM.nextInt(max - min + 1)) * 1000L; + this.numRefills++; + if (paperConfig.changeLootTableSeedOnFill) { -+ this.lootable.setLootTableSeed(0); ++ this.lootable.setSeed(0); + } + if (player != null) { // This means that numRefills can be incremented without a player being in the lootedPlayers list - Seems to be EntityMinecartChest specific + this.setPlayerLootedState(player.getUniqueID(), true); @@ -388,90 +376,101 @@ index 0000000000..8547205456 + return lootedPlayers != null ? lootedPlayers.get(player) : null; + } +} -diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -index 91b38fd64b..7120f00b6a 100644 ---- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java -+++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -@@ -5,18 +5,25 @@ import java.util.Random; - import javax.annotation.Nullable; - // CraftBukkit start - import java.util.List; -+// Paper start -+import com.destroystokyo.paper.loottable.CraftLootableInventoryData; -+import com.destroystokyo.paper.loottable.CraftLootableInventory; -+import com.destroystokyo.paper.loottable.LootableInventory; +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java +new file mode 100644 +index 0000000000..f9fbc221bd +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java +@@ -0,0 +1,64 @@ ++package com.destroystokyo.paper.loottable; ++ ++import net.minecraft.server.Entity; ++import net.minecraft.server.EntityMinecartContainer; ++import net.minecraft.server.MinecraftKey; ++import net.minecraft.server.World; +import org.bukkit.Bukkit; +import org.bukkit.craftbukkit.util.CraftNamespacedKey; -+// Paper end - import org.bukkit.Location; - import org.bukkit.craftbukkit.entity.CraftHumanEntity; - import org.bukkit.entity.HumanEntity; - import org.bukkit.inventory.InventoryHolder; - // CraftBukkit end - --public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable { -+public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable, CraftLootableInventory { // Paper - - private NonNullList items; - private boolean b; -- private MinecraftKey c; -- public long d; // CraftBukkit private -> public -+ private MinecraftKey c; private MinecraftKey getLootTableKey() { return c; } private void setLootTable(MinecraftKey key) { c = key; } // Paper - OBFHELPER -+ public long d; public long getSeed() { return d; } public void setSeed(long seed) { d = seed; } // Paper - OBFHELPER // CraftBukkit private -> public - - // CraftBukkit start - public List transaction = new java.util.ArrayList(); -@@ -168,12 +175,13 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp - - protected void b(NBTTagCompound nbttagcompound) { - super.b(nbttagcompound); -+ lootableData.saveNbt(nbttagcompound); // Paper - if (this.c != null) { - nbttagcompound.setString("LootTable", this.c.toString()); - if (this.d != 0L) { - nbttagcompound.setLong("LootTableSeed", this.d); - } -- } else { -+ } if (true) { // Paper - Always save the items, Table may stick around - ContainerUtil.a(nbttagcompound, this.items); - } - -@@ -181,11 +189,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp - - protected void a(NBTTagCompound nbttagcompound) { - super.a(nbttagcompound); -+ lootableData.loadNbt(nbttagcompound); // Paper - this.items = NonNullList.a(this.getSize(), ItemStack.a); - if (nbttagcompound.hasKeyOfType("LootTable", 8)) { - this.c = new MinecraftKey(nbttagcompound.getString("LootTable")); - this.d = nbttagcompound.getLong("LootTableSeed"); -- } else { -+ } if (true) { // Paper - always load the items, table may still remain - ContainerUtil.b(nbttagcompound, this.items); - } - -@@ -234,10 +243,10 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp - } - - public void f(@Nullable EntityHuman entityhuman) { -- 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) { -@@ -270,4 +279,39 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp - public MinecraftKey Q_() { - return this.c; - } + -+ // Paper start ++public class PaperMinecartLootableInventory implements PaperLootableEntityInventory { ++ ++ private EntityMinecartContainer entity; ++ ++ public PaperMinecartLootableInventory(EntityMinecartContainer entity) { ++ this.entity = entity; ++ } ++ + @Override + public org.bukkit.loot.LootTable getLootTable() { -+ return getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(getLootTableKey())) : null; ++ return entity.getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTableKey())) : null; ++ } ++ ++ @Override ++ public void setLootTable(org.bukkit.loot.LootTable table, long seed) { ++ setLootTable(table); ++ setSeed(seed); ++ } ++ ++ @Override ++ public void setSeed(long seed) { ++ entity.lootTableSeed = seed; ++ } ++ ++ @Override ++ public long getSeed() { ++ return entity.lootTableSeed; ++ } ++ ++ @Override ++ public void setLootTable(org.bukkit.loot.LootTable table) { ++ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); ++ entity.setLootTable(newKey); ++ } ++ ++ @Override ++ public PaperLootableInventoryData getLootableData() { ++ return entity.lootableData; ++ } ++ ++ @Override ++ public Entity getHandle() { ++ return entity; ++ } ++ ++ @Override ++ public LootableInventory getAPILootableInventory() { ++ return (LootableInventory) entity.getBukkitEntity(); ++ } ++ ++ @Override ++ public World getNMSWorld() { ++ return entity.world; ++ } ++} +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java +new file mode 100644 +index 0000000000..d50410532c +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java +@@ -0,0 +1,67 @@ ++package com.destroystokyo.paper.loottable; ++ ++import net.minecraft.server.MCUtil; ++import net.minecraft.server.MinecraftKey; ++import net.minecraft.server.TileEntityLootable; ++import net.minecraft.server.World; ++import org.bukkit.Bukkit; ++import org.bukkit.craftbukkit.util.CraftNamespacedKey; ++ ++public class PaperTileEntityLootableInventory implements PaperLootableBlockInventory { ++ private TileEntityLootable tileEntityLootable; ++ ++ public PaperTileEntityLootableInventory(TileEntityLootable tileEntityLootable) { ++ this.tileEntityLootable = tileEntityLootable; ++ } ++ ++ @Override ++ public org.bukkit.loot.LootTable getLootTable() { ++ return tileEntityLootable.getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.getLootTableKey())) : null; + } + + @Override @@ -483,55 +482,132 @@ index 91b38fd64b..7120f00b6a 100644 + @Override + public void setLootTable(org.bukkit.loot.LootTable table) { + MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); -+ setLootTable(newKey); ++ tileEntityLootable.setLootTable(newKey); + } -+ private final CraftLootableInventoryData lootableData = new CraftLootableInventoryData(this); + + @Override -+ public CraftLootableInventoryData getLootableData() { -+ return lootableData; ++ public void setSeed(long seed) { ++ tileEntityLootable.setSeed(seed); ++ } ++ ++ @Override ++ public long getSeed() { ++ return tileEntityLootable.getSeed(); ++ } ++ ++ @Override ++ public PaperLootableInventoryData getLootableData() { ++ return tileEntityLootable.lootableData; ++ } ++ ++ @Override ++ public TileEntityLootable getTileEntity() { ++ return tileEntityLootable; + } + + @Override + public LootableInventory getAPILootableInventory() { -+ return (LootableInventory) this.getBukkitEntity(); ++ World world = tileEntityLootable.getWorld(); ++ if (world == null) { ++ return null; ++ } ++ return (LootableInventory) getBukkitWorld().getBlockAt(MCUtil.toLocation(world, tileEntityLootable.getPosition())).getState(); + } + + @Override + public World getNMSWorld() { -+ return this.world; ++ return tileEntityLootable.getWorld(); + } -+ // Paper end - } ++} +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index 3fc9568663..d070d68d7c 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -69,6 +69,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; + } + ++ public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper + protected CraftEntity bukkitEntity; + + public CraftEntity getBukkitEntity() { +diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java +index 8945ab275b..184809b832 100644 +--- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java ++++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java +@@ -15,10 +15,11 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp + + private NonNullList items; + private boolean b; +- private MinecraftKey c; ++ private MinecraftKey c; public MinecraftKey getLootTableKey() { return c; } public void setLootTable(MinecraftKey key) { c = key; } // Paper - OBFHELPER + public long lootTableSeed; + + // CraftBukkit start ++ { lootableData = new com.destroystokyo.paper.loottable.PaperLootableInventoryData(new com.destroystokyo.paper.loottable.PaperMinecartLootableInventory(this)); } // Paper + public List transaction = new java.util.ArrayList(); + private int maxStack = MAX_STACK; + +@@ -168,12 +169,13 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp + + protected void b(NBTTagCompound nbttagcompound) { + super.b(nbttagcompound); ++ lootableData.saveNbt(nbttagcompound); // Paper + if (this.c != null) { + nbttagcompound.setString("LootTable", this.c.toString()); + if (this.lootTableSeed != 0L) { + nbttagcompound.setLong("LootTableSeed", this.lootTableSeed); + } +- } else { ++ } if (true) { // Paper - Always save the items, Table may stick around + ContainerUtil.a(nbttagcompound, this.items); + } + +@@ -181,11 +183,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp + + protected void a(NBTTagCompound nbttagcompound) { + super.a(nbttagcompound); ++ lootableData.loadNbt(nbttagcompound); // Paper + this.items = NonNullList.a(this.getSize(), ItemStack.a); + if (nbttagcompound.hasKeyOfType("LootTable", 8)) { + this.c = new MinecraftKey(nbttagcompound.getString("LootTable")); + this.lootTableSeed = nbttagcompound.getLong("LootTableSeed"); +- } else { ++ } if (true) { // Paper - always load the items, table may still remain + ContainerUtil.b(nbttagcompound, this.items); + } + +@@ -234,10 +237,10 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp + } + + public void f(@Nullable EntityHuman entityhuman) { +- if (this.c != null && this.world.getMinecraftServer() != null) { ++ if (lootableData.shouldReplenish(entityhuman) && this.world.getMinecraftServer() != null) { // Paper + LootTable loottable = this.world.getMinecraftServer().getLootTableRegistry().getLootTable(this.c); + +- this.c = null; ++ lootableData.processRefill(entityhuman); // Paper + Random random; + + if (this.lootTableSeed == 0L) { diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java -index fbda02b321..e0f87a3533 100644 +index 60d200f9eb..228d6b2800 100644 --- a/src/main/java/net/minecraft/server/TileEntityLootable.java +++ b/src/main/java/net/minecraft/server/TileEntityLootable.java -@@ -1,12 +1,20 @@ - package net.minecraft.server; +@@ -5,9 +5,10 @@ import javax.annotation.Nullable; -+// Paper start -+import com.destroystokyo.paper.loottable.CraftLootableInventoryData; -+import com.destroystokyo.paper.loottable.CraftLootableInventory; -+import com.destroystokyo.paper.loottable.LootableInventory; -+import org.bukkit.Bukkit; -+import org.bukkit.craftbukkit.util.CraftNamespacedKey; -+// Paper end -+ - import java.util.Random; - import javax.annotation.Nullable; - --public abstract class TileEntityLootable extends TileEntityContainer implements ILootable { -+public abstract class TileEntityLootable extends TileEntityContainer implements ILootable, CraftLootableInventory { // Paper + public abstract class TileEntityLootable extends TileEntityContainer implements ILootable { - protected MinecraftKey g; - protected long h; -+ protected MinecraftKey g; private MinecraftKey getLootTableKey() { return g; } private void setLootTable(MinecraftKey key) { g = key; } // Paper - OBFHELPER ++ protected MinecraftKey g; public MinecraftKey getLootTableKey() { return g; } public void setLootTable(MinecraftKey key) { g = key; } // Paper - OBFHELPER + protected long h; public long getSeed() { return h; } public void setSeed(long seed) { h = seed; } // Paper - OBFHELPER protected IChatBaseComponent i; ++ public final com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData = new com.destroystokyo.paper.loottable.PaperLootableInventoryData(new com.destroystokyo.paper.loottable.PaperTileEntityLootableInventory(this)); // Paper protected TileEntityLootable(TileEntityTypes tileentitytypes) { -@@ -23,16 +31,18 @@ public abstract class TileEntityLootable extends TileEntityContainer implements + super(tileentitytypes); +@@ -23,16 +24,18 @@ public abstract class TileEntityLootable extends TileEntityContainer implements } protected boolean d(NBTTagCompound nbttagcompound) { @@ -551,7 +627,7 @@ index fbda02b321..e0f87a3533 100644 if (this.g == null) { return false; } else { -@@ -41,15 +51,15 @@ public abstract class TileEntityLootable extends TileEntityContainer implements +@@ -41,15 +44,15 @@ public abstract class TileEntityLootable extends TileEntityContainer implements nbttagcompound.setLong("LootTableSeed", this.h); } @@ -563,53 +639,13 @@ index fbda02b321..e0f87a3533 100644 public void d(@Nullable EntityHuman entityhuman) { - 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); + LootTable loottable = this.world.getMinecraftServer().getLootTableRegistry().getLootTable(this.g); - this.g = null; + lootableData.processRefill(entityhuman); // Paper Random random; if (this.h == 0L) { -@@ -152,4 +162,39 @@ public abstract class TileEntityLootable extends TileEntityContainer implements - protected abstract NonNullList q(); - - protected abstract void a(NonNullList nonnulllist); -+ // Paper start - LootTable API -+ @Override -+ public org.bukkit.loot.LootTable getLootTable() { -+ return getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(getLootTableKey())) : null; -+ } -+ -+ @Override -+ public void setLootTable(org.bukkit.loot.LootTable table, long seed) { -+ setLootTable(table); -+ setSeed(seed); -+ } -+ -+ @Override -+ public void setLootTable(org.bukkit.loot.LootTable table) { -+ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); -+ setLootTable(newKey); -+ } -+ private final CraftLootableInventoryData lootableData = new CraftLootableInventoryData(this); -+ -+ @Override -+ public CraftLootableInventoryData getLootableData() { -+ return lootableData; -+ } -+ -+ @Override -+ public LootableInventory getAPILootableInventory() { -+ return (LootableInventory) getBukkitWorld().getBlockAt(MCUtil.toLocation(world, getPosition())).getState(); -+ } -+ -+ @Override -+ public World getNMSWorld() { -+ return world; -+ } -+ // 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 ac9b4297b2..0558cafe31 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -624,14 +660,14 @@ index ac9b4297b2..0558cafe31 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -index dff5bb5171..e7b719b43d 100644 +index dff5bb5171..c3e40aa172 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.server.BlockChest; -+import com.destroystokyo.paper.loottable.CraftLootableBlockInventory; // Paper ++import com.destroystokyo.paper.loottable.PaperLootableBlockInventory; // Paper import net.minecraft.server.BlockPosition; import net.minecraft.server.Blocks; import net.minecraft.server.ITileInventory; @@ -640,18 +676,18 @@ index dff5bb5171..e7b719b43d 100644 import org.bukkit.inventory.Inventory; -public class CraftChest extends CraftLootable implements Chest { -+public class CraftChest extends CraftLootable implements Chest, CraftLootableBlockInventory { // Paper ++public class CraftChest extends CraftLootable implements Chest, PaperLootableBlockInventory { // Paper public CraftChest(final Block block) { super(block, TileEntityChest.class); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java -index 34bcc49cf9..7ff7d33f06 100644 +index d519252521..a2324c7c8b 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.block; -+import com.destroystokyo.paper.loottable.CraftLootableBlockInventory; ++import com.destroystokyo.paper.loottable.PaperLootableBlockInventory; import net.minecraft.server.MinecraftKey; import net.minecraft.server.TileEntityLootable; import org.bukkit.Bukkit; @@ -660,7 +696,7 @@ index 34bcc49cf9..7ff7d33f06 100644 import org.bukkit.loot.Lootable; -public abstract class CraftLootable extends CraftContainer implements Nameable, Lootable { -+public abstract class CraftLootable extends CraftContainer implements Nameable, Lootable, CraftLootableBlockInventory { ++public abstract class CraftLootable extends CraftContainer implements Nameable, Lootable, PaperLootableBlockInventory { // Paper public CraftLootable(Block block, Class tileEntityClass) { super(block, tileEntityClass); @@ -671,16 +707,16 @@ index 34bcc49cf9..7ff7d33f06 100644 - private void setLootTable(LootTable table, long seed) { + public void setLootTable(LootTable table, long seed) { // Paper - public MinecraftKey key = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); - getSnapshot().a(key, seed); // PAIL setLootTable + getSnapshot().setLootTable(key, seed); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java -index 1b5b266c05..3d5225e9f2 100644 +index 1b5b266c05..e0b99207b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.entity; -+import com.destroystokyo.paper.loottable.CraftLootableEntityInventory; // Paper ++import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; // Paper import net.minecraft.server.EntityMinecartChest; import org.bukkit.craftbukkit.CraftServer; @@ -689,31 +725,31 @@ index 1b5b266c05..3d5225e9f2 100644 @SuppressWarnings("deprecation") -public class CraftMinecartChest extends CraftMinecartContainer implements StorageMinecart { -+public class CraftMinecartChest extends CraftMinecartContainer implements StorageMinecart, CraftLootableEntityInventory { // Paper ++public class CraftMinecartChest extends CraftMinecartContainer implements StorageMinecart, PaperLootableEntityInventory { // Paper private final CraftInventory inventory; public CraftMinecartChest(CraftServer server, EntityMinecartChest entity) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java -index 8ce9737451..7e11993aa6 100644 +index 87303ecd13..6790fa2fee 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java @@ -47,7 +47,7 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo - return getHandle().d; // PAIL rename lootTableSeed + return getHandle().lootTableSeed; } - private void setLootTable(LootTable table, long seed) { -+ public void setLootTable(LootTable table, long seed) { ++ public void setLootTable(LootTable table, long seed) { // Paper MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); getHandle().a(newKey, seed); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java -index f29365c948..c51de47433 100644 +index f29365c948..1937f7b9a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.entity; -+import com.destroystokyo.paper.loottable.CraftLootableEntityInventory; // Paper ++import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; // Paper import net.minecraft.server.EntityMinecartHopper; import org.bukkit.craftbukkit.CraftServer; @@ -722,36 +758,10 @@ index f29365c948..c51de47433 100644 import org.bukkit.inventory.Inventory; -public final class CraftMinecartHopper extends CraftMinecartContainer implements HopperMinecart { -+public final class CraftMinecartHopper extends CraftMinecartContainer implements HopperMinecart, CraftLootableEntityInventory { // Paper ++public final class CraftMinecartHopper extends CraftMinecartContainer implements HopperMinecart, PaperLootableEntityInventory { // Paper private final CraftInventory inventory; public CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) { -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index eb643cff3a..a3789c86b0 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -@@ -1,6 +1,7 @@ - package org.bukkit.craftbukkit.entity; - - import net.minecraft.server.EntityInsentient; -+import net.minecraft.server.MinecraftKey; - import org.bukkit.Bukkit; - import org.bukkit.NamespacedKey; - import org.bukkit.craftbukkit.CraftServer; -@@ -46,6 +47,13 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { - getHandle().bI = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); // PAIL rename lootTableKey - } - -+ // Paper start -+ public void setLootTable(LootTable table, long seed) { -+ setLootTable(table); -+ setSeed(seed); -+ } -+ // Paper end -+ - @Override - public LootTable getLootTable() { - if (getHandle().bI == null) { -- 2.18.0 diff --git a/Spigot-Server-Patches/0112-Do-not-load-chunks-for-pathfinding.patch b/Spigot-Server-Patches/0112-Do-not-load-chunks-for-pathfinding.patch index 776ccf1210..b76f6c8d47 100644 --- a/Spigot-Server-Patches/0112-Do-not-load-chunks-for-pathfinding.patch +++ b/Spigot-Server-Patches/0112-Do-not-load-chunks-for-pathfinding.patch @@ -1,14 +1,14 @@ -From 75a20e9c139b7789214b2e974441005d917b6870 Mon Sep 17 00:00:00 2001 +From b24b2307edfb6818ab904d60d55288bbf7a318ff 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 6d153e4311..07444a86ac 100644 +index 96c0c762ac..7020152a2d 100644 --- a/src/main/java/net/minecraft/server/ChunkCache.java +++ b/src/main/java/net/minecraft/server/ChunkCache.java -@@ -27,7 +27,7 @@ public class ChunkCache implements IIBlockAccess { +@@ -26,7 +26,7 @@ public class ChunkCache implements IIBlockAccess { for (l = this.a; l <= j; ++l) { for (i1 = this.b; i1 <= k; ++i1) { diff --git a/Spigot-Server-Patches/0113-Entity-Tracking-Improvements.patch b/Spigot-Server-Patches/0113-Entity-Tracking-Improvements.patch index 401d835699..b67631c0bb 100644 --- a/Spigot-Server-Patches/0113-Entity-Tracking-Improvements.patch +++ b/Spigot-Server-Patches/0113-Entity-Tracking-Improvements.patch @@ -1,4 +1,4 @@ -From d73a40f069529206aaa5365608272d6bfb902162 Mon Sep 17 00:00:00 2001 +From 3f75cb9ef3269d4e9c93f8e2dd9ad32598408488 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 17 Jun 2013 01:24:00 -0400 Subject: [PATCH] Entity Tracking Improvements @@ -7,11 +7,11 @@ 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 da1254f5e1..428eaca37a 100644 +index d070d68d7c..4d2e978894 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -71,6 +71,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - +@@ -72,6 +72,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper protected CraftEntity bukkitEntity; + EntityTrackerEntry tracker; // Paper @@ -19,7 +19,7 @@ index da1254f5e1..428eaca37a 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 a04a06f3bf..c405cc74ba 100644 +index cce2ce9397..4dbc5eca34 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 { diff --git a/Spigot-Server-Patches/0115-Fix-Chunk-Unload-Queue-Issues.patch b/Spigot-Server-Patches/0115-Fix-Chunk-Unload-Queue-Issues.patch deleted file mode 100644 index 013fe148c4..0000000000 --- a/Spigot-Server-Patches/0115-Fix-Chunk-Unload-Queue-Issues.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 88ae26f30c72f35356d81d68a6556611f3e050ea 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 - -Vanilla implemented similar logic as Paper had pre 1.9.4, but Spigot -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 e8a943cf74..63ca61c1d6 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -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 - 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 0e04d65981..2925c345a1 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -312,6 +312,7 @@ public class ChunkProviderServer implements IChunkProvider { - - if (chunk != null && chunk.d) { - // CraftBukkit start - move unload logic to own method -+ chunk.setShouldUnload(false); // Paper - if (!unloadChunk(chunk, true)) { - continue; - } --- -2.18.0 - diff --git a/Spigot-Server-Patches/0116-System-property-for-disabling-watchdoge.patch b/Spigot-Server-Patches/0115-System-property-for-disabling-watchdoge.patch similarity index 93% rename from Spigot-Server-Patches/0116-System-property-for-disabling-watchdoge.patch rename to Spigot-Server-Patches/0115-System-property-for-disabling-watchdoge.patch index 1e0c347c7c..1eb01c9116 100644 --- a/Spigot-Server-Patches/0116-System-property-for-disabling-watchdoge.patch +++ b/Spigot-Server-Patches/0115-System-property-for-disabling-watchdoge.patch @@ -1,4 +1,4 @@ -From 150dac76cd7357e6026832f7263c55c3cc87f587 Mon Sep 17 00:00:00 2001 +From 5fe9a031a9a71250a64c76d8f5e754b767ac2f19 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 diff --git a/Spigot-Server-Patches/0117-Optimize-EAR.patch b/Spigot-Server-Patches/0116-Optimize-EAR.patch similarity index 97% rename from Spigot-Server-Patches/0117-Optimize-EAR.patch rename to Spigot-Server-Patches/0116-Optimize-EAR.patch index b6280a8a8d..7af80138af 100644 --- a/Spigot-Server-Patches/0117-Optimize-EAR.patch +++ b/Spigot-Server-Patches/0116-Optimize-EAR.patch @@ -1,4 +1,4 @@ -From 032c328ab00e31daa453fa8aa02b823545b47146 Mon Sep 17 00:00:00 2001 +From 822622ef17b37a841d57067697dd95d5598f5ced 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/Spigot-Server-Patches/0118-Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/0117-Optimize-UserCache-Thread-Safe.patch similarity index 95% rename from Spigot-Server-Patches/0118-Optimize-UserCache-Thread-Safe.patch rename to Spigot-Server-Patches/0117-Optimize-UserCache-Thread-Safe.patch index d7b5a304e8..cedfcd95a9 100644 --- a/Spigot-Server-Patches/0118-Optimize-UserCache-Thread-Safe.patch +++ b/Spigot-Server-Patches/0117-Optimize-UserCache-Thread-Safe.patch @@ -1,4 +1,4 @@ -From c15b6afc0cf108c0a9da3655bdf3a6d0620231da Mon Sep 17 00:00:00 2001 +From b26f97657a8491fa7f159760722566e14fb80903 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,10 +10,10 @@ 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 b41e7badff..e3469cacff 100644 +index 18aa3bbb22..b1fbba3e2f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -676,7 +676,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -687,7 +687,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // Spigot start if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { LOGGER.info("Saving usercache.json"); diff --git a/Spigot-Server-Patches/0119-Avoid-blocking-on-Network-Manager-creation.patch b/Spigot-Server-Patches/0118-Avoid-blocking-on-Network-Manager-creation.patch similarity index 96% rename from Spigot-Server-Patches/0119-Avoid-blocking-on-Network-Manager-creation.patch rename to Spigot-Server-Patches/0118-Avoid-blocking-on-Network-Manager-creation.patch index acaea09883..9ead008f01 100644 --- a/Spigot-Server-Patches/0119-Avoid-blocking-on-Network-Manager-creation.patch +++ b/Spigot-Server-Patches/0118-Avoid-blocking-on-Network-Manager-creation.patch @@ -1,4 +1,4 @@ -From 425a37a0337ea93768d697b40b31625f56d6774c Mon Sep 17 00:00:00 2001 +From 7df87e1be5fa99ab7bd6b364376e23073f72d41f 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,7 +6,7 @@ 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 be8d07f41e..9808561eb3 100644 +index 9cff011dac..f04ce2fb03 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java @@ -40,6 +40,15 @@ public class ServerConnection { diff --git a/Spigot-Server-Patches/0120-Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/0119-Optional-TNT-doesn-t-move-in-water.patch similarity index 92% rename from Spigot-Server-Patches/0120-Optional-TNT-doesn-t-move-in-water.patch rename to Spigot-Server-Patches/0119-Optional-TNT-doesn-t-move-in-water.patch index eef40427b9..90173e9f33 100644 --- a/Spigot-Server-Patches/0120-Optional-TNT-doesn-t-move-in-water.patch +++ b/Spigot-Server-Patches/0119-Optional-TNT-doesn-t-move-in-water.patch @@ -1,11 +1,11 @@ -From 6d9962a0cf301943ff52739267c5c4435fad6fa4 Mon Sep 17 00:00:00 2001 +From 3c7d74ab58e7ae98df962acee851f875b4129330 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 a3823408ca..41e73b3409 100644 +index c2c4e16d13..f8102d9f07 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 a3823408ca..41e73b3409 100644 import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -276,4 +275,14 @@ public class PaperWorldConfig { +@@ -279,4 +278,14 @@ public class PaperWorldConfig { ); } } @@ -32,10 +32,10 @@ index a3823408ca..41e73b3409 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 428eaca37a..964caa080c 100644 +index 4fb42a6319..5bd129bcaf 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1173,6 +1173,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1170,6 +1170,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean aq() { @@ -48,7 +48,7 @@ index 428eaca37a..964caa080c 100644 return this.isInWater() || this.q(); } -@@ -2726,6 +2732,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2720,6 +2726,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean bw() { diff --git a/Spigot-Server-Patches/0121-Faster-redstone-torch-rapid-clock-removal.patch b/Spigot-Server-Patches/0120-Faster-redstone-torch-rapid-clock-removal.patch similarity index 94% rename from Spigot-Server-Patches/0121-Faster-redstone-torch-rapid-clock-removal.patch rename to Spigot-Server-Patches/0120-Faster-redstone-torch-rapid-clock-removal.patch index a1421990c3..17f84ae414 100644 --- a/Spigot-Server-Patches/0121-Faster-redstone-torch-rapid-clock-removal.patch +++ b/Spigot-Server-Patches/0120-Faster-redstone-torch-rapid-clock-removal.patch @@ -1,4 +1,4 @@ -From 0380647a8678e5285fb4191882e587197fd82bf3 Mon Sep 17 00:00:00 2001 +From dff6889d61088dc838be37a573ddf1429ebc1157 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,7 +6,7 @@ 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 c912fb8ae0..d2246cfb10 100644 +index 35abdee5e5..42cb2d47ca 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java @@ -63,9 +63,17 @@ public class BlockRedstoneTorch extends BlockTorch { diff --git a/Spigot-Server-Patches/0122-Ensure-Chunks-never-ever-load-async.patch b/Spigot-Server-Patches/0121-Ensure-Chunks-never-ever-load-async.patch similarity index 93% rename from Spigot-Server-Patches/0122-Ensure-Chunks-never-ever-load-async.patch rename to Spigot-Server-Patches/0121-Ensure-Chunks-never-ever-load-async.patch index 243b172733..3880eb34d7 100644 --- a/Spigot-Server-Patches/0122-Ensure-Chunks-never-ever-load-async.patch +++ b/Spigot-Server-Patches/0121-Ensure-Chunks-never-ever-load-async.patch @@ -1,4 +1,4 @@ -From 4aa4c8c762cbd75a985bd1bacfafe54507a38ece Mon Sep 17 00:00:00 2001 +From 2524c5992b465b4db1ccf20a94fd78e6decf5d53 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,7 +27,7 @@ index 7b7a3d01b9..9aaca21a79 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 52a8c48fa4..2bbd5a7e2a 100644 +index 52a8c48fa4..4cfe24df15 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java @@ -35,9 +35,9 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider Date: Sat, 28 May 2016 16:54:03 +0200 Subject: [PATCH] Add server-name parameter diff --git a/Spigot-Server-Patches/0124-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/Spigot-Server-Patches/0123-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch similarity index 95% rename from Spigot-Server-Patches/0124-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch rename to Spigot-Server-Patches/0123-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch index 3d252d2609..80acfbceed 100644 --- a/Spigot-Server-Patches/0124-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch +++ b/Spigot-Server-Patches/0123-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch @@ -1,4 +1,4 @@ -From fbd7b7751b67c1eeb439ea000ebb706f6a2897ef Mon Sep 17 00:00:00 2001 +From ac9156a326012ffc4bd53e63bed9531d22bb5005 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,7 +6,7 @@ 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 bbd807315a..131f8a5156 100644 +index 5375ef4699..b9afeaf72e 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 @@ -25,7 +25,7 @@ index bbd807315a..131f8a5156 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 4f73b02baf..0d68a9be6c 100644 +index b84e5728a0..485cac3240 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java @@ -199,8 +199,12 @@ public class EntityWither extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/0125-Delay-Chunk-Unloads-based-on-Player-Movement.patch b/Spigot-Server-Patches/0124-Delay-Chunk-Unloads-based-on-Player-Movement.patch similarity index 78% rename from Spigot-Server-Patches/0125-Delay-Chunk-Unloads-based-on-Player-Movement.patch rename to Spigot-Server-Patches/0124-Delay-Chunk-Unloads-based-on-Player-Movement.patch index 9ab4e05871..52a4835716 100644 --- a/Spigot-Server-Patches/0125-Delay-Chunk-Unloads-based-on-Player-Movement.patch +++ b/Spigot-Server-Patches/0124-Delay-Chunk-Unloads-based-on-Player-Movement.patch @@ -1,4 +1,4 @@ -From decdf8c2fb732471cb74652271e9ad351d74a207 Mon Sep 17 00:00:00 2001 +From 23074703de62e4ed8821b5a5d70478b97c160dd1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 18 Jun 2016 23:22:12 -0400 Subject: [PATCH] Delay Chunk Unloads based on Player Movement @@ -17,10 +17,10 @@ This allows servers with smaller worlds who do less long distance exploring to s wasting cpu cycles on saving/unloading/reloading chunks repeatedly. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 41e73b3409..ec6b550ff6 100644 +index f8102d9f07..547ab09627 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -285,4 +285,18 @@ public class PaperWorldConfig { +@@ -288,4 +288,18 @@ public class PaperWorldConfig { preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false); log("Prevent TNT from moving in water: " + preventTntFromMovingInWater); } @@ -40,23 +40,23 @@ index 41e73b3409..ec6b550ff6 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 63ca61c1d6..ace64c0345 100644 +index 0ef1a8c7d3..2efb870dd6 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -39,6 +39,7 @@ public class Chunk implements IChunkAccess { - private boolean j; public boolean isLoaded() { return j; } // Paper - OBFHELPER +@@ -37,6 +37,7 @@ public class Chunk implements IChunkAccess { + private boolean i;public boolean isLoaded() { return i; } // Paper - OBFHELPER public final World world; public final Map heightMap; + public Long scheduledForUnload; // Paper - delay chunk unloads public final int locX; public final int locZ; - private boolean m; + private boolean l; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 2925c345a1..a5139b0b0d 100644 +index 6b041f06e4..53dc1322e8 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -328,6 +328,19 @@ public class ChunkProviderServer implements IChunkProvider { - +@@ -305,6 +305,19 @@ public class ChunkProviderServer implements IChunkProvider { + } activityAccountant.endActivity(); // Spigot } + // Paper start - delayed chunk unloads @@ -73,16 +73,16 @@ index 2925c345a1..a5139b0b0d 100644 + } + // Paper end - this.f.a(); - this.chunkLoader.b(); + this.chunkScheduler.a(booleansupplier); + } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index ffff87dc03..344b95233f 100644 +index ac0e90eeca..3f4a8f21c0 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -33,14 +33,23 @@ public class PlayerChunk { +@@ -33,8 +33,16 @@ public class PlayerChunk { public void run() { loadInProgress = false; - PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getOrLoadChunkAt(location.x, location.z); + PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true); + markChunkUsed(); // Paper - delay chunk unloads } }; @@ -96,21 +96,22 @@ index ffff87dc03..344b95233f 100644 // CraftBukkit end public PlayerChunk(PlayerChunkMap playerchunkmap, int i, int j) { - this.playerChunkMap = playerchunkmap; - this.location = new ChunkCoordIntPair(i, j); - this.chunk = playerchunkmap.getWorld().getChunkProviderServer().getOrLoadChunkAt(i, j); +@@ -44,6 +52,7 @@ public class PlayerChunk { + + chunkproviderserver.a(i, j); + this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); + markChunkUsed(); // Paper - delay chunk unloads } public ChunkCoordIntPair a() { @@ -85,6 +94,7 @@ public class PlayerChunk { - this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z); - } else { - this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getOrLoadChunkAt(this.location.x, this.location.z); -+ markChunkUsed(); // Paper - delay chunk unloads - } - + return true; + } else { + this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag); ++ markChunkUsed(); // Paper - delay chunk unloads return this.chunk != null; + } + } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java index 4d888d6d4f..cf5c76a78e 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -131,11 +132,11 @@ index 4d888d6d4f..cf5c76a78e 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7dae87199e..b6efd8506b 100644 +index 8005b0c110..c6fa54848e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1305,7 +1305,13 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - if (!tileentity.x() && tileentity.u()) { +@@ -1329,7 +1329,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + if (!tileentity.x() && tileentity.hasWorld()) { BlockPosition blockposition = tileentity.getPosition(); - if (this.isLoaded(blockposition) && this.K.a(blockposition)) { @@ -143,17 +144,17 @@ index 7dae87199e..b6efd8506b 100644 + net.minecraft.server.Chunk chunk = this.getChunkIfLoaded(blockposition); + boolean shouldTick = chunk != null; + if(this.paperConfig.skipEntityTickingInChunksScheduledForUnload) -+ shouldTick = shouldTick && !chunk.isUnloading() && chunk.scheduledForUnload == null; ++ shouldTick = shouldTick && chunk.scheduledForUnload == null; + if (shouldTick && this.K.a(blockposition)) { + // Paper end try { this.methodProfiler.a(() -> { return String.valueOf(TileEntityTypes.a(tileentity.C())); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 907791a5f1..579e783d11 100644 +index 9637c98994..6b3b45f94a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1616,7 +1616,7 @@ public class CraftWorld implements World { +@@ -1620,7 +1620,7 @@ public class CraftWorld implements World { ChunkProviderServer cps = world.getChunkProviderServer(); for (net.minecraft.server.Chunk chunk : cps.chunks.values()) { // If in use, skip it @@ -163,16 +164,17 @@ index 907791a5f1..579e783d11 100644 } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index a9b84fdec4..e02647f806 100644 +index a9b84fdec4..34d2f11f4f 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -284,6 +284,10 @@ public class ActivationRange +@@ -284,6 +284,11 @@ public class ActivationRange { isActive = false; } + // Paper start - Skip ticking in chunks scheduled for unload -+ if(entity.world.paperConfig.skipEntityTickingInChunksScheduledForUnload && (chunk == null || chunk.isUnloading() || chunk.scheduledForUnload != null)) ++ else if (entity.world.paperConfig.skipEntityTickingInChunksScheduledForUnload && (chunk == null || chunk.scheduledForUnload != null)) { + isActive = false; ++ } + // Paper end return isActive; } diff --git a/Spigot-Server-Patches/0126-Fix-Double-World-Add-issues.patch b/Spigot-Server-Patches/0125-Fix-Double-World-Add-issues.patch similarity index 85% rename from Spigot-Server-Patches/0126-Fix-Double-World-Add-issues.patch rename to Spigot-Server-Patches/0125-Fix-Double-World-Add-issues.patch index 89101dce7c..52b05375af 100644 --- a/Spigot-Server-Patches/0126-Fix-Double-World-Add-issues.patch +++ b/Spigot-Server-Patches/0125-Fix-Double-World-Add-issues.patch @@ -1,4 +1,4 @@ -From c259b0b0cc6e23351d7f7a1ad344791a31eb8125 Mon Sep 17 00:00:00 2001 +From fef43c023a1486d881ecc405c59fc00acf543c3c Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 21 Jun 2016 22:54:34 -0400 Subject: [PATCH] Fix Double World Add issues @@ -8,10 +8,10 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added. Also add debug if something else tries to, and abort before world gets bad state diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index f007af2e1a..2f1488ee53 100644 +index dcd236a8e5..c85a8dac3e 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -1050,7 +1050,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -1036,7 +1036,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } public static void a(Entity entity, GeneratorAccess generatoraccess, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { @@ -21,10 +21,10 @@ index f007af2e1a..2f1488ee53 100644 Iterator iterator = entity.bP().iterator(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b6efd8506b..e74b53c483 100644 +index c6fa54848e..1ed4408e2a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -966,6 +966,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -987,6 +987,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot if (entity == null) return false; diff --git a/Spigot-Server-Patches/0127-Fix-Old-Sign-Conversion.patch b/Spigot-Server-Patches/0126-Fix-Old-Sign-Conversion.patch similarity index 93% rename from Spigot-Server-Patches/0127-Fix-Old-Sign-Conversion.patch rename to Spigot-Server-Patches/0126-Fix-Old-Sign-Conversion.patch index ec7a04d5f0..d13de63fce 100644 --- a/Spigot-Server-Patches/0127-Fix-Old-Sign-Conversion.patch +++ b/Spigot-Server-Patches/0126-Fix-Old-Sign-Conversion.patch @@ -1,4 +1,4 @@ -From bded4f3172edb734e59f253a5c4fa12c8e7d0e7c Mon Sep 17 00:00:00 2001 +From 80700c3208205e80f59a8d4b0f0f3c1f73bb6d2d Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 17 Jun 2016 20:50:11 -0400 Subject: [PATCH] Fix Old Sign Conversion @@ -9,7 +9,7 @@ Subject: [PATCH] Fix Old Sign Conversion This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java -index 785a1a2184..528db8704e 100644 +index bb1d00e440..9f29225cbd 100644 --- a/src/main/java/net/minecraft/server/DefinedStructure.java +++ b/src/main/java/net/minecraft/server/DefinedStructure.java @@ -218,9 +218,11 @@ public class DefinedStructure { @@ -25,7 +25,7 @@ index 785a1a2184..528db8704e 100644 } diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index d8d519143e..6021a3401f 100644 +index c5212417c6..b3c5766a27 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -11,6 +11,7 @@ import org.bukkit.inventory.InventoryHolder; // CraftBukkit @@ -37,10 +37,10 @@ index d8d519143e..6021a3401f 100644 private final TileEntityTypes e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER protected World world; diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index c5164ca3f4..2591c2f0b2 100644 +index 00b6a3c16d..20dc3f272c 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java -@@ -49,13 +49,14 @@ public class TileEntitySign extends TileEntity implements ICommandListener { +@@ -50,13 +50,14 @@ public class TileEntitySign extends TileEntity implements ICommandListener { } try { diff --git a/Spigot-Server-Patches/0128-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/Spigot-Server-Patches/0127-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch similarity index 93% rename from Spigot-Server-Patches/0128-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch rename to Spigot-Server-Patches/0127-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch index 2b886fa70d..b98a1d1f0e 100644 --- a/Spigot-Server-Patches/0128-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch +++ b/Spigot-Server-Patches/0127-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch @@ -1,4 +1,4 @@ -From 5292db9778ec4db6344cc8eebb6bf00c4f772c88 Mon Sep 17 00:00:00 2001 +From ad0fc24067501dccade31099a1cd96f049c9b280 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 16 Jul 2016 19:11:17 -0500 Subject: [PATCH] Don't lookup game profiles that have no UUID and no name diff --git a/Spigot-Server-Patches/0129-More-informative-vehicle-moved-wrongly-message.patch b/Spigot-Server-Patches/0128-More-informative-vehicle-moved-wrongly-message.patch similarity index 84% rename from Spigot-Server-Patches/0129-More-informative-vehicle-moved-wrongly-message.patch rename to Spigot-Server-Patches/0128-More-informative-vehicle-moved-wrongly-message.patch index c2790ad2c1..1f16c2f24c 100644 --- a/Spigot-Server-Patches/0129-More-informative-vehicle-moved-wrongly-message.patch +++ b/Spigot-Server-Patches/0128-More-informative-vehicle-moved-wrongly-message.patch @@ -1,14 +1,14 @@ -From 1b983e43aa6d3233a451b027d8b2a0b52e65bd9a Mon Sep 17 00:00:00 2001 +From 0625120d53d0e958a4bd2bf8e08390bf8c353f88 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 28 Jul 2016 17:58:53 -0500 Subject: [PATCH] More informative vehicle moved wrongly message diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 1ca3c87c7a..0fe8d1c3f1 100644 +index cc72398715..078230521f 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -354,7 +354,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -356,7 +356,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot flag1 = true; diff --git a/Spigot-Server-Patches/0130-Re-track-players-that-dismount-from-other-players.patch b/Spigot-Server-Patches/0129-Re-track-players-that-dismount-from-other-players.patch similarity index 85% rename from Spigot-Server-Patches/0130-Re-track-players-that-dismount-from-other-players.patch rename to Spigot-Server-Patches/0129-Re-track-players-that-dismount-from-other-players.patch index 18552ff27e..8322737292 100644 --- a/Spigot-Server-Patches/0130-Re-track-players-that-dismount-from-other-players.patch +++ b/Spigot-Server-Patches/0129-Re-track-players-that-dismount-from-other-players.patch @@ -1,14 +1,14 @@ -From 749742bd1afd6adb09686bc546a9c1884e94a469 Mon Sep 17 00:00:00 2001 +From e40481987760664b379e4efcc9079ce2d8b314ba Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 31 Jul 2016 16:33:03 -0500 Subject: [PATCH] Re-track players that dismount from other players diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e036716970..bdd1fef710 100644 +index 68e71a2f9d..96d7be49d8 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -746,6 +746,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -760,6 +760,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (entity1 != entity && this.playerConnection != null) { this.playerConnection.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch); } diff --git a/Spigot-Server-Patches/0131-Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/0130-Add-setting-for-proxy-online-mode-status.patch similarity index 92% rename from Spigot-Server-Patches/0131-Add-setting-for-proxy-online-mode-status.patch rename to Spigot-Server-Patches/0130-Add-setting-for-proxy-online-mode-status.patch index 1298a8bf00..28f771a0e5 100644 --- a/Spigot-Server-Patches/0131-Add-setting-for-proxy-online-mode-status.patch +++ b/Spigot-Server-Patches/0130-Add-setting-for-proxy-online-mode-status.patch @@ -1,4 +1,4 @@ -From 024f51166d00517cc92199c19abb9f7b04767b60 Mon Sep 17 00:00:00 2001 +From 7fba8277a95c2467bfa741dd65b9a057f290ec06 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Fri, 5 Aug 2016 01:03:08 +0200 Subject: [PATCH] Add setting for proxy online mode status @@ -19,7 +19,7 @@ index a1110da38e..0a8fc7927a 100644 + } } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index f135349174..85c7a96c5a 100644 +index 58d971cf20..8a2ff6a413 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -60,7 +60,8 @@ public class NameReferencingFileConverter { @@ -33,10 +33,10 @@ index f135349174..85c7a96c5a 100644 } else { String[] astring1 = astring; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3861c63cb8..ff1f71310e 100644 +index 89f6c77dbc..b0e8302f0c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1359,7 +1359,8 @@ public final class CraftServer implements Server { +@@ -1379,7 +1379,8 @@ public final class CraftServer implements Server { // Spigot Start GameProfile profile = null; // Only fetch an online UUID in online mode diff --git a/Spigot-Server-Patches/0132-Optimise-BlockStateEnum-hashCode-and-equals.patch b/Spigot-Server-Patches/0131-Optimise-BlockStateEnum-hashCode-and-equals.patch similarity index 97% rename from Spigot-Server-Patches/0132-Optimise-BlockStateEnum-hashCode-and-equals.patch rename to Spigot-Server-Patches/0131-Optimise-BlockStateEnum-hashCode-and-equals.patch index 85527a842e..8c6c47260d 100644 --- a/Spigot-Server-Patches/0132-Optimise-BlockStateEnum-hashCode-and-equals.patch +++ b/Spigot-Server-Patches/0131-Optimise-BlockStateEnum-hashCode-and-equals.patch @@ -1,4 +1,4 @@ -From 5954bc01e73be3868d879fe2fa37c67819cacb61 Mon Sep 17 00:00:00 2001 +From dd5091874dfece083093092af4cbda9ba622537c Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Fri, 19 Aug 2016 01:52:56 +0100 Subject: [PATCH] Optimise BlockStateEnum hashCode and equals diff --git a/Spigot-Server-Patches/0133-Disable-ticking-of-snow-blocks.patch b/Spigot-Server-Patches/0132-Disable-ticking-of-snow-blocks.patch similarity index 93% rename from Spigot-Server-Patches/0133-Disable-ticking-of-snow-blocks.patch rename to Spigot-Server-Patches/0132-Disable-ticking-of-snow-blocks.patch index efe60b5835..9a0fce8811 100644 --- a/Spigot-Server-Patches/0133-Disable-ticking-of-snow-blocks.patch +++ b/Spigot-Server-Patches/0132-Disable-ticking-of-snow-blocks.patch @@ -1,4 +1,4 @@ -From 8f03e0871060fbb45113907da543f4ef32e3fc65 Mon Sep 17 00:00:00 2001 +From 6617595e82a4ab827e58be697668323dbbeb3b46 Mon Sep 17 00:00:00 2001 From: killme Date: Tue, 30 Aug 2016 16:39:48 +0200 Subject: [PATCH] Disable ticking of snow blocks diff --git a/Spigot-Server-Patches/0134-Fix-AIOOBE-in-inventory-handling.patch b/Spigot-Server-Patches/0133-Fix-AIOOBE-in-inventory-handling.patch similarity index 85% rename from Spigot-Server-Patches/0134-Fix-AIOOBE-in-inventory-handling.patch rename to Spigot-Server-Patches/0133-Fix-AIOOBE-in-inventory-handling.patch index 4cf7eec17b..319461aa5c 100644 --- a/Spigot-Server-Patches/0134-Fix-AIOOBE-in-inventory-handling.patch +++ b/Spigot-Server-Patches/0133-Fix-AIOOBE-in-inventory-handling.patch @@ -1,14 +1,14 @@ -From a01021102b786403cb71a732788e62ec111eee75 Mon Sep 17 00:00:00 2001 +From 9ea05aab2d38b0135649160310d6b46a1133d409 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Sun, 4 Sep 2016 16:35:43 -0500 Subject: [PATCH] Fix AIOOBE in inventory handling diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 0fe8d1c3f1..ed02cd7a7a 100644 +index 078230521f..def0db5fea 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2086,7 +2086,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -2096,7 +2096,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { case CLONE: if (packetplayinwindowclick.d() == 2) { click = ClickType.MIDDLE; diff --git a/Spigot-Server-Patches/0135-Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/0134-Configurable-packet-in-spam-threshold.patch similarity index 93% rename from Spigot-Server-Patches/0135-Configurable-packet-in-spam-threshold.patch rename to Spigot-Server-Patches/0134-Configurable-packet-in-spam-threshold.patch index 99572dfced..13bc797d5f 100644 --- a/Spigot-Server-Patches/0135-Configurable-packet-in-spam-threshold.patch +++ b/Spigot-Server-Patches/0134-Configurable-packet-in-spam-threshold.patch @@ -1,4 +1,4 @@ -From 819150dc95ef61cb172647bd8eb4d73dd57252ea Mon Sep 17 00:00:00 2001 +From de3872ae39d2d23557256ea7d20a8f35808790d9 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 11 Sep 2016 14:30:57 -0500 Subject: [PATCH] Configurable packet in spam threshold @@ -23,10 +23,10 @@ index 0a8fc7927a..b496bc3869 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ed02cd7a7a..eec02ba0e9 100644 +index def0db5fea..830f3a89a8 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1186,13 +1186,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1199,13 +1199,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { // Spigot start - limit place/interactions private int limitedPackets; private long lastLimitedPacket = -1; diff --git a/Spigot-Server-Patches/0136-Configurable-flying-kick-messages.patch b/Spigot-Server-Patches/0135-Configurable-flying-kick-messages.patch similarity index 91% rename from Spigot-Server-Patches/0136-Configurable-flying-kick-messages.patch rename to Spigot-Server-Patches/0135-Configurable-flying-kick-messages.patch index 82227561fc..97c5aac8b3 100644 --- a/Spigot-Server-Patches/0136-Configurable-flying-kick-messages.patch +++ b/Spigot-Server-Patches/0135-Configurable-flying-kick-messages.patch @@ -1,4 +1,4 @@ -From e98e5640f208339d4204374704bbd2e10a9495cb Mon Sep 17 00:00:00 2001 +From 6416fe475c2676955813b2ea23fb84ef3a2384ba Mon Sep 17 00:00:00 2001 From: kashike Date: Tue, 20 Sep 2016 00:58:01 +0000 Subject: [PATCH] Configurable flying kick messages @@ -21,10 +21,10 @@ index b496bc3869..aa0e3c757d 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index eec02ba0e9..969e28c3b2 100644 +index 830f3a89a8..77f12b4d1d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -144,6 +144,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -146,6 +146,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { if (++this.C > 80) { PlayerConnection.LOGGER.warn("{} was kicked for floating too long!", this.player.getDisplayName().getString()); this.disconnect(new ChatMessage("multiplayer.disconnect.flying", new Object[0])); @@ -32,7 +32,7 @@ index eec02ba0e9..969e28c3b2 100644 return; } } else { -@@ -162,7 +163,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -164,7 +165,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { if (this.D && this.player.getRootVehicle().bO() == this.player) { if (++this.E > 80) { PlayerConnection.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getDisplayName().getString()); diff --git a/Spigot-Server-Patches/0137-Auto-Save-Improvements.patch b/Spigot-Server-Patches/0136-Auto-Save-Improvements.patch similarity index 81% rename from Spigot-Server-Patches/0137-Auto-Save-Improvements.patch rename to Spigot-Server-Patches/0136-Auto-Save-Improvements.patch index 1653244173..9b637dc5d8 100644 --- a/Spigot-Server-Patches/0137-Auto-Save-Improvements.patch +++ b/Spigot-Server-Patches/0136-Auto-Save-Improvements.patch @@ -1,4 +1,4 @@ -From 4f3ee27d644d6d032c9d1d1d2f8c12c621fa7908 Mon Sep 17 00:00:00 2001 +From 8120e628e716fa08733831f191244993f971e5b1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 19 Sep 2016 23:16:39 -0400 Subject: [PATCH] Auto Save Improvements @@ -32,7 +32,7 @@ index aa0e3c757d..c1845d6811 100644 + } } diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index ec6b550ff6..499230af60 100644 +index 547ab09627..78a3188274 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -2,6 +2,7 @@ package com.destroystokyo.paper; @@ -43,7 +43,7 @@ index ec6b550ff6..499230af60 100644 import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -299,4 +300,19 @@ public class PaperWorldConfig { +@@ -302,4 +303,19 @@ public class PaperWorldConfig { private void skipEntityTickingInChunksScheduledForUnload() { skipEntityTickingInChunksScheduledForUnload = getBoolean("skip-entity-ticking-in-chunks-scheduled-for-unload", skipEntityTickingInChunksScheduledForUnload); } @@ -64,30 +64,30 @@ index ec6b550ff6..499230af60 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index ace64c0345..229215180b 100644 +index 2efb870dd6..6c766f2bf7 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -52,9 +52,9 @@ public class Chunk implements IChunkAccess { - private final TickList t; - private final TickList u; - private boolean v; -- private boolean w; -+ private boolean w; public boolean hasEntities() { return w; } // Paper - OBFHELPER +@@ -50,9 +50,9 @@ public class Chunk implements IChunkAccess { + private final TickList s; + private final TickList t; + private boolean u; +- private boolean v; ++ private boolean v;public boolean hasEntities() { return v; } // Paper - OBFHELPER private long lastSaved; -- private boolean y; -+ private boolean y; public boolean isModified() { return y; } // Paper - OBFHELPER - private int z; - private long A; public long getInhabitedTime() { return A; } // Paper - OBFHELPER - private int B; -@@ -1022,11 +1022,11 @@ public class Chunk implements IChunkAccess { - if (this.w && this.world.getTime() != this.lastSaved || this.y) { +- private boolean x; ++ private boolean x; public boolean isModified() { return x; } // Paper - OBFHELPER + private int y; + private long z; + private int A; +@@ -1021,11 +1021,11 @@ public class Chunk implements IChunkAccess { + if (this.v && this.world.getTime() != this.lastSaved || this.x) { return true; } -- } else if (this.w && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification +- } else if (this.v && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification - return true; } - -- return this.y; +- return this.x; + // Paper start - Make world configurable and incremental + // This !flag section should say if isModified or hasEntities, then check auto save + return ((isModified() || hasEntities()) && this.world.getTime() >= this.lastSaved + world.paperConfig.autoSavePeriod); @@ -96,42 +96,35 @@ index ace64c0345..229215180b 100644 public boolean isEmpty() { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index a5139b0b0d..aa8d25e765 100644 +index 53dc1322e8..90840e4709 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -1,5 +1,6 @@ - package net.minecraft.server; - -+import com.destroystokyo.paper.PaperConfig; - import com.google.common.collect.Lists; - import it.unimi.dsi.fastutil.longs.Long2ObjectMap; - import it.unimi.dsi.fastutil.longs.Long2ObjectMaps; -@@ -270,7 +271,7 @@ public class ChunkProviderServer implements IChunkProvider { - this.saveChunk(chunk, false); // Spigot - chunk.a(false); - ++i; -- if (i == 24 && !flag && false) { // Spigot -+ if (!flag && i >= world.paperConfig.maxAutoSaveChunksPerTick) { // Spigot - // Paper - Incremental Auto Save - cap max per tick - return false; +@@ -240,7 +240,7 @@ public class ChunkProviderServer implements IChunkProvider { + this.saveChunk(chunk, false); // Spigot + chunk.a(false); + ++i; +- if (i == 24 && !flag && false) { // Spigot ++ if (!flag && i >= world.paperConfig.maxAutoSaveChunksPerTick) { // Spigot - // Paper - Incremental Auto Save - cap max + return false; + } } - } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index bdd1fef710..9c04fa4a6f 100644 +index 96d7be49d8..2c4fc9f3e6 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -38,6 +38,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -37,6 +37,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + private static final Logger cc = LogManager.getLogger(); - private static final IChatBaseComponent cd = (new ChatMessage("multiplayer.message_not_delivered", new Object[0])).a(EnumChatFormat.RED); public String locale = null; // CraftBukkit - lowercase // Paper - default to null + public long lastSave = MinecraftServer.currentTick; // Paper public PlayerConnection playerConnection; public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e3469cacff..02daa43c68 100644 +index 25946d2d79..ee13260af7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -144,6 +144,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -147,6 +147,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; public ConsoleReader reader; public static int currentTick = 0; // Paper - Further improve tick loop @@ -139,8 +132,8 @@ index e3469cacff..02daa43c68 100644 public final Thread primaryThread; public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; -@@ -913,22 +914,30 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.n.b().a(agameprofile); +@@ -934,22 +935,30 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + this.m.b().a(agameprofile); } - if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit @@ -161,7 +154,7 @@ index e3469cacff..02daa43c68 100644 // and causes the main thread to sleep for random amounts of time depending on chunk activity // Also pass flag to only save modified chunks server.playerCommandState = true; - for (World world : worlds) { + for (World world : getWorlds()) { - world.getWorld().save(false); + if (world.paperConfig.autoSavePeriod > 0) world.getWorld().save(false); // Paper - Incremental / Configurable Auto Saving } @@ -173,9 +166,9 @@ index e3469cacff..02daa43c68 100644 + //} // Paper - Incremental Auto Saving this.methodProfiler.a("snooper"); - if (getSnooperEnabled() && !this.j.d() && this.ticks > 100) { // Spigot + if (getSnooperEnabled() && !this.i.d() && this.ticks > 100) { // Spigot diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index d0c547cc99..12f6812d67 100644 +index 02dbb8c6c3..73d72ef7e3 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -341,6 +341,7 @@ public abstract class PlayerList { @@ -186,7 +179,7 @@ index d0c547cc99..12f6812d67 100644 this.playerFileData.save(entityplayer); ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) entityplayer.getStatisticManager(); // CraftBukkit -@@ -1213,13 +1214,25 @@ public abstract class PlayerList { +@@ -1207,13 +1208,25 @@ public abstract class PlayerList { } @@ -214,13 +207,13 @@ index d0c547cc99..12f6812d67 100644 public WhiteList getWhitelist() { return this.whitelist; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 96002184bb..bf07155bc1 100644 +index 4be3a6ae94..59b5a04581 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -872,8 +872,9 @@ public class WorldServer extends World implements IAsyncTaskHandler { ChunkProviderServer chunkproviderserver = this.getChunkProviderServer(); - if (chunkproviderserver.e()) { + if (chunkproviderserver.d()) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit + if (flag) org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit // Paper - Incremental Auto Saving - Only fire event on full save timings.worldSave.startTiming(); // Paper diff --git a/Spigot-Server-Patches/0138-Chunk-registration-fixes.patch b/Spigot-Server-Patches/0137-Chunk-registration-fixes.patch similarity index 80% rename from Spigot-Server-Patches/0138-Chunk-registration-fixes.patch rename to Spigot-Server-Patches/0137-Chunk-registration-fixes.patch index 8f53b82838..06e1f7e484 100644 --- a/Spigot-Server-Patches/0138-Chunk-registration-fixes.patch +++ b/Spigot-Server-Patches/0137-Chunk-registration-fixes.patch @@ -1,4 +1,4 @@ -From 09a9396af01295aa2445f6bcce8db8160d696d59 Mon Sep 17 00:00:00 2001 +From e0f5d9ef984d0bacc7739a5ad94d45e4761b196d Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 21 Sep 2016 22:54:28 -0400 Subject: [PATCH] Chunk registration fixes @@ -8,10 +8,10 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr Keep them consistent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e74b53c483..20e52fbcc8 100644 +index 1ed4408e2a..0fd91a687e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1485,7 +1485,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1509,7 +1509,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } i = MathHelper.floor(entity.locX / 16.0D); diff --git a/Spigot-Server-Patches/0139-Remove-FishingHook-reference-on-Craft-Entity-removal.patch b/Spigot-Server-Patches/0138-Remove-FishingHook-reference-on-Craft-Entity-removal.patch similarity index 93% rename from Spigot-Server-Patches/0139-Remove-FishingHook-reference-on-Craft-Entity-removal.patch rename to Spigot-Server-Patches/0138-Remove-FishingHook-reference-on-Craft-Entity-removal.patch index 596dae7848..8b8c587b7e 100644 --- a/Spigot-Server-Patches/0139-Remove-FishingHook-reference-on-Craft-Entity-removal.patch +++ b/Spigot-Server-Patches/0138-Remove-FishingHook-reference-on-Craft-Entity-removal.patch @@ -1,4 +1,4 @@ -From 7f9d1dd37e9eec7aa35da37945d67e42b73e3fae Mon Sep 17 00:00:00 2001 +From b663976005788b111d310e41061728bb1f628e86 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 16 Jun 2016 00:17:23 -0400 Subject: [PATCH] Remove FishingHook reference on Craft Entity removal diff --git a/Spigot-Server-Patches/0140-Auto-fix-bad-Y-levels-on-player-login.patch b/Spigot-Server-Patches/0139-Auto-fix-bad-Y-levels-on-player-login.patch similarity index 84% rename from Spigot-Server-Patches/0140-Auto-fix-bad-Y-levels-on-player-login.patch rename to Spigot-Server-Patches/0139-Auto-fix-bad-Y-levels-on-player-login.patch index 26fd3fe81b..1a90d5a433 100644 --- a/Spigot-Server-Patches/0140-Auto-fix-bad-Y-levels-on-player-login.patch +++ b/Spigot-Server-Patches/0139-Auto-fix-bad-Y-levels-on-player-login.patch @@ -1,4 +1,4 @@ -From f62f97c0dc44c38568c8b22e84f122d0281e82bb Mon Sep 17 00:00:00 2001 +From bbb2e472449e6a5bf3508c1fb0548ef3eda51957 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 21 Sep 2016 23:48:39 -0400 Subject: [PATCH] Auto fix bad Y levels on player login @@ -6,10 +6,10 @@ Subject: [PATCH] Auto fix bad Y levels on player login Bring down to a saner Y level if super high, as this can cause the server to crash diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 9c04fa4a6f..9bb70c151d 100644 +index 2c4fc9f3e6..47cf068a1e 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -199,6 +199,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -198,6 +198,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); diff --git a/Spigot-Server-Patches/0141-Disable-Vanilla-Chunk-GC.patch b/Spigot-Server-Patches/0140-Disable-Vanilla-Chunk-GC.patch similarity index 69% rename from Spigot-Server-Patches/0141-Disable-Vanilla-Chunk-GC.patch rename to Spigot-Server-Patches/0140-Disable-Vanilla-Chunk-GC.patch index 0fcf679aa1..bdca132a81 100644 --- a/Spigot-Server-Patches/0141-Disable-Vanilla-Chunk-GC.patch +++ b/Spigot-Server-Patches/0140-Disable-Vanilla-Chunk-GC.patch @@ -1,4 +1,4 @@ -From f46ee99721efcc27aebf7ad253a341f469316360 Mon Sep 17 00:00:00 2001 +From 9445d84de84ff1a9bd3edf221db6995c8fb1ab74 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 26 Sep 2016 01:51:30 -0400 Subject: [PATCH] Disable Vanilla Chunk GC @@ -6,19 +6,18 @@ Subject: [PATCH] Disable Vanilla Chunk GC Bukkit has its own system for this. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index bf07155bc1..8f6ce6bf1a 100644 +index 59b5a04581..e58b21ae43 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -889,7 +889,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -889,6 +889,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { chunkproviderserver.a(flag); timings.worldSaveChunks.stopTiming(); // Paper // CraftBukkit - ArrayList -> Collection -- Collection arraylist = chunkproviderserver.a(); -+ /* //Paper start Collection arraylist = chunkproviderserver.a(); ++ /* //Paper start - disable vanilla chunk GC + java.util.Collection arraylist = chunkproviderserver.a(); Iterator iterator = arraylist.iterator(); - while (iterator.hasNext()) { -@@ -898,7 +898,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -898,7 +899,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (chunk != null && !this.manager.a(chunk.locX, chunk.locZ)) { chunkproviderserver.unload(chunk); } diff --git a/Spigot-Server-Patches/0142-Option-to-remove-corrupt-tile-entities.patch b/Spigot-Server-Patches/0141-Option-to-remove-corrupt-tile-entities.patch similarity index 81% rename from Spigot-Server-Patches/0142-Option-to-remove-corrupt-tile-entities.patch rename to Spigot-Server-Patches/0141-Option-to-remove-corrupt-tile-entities.patch index 118930e5c0..8c21ccf286 100644 --- a/Spigot-Server-Patches/0142-Option-to-remove-corrupt-tile-entities.patch +++ b/Spigot-Server-Patches/0141-Option-to-remove-corrupt-tile-entities.patch @@ -1,14 +1,14 @@ -From acf15675a88a8b5969eb038d22b49e5cd5cf3e0c Mon Sep 17 00:00:00 2001 +From 562484f0d056b6dc66bb41aff08825166baaf62e Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 5 Oct 2016 16:27:36 -0500 Subject: [PATCH] Option to remove corrupt tile entities diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 499230af60..189ec79f05 100644 +index 78a3188274..79260172d9 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -315,4 +315,9 @@ public class PaperWorldConfig { +@@ -318,4 +318,9 @@ public class PaperWorldConfig { private void maxAutoSaveChunksPerTick() { maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); } @@ -19,10 +19,10 @@ index 499230af60..189ec79f05 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 229215180b..f6beb6886d 100644 +index 6c766f2bf7..fa549cc372 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -829,6 +829,12 @@ public class Chunk implements IChunkAccess { +@@ -826,6 +826,12 @@ public class Chunk implements IChunkAccess { "Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); e.printStackTrace(); ServerInternalException.reportInternalException(e); @@ -35,13 +35,13 @@ index 229215180b..f6beb6886d 100644 // Paper end // CraftBukkit end } -@@ -838,6 +844,7 @@ public class Chunk implements IChunkAccess { - this.i.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound); +@@ -835,6 +841,7 @@ public class Chunk implements IChunkAccess { + this.h.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound); } + public void removeTileEntity(BlockPosition blockposition) { this.d(blockposition); } // Paper - OBFHELPER public void d(BlockPosition blockposition) { - if (this.j) { + if (this.i) { TileEntity tileentity = (TileEntity) this.tileEntities.remove(blockposition); -- 2.18.0 diff --git a/Spigot-Server-Patches/0143-Add-EntityZapEvent.patch b/Spigot-Server-Patches/0142-Add-EntityZapEvent.patch similarity index 95% rename from Spigot-Server-Patches/0143-Add-EntityZapEvent.patch rename to Spigot-Server-Patches/0142-Add-EntityZapEvent.patch index 2e9fef3b34..8c51f1916d 100644 --- a/Spigot-Server-Patches/0143-Add-EntityZapEvent.patch +++ b/Spigot-Server-Patches/0142-Add-EntityZapEvent.patch @@ -1,11 +1,11 @@ -From faf970b94899cf3982625094f4068a6234035e09 Mon Sep 17 00:00:00 2001 +From 9e4cd9c04aa30130fee5dc678fc2f9812e24ccf4 Mon Sep 17 00:00:00 2001 From: AlphaBlend Date: Sun, 16 Oct 2016 23:19:30 -0700 Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index 34b6b01a30..670f26c827 100644 +index fecc7e154d..b405e63e81 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -152,6 +152,12 @@ public class EntityPig extends EntityAnimal { @@ -22,7 +22,7 @@ index 34b6b01a30..670f26c827 100644 if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) { return; diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 32893a32c9..45df38bad4 100644 +index 74a9fa9434..10921c1cbc 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -610,6 +610,12 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -48,7 +48,7 @@ index 32893a32c9..45df38bad4 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 38e07f39c0..5227c15d71 100644 +index e39352c221..4c98c7b337 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -695,6 +695,14 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/0144-Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/Spigot-Server-Patches/0143-Don-t-load-Chunks-from-Hoppers-and-other-things.patch similarity index 94% rename from Spigot-Server-Patches/0144-Don-t-load-Chunks-from-Hoppers-and-other-things.patch rename to Spigot-Server-Patches/0143-Don-t-load-Chunks-from-Hoppers-and-other-things.patch index f3fcd775fc..71fbf8d5f0 100644 --- a/Spigot-Server-Patches/0144-Don-t-load-Chunks-from-Hoppers-and-other-things.patch +++ b/Spigot-Server-Patches/0143-Don-t-load-Chunks-from-Hoppers-and-other-things.patch @@ -1,4 +1,4 @@ -From 9047a61c9f88a72ba5b3eb8757040b86c1be3951 Mon Sep 17 00:00:00 2001 +From d1ec7e8b6b6c83d3f142b5533340ae10a2ac9048 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Nov 2016 20:28:12 -0400 Subject: [PATCH] Don't load Chunks from Hoppers and other things @@ -13,7 +13,7 @@ This of course is undesirable, so just return the loaded side as "primary" and treat it as a single chest if the other sides are unloaded diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index 1ad39aca3b..7262c2b19f 100644 +index dd2d62bfba..8afd48de96 100644 --- a/src/main/java/net/minecraft/server/BlockChest.java +++ b/src/main/java/net/minecraft/server/BlockChest.java @@ -196,7 +196,12 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC diff --git a/Spigot-Server-Patches/0145-Prevent-Auto-Save-if-Save-Queue-is-full.patch b/Spigot-Server-Patches/0144-Prevent-Auto-Save-if-Save-Queue-is-full.patch similarity index 51% rename from Spigot-Server-Patches/0145-Prevent-Auto-Save-if-Save-Queue-is-full.patch rename to Spigot-Server-Patches/0144-Prevent-Auto-Save-if-Save-Queue-is-full.patch index 0d75004078..f23302648f 100644 --- a/Spigot-Server-Patches/0145-Prevent-Auto-Save-if-Save-Queue-is-full.patch +++ b/Spigot-Server-Patches/0144-Prevent-Auto-Save-if-Save-Queue-is-full.patch @@ -1,4 +1,4 @@ -From 611b7ca3705d1bbddc52ce5b54239609b31dbb28 Mon Sep 17 00:00:00 2001 +From bc41dd42020d4ee02972e95b3c721c52c6a0cf69 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Nov 2016 21:52:22 -0400 Subject: [PATCH] Prevent Auto Save if Save Queue is full @@ -7,10 +7,10 @@ If the save queue already has 50 (configurable) of chunks pending, then avoid processing auto save (which would add more) diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 189ec79f05..4d0f2051aa 100644 +index 79260172d9..381edf3e7d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -316,6 +316,11 @@ public class PaperWorldConfig { +@@ -319,6 +319,11 @@ public class PaperWorldConfig { maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); } @@ -23,46 +23,36 @@ index 189ec79f05..4d0f2051aa 100644 private void removeCorruptTEs() { removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false); diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index aa8d25e765..c1a42e61e7 100644 +index 90840e4709..87960344f1 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -260,6 +260,14 @@ public class ChunkProviderServer implements IChunkProvider { - ArrayList arraylist = Lists.newArrayList(this.chunks.values()); - Iterator iterator = arraylist.iterator(); +@@ -233,6 +233,13 @@ public class ChunkProviderServer implements IChunkProvider { + synchronized (this.chunkLoader) { + ObjectIterator objectiterator = this.chunks.values().iterator(); -+ // Paper start -+ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; -+ final int queueSize = chunkLoader.getQueueSize(); -+ if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ -+ return false; -+ } -+ final int autoSaveLimit = world.paperConfig.maxAutoSaveChunksPerTick; -+ // Paper end - while (iterator.hasNext()) { - Chunk chunk = (Chunk) iterator.next(); ++ // Paper start ++ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; ++ final int queueSize = chunkLoader.getQueueSize(); ++ if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ ++ return false; ++ } ++ // Paper end + while (objectiterator.hasNext()) { + Chunk chunk = (Chunk) objectiterator.next(); -@@ -271,7 +279,7 @@ public class ChunkProviderServer implements IChunkProvider { - this.saveChunk(chunk, false); // Spigot - chunk.a(false); - ++i; -- if (!flag && i >= world.paperConfig.maxAutoSaveChunksPerTick) { // Spigot - // Paper - Incremental Auto Save - cap max per tick -+ if (!flag && i >= autoSaveLimit) { // Spigot - // Paper - Incremental Auto Save - cap max per tick - return false; - } - } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 2f1488ee53..859148cb86 100644 +index c85a8dac3e..0fc50ce60c 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -137,6 +137,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - } +@@ -141,6 +141,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } + public int getQueueSize() { return queue.size(); } // Paper + // CraftBukkit start - Add async variant, provide compatibility @Nullable - public synchronized Chunk a(GeneratorAccess generatoraccess, int i, int j, Consumer consumer) throws IOException { + public Chunk a(GeneratorAccess generatoraccess, int i, int j, Consumer consumer) throws IOException { -- 2.18.0 diff --git a/Spigot-Server-Patches/0145-Chunk-Save-Stats-Debug-Option.patch b/Spigot-Server-Patches/0145-Chunk-Save-Stats-Debug-Option.patch new file mode 100644 index 0000000000..802c5ebd43 --- /dev/null +++ b/Spigot-Server-Patches/0145-Chunk-Save-Stats-Debug-Option.patch @@ -0,0 +1,93 @@ +From fc1808562cf1dd7ff5834b4e5692394bb9dd1524 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Fri, 4 Nov 2016 02:12:10 -0400 +Subject: [PATCH] Chunk Save Stats Debug Option + +Adds a command line flag to enable stats on how chunk saves are processing. + +Stats on current queue, how many was processed and how many were queued. + +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index 87960344f1..6b8d4c79e8 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -30,6 +30,11 @@ public class ChunkProviderServer implements IChunkProvider { + public final LongSet unloadQueue = new LongOpenHashSet(); + public final ChunkGenerator chunkGenerator; + private final IChunkLoader chunkLoader; ++ // Paper start - chunk save stats ++ private long lastQueuedSaves = 0L; // Paper ++ private long lastProcessedSaves = 0L; // Paper ++ private long lastSaveStatPrinted = System.currentTimeMillis(); ++ // Paper end + public final Long2ObjectMap chunks = Long2ObjectMaps.synchronize(new ChunkMap(8192)); + private Chunk lastChunk; + private final ChunkTaskScheduler chunkScheduler; +@@ -236,6 +241,29 @@ public class ChunkProviderServer implements IChunkProvider { + // Paper start + final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; + final int queueSize = chunkLoader.getQueueSize(); ++ ++ final long now = System.currentTimeMillis(); ++ final long timeSince = (now - lastSaveStatPrinted) / 1000; ++ final Integer printRateSecs = Integer.getInteger("printSaveStats"); ++ if (printRateSecs != null && timeSince >= printRateSecs) { ++ final String timeStr = "/" + timeSince +"s"; ++ final long queuedSaves = chunkLoader.getQueuedSaves(); ++ long queuedDiff = queuedSaves - lastQueuedSaves; ++ lastQueuedSaves = queuedSaves; ++ ++ final long processedSaves = chunkLoader.getProcessedSaves(); ++ long processedDiff = processedSaves - lastProcessedSaves; ++ lastProcessedSaves = processedSaves; ++ ++ lastSaveStatPrinted = now; ++ if (processedDiff > 0 || queueSize > 0 || queuedDiff > 0) { ++ System.out.println("[Chunk Save Stats] " + world.worldData.getName() + ++ " - Current: " + queueSize + ++ " - Queued: " + queuedDiff + timeStr + ++ " - Processed: " +processedDiff + timeStr ++ ); ++ } ++ } + if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ + return false; + } +diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +index 3283b5047d..110c9ef520 100644 +--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +@@ -141,7 +141,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + + } + +- public int getQueueSize() { return queue.size(); } // Paper ++ // Paper start ++ private long queuedSaves = 0; ++ private final java.util.concurrent.atomic.AtomicLong processedSaves = new java.util.concurrent.atomic.AtomicLong(0L); ++ public int getQueueSize() { return queue.size(); } ++ public long getQueuedSaves() { return queuedSaves; } ++ public long getProcessedSaves() { return processedSaves.longValue(); } ++ // Paper end + + // CraftBukkit start - Add async variant, provide compatibility + @Nullable +@@ -331,6 +337,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } + + protected void a(ChunkCoordIntPair chunkcoordintpair, Supplier nbttagcompound) { // Spigot ++ queuedSaves++; // Paper + synchronized (this.queue) { // Paper - synchronize while modifying the map + queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements + this.b.put(chunkcoordintpair, nbttagcompound); +@@ -356,6 +363,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } else { + ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements + Supplier nbttagcompound = chunk.compoundSupplier; // Spigot // Paper ++ processedSaves.incrementAndGet(); // Paper + + if (nbttagcompound == null) { + return true; +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0146-Chunk-Save-Stats-Debug-Option.patch b/Spigot-Server-Patches/0146-Chunk-Save-Stats-Debug-Option.patch deleted file mode 100644 index e2759332fc..0000000000 --- a/Spigot-Server-Patches/0146-Chunk-Save-Stats-Debug-Option.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 4acb687be9e81d3882d1dcc889a97acc566f8eb3 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Fri, 4 Nov 2016 02:12:10 -0400 -Subject: [PATCH] Chunk Save Stats Debug Option - -Adds a command line flag to enable stats on how chunk saves are processing. - -Stats on current queue, how many was processed and how many were queued. - -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index c1a42e61e7..c96f1b2753 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -36,6 +36,11 @@ public class ChunkProviderServer implements IChunkProvider { - public final Long2ObjectMap chunks = Long2ObjectMaps.synchronize(new ChunkMap(8192)); - private final ChunkTaskScheduler f; - private final SchedulerBatch g; -+ // Paper start - chunk save stats -+ private long lastQueuedSaves = 0L; // Paper -+ private long lastProcessedSaves = 0L; // Paper -+ private long lastSaveStatPrinted = System.currentTimeMillis(); -+ // Paper end - public final WorldServer world; - - public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, ChunkGenerator chunkgenerator, IAsyncTaskHandler iasynctaskhandler) { -@@ -263,6 +268,30 @@ public class ChunkProviderServer implements IChunkProvider { - // Paper start - final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; - final int queueSize = chunkLoader.getQueueSize(); -+ -+ final long now = System.currentTimeMillis(); -+ final long timeSince = (now - lastSaveStatPrinted) / 1000; -+ final Integer printRateSecs = Integer.getInteger("printSaveStats"); -+ if (printRateSecs != null && timeSince >= printRateSecs) { -+ final String timeStr = "/" + timeSince +"s"; -+ final long queuedSaves = chunkLoader.getQueuedSaves(); -+ long queuedDiff = queuedSaves - lastQueuedSaves; -+ lastQueuedSaves = queuedSaves; -+ -+ final long processedSaves = chunkLoader.getProcessedSaves(); -+ long processedDiff = processedSaves - lastProcessedSaves; -+ lastProcessedSaves = processedSaves; -+ -+ lastSaveStatPrinted = now; -+ if (processedDiff > 0 || queueSize > 0 || queuedDiff > 0) { -+ System.out.println("[Chunk Save Stats] " + world.worldData.getName() + -+ " - Current: " + queueSize + -+ " - Queued: " + queuedDiff + timeStr + -+ " - Processed: " +processedDiff + timeStr -+ ); -+ } -+ } -+ - if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ - return false; - } -diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 859148cb86..ea8684747d 100644 ---- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java -+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -137,7 +137,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - } - } - -- public int getQueueSize() { return queue.size(); } // Paper -+ // Paper start -+ private long queuedSaves = 0; -+ private final java.util.concurrent.atomic.AtomicLong processedSaves = new java.util.concurrent.atomic.AtomicLong(0L); -+ public int getQueueSize() { return queue.size(); } -+ public long getQueuedSaves() { return queuedSaves; } -+ public long getProcessedSaves() { return processedSaves.longValue(); } -+ // Paper end - - // CraftBukkit start - Add async variant, provide compatibility - @Nullable -@@ -325,6 +331,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - - protected synchronized void a(ChunkCoordIntPair chunkcoordintpair, Supplier nbttagcompound) { // Spigot - queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements -+ queuedSaves++; // Paper - this.b.put(chunkcoordintpair, nbttagcompound); - FileIOThread.a().a(this); - } -@@ -348,6 +355,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - return false; - } else { - ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements -+ processedSaves.incrementAndGet(); // Paper - - boolean flag; - --- -2.18.0 - diff --git a/Spigot-Server-Patches/0147-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch b/Spigot-Server-Patches/0146-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch similarity index 92% rename from Spigot-Server-Patches/0147-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch rename to Spigot-Server-Patches/0146-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch index 7e30ef4e06..d72e7c1bd4 100644 --- a/Spigot-Server-Patches/0147-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch +++ b/Spigot-Server-Patches/0146-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch @@ -1,11 +1,11 @@ -From 69ebaca79e2c169b0db6b464beaf1b8a384ae0ed Mon Sep 17 00:00:00 2001 +From efbd648ee65d57802a55f2fac78a344b3481f6e4 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 12 Nov 2016 23:25:22 -0600 Subject: [PATCH] Filter bad data from ArmorStand and SpawnEgg items diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 4d0f2051aa..872001d041 100644 +index 381edf3e7d..c22afafd6a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -3,6 +3,7 @@ package com.destroystokyo.paper; @@ -16,7 +16,7 @@ index 4d0f2051aa..872001d041 100644 import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -325,4 +326,12 @@ public class PaperWorldConfig { +@@ -328,4 +329,12 @@ public class PaperWorldConfig { private void removeCorruptTEs() { removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false); } @@ -30,7 +30,7 @@ index 4d0f2051aa..872001d041 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 33bc46b054..4e1b74ebe4 100644 +index 1fb912eb0d..3c3f82f987 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -228,6 +228,15 @@ public class EntityFallingBlock extends Entity { diff --git a/Spigot-Server-Patches/0148-Cache-user-authenticator-threads.patch b/Spigot-Server-Patches/0147-Cache-user-authenticator-threads.patch similarity index 92% rename from Spigot-Server-Patches/0148-Cache-user-authenticator-threads.patch rename to Spigot-Server-Patches/0147-Cache-user-authenticator-threads.patch index 197427c333..8d51849d38 100644 --- a/Spigot-Server-Patches/0148-Cache-user-authenticator-threads.patch +++ b/Spigot-Server-Patches/0147-Cache-user-authenticator-threads.patch @@ -1,11 +1,11 @@ -From b38249ab76ae2e8e2b755b638a6f33c10b388258 Mon Sep 17 00:00:00 2001 +From 8c8127501a72141fb7ee4ab3409810c47b859dcf Mon Sep 17 00:00:00 2001 From: vemacs Date: Wed, 23 Nov 2016 08:31:45 -0500 Subject: [PATCH] Cache user authenticator threads diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index eb936a0445..fae8a13973 100644 +index dea401c924..19ac21e385 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -93,6 +93,12 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -22,7 +22,7 @@ index eb936a0445..fae8a13973 100644 public void initUUID() { @@ -169,8 +175,8 @@ public class LoginListener implements PacketLoginInListener, ITickable { - this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.G().getPublic(), this.e)); + this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.E().getPublic(), this.e)); } else { // Spigot start - new Thread("User Authenticator #" + LoginListener.b.incrementAndGet()) { @@ -54,7 +54,7 @@ index eb936a0445..fae8a13973 100644 @@ -244,10 +252,8 @@ public class LoginListener implements PacketLoginInListener, ITickable { - return LoginListener.this.server.U() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; + return LoginListener.this.server.S() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; } - }; - diff --git a/Spigot-Server-Patches/0150-Optimise-removeQueue.patch b/Spigot-Server-Patches/0148-Optimise-removeQueue.patch similarity index 62% rename from Spigot-Server-Patches/0150-Optimise-removeQueue.patch rename to Spigot-Server-Patches/0148-Optimise-removeQueue.patch index 1c9325e11b..40f03066e6 100644 --- a/Spigot-Server-Patches/0150-Optimise-removeQueue.patch +++ b/Spigot-Server-Patches/0148-Optimise-removeQueue.patch @@ -1,11 +1,11 @@ -From ebb301f7d984c0b8b4e17421060351a161896c9b Mon Sep 17 00:00:00 2001 +From 8c714223164c2a6d6bc14adf7b4a518befb239b9 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Fri, 25 Nov 2016 13:22:40 +0000 Subject: [PATCH] Optimise removeQueue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 9bb70c151d..9505511b14 100644 +index 47cf068a1e..d8299a5759 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -5,8 +5,10 @@ import com.mojang.authlib.GameProfile; @@ -19,17 +19,21 @@ index 9bb70c151d..9505511b14 100644 import java.util.Iterator; import java.util.List; import java.util.Random; -@@ -44,7 +46,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -43,7 +45,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public final PlayerInteractManager playerInteractManager; public double d; public double e; - public final List removeQueue = Lists.newLinkedList(); + public final Deque removeQueue = new ArrayDeque<>(); // Paper - private final AdvancementDataPlayer cg; - private final ServerStatisticManager ch; - private float ci = Float.MIN_VALUE; -@@ -364,10 +366,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - Iterator iterator = this.removeQueue.iterator(); + private final AdvancementDataPlayer cf; + private final ServerStatisticManager cg; + private float ch = Float.MIN_VALUE; +@@ -360,13 +362,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + while (!this.removeQueue.isEmpty()) { + int i = Math.min(this.removeQueue.size(), Integer.MAX_VALUE); + int[] aint = new int[i]; +- Iterator iterator = this.removeQueue.iterator(); ++ //Iterator iterator = this.removeQueue.iterator(); // Paper int j = 0; - while (iterator.hasNext() && j < i) { @@ -47,18 +51,21 @@ index 9bb70c151d..9505511b14 100644 this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(aint)); } -@@ -1132,7 +1141,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1146,7 +1155,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.lastHealthSent = -1.0F; - this.cp = -1; - // this.cz.a((RecipeBook) entityplayer.cz); // CraftBukkit + this.co = -1; + // this.cy.a((RecipeBook) entityplayer.cy); // CraftBukkit - this.removeQueue.addAll(entityplayer.removeQueue); -+ // Paper start - Optimize remove queue ++ // Paper start - Optimize remove queue - vanilla copies player objects, but CB doesn't. This method currently only ++ // Applies to the same player, so we need to not duplicate our removal queue. The rest of this method does "resetting" ++ // type logic so it does need to be called, maybe? This is silly. + //this.removeQueue.addAll(entityplayer.removeQueue); + if (this.removeQueue != entityplayer.removeQueue) { + this.removeQueue.addAll(entityplayer.removeQueue); + } - this.cy = entityplayer.cy; - this.cD = entityplayer.cD; ++ // Paper end + this.cx = entityplayer.cx; + this.cC = entityplayer.cC; this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft()); -- 2.18.0 diff --git a/Spigot-Server-Patches/0151-Allow-Reloading-of-Command-Aliases.patch b/Spigot-Server-Patches/0149-Allow-Reloading-of-Command-Aliases.patch similarity index 89% rename from Spigot-Server-Patches/0151-Allow-Reloading-of-Command-Aliases.patch rename to Spigot-Server-Patches/0149-Allow-Reloading-of-Command-Aliases.patch index 42047148de..0951fb41e6 100644 --- a/Spigot-Server-Patches/0151-Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-Server-Patches/0149-Allow-Reloading-of-Command-Aliases.patch @@ -1,4 +1,4 @@ -From 4b5e62dfcb3777228d4557a314f3b9eb89513362 Mon Sep 17 00:00:00 2001 +From dc09fa789cba2a765342c96dc98767e5487c16ca Mon Sep 17 00:00:00 2001 From: willies952002 Date: Mon, 28 Nov 2016 10:21:52 -0500 Subject: [PATCH] Allow Reloading of Command Aliases @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ff1f71310e..476b01f70f 100644 +index b0e8302f0c..95f28c83af 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1983,5 +1983,24 @@ public final class CraftServer implements Server { +@@ -2003,5 +2003,24 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); } diff --git a/Spigot-Server-Patches/0149-Optimize-Network-Queue.patch b/Spigot-Server-Patches/0149-Optimize-Network-Queue.patch deleted file mode 100644 index bccc4bf6df..0000000000 --- a/Spigot-Server-Patches/0149-Optimize-Network-Queue.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 4d7709bdec846b2845277b058b0fee0c2afb580d Mon Sep 17 00:00:00 2001 -From: vemacs -Date: Wed, 23 Nov 2016 12:54:56 -0500 -Subject: [PATCH] Optimize Network Queue - - -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 02daa43c68..0560882314 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -118,7 +118,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - private final GameProfileRepository W; - private final UserCache X; - private long Y; -- protected final Queue> g = Queues.newConcurrentLinkedQueue(); -+ protected final Queue> g = new com.destroystokyo.paper.utils.CachedSizeConcurrentLinkedQueue<>(); // Spigot, PAIL: Rename // Paper - Make size() constant-time - private Thread serverThread; - private long aa = SystemUtils.b(); - private final IReloadableResourceManager ac; --- -2.18.0 - diff --git a/Spigot-Server-Patches/0152-Add-source-to-PlayerExpChangeEvent.patch b/Spigot-Server-Patches/0150-Add-source-to-PlayerExpChangeEvent.patch similarity index 94% rename from Spigot-Server-Patches/0152-Add-source-to-PlayerExpChangeEvent.patch rename to Spigot-Server-Patches/0150-Add-source-to-PlayerExpChangeEvent.patch index a6d140a0fa..a8b7c2c65e 100644 --- a/Spigot-Server-Patches/0152-Add-source-to-PlayerExpChangeEvent.patch +++ b/Spigot-Server-Patches/0150-Add-source-to-PlayerExpChangeEvent.patch @@ -1,11 +1,11 @@ -From f0e15ef75b19d01a56fc793b28d3bb65478358de Mon Sep 17 00:00:00 2001 +From 75d4ed8c2d6ddcca383a8e9e57733bbbca66ca1b Mon Sep 17 00:00:00 2001 From: AlphaBlend Date: Thu, 8 Sep 2016 08:48:33 -0700 Subject: [PATCH] Add source to PlayerExpChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index c8698b2f67..3c888d6015 100644 +index 33b24c833b..880f496526 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -185,7 +185,7 @@ public class EntityExperienceOrb extends Entity { @@ -18,7 +18,7 @@ index c8698b2f67..3c888d6015 100644 this.die(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 5227c15d71..01961c5bdd 100644 +index 4c98c7b337..488d0221c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -48,6 +48,7 @@ import org.bukkit.entity.Player; diff --git a/Spigot-Server-Patches/0153-Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/0151-Optimize-World.isLoaded-BlockPosition-Z.patch similarity index 68% rename from Spigot-Server-Patches/0153-Optimize-World.isLoaded-BlockPosition-Z.patch rename to Spigot-Server-Patches/0151-Optimize-World.isLoaded-BlockPosition-Z.patch index f49228d96d..fa62eb0bcf 100644 --- a/Spigot-Server-Patches/0153-Optimize-World.isLoaded-BlockPosition-Z.patch +++ b/Spigot-Server-Patches/0151-Optimize-World.isLoaded-BlockPosition-Z.patch @@ -1,4 +1,4 @@ -From 7b189ce3b0d490e5193f148241f783ed19d40033 Mon Sep 17 00:00:00 2001 +From e7ea340cf92a564e8eec4d6e46ca6be9d60b8db0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 2 Dec 2016 00:11:43 -0500 Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 20e52fbcc8..6fe8ce96aa 100644 +index 0fd91a687e..0cf5d80899 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -273,6 +273,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -274,6 +274,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return this.getType(blockposition).isAir(); } @@ -19,7 +19,7 @@ index 20e52fbcc8..6fe8ce96aa 100644 + // Paper start public Chunk getChunkIfLoaded(BlockPosition blockposition) { - return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); + return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); -- 2.18.0 diff --git a/Spigot-Server-Patches/0154-Don-t-let-fishinghooks-use-portals.patch b/Spigot-Server-Patches/0152-Don-t-let-fishinghooks-use-portals.patch similarity index 84% rename from Spigot-Server-Patches/0154-Don-t-let-fishinghooks-use-portals.patch rename to Spigot-Server-Patches/0152-Don-t-let-fishinghooks-use-portals.patch index 1fb32863c2..1057801c6c 100644 --- a/Spigot-Server-Patches/0154-Don-t-let-fishinghooks-use-portals.patch +++ b/Spigot-Server-Patches/0152-Don-t-let-fishinghooks-use-portals.patch @@ -1,24 +1,24 @@ -From 0caccdfd0545a6b148266d891c7918effde93a12 Mon Sep 17 00:00:00 2001 +From 8d513424da1fcbd8b169d842586a0adf68658f9a Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 16 Dec 2016 16:03:19 -0600 Subject: [PATCH] Don't let fishinghooks use portals diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 964caa080c..c287231584 100644 +index 5bd129bcaf..7f430e590f 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -157,7 +157,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -158,7 +158,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public boolean ak; public boolean impulse; public int portalCooldown; - protected boolean an; + protected boolean an; public boolean inPortal() { return an; } // Paper - OBFHELPER protected int ao; - public int dimension; + public DimensionManager dimension; protected BlockPosition aq; diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 7c119282b9..4f801e8fec 100644 +index b52aaa57e3..62e8f27aa7 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -190,6 +190,12 @@ public class EntityFishingHook extends Entity { diff --git a/Spigot-Server-Patches/0155-Add-ProjectileCollideEvent.patch b/Spigot-Server-Patches/0153-Add-ProjectileCollideEvent.patch similarity index 96% rename from Spigot-Server-Patches/0155-Add-ProjectileCollideEvent.patch rename to Spigot-Server-Patches/0153-Add-ProjectileCollideEvent.patch index 288c155071..c10949d8bf 100644 --- a/Spigot-Server-Patches/0155-Add-ProjectileCollideEvent.patch +++ b/Spigot-Server-Patches/0153-Add-ProjectileCollideEvent.patch @@ -1,14 +1,14 @@ -From dcd8262480ab5d1b2cfa2c232d16c345c48bf1de Mon Sep 17 00:00:00 2001 +From 35af608bf342b067ec974d7a2bd5fea0b8241388 Mon Sep 17 00:00:00 2001 From: Techcable Date: Fri, 16 Dec 2016 21:25:39 -0600 Subject: [PATCH] Add ProjectileCollideEvent diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 75445b00dc..4ab875a3d3 100644 +index c24225892f..187f02d4e4 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -191,6 +191,16 @@ public abstract class EntityArrow extends Entity implements IProjectile { +@@ -195,6 +195,16 @@ public abstract class EntityArrow extends Entity implements IProjectile { } } @@ -46,7 +46,7 @@ index 3e3619d79f..58cc4824cf 100644 this.a(movingobjectposition); diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 4f801e8fec..1804a49de9 100644 +index 62e8f27aa7..81de03084a 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -245,6 +245,16 @@ public class EntityFishingHook extends Entity { @@ -87,7 +87,7 @@ index ee402d4140..fc8c0cab55 100644 if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.a()).getBlock() == Blocks.NETHER_PORTAL) { this.e(movingobjectposition.a()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 01961c5bdd..8df07536f8 100644 +index 488d0221c2..89e765e803 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -799,6 +799,16 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/0156-Prevent-Pathfinding-out-of-World-Border.patch b/Spigot-Server-Patches/0154-Prevent-Pathfinding-out-of-World-Border.patch similarity index 91% rename from Spigot-Server-Patches/0156-Prevent-Pathfinding-out-of-World-Border.patch rename to Spigot-Server-Patches/0154-Prevent-Pathfinding-out-of-World-Border.patch index ea61642853..b736544017 100644 --- a/Spigot-Server-Patches/0156-Prevent-Pathfinding-out-of-World-Border.patch +++ b/Spigot-Server-Patches/0154-Prevent-Pathfinding-out-of-World-Border.patch @@ -1,4 +1,4 @@ -From 142065759260b7302dcdd7abf73aff114fe2aba5 Mon Sep 17 00:00:00 2001 +From a51800a28e394769c3410665328f4e43337f980b 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 @@ -26,12 +26,12 @@ index 76d1f4bd21..76b2787bae 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 4763c30a81..ec5386fd50 100644 +index acd76e13bb..1a87480f09 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 { - this.l = 5; - } +@@ -19,7 +19,7 @@ public class WorldBorder { + + public WorldBorder() {} - public boolean a(BlockPosition blockposition) { + public boolean isInBounds(BlockPosition blockposition) { return a(blockposition); }public boolean a(BlockPosition blockposition) { // Paper - OBFHELPER diff --git a/Spigot-Server-Patches/0157-Bound-Treasure-Maps-to-World-Border.patch b/Spigot-Server-Patches/0155-Bound-Treasure-Maps-to-World-Border.patch similarity index 91% rename from Spigot-Server-Patches/0157-Bound-Treasure-Maps-to-World-Border.patch rename to Spigot-Server-Patches/0155-Bound-Treasure-Maps-to-World-Border.patch index daa6f6664f..cf5d81aa71 100644 --- a/Spigot-Server-Patches/0157-Bound-Treasure-Maps-to-World-Border.patch +++ b/Spigot-Server-Patches/0155-Bound-Treasure-Maps-to-World-Border.patch @@ -1,4 +1,4 @@ -From 9d310106114ee82c53fbcf15191d7ada9fa69cf3 Mon Sep 17 00:00:00 2001 +From d5fa24ce4fb5599566b69cf8ccd2bfd27ffdd59c 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,22 +11,22 @@ 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 263ea953ad..8b8b468f39 100644 +index 142655c57e..6c2899e84d 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java @@ -124,6 +124,7 @@ public abstract class StructureGenerator - if (flag || flag1) { + if (flag1 || flag2) { 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 ec5386fd50..08424a88bf 100644 +index 1a87480f09..057ea1c5ac 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 { +@@ -23,6 +23,18 @@ public class WorldBorder { return (double) (blockposition.getX() + 1) > this.b() && (double) blockposition.getX() < this.d() && (double) (blockposition.getZ() + 1) > this.c() && (double) blockposition.getZ() < this.e(); } diff --git a/Spigot-Server-Patches/0158-Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/0156-Configurable-Cartographer-Treasure-Maps.patch similarity index 89% rename from Spigot-Server-Patches/0158-Configurable-Cartographer-Treasure-Maps.patch rename to Spigot-Server-Patches/0156-Configurable-Cartographer-Treasure-Maps.patch index fcbe594c6e..21a85b1ec9 100644 --- a/Spigot-Server-Patches/0158-Configurable-Cartographer-Treasure-Maps.patch +++ b/Spigot-Server-Patches/0156-Configurable-Cartographer-Treasure-Maps.patch @@ -1,4 +1,4 @@ -From 016a2ae644aa7f14306cfa9a71fd9b86637a5d34 Mon Sep 17 00:00:00 2001 +From 32fc8af4147db608136cb5c17b981e1e52693321 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 872001d041..b95f259a9a 100644 +index c22afafd6a..391cdd2fa5 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -334,4 +334,14 @@ public class PaperWorldConfig { +@@ -337,4 +337,14 @@ public class PaperWorldConfig { Bukkit.getLogger().warning("Spawn Egg and Armor Stand NBT filtering disabled, this is a potential security risk"); } } @@ -28,7 +28,7 @@ index 872001d041..b95f259a9a 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 45df38bad4..e8fdf86250 100644 +index 10921c1cbc..0227196f1e 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -755,6 +755,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -36,7 +36,7 @@ index 45df38bad4..e8fdf86250 100644 int i = this.a.a(random); World world = imerchant.getWorld(); + if (!world.paperConfig.enableTreasureMaps) return; //Paper - BlockPosition blockposition = world.a(this.b, imerchant.getPosition(), 100); + BlockPosition blockposition = world.a(this.b, imerchant.getPosition(), 100, true); if (blockposition != null) { -- diff --git a/Spigot-Server-Patches/0159-Optimize-ItemStack.isEmpty.patch b/Spigot-Server-Patches/0157-Optimize-ItemStack.isEmpty.patch similarity index 89% rename from Spigot-Server-Patches/0159-Optimize-ItemStack.isEmpty.patch rename to Spigot-Server-Patches/0157-Optimize-ItemStack.isEmpty.patch index 8f9009c4de..cb15a4e2c5 100644 --- a/Spigot-Server-Patches/0159-Optimize-ItemStack.isEmpty.patch +++ b/Spigot-Server-Patches/0157-Optimize-ItemStack.isEmpty.patch @@ -1,4 +1,4 @@ -From f71f7c99f39e17afaa189ddb74c6ff65d58231d8 Mon Sep 17 00:00:00 2001 +From ec3d526bfbed7645787a228fe8fc105bcea37a98 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 21 Dec 2016 03:48:29 -0500 Subject: [PATCH] Optimize ItemStack.isEmpty() @@ -6,7 +6,7 @@ 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 c7ef9c6890..4f230975aa 100644 +index 56787ed25c..f71d9ee578 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -142,7 +142,7 @@ public final class ItemStack { diff --git a/Spigot-Server-Patches/0160-Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-Server-Patches/0158-Add-API-methods-to-control-if-armour-stands-can-move.patch similarity index 91% rename from Spigot-Server-Patches/0160-Add-API-methods-to-control-if-armour-stands-can-move.patch rename to Spigot-Server-Patches/0158-Add-API-methods-to-control-if-armour-stands-can-move.patch index 9415573991..a816ea3204 100644 --- a/Spigot-Server-Patches/0160-Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/Spigot-Server-Patches/0158-Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -1,11 +1,11 @@ -From dd4923a11f20976061fbd0f9bfcbf2d688bd1eb8 Mon Sep 17 00:00:00 2001 +From 72a2b862549a3b7c84d6842b88669ce8325df998 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 cf11a2225b..578d966401 100644 +index 5485c4bff3..00a46129b8 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -44,6 +44,7 @@ public class EntityArmorStand extends EntityLiving { @@ -16,7 +16,7 @@ index cf11a2225b..578d966401 100644 public EntityArmorStand(World world) { super(EntityTypes.ARMOR_STAND, world); -@@ -755,4 +756,13 @@ public class EntityArmorStand extends EntityLiving { +@@ -757,4 +758,13 @@ public class EntityArmorStand extends EntityLiving { public boolean df() { return false; } diff --git a/Spigot-Server-Patches/0161-Add-option-to-remove-invalid-statistics.patch b/Spigot-Server-Patches/0159-Add-option-to-remove-invalid-statistics.patch similarity index 76% rename from Spigot-Server-Patches/0161-Add-option-to-remove-invalid-statistics.patch rename to Spigot-Server-Patches/0159-Add-option-to-remove-invalid-statistics.patch index 412485007d..2d8ef908c5 100644 --- a/Spigot-Server-Patches/0161-Add-option-to-remove-invalid-statistics.patch +++ b/Spigot-Server-Patches/0159-Add-option-to-remove-invalid-statistics.patch @@ -1,4 +1,4 @@ -From 91cc5d3990869c146ee076d44d79fa05d39a83d0 Mon Sep 17 00:00:00 2001 +From 835919765540d8cdbaca376e1f1ad2e8e23e868e 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 @@ -23,7 +23,7 @@ index c1845d6811..9f1182c723 100644 + } } diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java -index 07e7db455b..34c57e26f4 100644 +index 6405f98e06..42e2f3d22b 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 { @@ -34,14 +34,14 @@ index 07e7db455b..34c57e26f4 100644 try { jsonreader.setLenient(false); -@@ -118,6 +119,7 @@ public class ServerStatisticManager extends StatisticManager { +@@ -120,6 +121,7 @@ public class ServerStatisticManager extends StatisticManager { - if (statistic == null) { - ServerStatisticManager.b.warn("Invalid statistic in {}: Don\'t know what {} is", this.d, s2); + 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)); - } + } else { + this.a.put(statistic, nbttagcompound2.getInt(s2)); + } -- 2.18.0 diff --git a/Spigot-Server-Patches/0162-Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/0160-Properly-fix-item-duplication-bug.patch similarity index 83% rename from Spigot-Server-Patches/0162-Properly-fix-item-duplication-bug.patch rename to Spigot-Server-Patches/0160-Properly-fix-item-duplication-bug.patch index d9ce1e3019..1e8fe985cb 100644 --- a/Spigot-Server-Patches/0162-Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/0160-Properly-fix-item-duplication-bug.patch @@ -1,4 +1,4 @@ -From 24ecc3817771126c2d7976e868d27eed874baba7 Mon Sep 17 00:00:00 2001 +From 6e85901d729d461b68f4dd77f52d5bc6e8227021 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 9505511b14..9b1edab77d 100644 +index d8299a5759..49470bf5f0 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1538,7 +1538,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1559,7 +1559,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override protected boolean isFrozen() { @@ -19,10 +19,10 @@ index 9505511b14..9b1edab77d 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 969e28c3b2..3885c8628c 100644 +index 77f12b4d1d..9de392315e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2505,7 +2505,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -2515,7 +2515,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } public final boolean isDisconnected() { diff --git a/Spigot-Server-Patches/0163-String-based-Action-Bar-API.patch b/Spigot-Server-Patches/0161-String-based-Action-Bar-API.patch similarity index 90% rename from Spigot-Server-Patches/0163-String-based-Action-Bar-API.patch rename to Spigot-Server-Patches/0161-String-based-Action-Bar-API.patch index b3923f2964..3ef1c6bd16 100644 --- a/Spigot-Server-Patches/0163-String-based-Action-Bar-API.patch +++ b/Spigot-Server-Patches/0161-String-based-Action-Bar-API.patch @@ -1,11 +1,11 @@ -From 2a36c0293be0e894d2fb7531a905844308ce4a32 Mon Sep 17 00:00:00 2001 +From b63f8f73cacbf9ed1daaf8b6b722c9db0a51157f 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 diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 70cdc3f102..381542e0d2 100644 +index 9f9341c98f..966309a07d 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -1,10 +1,13 @@ @@ -47,7 +47,7 @@ index 70cdc3f102..381542e0d2 100644 public static boolean isMainThread() { return MinecraftServer.getServer().isMainThread(); -@@ -289,4 +310,13 @@ public final class MCUtil { +@@ -293,4 +314,13 @@ public final class MCUtil { } return null; } @@ -62,7 +62,7 @@ index 70cdc3f102..381542e0d2 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6f23ef5b81..63341ec778 100644 +index 03c262935d..2837fb87e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -209,6 +209,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -83,7 +83,7 @@ index 6f23ef5b81..63341ec778 100644 + @Override public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) { - PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter(); + setPlayerListHeader(header == null ? null : net.md_5.bungee.chat.ComponentSerializer.toString(header)); -- 2.18.0 diff --git a/Spigot-Server-Patches/0164-Activation-Range-Improvements.patch b/Spigot-Server-Patches/0162-Activation-Range-Improvements.patch similarity index 95% rename from Spigot-Server-Patches/0164-Activation-Range-Improvements.patch rename to Spigot-Server-Patches/0162-Activation-Range-Improvements.patch index 2973371b10..a9cffb1aa7 100644 --- a/Spigot-Server-Patches/0164-Activation-Range-Improvements.patch +++ b/Spigot-Server-Patches/0162-Activation-Range-Improvements.patch @@ -1,4 +1,4 @@ -From 9f4b4b473e9497c4d41e4a7c3797b2b352d4acfe Mon Sep 17 00:00:00 2001 +From e0b6b4859c0c2753033823614bd3b1217cee79be Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 27 Dec 2016 22:38:06 -0500 Subject: [PATCH] Activation Range Improvements @@ -6,7 +6,7 @@ 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 ceed50d8de..4c2cd41700 100644 +index 3790039f18..a644f393af 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -7,6 +7,7 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -18,7 +18,7 @@ index ceed50d8de..4c2cd41700 100644 private float b; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 05546ff4db..422b826d61 100644 +index 7e13a78411..60f22959b5 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -74,7 +74,7 @@ public abstract class EntityLiving extends Entity { @@ -31,15 +31,15 @@ index 05546ff4db..422b826d61 100644 protected int ticksFarFromPlayer; protected float aZ; diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index bb86ecb2fb..5cd8c3f288 100644 +index cdf50ed1cf..10b325043c 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.bR != null; } -+ public boolean inCaravan() { return this.en(); } // Paper - OBFHELPER - public boolean en() { ++ 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 @@ -99,7 +99,7 @@ index d5c08aa7cb..fe6570c88d 100644 } } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index e02647f806..cdbf769e7b 100644 +index 34d2f11f4f..958d15a6ba 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; diff --git a/Spigot-Server-Patches/0165-Firework-API-s.patch b/Spigot-Server-Patches/0163-Firework-API-s.patch similarity index 98% rename from Spigot-Server-Patches/0165-Firework-API-s.patch rename to Spigot-Server-Patches/0163-Firework-API-s.patch index 3a0a247d93..40c2510a98 100644 --- a/Spigot-Server-Patches/0165-Firework-API-s.patch +++ b/Spigot-Server-Patches/0163-Firework-API-s.patch @@ -1,4 +1,4 @@ -From 19b9fd7bebcb2b56fcfd4d48a77d58ae4cde4731 Mon Sep 17 00:00:00 2001 +From 2f347649f80f9ab29d035f5e7024c26bbd88bf5e 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/Spigot-Server-Patches/0166-PlayerTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0164-PlayerTeleportEndGatewayEvent.patch similarity index 92% rename from Spigot-Server-Patches/0166-PlayerTeleportEndGatewayEvent.patch rename to Spigot-Server-Patches/0164-PlayerTeleportEndGatewayEvent.patch index ed9c59735d..6a44c847d9 100644 --- a/Spigot-Server-Patches/0166-PlayerTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/0164-PlayerTeleportEndGatewayEvent.patch @@ -1,4 +1,4 @@ -From 10a014c690c95c33e9ff9aa5667fe820fc2e9a06 Mon Sep 17 00:00:00 2001 +From b5aa52013eeb8a676d7071f3cd8357877b9a4187 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 31 Dec 2016 21:44:50 -0500 Subject: [PATCH] PlayerTeleportEndGatewayEvent @@ -6,7 +6,7 @@ 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 9fd4ab6a7f..888bbd7a45 100644 +index 2a17115ac6..b36dcb4d7d 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java @@ -126,7 +126,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick diff --git a/Spigot-Server-Patches/0167-ShulkerBox-Dupe-Prevention.patch b/Spigot-Server-Patches/0165-ShulkerBox-Dupe-Prevention.patch similarity index 94% rename from Spigot-Server-Patches/0167-ShulkerBox-Dupe-Prevention.patch rename to Spigot-Server-Patches/0165-ShulkerBox-Dupe-Prevention.patch index 0fe03ad564..8ca28b919e 100644 --- a/Spigot-Server-Patches/0167-ShulkerBox-Dupe-Prevention.patch +++ b/Spigot-Server-Patches/0165-ShulkerBox-Dupe-Prevention.patch @@ -1,4 +1,4 @@ -From 09e0e636a258cd813f6833d95c9c226037644891 Mon Sep 17 00:00:00 2001 +From ca24c81230c4116ef5db72b222032c3d6b219078 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 2 Jan 2017 16:32:56 -0500 Subject: [PATCH] ShulkerBox Dupe Prevention diff --git a/Spigot-Server-Patches/0168-Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/0166-Provide-E-TE-Chunk-count-stat-methods.patch similarity index 93% rename from Spigot-Server-Patches/0168-Provide-E-TE-Chunk-count-stat-methods.patch rename to Spigot-Server-Patches/0166-Provide-E-TE-Chunk-count-stat-methods.patch index bbf94c405b..7f34d1f37b 100644 --- a/Spigot-Server-Patches/0168-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-Server-Patches/0166-Provide-E-TE-Chunk-count-stat-methods.patch @@ -1,4 +1,4 @@ -From 232d01433fe37bfda7b651b7070ddc53655592db Mon Sep 17 00:00:00 2001 +From 9c07ac68a080fbb4b9af90fde64a2f2902c7243c Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 15:24:46 -0500 Subject: [PATCH] Provide E/TE/Chunk count stat methods @@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index d4851dd2a6..84fcebd710 100644 +index 6b3b45f94a..f75a2e6be7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -81,6 +81,29 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0169-Enforce-Sync-Player-Saves.patch b/Spigot-Server-Patches/0167-Enforce-Sync-Player-Saves.patch similarity index 81% rename from Spigot-Server-Patches/0169-Enforce-Sync-Player-Saves.patch rename to Spigot-Server-Patches/0167-Enforce-Sync-Player-Saves.patch index 14d620c3b6..43f2357c88 100644 --- a/Spigot-Server-Patches/0169-Enforce-Sync-Player-Saves.patch +++ b/Spigot-Server-Patches/0167-Enforce-Sync-Player-Saves.patch @@ -1,4 +1,4 @@ -From 72379254cb1a9ed6e70ae8769b40fcbb8b86f562 Mon Sep 17 00:00:00 2001 +From f15ccb3e2e5e02171f6106325fa92f3217019104 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 12f6812d67..c8b5a610aa 100644 +index 73d72ef7e3..cc0ed8546f 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1220,6 +1220,7 @@ public abstract class PlayerList { +@@ -1214,6 +1214,7 @@ public abstract class PlayerList { } public void savePlayers(Integer interval) { @@ -18,7 +18,7 @@ index 12f6812d67..c8b5a610aa 100644 long now = MinecraftServer.currentTick; MinecraftTimings.savePlayers.startTiming(); // Paper int numSaved = 0; // Paper -@@ -1231,6 +1232,7 @@ public abstract class PlayerList { +@@ -1225,6 +1226,7 @@ public abstract class PlayerList { } } MinecraftTimings.savePlayers.stopTiming(); // Paper diff --git a/Spigot-Server-Patches/0170-Enforce-Sync-Chunk-Unloads.patch b/Spigot-Server-Patches/0168-Enforce-Sync-Chunk-Unloads.patch similarity index 89% rename from Spigot-Server-Patches/0170-Enforce-Sync-Chunk-Unloads.patch rename to Spigot-Server-Patches/0168-Enforce-Sync-Chunk-Unloads.patch index 61a618ef5b..413865f2b2 100644 --- a/Spigot-Server-Patches/0170-Enforce-Sync-Chunk-Unloads.patch +++ b/Spigot-Server-Patches/0168-Enforce-Sync-Chunk-Unloads.patch @@ -1,4 +1,4 @@ -From c2d1aef7ed491a82d01740c0a1de7b458ba1358e Mon Sep 17 00:00:00 2001 +From 48ae99005497fb58d8ed092c3e15d36f26593cec Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 16:06:44 -0500 Subject: [PATCH] Enforce Sync Chunk Unloads @@ -7,7 +7,7 @@ Unloading Chunks async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 84fcebd710..9cd991c3e7 100644 +index f75a2e6be7..5bfcedccc1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -224,6 +224,7 @@ public class CraftWorld implements World { @@ -15,7 +15,7 @@ index 84fcebd710..9cd991c3e7 100644 private boolean unloadChunk0(int x, int z, boolean save) { + Boolean result = MCUtil.ensureMain("Unload Chunk", () -> { // Paper - Ensure never async - net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkIfLoaded(x, z); + net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z, false, false); if (chunk == null) { return true; @@ -231,6 +232,7 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0171-Don-t-allow-entities-to-ride-themselves-572.patch b/Spigot-Server-Patches/0169-Don-t-allow-entities-to-ride-themselves-572.patch similarity index 82% rename from Spigot-Server-Patches/0171-Don-t-allow-entities-to-ride-themselves-572.patch rename to Spigot-Server-Patches/0169-Don-t-allow-entities-to-ride-themselves-572.patch index 55ec55e186..d7af5c2eec 100644 --- a/Spigot-Server-Patches/0171-Don-t-allow-entities-to-ride-themselves-572.patch +++ b/Spigot-Server-Patches/0169-Don-t-allow-entities-to-ride-themselves-572.patch @@ -1,14 +1,14 @@ -From 490f80cc952730f9b5974295f680abcde76b1d3c Mon Sep 17 00:00:00 2001 +From df9a405ea09f990b466ea4b5482545b799066b32 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 c287231584..3955884e10 100644 +index 7f430e590f..a16fbd4579 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2077,6 +2077,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2073,6 +2073,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } protected void o(Entity entity) { diff --git a/Spigot-Server-Patches/0172-Fix-block-break-desync.patch b/Spigot-Server-Patches/0170-Fix-block-break-desync.patch similarity index 85% rename from Spigot-Server-Patches/0172-Fix-block-break-desync.patch rename to Spigot-Server-Patches/0170-Fix-block-break-desync.patch index 36516270e0..13694912f7 100644 --- a/Spigot-Server-Patches/0172-Fix-block-break-desync.patch +++ b/Spigot-Server-Patches/0170-Fix-block-break-desync.patch @@ -1,14 +1,14 @@ -From 8a7de9d244d1ba40567f71a5e09e3b4d43122611 Mon Sep 17 00:00:00 2001 +From b3ad34c21c285e2b9c65597ebe1a722ae8c536ad 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 3885c8628c..08ef17dfe1 100644 +index 9de392315e..7f61da1cd3 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1145,6 +1145,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1158,6 +1158,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { double d3 = d0 * d0 + d1 * d1 + d2 * d2; if (d3 > 36.0D) { diff --git a/Spigot-Server-Patches/0173-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/Spigot-Server-Patches/0171-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch similarity index 96% rename from Spigot-Server-Patches/0173-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch rename to Spigot-Server-Patches/0171-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 88afe12f4f..e96b2d87e8 100644 --- a/Spigot-Server-Patches/0173-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/Spigot-Server-Patches/0171-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -1,4 +1,4 @@ -From 8c55114fb8480e5ec9da06926509ac8864ad2762 Mon Sep 17 00:00:00 2001 +From e1de8e00ef96880a95e17dee22f3e1f1ad5ed3f5 Mon Sep 17 00:00:00 2001 From: Aikar 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 43feccef8f..e820bfbd56 100644 +index 7818a3b6a7..d55b076f5d 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -471,13 +471,13 @@ public class Block implements IMaterial { +@@ -454,13 +454,13 @@ public class Block implements IMaterial { } } @@ -28,7 +28,7 @@ index 43feccef8f..e820bfbd56 100644 } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 131f8a5156..d8ab87e216 100644 +index b9afeaf72e..2c735a920d 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,7 +41,7 @@ index 131f8a5156..d8ab87e216 100644 } diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 3c888d6015..79d80596df 100644 +index 880f496526..31c8d4bc86 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -15,9 +15,59 @@ public class EntityExperienceOrb extends Entity { @@ -120,7 +120,7 @@ index 3c888d6015..79d80596df 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 1804a49de9..82e4d2eab6 100644 +index 81de03084a..4c92896ef8 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -467,7 +467,7 @@ public class EntityFishingHook extends Entity { @@ -131,9 +131,9 @@ index 1804a49de9..82e4d2eab6 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 - if (itemstack1.getItem().a(TagsItem.D)) { + if (itemstack1.getItem().a(TagsItem.FISHES)) { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 422b826d61..fdfef98a3f 100644 +index 60f22959b5..1b8763f618 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -354,7 +354,8 @@ public abstract class EntityLiving extends Entity { @@ -160,7 +160,7 @@ index a5e1939e05..e73dba09a6 100644 this.die(); diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index e8fdf86250..b51543ea7a 100644 +index 0227196f1e..8fe68c2eb4 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -411,7 +411,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -186,7 +186,7 @@ index 4a128f707b..b870964674 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 54ee305eba..6e524353b5 100644 +index 1bfa7e5e69..4e44180329 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -385,7 +385,7 @@ public class PlayerInteractManager { @@ -199,7 +199,7 @@ index 54ee305eba..6e524353b5 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/SlotFurnaceResult.java b/src/main/java/net/minecraft/server/SlotFurnaceResult.java -index 998662d9e6..6b4eb7f053 100644 +index 22c47c63c7..52e296d468 100644 --- a/src/main/java/net/minecraft/server/SlotFurnaceResult.java +++ b/src/main/java/net/minecraft/server/SlotFurnaceResult.java @@ -9,7 +9,7 @@ import org.bukkit.event.inventory.FurnaceExtractEvent; @@ -221,10 +221,10 @@ index 998662d9e6..6b4eb7f053 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9cd991c3e7..b3756074b5 100644 +index 5bfcedccc1..6347d3d1f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1216,7 +1216,7 @@ public class CraftWorld implements World { +@@ -1209,7 +1209,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/0174-Cap-Entity-Collisions.patch b/Spigot-Server-Patches/0172-Cap-Entity-Collisions.patch similarity index 86% rename from Spigot-Server-Patches/0174-Cap-Entity-Collisions.patch rename to Spigot-Server-Patches/0172-Cap-Entity-Collisions.patch index 27aee6de5b..c15d2147d3 100644 --- a/Spigot-Server-Patches/0174-Cap-Entity-Collisions.patch +++ b/Spigot-Server-Patches/0172-Cap-Entity-Collisions.patch @@ -1,4 +1,4 @@ -From b641b0729bb684eed8ca532e9f36b60197926e07 Mon Sep 17 00:00:00 2001 +From c30c57ac7ae9a69386053140d86c0d03d78059e7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 22 Jan 2017 18:07:56 -0500 Subject: [PATCH] Cap Entity Collisions @@ -12,10 +12,10 @@ just as it does in Vanilla, but entity pushing logic will be capped. You can set this to 0 to disable collisions. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b95f259a9a..4991138dfe 100644 +index 391cdd2fa5..8923454524 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -344,4 +344,10 @@ public class PaperWorldConfig { +@@ -347,4 +347,10 @@ public class PaperWorldConfig { log("Treasure Maps will return already discovered locations"); } } @@ -27,10 +27,10 @@ index b95f259a9a..4991138dfe 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 3955884e10..33683301b2 100644 +index a16fbd4579..cad4894000 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -183,6 +183,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -184,6 +184,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public final boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; public boolean fromMobSpawner; @@ -39,10 +39,10 @@ index 3955884e10..33683301b2 100644 // Spigot end diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index fdfef98a3f..5da05c0825 100644 +index 1b8763f618..8c56eeb11c 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2319,8 +2319,11 @@ public abstract class EntityLiving extends Entity { +@@ -2354,8 +2354,11 @@ public abstract class EntityLiving extends Entity { } } diff --git a/Spigot-Server-Patches/0175-Remove-CraftScheduler-Async-Task-Debugger.patch b/Spigot-Server-Patches/0173-Remove-CraftScheduler-Async-Task-Debugger.patch similarity index 97% rename from Spigot-Server-Patches/0175-Remove-CraftScheduler-Async-Task-Debugger.patch rename to Spigot-Server-Patches/0173-Remove-CraftScheduler-Async-Task-Debugger.patch index f965ddaa02..ba1a1e0b95 100644 --- a/Spigot-Server-Patches/0175-Remove-CraftScheduler-Async-Task-Debugger.patch +++ b/Spigot-Server-Patches/0173-Remove-CraftScheduler-Async-Task-Debugger.patch @@ -1,4 +1,4 @@ -From 62d4ba558bbd6bdb3ef28b071fdfffa90af9eb93 Mon Sep 17 00:00:00 2001 +From 2ba326cb516eadbfd22cb637ddd9bfd4d15cc116 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 5 Feb 2017 00:04:04 -0500 Subject: [PATCH] Remove CraftScheduler Async Task Debugger diff --git a/Spigot-Server-Patches/0176-Shame-on-you-Mojang.patch b/Spigot-Server-Patches/0174-Shame-on-you-Mojang.patch similarity index 94% rename from Spigot-Server-Patches/0176-Shame-on-you-Mojang.patch rename to Spigot-Server-Patches/0174-Shame-on-you-Mojang.patch index 84b294f291..fed5167a7e 100644 --- a/Spigot-Server-Patches/0176-Shame-on-you-Mojang.patch +++ b/Spigot-Server-Patches/0174-Shame-on-you-Mojang.patch @@ -1,4 +1,4 @@ -From 03255394631407b2ffe0d99996aaf5373bc6d94d Mon Sep 17 00:00:00 2001 +From 8cbd912cf60f5989d4b7fdd54f58466b5455906a Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 5 Feb 2017 19:17:28 -0500 Subject: [PATCH] Shame on you Mojang diff --git a/Spigot-Server-Patches/0177-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/Spigot-Server-Patches/0175-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch similarity index 86% rename from Spigot-Server-Patches/0177-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch rename to Spigot-Server-Patches/0175-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch index 17df9067cc..4621c052c2 100644 --- a/Spigot-Server-Patches/0177-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch +++ b/Spigot-Server-Patches/0175-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch @@ -1,14 +1,14 @@ -From 0fea4b74b91d8ce4a6e5069773a8e345363569e8 Mon Sep 17 00:00:00 2001 +From 4e1234fad311a8d7fc90e7c4a1c2359eaf15de60 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Tue, 7 Feb 2017 16:55:35 -0600 Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index c96f1b2753..4973721243 100644 +index 6b8d4c79e8..5e8a20fdd6 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -338,7 +338,7 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -310,7 +310,7 @@ public class ChunkProviderServer implements IChunkProvider { // Spigot start org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; activityAccountant.startActivity(0.5); diff --git a/Spigot-Server-Patches/0178-Do-not-let-armorstands-drown.patch b/Spigot-Server-Patches/0176-Do-not-let-armorstands-drown.patch similarity index 78% rename from Spigot-Server-Patches/0178-Do-not-let-armorstands-drown.patch rename to Spigot-Server-Patches/0176-Do-not-let-armorstands-drown.patch index a063995021..207a325a6d 100644 --- a/Spigot-Server-Patches/0178-Do-not-let-armorstands-drown.patch +++ b/Spigot-Server-Patches/0176-Do-not-let-armorstands-drown.patch @@ -1,14 +1,14 @@ -From 5de4b721abc005b58dd8b4bfb1025fb8df9ba9e5 Mon Sep 17 00:00:00 2001 +From 6a3b5203784f3a3498aa5f905578554c89d00868 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 18 Feb 2017 19:29:58 -0600 Subject: [PATCH] Do not let armorstands drown diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 578d966401..e9a746f138 100644 +index 00a46129b8..6628af7778 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -764,5 +764,10 @@ public class EntityArmorStand extends EntityLiving { +@@ -766,5 +766,10 @@ public class EntityArmorStand extends EntityLiving { super.move(moveType, x, y, z); } } @@ -20,7 +20,7 @@ index 578d966401..e9a746f138 100644 // Paper end } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 5da05c0825..169ad7619e 100644 +index 8c56eeb11c..2ff82694b4 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -202,6 +202,7 @@ public abstract class EntityLiving extends Entity { @@ -34,10 +34,10 @@ index 5da05c0825..169ad7619e 100644 @@ -236,7 +237,7 @@ public abstract class EntityLiving extends Entity { if (this.isAlive()) { - if (this.a(TagsFluid.a) && this.world.getType(new BlockPosition(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ)).getBlock() != Blocks.BUBBLE_COLUMN) { + if (this.a(TagsFluid.WATER) && this.world.getType(new BlockPosition(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ)).getBlock() != Blocks.BUBBLE_COLUMN) { - if (!this.ca() && !MobEffectUtil.c(this) && !flag1) { + if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden - this.setAirTicks(this.l(this.getAirTicks())); + this.setAirTicks(this.k(this.getAirTicks())); if (this.getAirTicks() == -20) { this.setAirTicks(0); -- diff --git a/Spigot-Server-Patches/0179-Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/0177-Properly-handle-async-calls-to-restart-the-server.patch similarity index 91% rename from Spigot-Server-Patches/0179-Properly-handle-async-calls-to-restart-the-server.patch rename to Spigot-Server-Patches/0177-Properly-handle-async-calls-to-restart-the-server.patch index 1270408e81..f27fb19fe6 100644 --- a/Spigot-Server-Patches/0179-Properly-handle-async-calls-to-restart-the-server.patch +++ b/Spigot-Server-Patches/0177-Properly-handle-async-calls-to-restart-the-server.patch @@ -1,4 +1,4 @@ -From b9074e0ad5743326d4ccab91a38999cae8f89e74 Mon Sep 17 00:00:00 2001 +From 5e520316a953640c0e50801cd486c34a367dbd0b Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 12 May 2017 23:34:11 -0500 Subject: [PATCH] Properly handle async calls to restart the server @@ -30,27 +30,27 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0560882314..7a7893c4df 100644 +index ee13260af7..5d8dbdf8a3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -85,6 +85,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - public WorldServer[] worldServer; +@@ -89,6 +89,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + public final Map worldServer = Maps.newIdentityHashMap(); private PlayerList s; private boolean isRunning = true; + private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart private boolean isStopped; private int ticks; - protected final Proxy d; -@@ -635,7 +636,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + protected final Proxy c; +@@ -655,7 +656,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati if (this.s != null) { MinecraftServer.LOGGER.info("Saving players"); this.s.savePlayers(); - this.s.u(); -+ this.s.u(isRestarting);; ++ this.s.u(isRestarting); // Paper try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets } -@@ -694,10 +695,18 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -705,9 +706,16 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati return this.isRunning; } @@ -63,25 +63,15 @@ index 0560882314..7a7893c4df 100644 this.isRunning = false; + this.isRestarting = isRestarting; } - + // Paper end -+ - // Paper start - Further improve server tick loop - private static final int TPS = 20; - private static final long SEC_IN_NANO = 1000000000; -@@ -1667,6 +1676,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - return this.aa; - } -+ public final Thread getServerThread() { return this.aA(); } // Paper - OBFHELPER - public Thread aA() { - return this.serverThread; - } + private boolean aT() { + return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index c8b5a610aa..0b0d996523 100644 +index cc0ed8546f..a9906f03c9 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1338,10 +1338,15 @@ public abstract class PlayerList { +@@ -1332,10 +1332,15 @@ public abstract class PlayerList { entityplayer.playerInteractManager.b(generatoraccess.getWorldData().getGameType()); } @@ -98,7 +88,7 @@ index c8b5a610aa..0b0d996523 100644 } // CraftBukkit end // Paper start - Remove collideRule team if it exists -@@ -1352,6 +1357,7 @@ public abstract class PlayerList { +@@ -1346,6 +1351,7 @@ public abstract class PlayerList { } // Paper end } diff --git a/Spigot-Server-Patches/0180-Add-system-property-to-disable-book-size-limits.patch b/Spigot-Server-Patches/0178-Add-system-property-to-disable-book-size-limits.patch similarity index 97% rename from Spigot-Server-Patches/0180-Add-system-property-to-disable-book-size-limits.patch rename to Spigot-Server-Patches/0178-Add-system-property-to-disable-book-size-limits.patch index a4eb0398a0..c478a93fd1 100644 --- a/Spigot-Server-Patches/0180-Add-system-property-to-disable-book-size-limits.patch +++ b/Spigot-Server-Patches/0178-Add-system-property-to-disable-book-size-limits.patch @@ -1,4 +1,4 @@ -From 97d5e2fa2bc33147c60d9788b9d424e22037d5b7 Mon Sep 17 00:00:00 2001 +From 703a23f2b92efc065861a675cca9cf28b3bf000e Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 13 May 2017 20:11:21 -0500 Subject: [PATCH] Add system property to disable book size limits diff --git a/Spigot-Server-Patches/0181-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/Spigot-Server-Patches/0179-Add-option-to-make-parrots-stay-on-shoulders-despite.patch similarity index 90% rename from Spigot-Server-Patches/0181-Add-option-to-make-parrots-stay-on-shoulders-despite.patch rename to Spigot-Server-Patches/0179-Add-option-to-make-parrots-stay-on-shoulders-despite.patch index ab5d399ae2..ab4b9a4c6b 100644 --- a/Spigot-Server-Patches/0181-Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/Spigot-Server-Patches/0179-Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -1,4 +1,4 @@ -From 2cd2c05c82e8c8fc0b70d0bcebeb900dd4c5fe07 Mon Sep 17 00:00:00 2001 +From 4ce968e99445a133ff9bf1e0512572b0295b7436 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 16 May 2017 21:29:08 -0500 Subject: [PATCH] Add option to make parrots stay on shoulders despite movement @@ -11,10 +11,10 @@ I suspect Mojang may switch to this behavior before full release. To be converted into a Paper-API event at some point in the future? diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 4991138dfe..87c599338a 100644 +index 8923454524..0094f6ab98 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -350,4 +350,10 @@ public class PaperWorldConfig { +@@ -353,4 +353,10 @@ public class PaperWorldConfig { maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); log( "Max Entity Collisions: " + maxCollisionsPerEntity ); } @@ -26,7 +26,7 @@ index 4991138dfe..87c599338a 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 9814075d6d..814202286c 100644 +index 79233fe463..f6600ce515 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -460,7 +460,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -39,10 +39,10 @@ index 9814075d6d..814202286c 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 08ef17dfe1..d4701d8d56 100644 +index 7f61da1cd3..7e06e5bc67 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1747,6 +1747,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1757,6 +1757,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { switch (packetplayinentityaction.c()) { case START_SNEAKING: this.player.setSneaking(true); diff --git a/Spigot-Server-Patches/0182-Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-Server-Patches/0180-Add-configuration-option-to-prevent-player-names-fro.patch similarity index 89% rename from Spigot-Server-Patches/0182-Add-configuration-option-to-prevent-player-names-fro.patch rename to Spigot-Server-Patches/0180-Add-configuration-option-to-prevent-player-names-fro.patch index bfdabaa0df..4d03206868 100644 --- a/Spigot-Server-Patches/0182-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-Server-Patches/0180-Add-configuration-option-to-prevent-player-names-fro.patch @@ -1,4 +1,4 @@ -From 915c25172662346c874c1ae74e73c93aa4dc2617 Mon Sep 17 00:00:00 2001 +From 213e2449fa13d0530dc588c1f585fe1d051be194 Mon Sep 17 00:00:00 2001 From: kashike Date: Fri, 9 Jun 2017 07:24:34 -0700 Subject: [PATCH] Add configuration option to prevent player names from being @@ -20,10 +20,10 @@ index 9f1182c723..e97dbaf8e3 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 476b01f70f..17b398cde0 100644 +index 95f28c83af..6a44428293 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2002,5 +2002,10 @@ public final class CraftServer implements Server { +@@ -2022,5 +2022,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/Spigot-Server-Patches/0183-Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/0181-Use-TerminalConsoleAppender-for-console-improvements.patch similarity index 94% rename from Spigot-Server-Patches/0183-Use-TerminalConsoleAppender-for-console-improvements.patch rename to Spigot-Server-Patches/0181-Use-TerminalConsoleAppender-for-console-improvements.patch index 81757c041c..7ad5d719b4 100644 --- a/Spigot-Server-Patches/0183-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/0181-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -1,4 +1,4 @@ -From 7877e0c54daccdb05399a4beee35d8bff0067583 Mon Sep 17 00:00:00 2001 +From 45c2e344bc30b2dab617527509826e1657d65836 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 9 Jun 2017 19:03:43 +0200 Subject: [PATCH] Use TerminalConsoleAppender for console improvements @@ -19,28 +19,17 @@ Other changes: configuration diff --git a/pom.xml b/pom.xml -index 09b4ddf19..47e307a24 100644 +index 17c3baaec9..ced853423d 100644 --- a/pom.xml +++ b/pom.xml -@@ -39,12 +39,6 @@ - ${minecraft.version}-SNAPSHOT +@@ -40,10 +40,27 @@ compile -- + - jline - jline - 2.12.1 - compile -- - - org.ow2.asm - asm -@@ -69,6 +63,32 @@ - 3.0.3 - compile - -+ -+ + net.minecrell + terminalconsoleappender + 1.1.1 @@ -51,7 +40,6 @@ index 09b4ddf19..47e307a24 100644 + 4.5.2 + runtime + -+ + + - junit -@@ -202,10 +222,18 @@ + org.ow2.asm +@@ -203,10 +220,18 @@ META-INF/services/java.sql.Driver @@ -89,7 +75,7 @@ index 09b4ddf19..47e307a24 100644 org.apache.maven.plugins diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java new file mode 100644 -index 000000000..688b4715e +index 0000000000..688b4715eb --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -0,0 +1,40 @@ @@ -135,7 +121,7 @@ index 000000000..688b4715e +} diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java new file mode 100644 -index 000000000..685deaa0e +index 0000000000..685deaa0e5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java @@ -0,0 +1,17 @@ @@ -157,7 +143,7 @@ index 000000000..685deaa0e + +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index bf1fffcfe..af430b73f 100644 +index dabad6b055..fc7e244f8b 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -79,6 +79,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -199,10 +185,10 @@ index bf1fffcfe..af430b73f 100644 System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a49393b2f..5635997d0 100644 +index 5d8dbdf8a3..6aec7c31e3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -57,7 +57,6 @@ import org.apache.commons.lang3.Validate; +@@ -61,7 +61,6 @@ import org.apache.commons.lang3.Validate; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; // CraftBukkit start @@ -210,7 +196,7 @@ index a49393b2f..5635997d0 100644 import joptsimple.OptionSet; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; -@@ -143,7 +142,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -146,7 +145,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati public OptionSet options; public org.bukkit.command.ConsoleCommandSender console; public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; @@ -219,7 +205,7 @@ index a49393b2f..5635997d0 100644 public static int currentTick = 0; // Paper - Further improve tick loop public boolean serverAutoSave = false; // Paper public final Thread primaryThread; -@@ -185,7 +184,9 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -192,7 +191,9 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati this.ac.a((IResourcePackListener) this.al); // CraftBukkit start this.options = options; @@ -229,7 +215,7 @@ index a49393b2f..5635997d0 100644 if (System.console() == null && System.getProperty("jline.terminal") == null) { System.setProperty("jline.terminal", "jline.UnsupportedTerminal"); Main.useJline = false; -@@ -206,6 +207,8 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -213,6 +214,8 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati LOGGER.warn((String) null, ex); } } @@ -238,7 +224,7 @@ index a49393b2f..5635997d0 100644 Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); this.serverThread = primaryThread = new Thread(this, "Server thread"); // Moved from main -@@ -849,7 +852,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -869,7 +872,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } finally { // CraftBukkit start - Restore terminal to original settings try { @@ -247,7 +233,7 @@ index a49393b2f..5635997d0 100644 } catch (Exception ignored) { } // CraftBukkit end -@@ -1345,7 +1348,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -1357,7 +1360,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } public void sendMessage(IChatBaseComponent ichatbasecomponent) { @@ -255,9 +241,9 @@ index a49393b2f..5635997d0 100644 + MinecraftServer.LOGGER.info(org.bukkit.craftbukkit.util.CraftChatMessage.fromComponent(ichatbasecomponent, net.minecraft.server.EnumChatFormat.WHITE));// Paper - Log message with colors } - public KeyPair G() { + public KeyPair E() { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0b0d99652..4cbe14801 100644 +index a9906f03c9..2f2f301383 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -78,8 +78,7 @@ public abstract class PlayerList { @@ -271,10 +257,10 @@ index 0b0d99652..4cbe14801 100644 this.k = new GameProfileBanList(PlayerList.a); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 17b398cde..51ea2013e 100644 +index 6a44428293..10cbe8c6a1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -138,8 +138,8 @@ import java.nio.ByteBuffer; +@@ -139,8 +139,8 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.HashMap; @@ -284,7 +270,7 @@ index 17b398cde..51ea2013e 100644 import org.bukkit.NamespacedKey; import org.bukkit.block.data.BlockData; import org.bukkit.craftbukkit.block.data.CraftBlockData; -@@ -1125,9 +1125,13 @@ public final class CraftServer implements Server { +@@ -1145,9 +1145,13 @@ public final class CraftServer implements Server { return logger; } @@ -299,7 +285,7 @@ index 17b398cde..51ea2013e 100644 @Override public PluginCommand getPluginCommand(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index ced9b7231..e68d2d6bb 100644 +index 5c26e78a71..69a7c5205e 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -14,7 +14,7 @@ import java.util.logging.Logger; @@ -338,10 +324,10 @@ index ced9b7231..e68d2d6bb 100644 + System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper } - if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { + if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java deleted file mode 100644 -index 26a2fb894..000000000 +index 26a2fb8942..0000000000 --- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java +++ /dev/null @@ -1,74 +0,0 @@ @@ -420,7 +406,7 @@ index 26a2fb894..000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -index 33e8ea02c..1e3aae3b8 100644 +index 33e8ea02c4..1e3aae3b8f 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java @@ -8,17 +8,27 @@ import java.util.logging.Level; @@ -499,7 +485,7 @@ index 33e8ea02c..1e3aae3b8 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java -index 984df4083..bbb5a84f3 100644 +index 984df4083d..bbb5a84f36 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java +++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java @@ -20,7 +20,7 @@ public class ServerShutdownThread extends Thread { @@ -513,7 +499,7 @@ index 984df4083..bbb5a84f3 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java deleted file mode 100644 -index b64097113..000000000 +index b640971130..0000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java +++ /dev/null @@ -1,54 +0,0 @@ @@ -572,7 +558,7 @@ index b64097113..000000000 - } -} diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml -index 5cee8f00e..08b6bb7f9 100644 +index 5cee8f00ef..08b6bb7f97 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -1,12 +1,11 @@ diff --git a/Spigot-Server-Patches/0184-provide-a-configurable-option-to-disable-creeper-lin.patch b/Spigot-Server-Patches/0182-provide-a-configurable-option-to-disable-creeper-lin.patch similarity index 88% rename from Spigot-Server-Patches/0184-provide-a-configurable-option-to-disable-creeper-lin.patch rename to Spigot-Server-Patches/0182-provide-a-configurable-option-to-disable-creeper-lin.patch index 5ea199a978..e92c603a39 100644 --- a/Spigot-Server-Patches/0184-provide-a-configurable-option-to-disable-creeper-lin.patch +++ b/Spigot-Server-Patches/0182-provide-a-configurable-option-to-disable-creeper-lin.patch @@ -1,4 +1,4 @@ -From e9981fa3ef4ec3f077afbffe264b88718385fc88 Mon Sep 17 00:00:00 2001 +From c208f44b0480efebfb3d00395fa57e0c495adef4 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 11 Jun 2017 21:01:18 +0100 Subject: [PATCH] provide a configurable option to disable creeper lingering @@ -6,10 +6,10 @@ Subject: [PATCH] provide a configurable option to disable creeper lingering diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 87c599338a..23cb3feef0 100644 +index 0094f6ab98..22af662ff3 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -356,4 +356,10 @@ public class PaperWorldConfig { +@@ -359,4 +359,10 @@ public class PaperWorldConfig { parrotsHangOnBetter = getBoolean("parrots-are-unaffected-by-player-movement", false); log("Parrots are unaffected by player movement: " + parrotsHangOnBetter); } @@ -21,11 +21,11 @@ index 87c599338a..23cb3feef0 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 8b0134ecdb..0147054dff 100644 +index a1c343d77b..765123e3d2 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -214,7 +214,7 @@ public class EntityCreeper extends EntityMonster { - private void dG() { + private void dF() { Collection collection = this.getEffects(); - if (!collection.isEmpty()) { diff --git a/Spigot-Server-Patches/0185-Item-canEntityPickup.patch b/Spigot-Server-Patches/0183-Item-canEntityPickup.patch similarity index 94% rename from Spigot-Server-Patches/0185-Item-canEntityPickup.patch rename to Spigot-Server-Patches/0183-Item-canEntityPickup.patch index 99c681b5e9..b7cbe01ab4 100644 --- a/Spigot-Server-Patches/0185-Item-canEntityPickup.patch +++ b/Spigot-Server-Patches/0183-Item-canEntityPickup.patch @@ -1,11 +1,11 @@ -From 9af9c41e54019184086ba7889e8abfe7e5ef2fef Mon Sep 17 00:00:00 2001 +From 0ed2995d925d4bf1a86f7212f4e3ae914d0d144d Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 5 May 2017 03:57:17 -0500 Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 0cfda190bc..bca2aa8298 100644 +index ec06f4badb..d4c86c2d65 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -517,6 +517,11 @@ public abstract class EntityInsentient extends EntityLiving { @@ -21,7 +21,7 @@ index 0cfda190bc..bca2aa8298 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 4af09f5cdb..f2a4476c5c 100644 +index eecebafdad..3e70a06397 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -13,6 +13,7 @@ public class EntityItem extends Entity { diff --git a/Spigot-Server-Patches/0186-PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-Server-Patches/0184-PlayerPickupItemEvent-setFlyAtPlayer.patch similarity index 95% rename from Spigot-Server-Patches/0186-PlayerPickupItemEvent-setFlyAtPlayer.patch rename to Spigot-Server-Patches/0184-PlayerPickupItemEvent-setFlyAtPlayer.patch index dfa50d2fbb..9fa436cc74 100644 --- a/Spigot-Server-Patches/0186-PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-Server-Patches/0184-PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -1,11 +1,11 @@ -From f989d3289e2f07075a08f3bb146301470a89f3fe Mon Sep 17 00:00:00 2001 +From a0615a922ee10148521e6bd8db444064e739c9cb Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 May 2017 06:26:09 -0500 Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index f2a4476c5c..62d1c3d119 100644 +index 3e70a06397..d9d52a63d8 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -308,6 +308,7 @@ public class EntityItem extends Entity { diff --git a/Spigot-Server-Patches/0187-PlayerAttemptPickupItemEvent.patch b/Spigot-Server-Patches/0185-PlayerAttemptPickupItemEvent.patch similarity index 94% rename from Spigot-Server-Patches/0187-PlayerAttemptPickupItemEvent.patch rename to Spigot-Server-Patches/0185-PlayerAttemptPickupItemEvent.patch index ae160895d8..faf7d27150 100644 --- a/Spigot-Server-Patches/0187-PlayerAttemptPickupItemEvent.patch +++ b/Spigot-Server-Patches/0185-PlayerAttemptPickupItemEvent.patch @@ -1,11 +1,11 @@ -From 97bc66e2114ac535c2ec75a55635bac26ea93db5 Mon Sep 17 00:00:00 2001 +From 2e977a86bc5bdfcad0e652f585fe6e90289f3248 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 11 Jun 2017 16:30:30 -0500 Subject: [PATCH] PlayerAttemptPickupItemEvent diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 62d1c3d119..d232bab745 100644 +index d9d52a63d8..946e59753e 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -7,6 +7,7 @@ import javax.annotation.Nullable; diff --git a/Spigot-Server-Patches/0188-Add-UnknownCommandEvent.patch b/Spigot-Server-Patches/0186-Add-UnknownCommandEvent.patch similarity index 89% rename from Spigot-Server-Patches/0188-Add-UnknownCommandEvent.patch rename to Spigot-Server-Patches/0186-Add-UnknownCommandEvent.patch index 9f14316847..e1f10bcc72 100644 --- a/Spigot-Server-Patches/0188-Add-UnknownCommandEvent.patch +++ b/Spigot-Server-Patches/0186-Add-UnknownCommandEvent.patch @@ -1,11 +1,11 @@ -From 304eb1d1de3fa6ed14586db0df3b7dc92176fc33 Mon Sep 17 00:00:00 2001 +From 6c5de5033565d877fb7e926a50a5ee6f75d66105 Mon Sep 17 00:00:00 2001 From: Sweepyoface Date: Sat, 17 Jun 2017 18:48:21 -0400 Subject: [PATCH] Add UnknownCommandEvent diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 51ea2013e8..42b3447a1a 100644 +index 10cbe8c6a1..5c48430313 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -79,6 +79,7 @@ import org.bukkit.craftbukkit.util.Versioning; @@ -16,7 +16,7 @@ index 51ea2013e8..42b3447a1a 100644 import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.PlayerChatTabCompleteEvent; import org.bukkit.event.server.BroadcastMessageEvent; -@@ -722,7 +723,13 @@ public final class CraftServer implements Server { +@@ -723,7 +724,13 @@ public final class CraftServer implements Server { // Spigot start if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) { diff --git a/Spigot-Server-Patches/0189-Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/0187-Basic-PlayerProfile-API.patch similarity index 97% rename from Spigot-Server-Patches/0189-Basic-PlayerProfile-API.patch rename to Spigot-Server-Patches/0187-Basic-PlayerProfile-API.patch index fc2801d443..aa5e1e644a 100644 --- a/Spigot-Server-Patches/0189-Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/0187-Basic-PlayerProfile-API.patch @@ -1,4 +1,4 @@ -From b81f6fea6d00e141ff1fd45a4de216fabca7b84f Mon Sep 17 00:00:00 2001 +From 0051cf45fc5085978b49aa5a0895ccec4a0a1169 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 15 Jan 2018 22:11:48 -0500 Subject: [PATCH] Basic PlayerProfile API @@ -403,7 +403,7 @@ index 0000000000..3aceb0ea8a + } +} diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 381542e0d2..80927de08b 100644 +index 966309a07d..e36e2e0a31 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -1,6 +1,9 @@ @@ -428,10 +428,10 @@ index 381542e0d2..80927de08b 100644 * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5635997d0b..02b6218807 100644 +index 6aec7c31e3..014c923897 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1162,7 +1162,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -1181,7 +1181,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati */ // CraftBukkit end String s1 = "."; // PAIL? @@ -440,12 +440,12 @@ index 5635997d0b..02b6218807 100644 MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService(); GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); UserCache usercache = new UserCache(gameprofilerepository, new File(s1, MinecraftServer.a.getName())); -@@ -1622,6 +1622,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -1630,6 +1630,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati this.G = i; } -+ public MinecraftSessionService getSessionService() { return ar(); } // Paper - OBFHELPER - public MinecraftSessionService ar() { ++ public MinecraftSessionService getSessionService() { return ap(); } // Paper - OBFHELPER + public MinecraftSessionService ap() { return this.V; } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java @@ -485,10 +485,10 @@ index a47a51a412..4c476f757c 100644 private UserCacheEntry(GameProfile gameprofile, Date date) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 42b3447a1a..3d4bb6d8c9 100644 +index 5c48430313..0eea57eb7d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -154,6 +154,10 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; +@@ -155,6 +155,10 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.event.server.TabCompleteEvent; import net.md_5.bungee.api.chat.BaseComponent; @@ -499,7 +499,7 @@ index 42b3447a1a..3d4bb6d8c9 100644 public final class CraftServer implements Server { private final String serverName = "Paper"; // Paper private final String serverVersion; -@@ -2018,5 +2022,21 @@ public final class CraftServer implements Server { +@@ -2038,5 +2042,21 @@ public final class CraftServer implements Server { public boolean suggestPlayerNamesWhenNullTabCompletions() { return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; } diff --git a/Spigot-Server-Patches/0190-Shoulder-Entities-Release-API.patch b/Spigot-Server-Patches/0188-Shoulder-Entities-Release-API.patch similarity index 95% rename from Spigot-Server-Patches/0190-Shoulder-Entities-Release-API.patch rename to Spigot-Server-Patches/0188-Shoulder-Entities-Release-API.patch index 0b541cbcfb..e18fa36805 100644 --- a/Spigot-Server-Patches/0190-Shoulder-Entities-Release-API.patch +++ b/Spigot-Server-Patches/0188-Shoulder-Entities-Release-API.patch @@ -1,14 +1,14 @@ -From d33bc2c9cfecea2a6c4d007cef97daafcaaa1360 Mon Sep 17 00:00:00 2001 +From 17b0566d31b2137a347f9a9e14beb501694f5cd5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 17 Jun 2017 15:18:30 -0400 Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 814202286c..d9f81e6348 100644 +index f6600ce515..d11edae03c 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1819,21 +1819,48 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1814,21 +1814,48 @@ public abstract class EntityHuman extends EntityLiving { } // CraftBukkit end } @@ -62,7 +62,7 @@ index 814202286c..d9f81e6348 100644 public abstract boolean isSpectator(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index cce9366f4d..4afff2f262 100644 +index 289e267bdd..38a886fbd5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -455,6 +455,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/Spigot-Server-Patches/0191-Profile-Lookup-Events.patch b/Spigot-Server-Patches/0189-Profile-Lookup-Events.patch similarity index 98% rename from Spigot-Server-Patches/0191-Profile-Lookup-Events.patch rename to Spigot-Server-Patches/0189-Profile-Lookup-Events.patch index 4eca02d3ac..5c9af08440 100644 --- a/Spigot-Server-Patches/0191-Profile-Lookup-Events.patch +++ b/Spigot-Server-Patches/0189-Profile-Lookup-Events.patch @@ -1,4 +1,4 @@ -From 9de3dab38948bea6b6251204e18b27a77120b583 Mon Sep 17 00:00:00 2001 +From 2f9c791a592bd0ee15b11bc736189c62979dd617 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 17 Jun 2017 17:00:32 -0400 Subject: [PATCH] Profile Lookup Events diff --git a/Spigot-Server-Patches/0192-Block-player-logins-during-server-shutdown.patch b/Spigot-Server-Patches/0190-Block-player-logins-during-server-shutdown.patch similarity index 90% rename from Spigot-Server-Patches/0192-Block-player-logins-during-server-shutdown.patch rename to Spigot-Server-Patches/0190-Block-player-logins-during-server-shutdown.patch index 746086ab32..6e921ef6dc 100644 --- a/Spigot-Server-Patches/0192-Block-player-logins-during-server-shutdown.patch +++ b/Spigot-Server-Patches/0190-Block-player-logins-during-server-shutdown.patch @@ -1,11 +1,11 @@ -From b4bec1df3b0d1eaaa07b969dd8cd6494c88782c7 Mon Sep 17 00:00:00 2001 +From 94b386a46fa89e762cead571cdf3ccc0b3975532 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 2 Jul 2017 21:35:56 -0500 Subject: [PATCH] Block player logins during server shutdown diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index fae8a13973..005efbc111 100644 +index 19ac21e385..8bbea96240 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -50,6 +50,12 @@ public class LoginListener implements PacketLoginInListener, ITickable { diff --git a/Spigot-Server-Patches/0193-Entity-fromMobSpawner.patch b/Spigot-Server-Patches/0191-Entity-fromMobSpawner.patch similarity index 90% rename from Spigot-Server-Patches/0193-Entity-fromMobSpawner.patch rename to Spigot-Server-Patches/0191-Entity-fromMobSpawner.patch index ebba0a4118..0fe471866b 100644 --- a/Spigot-Server-Patches/0193-Entity-fromMobSpawner.patch +++ b/Spigot-Server-Patches/0191-Entity-fromMobSpawner.patch @@ -1,14 +1,14 @@ -From 138911e0ab52c942ed20ed80b3ac6a2c8c7b8ded Mon Sep 17 00:00:00 2001 +From b07b931f168834c010651b70e6d2f5af384c0430 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 18 Jun 2017 18:17:05 -0500 Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 33683301b2..aba517a710 100644 +index cad4894000..0e8c95d96b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -183,6 +183,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -184,6 +184,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public final boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; public boolean fromMobSpawner; @@ -16,7 +16,7 @@ index 33683301b2..aba517a710 100644 protected int numCollisions = 0; // Paper public void inactiveTick() { } // Spigot end -@@ -1649,6 +1650,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1646,6 +1647,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (origin != null) { nbttagcompound.set("Paper.Origin", this.createList(origin.getX(), origin.getY(), origin.getZ())); } @@ -27,7 +27,7 @@ index 33683301b2..aba517a710 100644 // Paper end return nbttagcompound; } catch (Throwable throwable) { -@@ -1797,6 +1802,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1793,6 +1798,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (!originTag.isEmpty()) { origin = new Location(world.getWorld(), originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2)); } @@ -37,7 +37,7 @@ index 33683301b2..aba517a710 100644 } catch (Throwable throwable) { diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 61472a0eb2..2b6b062c61 100644 +index a62e34f7f9..ef93f433d6 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -115,6 +115,7 @@ public abstract class MobSpawnerAbstract { diff --git a/Spigot-Server-Patches/0194-Fix-Anvil-Level-sync-to-client.patch b/Spigot-Server-Patches/0192-Fix-Anvil-Level-sync-to-client.patch similarity index 90% rename from Spigot-Server-Patches/0194-Fix-Anvil-Level-sync-to-client.patch rename to Spigot-Server-Patches/0192-Fix-Anvil-Level-sync-to-client.patch index 02ea5ac6e9..27fb4a0a99 100644 --- a/Spigot-Server-Patches/0194-Fix-Anvil-Level-sync-to-client.patch +++ b/Spigot-Server-Patches/0192-Fix-Anvil-Level-sync-to-client.patch @@ -1,4 +1,4 @@ -From d7d65dc85cb3518324f27df6192d707fd664d562 Mon Sep 17 00:00:00 2001 +From 7925cf56b5e55b1d3f53e3299dd256d2cf6a21a7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 11 Jul 2017 23:17:57 -0400 Subject: [PATCH] Fix Anvil Level sync to client @@ -10,7 +10,7 @@ Was done incorrectly and is now causing level desyncs to client. Always send current level to the client, and instead make setWindowProperty set the level. diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java -index 229f4f8829..fb3413d81e 100644 +index a8a875fe11..f2e15fa545 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvil.java +++ b/src/main/java/net/minecraft/server/ContainerAnvil.java @@ -377,9 +377,9 @@ public class ContainerAnvil extends Container { @@ -26,10 +26,10 @@ index 229f4f8829..fb3413d81e 100644 this.lastLevelCost = this.levelCost; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 63341ec778..bf7bfb427b 100644 +index 2837fb87e5..b3479a6194 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1420,6 +1420,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1418,6 +1418,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (container.getBukkitView().getType() != prop.getType()) { return false; } diff --git a/Spigot-Server-Patches/0195-Add-missing-coverages-for-getTileEntity-in-order-to-.patch b/Spigot-Server-Patches/0193-Add-missing-coverages-for-getTileEntity-in-order-to-.patch similarity index 90% rename from Spigot-Server-Patches/0195-Add-missing-coverages-for-getTileEntity-in-order-to-.patch rename to Spigot-Server-Patches/0193-Add-missing-coverages-for-getTileEntity-in-order-to-.patch index 732fce6452..bb0b2dc8ca 100644 --- a/Spigot-Server-Patches/0195-Add-missing-coverages-for-getTileEntity-in-order-to-.patch +++ b/Spigot-Server-Patches/0193-Add-missing-coverages-for-getTileEntity-in-order-to-.patch @@ -1,4 +1,4 @@ -From ff5fed386f5e6482a0e6479e31ee5ba4557d2b66 Mon Sep 17 00:00:00 2001 +From aa533892a0d710314855e69f85c2cf10f09bc992 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 22 Jul 2017 15:22:59 +0100 Subject: [PATCH] Add missing coverages for getTileEntity in order to attempt @@ -6,7 +6,7 @@ Subject: [PATCH] Add missing coverages for getTileEntity in order to attempt diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 8f6ce6bf1a..5d5f6f6328 100644 +index e58b21ae43..e4ba13cec5 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -234,6 +234,13 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/0196-Improve-the-Saddle-API-for-Horses.patch b/Spigot-Server-Patches/0194-Improve-the-Saddle-API-for-Horses.patch similarity index 97% rename from Spigot-Server-Patches/0196-Improve-the-Saddle-API-for-Horses.patch rename to Spigot-Server-Patches/0194-Improve-the-Saddle-API-for-Horses.patch index 1ad7b9434e..869999a679 100644 --- a/Spigot-Server-Patches/0196-Improve-the-Saddle-API-for-Horses.patch +++ b/Spigot-Server-Patches/0194-Improve-the-Saddle-API-for-Horses.patch @@ -1,4 +1,4 @@ -From d293eb84fe13d44b756fb6bb9c905450470bd70e Mon Sep 17 00:00:00 2001 +From 1b733d9f6239b8bf794a6f8333ce15cd49cf5c2d Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 10 Dec 2016 16:24:06 -0500 Subject: [PATCH] Improve the Saddle API for Horses diff --git a/Spigot-Server-Patches/0197-Implement-ensureServerConversions-API.patch b/Spigot-Server-Patches/0195-Implement-ensureServerConversions-API.patch similarity index 91% rename from Spigot-Server-Patches/0197-Implement-ensureServerConversions-API.patch rename to Spigot-Server-Patches/0195-Implement-ensureServerConversions-API.patch index 53bde78298..9fe6b5c76c 100644 --- a/Spigot-Server-Patches/0197-Implement-ensureServerConversions-API.patch +++ b/Spigot-Server-Patches/0195-Implement-ensureServerConversions-API.patch @@ -1,4 +1,4 @@ -From ceb030382bed66093c058bf950dc62c7d3b9fb34 Mon Sep 17 00:00:00 2001 +From 9eec798ed47a25bd4d1975b924ebe06a5a6d873a Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 May 2016 22:43:12 -0400 Subject: [PATCH] Implement ensureServerConversions API @@ -7,7 +7,7 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 6998fddc5..f7e11412a 100644 +index 6998fddc5a..f7e11412a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -289,4 +289,10 @@ public final class CraftItemFactory implements ItemFactory { diff --git a/Spigot-Server-Patches/0198-Implement-getI18NDisplayName.patch b/Spigot-Server-Patches/0196-Implement-getI18NDisplayName.patch similarity index 93% rename from Spigot-Server-Patches/0198-Implement-getI18NDisplayName.patch rename to Spigot-Server-Patches/0196-Implement-getI18NDisplayName.patch index 759e07db9b..a3e48f8a35 100644 --- a/Spigot-Server-Patches/0198-Implement-getI18NDisplayName.patch +++ b/Spigot-Server-Patches/0196-Implement-getI18NDisplayName.patch @@ -1,4 +1,4 @@ -From 3f33d6f6fd24dc37b5a25d819eeb9c5db7ddd40f Mon Sep 17 00:00:00 2001 +From 78dfcf390705aa37a32ced73608183c4e3b4c51a Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 May 2016 23:59:38 -0400 Subject: [PATCH] Implement getI18NDisplayName @@ -8,7 +8,7 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java -index 4361b2cee..f81887c66 100644 +index 4361b2cee5..f81887c661 100644 --- a/src/main/java/net/minecraft/server/LocaleLanguage.java +++ b/src/main/java/net/minecraft/server/LocaleLanguage.java @@ -44,10 +44,12 @@ public class LocaleLanguage { @@ -25,7 +25,7 @@ index 4361b2cee..f81887c66 100644 return this.c(s); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index f7e11412a..3dbe9d81e 100644 +index f7e11412a5..3dbe9d81ea 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -294,5 +294,18 @@ public final class CraftItemFactory implements ItemFactory { diff --git a/Spigot-Server-Patches/0199-GH-806-Respect-saving-disabled-before-unloading-all-.patch b/Spigot-Server-Patches/0197-GH-806-Respect-saving-disabled-before-unloading-all-.patch similarity index 94% rename from Spigot-Server-Patches/0199-GH-806-Respect-saving-disabled-before-unloading-all-.patch rename to Spigot-Server-Patches/0197-GH-806-Respect-saving-disabled-before-unloading-all-.patch index a597d9b842..2eb8df9214 100644 --- a/Spigot-Server-Patches/0199-GH-806-Respect-saving-disabled-before-unloading-all-.patch +++ b/Spigot-Server-Patches/0197-GH-806-Respect-saving-disabled-before-unloading-all-.patch @@ -1,4 +1,4 @@ -From 2d521b50b05f62a77cd6109a50cee90788186f29 Mon Sep 17 00:00:00 2001 +From d295278d6afa7785d9375cb4d0598d64a8ba7f60 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 27 Jul 2017 00:06:43 -0400 Subject: [PATCH] GH-806: Respect saving disabled before unloading all chunks diff --git a/Spigot-Server-Patches/0200-ProfileWhitelistVerifyEvent.patch b/Spigot-Server-Patches/0198-ProfileWhitelistVerifyEvent.patch similarity index 87% rename from Spigot-Server-Patches/0200-ProfileWhitelistVerifyEvent.patch rename to Spigot-Server-Patches/0198-ProfileWhitelistVerifyEvent.patch index 4fbe20b3a6..08512ce180 100644 --- a/Spigot-Server-Patches/0200-ProfileWhitelistVerifyEvent.patch +++ b/Spigot-Server-Patches/0198-ProfileWhitelistVerifyEvent.patch @@ -1,11 +1,11 @@ -From d2e6f1a46ad82e4c7f839f5b3efaef96a479377b Mon Sep 17 00:00:00 2001 +From 3d835ae5aeb97ff76826227264621bcaf5e23c9a Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 3 Jul 2017 18:11:10 -0500 Subject: [PATCH] ProfileWhitelistVerifyEvent diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 4cbe148010..45e42e9989 100644 +index 2f2f301383..304cae655d 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -543,9 +543,9 @@ public abstract class PlayerList { @@ -20,7 +20,7 @@ index 4cbe148010..45e42e9989 100644 } else if (getIPBans().isBanned(socketaddress) && !getIPBans().get(socketaddress).hasExpired()) { IpBanEntry ipbanentry = this.l.get(socketaddress); -@@ -1177,9 +1177,25 @@ public abstract class PlayerList { +@@ -1171,9 +1171,25 @@ public abstract class PlayerList { this.server.getCommandDispatcher().a(entityplayer); } @@ -46,7 +46,7 @@ index 4cbe148010..45e42e9989 100644 + // Paper end public boolean isOp(GameProfile gameprofile) { - return this.operators.d(gameprofile) || this.server.J() && this.server.worlds.get(0).getWorldData().u() && this.server.I().equalsIgnoreCase(gameprofile.getName()) || this.u; // CraftBukkit + return this.operators.d(gameprofile) || this.server.H() && this.server.getWorldServer(DimensionManager.OVERWORLD).getWorldData().u() && this.server.G().equalsIgnoreCase(gameprofile.getName()) || this.u; -- 2.18.0 diff --git a/Spigot-Server-Patches/0201-Fix-this-stupid-bullshit.patch b/Spigot-Server-Patches/0199-Fix-this-stupid-bullshit.patch similarity index 96% rename from Spigot-Server-Patches/0201-Fix-this-stupid-bullshit.patch rename to Spigot-Server-Patches/0199-Fix-this-stupid-bullshit.patch index b52f190108..65626db276 100644 --- a/Spigot-Server-Patches/0201-Fix-this-stupid-bullshit.patch +++ b/Spigot-Server-Patches/0199-Fix-this-stupid-bullshit.patch @@ -1,4 +1,4 @@ -From 9a1b31f7fd87a9d85dcc314008ea87dab210eb57 Mon Sep 17 00:00:00 2001 +From 52c0a75f307560e231c4370948c30fc1bf3c8849 Mon Sep 17 00:00:00 2001 From: DemonWav Date: Sun, 6 Aug 2017 17:17:53 -0500 Subject: [PATCH] Fix this stupid bullshit diff --git a/Spigot-Server-Patches/0202-Ocelot-despawns-should-honor-nametags-and-leash.patch b/Spigot-Server-Patches/0200-Ocelot-despawns-should-honor-nametags-and-leash.patch similarity index 89% rename from Spigot-Server-Patches/0202-Ocelot-despawns-should-honor-nametags-and-leash.patch rename to Spigot-Server-Patches/0200-Ocelot-despawns-should-honor-nametags-and-leash.patch index 48f4a51c34..5c700f10a1 100644 --- a/Spigot-Server-Patches/0202-Ocelot-despawns-should-honor-nametags-and-leash.patch +++ b/Spigot-Server-Patches/0200-Ocelot-despawns-should-honor-nametags-and-leash.patch @@ -1,11 +1,11 @@ -From afb4de1022909548147905e64811aeff915d6b3a Mon Sep 17 00:00:00 2001 +From 29a61a44f7c238b2b6df9e73c97ae992b2360d3d Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 01:54:40 -0500 Subject: [PATCH] Ocelot despawns should honor nametags and leash diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index 4e132eabb1..c28b72222e 100644 +index 447e6c2d12..5431ef57ab 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -61,7 +61,7 @@ public class EntityOcelot extends EntityTameableAnimal { diff --git a/Spigot-Server-Patches/0203-Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/Spigot-Server-Patches/0201-Reset-spawner-timer-when-spawner-event-is-cancelled.patch similarity index 92% rename from Spigot-Server-Patches/0203-Reset-spawner-timer-when-spawner-event-is-cancelled.patch rename to Spigot-Server-Patches/0201-Reset-spawner-timer-when-spawner-event-is-cancelled.patch index b55bb4631e..2c9128f7b3 100644 --- a/Spigot-Server-Patches/0203-Reset-spawner-timer-when-spawner-event-is-cancelled.patch +++ b/Spigot-Server-Patches/0201-Reset-spawner-timer-when-spawner-event-is-cancelled.patch @@ -1,11 +1,11 @@ -From 820705561359a30a115356f6e750af261c6f770b Mon Sep 17 00:00:00 2001 +From d2a91d650e428d979607011c24efc0a2802d6b3d Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 01:45:19 -0500 Subject: [PATCH] Reset spawner timer when spawner event is cancelled diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 2b6b062c61..c76dbe74ac 100644 +index ef93f433d6..e4598d8314 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -121,6 +121,9 @@ public abstract class MobSpawnerAbstract { diff --git a/Spigot-Server-Patches/0204-Fix-MC-117075-TE-Unload-Lag-Spike.patch b/Spigot-Server-Patches/0202-Fix-MC-117075-TE-Unload-Lag-Spike.patch similarity index 84% rename from Spigot-Server-Patches/0204-Fix-MC-117075-TE-Unload-Lag-Spike.patch rename to Spigot-Server-Patches/0202-Fix-MC-117075-TE-Unload-Lag-Spike.patch index df248ec9a4..5da64c596d 100644 --- a/Spigot-Server-Patches/0204-Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/Spigot-Server-Patches/0202-Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -1,14 +1,14 @@ -From b9797501f8ee9331f216cf6fd44327bcef579c94 Mon Sep 17 00:00:00 2001 +From cfb49559e28c704eb9d49d5d4010174dd214797f Mon Sep 17 00:00:00 2001 From: mezz Date: Wed, 9 Aug 2017 17:51:22 -0500 Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6fe8ce96aa..6d314a7124 100644 +index 0cf5d80899..109e718118 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1286,7 +1286,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1310,7 +1310,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.methodProfiler.c("blockEntities"); timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { diff --git a/Spigot-Server-Patches/0205-Allow-specifying-a-custom-authentication-servers-dow.patch b/Spigot-Server-Patches/0203-Allow-specifying-a-custom-authentication-servers-dow.patch similarity index 96% rename from Spigot-Server-Patches/0205-Allow-specifying-a-custom-authentication-servers-dow.patch rename to Spigot-Server-Patches/0203-Allow-specifying-a-custom-authentication-servers-dow.patch index 0014dc5dde..20ddcbc175 100644 --- a/Spigot-Server-Patches/0205-Allow-specifying-a-custom-authentication-servers-dow.patch +++ b/Spigot-Server-Patches/0203-Allow-specifying-a-custom-authentication-servers-dow.patch @@ -1,4 +1,4 @@ -From ba56e59de1c80d48ff61b963108ba3031091f2ec Mon Sep 17 00:00:00 2001 +From d85c759a84dfcc06cc74027447ae85e4bb4bf00e Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 17 Aug 2017 16:08:20 -0700 Subject: [PATCH] Allow specifying a custom "authentication servers down" kick @@ -27,7 +27,7 @@ index e97dbaf8e3..45863c017c 100644 + } } diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 005efbc111..6249b0e686 100644 +index 8bbea96240..10c82107d4 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -240,6 +240,10 @@ public class LoginListener implements PacketLoginInListener, ITickable { diff --git a/Spigot-Server-Patches/0206-LivingEntity-setKiller.patch b/Spigot-Server-Patches/0204-LivingEntity-setKiller.patch similarity index 92% rename from Spigot-Server-Patches/0206-LivingEntity-setKiller.patch rename to Spigot-Server-Patches/0204-LivingEntity-setKiller.patch index 5888915e84..4afad96911 100644 --- a/Spigot-Server-Patches/0206-LivingEntity-setKiller.patch +++ b/Spigot-Server-Patches/0204-LivingEntity-setKiller.patch @@ -1,11 +1,11 @@ -From 499738f52c8435fa5f33492d0fd2b46f4048c14b Mon Sep 17 00:00:00 2001 +From df90c74841f68a91de827cd8f7ba0de5af40e120 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 01:49:48 -0500 Subject: [PATCH] LivingEntity#setKiller diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index ac301d379b..49f515d868 100644 +index 09cf843d46..9acafadbbf 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -253,6 +253,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/Spigot-Server-Patches/0207-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch b/Spigot-Server-Patches/0205-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch similarity index 86% rename from Spigot-Server-Patches/0207-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch rename to Spigot-Server-Patches/0205-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch index 8de73ff842..84f9cc9f1e 100644 --- a/Spigot-Server-Patches/0207-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch +++ b/Spigot-Server-Patches/0205-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch @@ -1,4 +1,4 @@ -From 4aac22aa465248aaabd4292bf6804bf8c88d60fe Mon Sep 17 00:00:00 2001 +From 30c1b3eda760b16ae8ab175f7811c70566851fe0 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Mon, 18 Sep 2017 12:00:03 +0200 Subject: [PATCH] Use Log4j IOStreams to redirect System.out/err to logger @@ -12,25 +12,23 @@ results in a separate line, even though it should not result in a line break. Log4j's implementation handles it correctly. diff --git a/pom.xml b/pom.xml -index 47e307a246..a93ed45df9 100644 +index ced853423d..5afd16d7fe 100644 --- a/pom.xml +++ b/pom.xml -@@ -89,6 +89,13 @@ +@@ -62,6 +62,11 @@ + 2.8.1 runtime - -+ + + org.apache.logging.log4j + log4j-iostreams + 2.8.1 + -+ - - junit + org.ow2.asm + asm diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index af430b73f0..8c76300185 100644 +index fc7e244f8b..50d7ef0b2a 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -131,8 +131,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/0208-Handle-plugin-prefixes-using-Log4J-configuration.patch b/Spigot-Server-Patches/0206-Handle-plugin-prefixes-using-Log4J-configuration.patch similarity index 93% rename from Spigot-Server-Patches/0208-Handle-plugin-prefixes-using-Log4J-configuration.patch rename to Spigot-Server-Patches/0206-Handle-plugin-prefixes-using-Log4J-configuration.patch index ebd5f761f6..9c6c94a1b1 100644 --- a/Spigot-Server-Patches/0208-Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/Spigot-Server-Patches/0206-Handle-plugin-prefixes-using-Log4J-configuration.patch @@ -1,4 +1,4 @@ -From e1a7de8e88cc6bba3ddc27270d1bf6d592c24e2d Mon Sep 17 00:00:00 2001 +From 850c7f08feb2fd680eecddf1f9141a34e5053130 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 21 Sep 2017 16:14:55 +0200 Subject: [PATCH] Handle plugin prefixes using Log4J configuration @@ -15,20 +15,20 @@ This may cause additional prefixes to be disabled for plugins bypassing the plugin logger. diff --git a/pom.xml b/pom.xml -index a93ed45df9..bb32cb749d 100644 +index 5afd16d7fe..cb42202add 100644 --- a/pom.xml +++ b/pom.xml -@@ -86,7 +86,7 @@ +@@ -60,7 +60,7 @@ org.apache.logging.log4j log4j-core 2.8.1 - runtime + compile - - + + org.apache.logging.log4j diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index ff85d45ab1..abf281c748 100644 +index 9dca5aeda1..9584950c63 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -292,7 +292,7 @@ public class SpigotConfig diff --git a/Spigot-Server-Patches/0209-Include-Log4J2-SLF4J-implementation.patch b/Spigot-Server-Patches/0207-Include-Log4J2-SLF4J-implementation.patch similarity index 75% rename from Spigot-Server-Patches/0209-Include-Log4J2-SLF4J-implementation.patch rename to Spigot-Server-Patches/0207-Include-Log4J2-SLF4J-implementation.patch index 4e5098b4e1..15e88b46c8 100644 --- a/Spigot-Server-Patches/0209-Include-Log4J2-SLF4J-implementation.patch +++ b/Spigot-Server-Patches/0207-Include-Log4J2-SLF4J-implementation.patch @@ -1,17 +1,17 @@ -From 866b60f01910710276920494602e62743f83436f Mon Sep 17 00:00:00 2001 +From 7c9f61c730535ac6471b6b58014810a90ca7d12f Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 21 Sep 2017 16:33:35 +0200 Subject: [PATCH] Include Log4J2 SLF4J implementation diff --git a/pom.xml b/pom.xml -index bb32cb749d..a319cfe3b8 100644 +index cb42202add..3be49ee7f4 100644 --- a/pom.xml +++ b/pom.xml -@@ -90,6 +90,12 @@ +@@ -62,6 +62,12 @@ + 2.8.1 + compile - - + + org.apache.logging.log4j + log4j-slf4j-impl diff --git a/Spigot-Server-Patches/0210-Disable-logger-prefix-for-various-plugins-bypassing-.patch b/Spigot-Server-Patches/0208-Disable-logger-prefix-for-various-plugins-bypassing-.patch similarity index 97% rename from Spigot-Server-Patches/0210-Disable-logger-prefix-for-various-plugins-bypassing-.patch rename to Spigot-Server-Patches/0208-Disable-logger-prefix-for-various-plugins-bypassing-.patch index c5f1fb704a..059b3c3745 100644 --- a/Spigot-Server-Patches/0210-Disable-logger-prefix-for-various-plugins-bypassing-.patch +++ b/Spigot-Server-Patches/0208-Disable-logger-prefix-for-various-plugins-bypassing-.patch @@ -1,4 +1,4 @@ -From 104d89a68c3610578d3840103d37171411077515 Mon Sep 17 00:00:00 2001 +From d00809c9fe5610482b4737825afcf56f6d9ce5b7 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Sat, 23 Sep 2017 21:07:20 +0200 Subject: [PATCH] Disable logger prefix for various plugins bypassing the diff --git a/Spigot-Server-Patches/0211-Add-PlayerJumpEvent.patch b/Spigot-Server-Patches/0209-Add-PlayerJumpEvent.patch similarity index 91% rename from Spigot-Server-Patches/0211-Add-PlayerJumpEvent.patch rename to Spigot-Server-Patches/0209-Add-PlayerJumpEvent.patch index 1bcd2fe767..723b74bae0 100644 --- a/Spigot-Server-Patches/0211-Add-PlayerJumpEvent.patch +++ b/Spigot-Server-Patches/0209-Add-PlayerJumpEvent.patch @@ -1,14 +1,14 @@ -From 5b5bb14c14b7a713d52340838fc20760613a7026 Mon Sep 17 00:00:00 2001 +From 8f05603f944100ea26d4fcf0fd5896c9b13838db Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 28 Sep 2017 17:21:44 -0400 Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index d9f81e6348..8aad37b9be 100644 +index d11edae03c..9a71fa1e94 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1460,6 +1460,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1466,6 +1466,7 @@ public abstract class EntityHuman extends EntityLiving { return 0; } @@ -17,10 +17,10 @@ index d9f81e6348..8aad37b9be 100644 super.cH(); this.a(StatisticList.JUMP); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index d4701d8d56..c1dd2db89d 100644 +index 7e06e5bc67..4cf738e0f8 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -57,6 +57,8 @@ import org.bukkit.inventory.CraftingInventory; +@@ -59,6 +59,8 @@ import org.bukkit.inventory.CraftingInventory; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.InventoryView; import org.bukkit.util.NumberConversions; @@ -29,7 +29,7 @@ index d4701d8d56..c1dd2db89d 100644 import co.aikar.timings.MinecraftTimings; // Paper // CraftBukkit end -@@ -861,7 +863,34 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -873,7 +875,34 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { d8 = d5 - this.p; d9 = d6 - this.q; if (this.player.onGround && !packetplayinflying.b() && d8 > 0.0D) { diff --git a/Spigot-Server-Patches/0212-handle-PacketPlayInKeepAlive-async.patch b/Spigot-Server-Patches/0210-handle-PacketPlayInKeepAlive-async.patch similarity index 86% rename from Spigot-Server-Patches/0212-handle-PacketPlayInKeepAlive-async.patch rename to Spigot-Server-Patches/0210-handle-PacketPlayInKeepAlive-async.patch index eb994f0264..0d24d29426 100644 --- a/Spigot-Server-Patches/0212-handle-PacketPlayInKeepAlive-async.patch +++ b/Spigot-Server-Patches/0210-handle-PacketPlayInKeepAlive-async.patch @@ -1,4 +1,4 @@ -From 402578e7374284a7fcf9e856ea73afde425701cd Mon Sep 17 00:00:00 2001 +From 34ac5d46abe3ec4ca621652fae24bda7726ce9b3 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 5 Oct 2017 01:54:07 +0100 Subject: [PATCH] handle PacketPlayInKeepAlive async @@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing random disconnections for clients. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index c1dd2db89d..b106454447 100644 +index 4cf738e0f8..66d7d76d41 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2471,14 +2471,18 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -2481,14 +2481,18 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } public void a(PacketPlayInKeepAlive packetplayinkeepalive) { @@ -29,11 +29,11 @@ index c1dd2db89d..b106454447 100644 this.player.ping = (this.player.ping * 3 + i) / 4; this.g = false; - } else if (!this.player.getDisplayName().getString().equals(this.minecraftServer.I())) { + } else if (!this.player.getDisplayName().getString().equals(this.minecraftServer.G())) { - this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); + // Paper start - This needs to be handled on the main thread for plugins + minecraftServer.postToMainThread(() -> { -+ this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); ++ this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); + }); + // Paper end } diff --git a/Spigot-Server-Patches/0213-Expose-client-protocol-version-and-virtual-host.patch b/Spigot-Server-Patches/0211-Expose-client-protocol-version-and-virtual-host.patch similarity index 96% rename from Spigot-Server-Patches/0213-Expose-client-protocol-version-and-virtual-host.patch rename to Spigot-Server-Patches/0211-Expose-client-protocol-version-and-virtual-host.patch index 637ed787c3..58250659f6 100644 --- a/Spigot-Server-Patches/0213-Expose-client-protocol-version-and-virtual-host.patch +++ b/Spigot-Server-Patches/0211-Expose-client-protocol-version-and-virtual-host.patch @@ -1,4 +1,4 @@ -From 4956bbfb58c4377b69d4290d5a17d5865671e254 Mon Sep 17 00:00:00 2001 +From e4086a415045c7f86ada6a640de0b2fff40cf4f7 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Tue, 10 Oct 2017 18:45:20 +0200 Subject: [PATCH] Expose client protocol version and virtual host @@ -61,7 +61,7 @@ index 0000000000..5caca6439d + +} diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index 2d57bdf40e..816210fb91 100644 +index 6aabdc2974..a02fa29217 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -15,6 +15,7 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -84,7 +84,7 @@ index 2d57bdf40e..816210fb91 100644 public void a(IChatBaseComponent ichatbasecomponent) {} diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 0afaea8109..61f9eb3e64 100644 +index 26da897243..4f3f88ff66 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -63,6 +63,10 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -111,7 +111,7 @@ index 7acdac55e5..f1a3be69d0 100644 return this.a; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index bf7bfb427b..b455d8e287 100644 +index b3479a6194..a89fbc6027 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -176,6 +176,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0214-revert-serverside-behavior-of-keepalives.patch b/Spigot-Server-Patches/0212-revert-serverside-behavior-of-keepalives.patch similarity index 93% rename from Spigot-Server-Patches/0214-revert-serverside-behavior-of-keepalives.patch rename to Spigot-Server-Patches/0212-revert-serverside-behavior-of-keepalives.patch index 38bb0a0841..e079aaa452 100644 --- a/Spigot-Server-Patches/0214-revert-serverside-behavior-of-keepalives.patch +++ b/Spigot-Server-Patches/0212-revert-serverside-behavior-of-keepalives.patch @@ -1,4 +1,4 @@ -From 23904660de3a66149fe2c666a2ae7d4c43634f65 Mon Sep 17 00:00:00 2001 +From c0478436a87952e21925c9a7429ce1b242e7648a Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 15 Oct 2017 00:29:07 +0100 Subject: [PATCH] revert serverside behavior of keepalives @@ -17,10 +17,10 @@ from networking or during connections flood of chunk packets on slower clients, at the cost of dead connections being kept open for longer. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index b106454447..60d9f5706a 100644 +index 66d7d76d41..5ffe4b374e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -69,7 +69,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -71,7 +71,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private final MinecraftServer minecraftServer; public EntityPlayer player; private int e; @@ -29,7 +29,7 @@ index b106454447..60d9f5706a 100644 private boolean g; private void setPendingPing(boolean isPending) { this.g = isPending;}; private boolean isPendingPing() { return this.g;}; // Paper - OBFHELPER private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER // CraftBukkit start - multithreaded fields -@@ -100,6 +100,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -102,6 +102,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private int E; private int receivedMovePackets; private int processedMovePackets; @@ -37,7 +37,7 @@ index b106454447..60d9f5706a 100644 public PlayerConnection(MinecraftServer minecraftserver, NetworkManager networkmanager, EntityPlayer entityplayer) { this.minecraftServer = minecraftserver; -@@ -179,18 +180,26 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -181,18 +182,26 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } this.minecraftServer.methodProfiler.a("keepAlive"); diff --git a/Spigot-Server-Patches/0215-Replace-HashSet-with-fastutil-s-ObjectOpenHashSet-in.patch b/Spigot-Server-Patches/0213-Replace-HashSet-with-fastutil-s-ObjectOpenHashSet-in.patch similarity index 95% rename from Spigot-Server-Patches/0215-Replace-HashSet-with-fastutil-s-ObjectOpenHashSet-in.patch rename to Spigot-Server-Patches/0213-Replace-HashSet-with-fastutil-s-ObjectOpenHashSet-in.patch index aaa1a36c7c..06dd84e39a 100644 --- a/Spigot-Server-Patches/0215-Replace-HashSet-with-fastutil-s-ObjectOpenHashSet-in.patch +++ b/Spigot-Server-Patches/0213-Replace-HashSet-with-fastutil-s-ObjectOpenHashSet-in.patch @@ -1,4 +1,4 @@ -From 4fa048db1658629e71132678cc4e754b3e55597e Mon Sep 17 00:00:00 2001 +From 55202d86e3df4ab6373ce7a4ea747f62e9641386 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Fri, 20 Oct 2017 04:33:45 +0200 Subject: [PATCH] Replace HashSet with fastutil's ObjectOpenHashSet in diff --git a/Spigot-Server-Patches/0216-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/Spigot-Server-Patches/0214-Send-attack-SoundEffects-only-to-players-who-can-see.patch similarity index 90% rename from Spigot-Server-Patches/0216-Send-attack-SoundEffects-only-to-players-who-can-see.patch rename to Spigot-Server-Patches/0214-Send-attack-SoundEffects-only-to-players-who-can-see.patch index 1002e0040e..243b232ae5 100644 --- a/Spigot-Server-Patches/0216-Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/Spigot-Server-Patches/0214-Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -1,4 +1,4 @@ -From ac77e2ea99df9d12f958f288f46154ffb5655dbc Mon Sep 17 00:00:00 2001 +From a83ee4ce9aa0e78f0b29c856904762ca759710f6 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Tue, 31 Oct 2017 03:26:18 +0100 Subject: [PATCH] Send attack SoundEffects only to players who can see the @@ -6,10 +6,10 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 8aad37b9be..686c61133d 100644 +index 9a71fa1e94..380192501e 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -981,6 +981,15 @@ public abstract class EntityHuman extends EntityLiving { +@@ -987,6 +987,15 @@ public abstract class EntityHuman extends EntityLiving { this.k = 0; } @@ -25,7 +25,7 @@ index 8aad37b9be..686c61133d 100644 public void attack(Entity entity) { if (entity.bk()) { if (!entity.t(this)) { -@@ -1005,7 +1014,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1011,7 +1020,7 @@ public abstract class EntityHuman extends EntityLiving { int i = b0 + EnchantmentManager.b((EntityLiving) this); if (this.isSprinting() && flag) { @@ -34,7 +34,7 @@ index 8aad37b9be..686c61133d 100644 ++i; flag1 = true; } -@@ -1083,7 +1092,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1089,7 +1098,7 @@ public abstract class EntityHuman extends EntityLiving { } } @@ -43,7 +43,7 @@ index 8aad37b9be..686c61133d 100644 this.dl(); } -@@ -1113,15 +1122,15 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1119,15 +1128,15 @@ public abstract class EntityHuman extends EntityLiving { } if (flag2) { @@ -62,7 +62,7 @@ index 8aad37b9be..686c61133d 100644 } } -@@ -1177,7 +1186,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1183,7 +1192,7 @@ public abstract class EntityHuman extends EntityLiving { this.applyExhaustion(world.spigotConfig.combatExhaustion); // Spigot - Change to use configurable value } else { @@ -72,10 +72,10 @@ index 8aad37b9be..686c61133d 100644 entity.extinguish(); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6d314a7124..412300fbb5 100644 +index 109e718118..9f6027d5e4 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -927,6 +927,12 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -948,6 +948,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.a(entityhuman, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, soundeffect, soundcategory, f, f1); } diff --git a/Spigot-Server-Patches/0217-Option-for-maximum-exp-value-when-merging-orbs.patch b/Spigot-Server-Patches/0215-Option-for-maximum-exp-value-when-merging-orbs.patch similarity index 91% rename from Spigot-Server-Patches/0217-Option-for-maximum-exp-value-when-merging-orbs.patch rename to Spigot-Server-Patches/0215-Option-for-maximum-exp-value-when-merging-orbs.patch index ade3776b32..cfe0b7d161 100644 --- a/Spigot-Server-Patches/0217-Option-for-maximum-exp-value-when-merging-orbs.patch +++ b/Spigot-Server-Patches/0215-Option-for-maximum-exp-value-when-merging-orbs.patch @@ -1,14 +1,14 @@ -From 4cb92bb43d9c51c89afbc109b2f465957e9c68a8 Mon Sep 17 00:00:00 2001 +From 6b0122321de7304bfea1554d803e68672966274d Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 10 Nov 2017 23:03:12 -0500 Subject: [PATCH] Option for maximum exp value when merging orbs diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 23cb3feef0..1c642e6364 100644 +index 22af662ff3..9864c95a8c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -362,4 +362,10 @@ public class PaperWorldConfig { +@@ -365,4 +365,10 @@ public class PaperWorldConfig { disableCreeperLingeringEffect = getBoolean("disable-creeper-lingering-effect", false); log("Creeper lingering effect: " + disableCreeperLingeringEffect); } @@ -20,10 +20,10 @@ index 23cb3feef0..1c642e6364 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 412300fbb5..f740328183 100644 +index 9f6027d5e4..a6d5fb7c73 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1005,16 +1005,32 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1026,16 +1026,32 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc EntityExperienceOrb xp = (EntityExperienceOrb) entity; double radius = spigotConfig.expMerge; if (radius > 0) { diff --git a/Spigot-Server-Patches/0218-Add-PlayerArmorChangeEvent.patch b/Spigot-Server-Patches/0216-Add-PlayerArmorChangeEvent.patch similarity index 93% rename from Spigot-Server-Patches/0218-Add-PlayerArmorChangeEvent.patch rename to Spigot-Server-Patches/0216-Add-PlayerArmorChangeEvent.patch index 603fe5508d..94ff8cca34 100644 --- a/Spigot-Server-Patches/0218-Add-PlayerArmorChangeEvent.patch +++ b/Spigot-Server-Patches/0216-Add-PlayerArmorChangeEvent.patch @@ -1,11 +1,11 @@ -From 5143d41a1c355e2d6776b45b81c07f0b454d8a12 Mon Sep 17 00:00:00 2001 +From 37bd8ea924c7ec4f22345b6c25751e02928ce96f Mon Sep 17 00:00:00 2001 From: pkt77 Date: Fri, 10 Nov 2017 23:46:34 -0500 Subject: [PATCH] Add PlayerArmorChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 169ad7619e..3236179a45 100644 +index 2ff82694b4..e2ceb7ae4b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1,5 +1,6 @@ @@ -15,7 +15,7 @@ index 169ad7619e..3236179a45 100644 import com.google.common.base.Objects; import com.google.common.collect.Maps; import java.util.Collection; -@@ -2048,6 +2049,13 @@ public abstract class EntityLiving extends Entity { +@@ -2083,6 +2084,13 @@ public abstract class EntityLiving extends Entity { ItemStack itemstack1 = this.getEquipment(enumitemslot); if (!ItemStack.matches(itemstack1, itemstack)) { diff --git a/Spigot-Server-Patches/0219-Prevent-logins-from-being-processed-when-the-player-.patch b/Spigot-Server-Patches/0217-Prevent-logins-from-being-processed-when-the-player-.patch similarity index 91% rename from Spigot-Server-Patches/0219-Prevent-logins-from-being-processed-when-the-player-.patch rename to Spigot-Server-Patches/0217-Prevent-logins-from-being-processed-when-the-player-.patch index 11bb000c3a..28209d6277 100644 --- a/Spigot-Server-Patches/0219-Prevent-logins-from-being-processed-when-the-player-.patch +++ b/Spigot-Server-Patches/0217-Prevent-logins-from-being-processed-when-the-player-.patch @@ -1,4 +1,4 @@ -From 06ac9de078e849e33432685b46fd5e2094f88d0f Mon Sep 17 00:00:00 2001 +From fe33c9b37e6c35b64499e7241d73fa376296cf38 Mon Sep 17 00:00:00 2001 From: killme Date: Sun, 12 Nov 2017 19:40:01 +0100 Subject: [PATCH] Prevent logins from being processed when the player has @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent logins from being processed when the player has diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 6249b0e686..91cd6e0f61 100644 +index 10c82107d4..1380a14274 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -57,7 +57,11 @@ public class LoginListener implements PacketLoginInListener, ITickable { diff --git a/Spigot-Server-Patches/0220-use-CB-BlockState-implementations-for-captured-block.patch b/Spigot-Server-Patches/0218-use-CB-BlockState-implementations-for-captured-block.patch similarity index 89% rename from Spigot-Server-Patches/0220-use-CB-BlockState-implementations-for-captured-block.patch rename to Spigot-Server-Patches/0218-use-CB-BlockState-implementations-for-captured-block.patch index c4fd48fd42..5c9d92cab4 100644 --- a/Spigot-Server-Patches/0220-use-CB-BlockState-implementations-for-captured-block.patch +++ b/Spigot-Server-Patches/0218-use-CB-BlockState-implementations-for-captured-block.patch @@ -1,4 +1,4 @@ -From 52436b3658cfae5889419adb6d1cd690c41bea8e Mon Sep 17 00:00:00 2001 +From ed331c984a7c09f15bc7e4c1e904b3f06d90ba7e Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 16 Nov 2017 12:12:41 +0000 Subject: [PATCH] use CB BlockState implementations for captured blocks @@ -18,10 +18,10 @@ the blockstate that will be valid for restoration, as opposed to dropping information on restoration when the event is cancelled. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f740328183..7cd07112a3 100644 +index a6d5fb7c73..08aab08ec2 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -374,7 +374,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -395,7 +395,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit start - capture blockstates CraftBlockState blockstate = null; if (this.captureBlockStates) { diff --git a/Spigot-Server-Patches/0221-API-to-get-a-BlockState-without-a-snapshot.patch b/Spigot-Server-Patches/0219-API-to-get-a-BlockState-without-a-snapshot.patch similarity index 97% rename from Spigot-Server-Patches/0221-API-to-get-a-BlockState-without-a-snapshot.patch rename to Spigot-Server-Patches/0219-API-to-get-a-BlockState-without-a-snapshot.patch index 4257ea80e2..f16a7044c0 100644 --- a/Spigot-Server-Patches/0221-API-to-get-a-BlockState-without-a-snapshot.patch +++ b/Spigot-Server-Patches/0219-API-to-get-a-BlockState-without-a-snapshot.patch @@ -1,4 +1,4 @@ -From 237dda00e5b8bb9e5e81c021a7562fec179388a2 Mon Sep 17 00:00:00 2001 +From ebb2afdc3c8ca00cf538b5b2afe82908db6df9bf Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 6 Nov 2017 21:08:22 -0500 Subject: [PATCH] API to get a BlockState without a snapshot @@ -13,7 +13,7 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE If Tile Entity was null, correct Sign to return empty lines instead of null diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 6021a3401f..536fd37254 100644 +index b3c5766a27..29fe031d85 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -206,7 +206,12 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -39,7 +39,7 @@ index 6021a3401f..536fd37254 100644 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index dfddbaf825..4aaf14e8ce 100644 +index 370a222f83..f493ebc4f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -267,6 +267,20 @@ public class CraftBlock implements Block { diff --git a/Spigot-Server-Patches/0222-AsyncTabCompleteEvent.patch b/Spigot-Server-Patches/0220-AsyncTabCompleteEvent.patch similarity index 94% rename from Spigot-Server-Patches/0222-AsyncTabCompleteEvent.patch rename to Spigot-Server-Patches/0220-AsyncTabCompleteEvent.patch index 40d462c682..a35844d9d0 100644 --- a/Spigot-Server-Patches/0222-AsyncTabCompleteEvent.patch +++ b/Spigot-Server-Patches/0220-AsyncTabCompleteEvent.patch @@ -1,4 +1,4 @@ -From 99a069220500774f7bfe14e602af116c48169982 Mon Sep 17 00:00:00 2001 +From 153bffed74e9dedaab3c2fbadcc9666a03c101f8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 26 Nov 2017 13:19:58 -0500 Subject: [PATCH] AsyncTabCompleteEvent @@ -14,10 +14,10 @@ completion, such as offline players. Also adds isCommand and getLocation to the sync TabCompleteEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 60d9f5706a..a912fb3414 100644 +index 5ffe4b374e..93807ffa62 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -504,18 +504,60 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -506,10 +506,11 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } public void a(PacketPlayInTabComplete packetplayintabcomplete) { @@ -29,8 +29,16 @@ index 60d9f5706a..a912fb3414 100644 + minecraftServer.postToMainThread(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); // Paper return; } -- // CraftBukkit end -- ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(packetplayintabcomplete.c(), this.player.getCommandListener()); + // CraftBukkit end +@@ -519,11 +520,53 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + stringreader.skip(); + } + +- ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener()); +- +- this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { +- if (((Suggestions) suggestions).isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer +- this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), (Suggestions) suggestions)); // CraftBukkit - decompile error + // Paper start + com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event; + java.util.List completions = new java.util.ArrayList<>(); @@ -65,10 +73,7 @@ index 60d9f5706a..a912fb3414 100644 + minecraftServer.postToMainThread(() -> sendSuggestions(packetplayintabcomplete, null)); + } + public void sendSuggestions(PacketPlayInTabComplete packetplayintabcomplete, java.util.List otherSuggestions) { - -- this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { -- if (((Suggestions) suggestions).isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer -- this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), (Suggestions) suggestions)); // CraftBukkit - decompile error ++ + ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(packetplayintabcomplete.c(), this.player.getCommandListener()); + //noinspection unchecked + java.util.concurrent.CompletableFuture completionSuggestions = this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults); @@ -85,10 +90,10 @@ index 60d9f5706a..a912fb3414 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3d4bb6d8c9..b5fd412b74 100644 +index 0eea57eb7d..99f4b40f7f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1670,7 +1670,7 @@ public final class CraftServer implements Server { +@@ -1690,7 +1690,7 @@ public final class CraftServer implements Server { offers = tabCompleteChat(player, message); } diff --git a/Spigot-Server-Patches/0223-Avoid-NPE-in-PathfinderGoalTempt.patch b/Spigot-Server-Patches/0221-Avoid-NPE-in-PathfinderGoalTempt.patch similarity index 93% rename from Spigot-Server-Patches/0223-Avoid-NPE-in-PathfinderGoalTempt.patch rename to Spigot-Server-Patches/0221-Avoid-NPE-in-PathfinderGoalTempt.patch index 035f9f80c3..c77116b347 100644 --- a/Spigot-Server-Patches/0223-Avoid-NPE-in-PathfinderGoalTempt.patch +++ b/Spigot-Server-Patches/0221-Avoid-NPE-in-PathfinderGoalTempt.patch @@ -1,4 +1,4 @@ -From 8d6e94abf1d507f277f931627d3c89cff95577e5 Mon Sep 17 00:00:00 2001 +From cb4108bd19b1858eba6660560f057a2ef32ae100 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 29 Nov 2017 22:18:54 -0500 Subject: [PATCH] Avoid NPE in PathfinderGoalTempt diff --git a/Spigot-Server-Patches/0224-PlayerPickupExperienceEvent.patch b/Spigot-Server-Patches/0222-PlayerPickupExperienceEvent.patch similarity index 91% rename from Spigot-Server-Patches/0224-PlayerPickupExperienceEvent.patch rename to Spigot-Server-Patches/0222-PlayerPickupExperienceEvent.patch index b7db37f01b..a5a9cadf16 100644 --- a/Spigot-Server-Patches/0224-PlayerPickupExperienceEvent.patch +++ b/Spigot-Server-Patches/0222-PlayerPickupExperienceEvent.patch @@ -1,4 +1,4 @@ -From 0141073e6731a1a73a7ecce095cdc418e6c161ea Mon Sep 17 00:00:00 2001 +From 06ddb8c6b47ebc7894162d3ac09d7650ebfa2087 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 22:02:53 -0500 Subject: [PATCH] PlayerPickupExperienceEvent @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerPickupExperienceEvent Allows plugins to cancel a player picking up an experience orb diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 79d80596df..a87ef5fb8c 100644 +index 31c8d4bc86..dcef63bb1f 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -218,7 +218,7 @@ public class EntityExperienceOrb extends Entity { diff --git a/Spigot-Server-Patches/0225-ExperienceOrbMergeEvent.patch b/Spigot-Server-Patches/0223-ExperienceOrbMergeEvent.patch similarity index 87% rename from Spigot-Server-Patches/0225-ExperienceOrbMergeEvent.patch rename to Spigot-Server-Patches/0223-ExperienceOrbMergeEvent.patch index a25cc70d00..270cb3aa8c 100644 --- a/Spigot-Server-Patches/0225-ExperienceOrbMergeEvent.patch +++ b/Spigot-Server-Patches/0223-ExperienceOrbMergeEvent.patch @@ -1,4 +1,4 @@ -From d9cc2b9aa6ff6b68198dc8948be78ef1ca309e1b Mon Sep 17 00:00:00 2001 +From 97a51fb15c9f072778dfe97bf438633c5ccef933 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 22:57:26 -0500 Subject: [PATCH] ExperienceOrbMergeEvent @@ -8,10 +8,10 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor metadata such as spawn reason, or conditionally move data from source to target. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7cd07112a3..852977cab3 100644 +index 08aab08ec2..32c8fb4531 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1015,7 +1015,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1036,7 +1036,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (e instanceof EntityExperienceOrb) { EntityExperienceOrb loopItem = (EntityExperienceOrb) e; // Paper start diff --git a/Spigot-Server-Patches/0226-Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/0224-Ability-to-apply-mending-to-XP-API.patch similarity index 93% rename from Spigot-Server-Patches/0226-Ability-to-apply-mending-to-XP-API.patch rename to Spigot-Server-Patches/0224-Ability-to-apply-mending-to-XP-API.patch index f19983487e..94e2810e80 100644 --- a/Spigot-Server-Patches/0226-Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-Server-Patches/0224-Ability-to-apply-mending-to-XP-API.patch @@ -1,4 +1,4 @@ -From 2d5fd7c000d0c8f28019f1bcfb5b0a675d57c821 Mon Sep 17 00:00:00 2001 +From 4672fc0942d4d2f48066ec4fb9bbd9c95649954e Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 20 Dec 2017 17:36:49 -0500 Subject: [PATCH] Ability to apply mending to XP API @@ -10,10 +10,10 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index 3204d94c54..e4ed9e2066 100644 +index c90e413f8c..c365bfea04 100644 --- a/src/main/java/net/minecraft/server/EnchantmentManager.java +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java -@@ -245,6 +245,7 @@ public class EnchantmentManager { +@@ -244,6 +244,7 @@ public class EnchantmentManager { return getEnchantmentLevel(Enchantments.F, itemstack) > 0; } @@ -22,7 +22,7 @@ index 3204d94c54..e4ed9e2066 100644 List list = enchantment.a(entityliving); diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java -index 0f4aad20fe..3a5263fd9f 100644 +index 836fe13c3d..27093a672e 100644 --- a/src/main/java/net/minecraft/server/Enchantments.java +++ b/src/main/java/net/minecraft/server/Enchantments.java @@ -36,7 +36,7 @@ public class Enchantments { @@ -35,7 +35,7 @@ index 0f4aad20fe..3a5263fd9f 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index a87ef5fb8c..b8bfc75771 100644 +index dcef63bb1f..53cfc10017 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -246,10 +246,12 @@ public class EntityExperienceOrb extends Entity { @@ -52,10 +52,10 @@ index a87ef5fb8c..b8bfc75771 100644 return i * 2; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b455d8e287..c7adfaad91 100644 +index a89fbc6027..c2016ba003 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1012,8 +1012,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1010,8 +1010,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().getId()); } diff --git a/Spigot-Server-Patches/0227-Configurable-Chunks-Sends-per-Tick-setting.patch b/Spigot-Server-Patches/0225-Configurable-Chunks-Sends-per-Tick-setting.patch similarity index 91% rename from Spigot-Server-Patches/0227-Configurable-Chunks-Sends-per-Tick-setting.patch rename to Spigot-Server-Patches/0225-Configurable-Chunks-Sends-per-Tick-setting.patch index 8a779c8109..d3cd084f75 100644 --- a/Spigot-Server-Patches/0227-Configurable-Chunks-Sends-per-Tick-setting.patch +++ b/Spigot-Server-Patches/0225-Configurable-Chunks-Sends-per-Tick-setting.patch @@ -1,4 +1,4 @@ -From 9d046f9a244e2e04a90005fcee94495532ffb1c5 Mon Sep 17 00:00:00 2001 +From dec1c132081c3fd428f8ed46608cb15b011bac51 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 1 Jan 2018 15:41:59 -0500 Subject: [PATCH] Configurable Chunks Sends per Tick setting @@ -8,10 +8,10 @@ Vanilla already had this limited, make it configurable. Limit how much exploration lags the server diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 1c642e6364..87c0feb25e 100644 +index 9864c95a8c..9188e49b71 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -368,4 +368,13 @@ public class PaperWorldConfig { +@@ -371,4 +371,13 @@ public class PaperWorldConfig { expMergeMaxValue = getInt("experience-merge-max-value", -1); log("Experience Merge Max Value: " + expMergeMaxValue); } diff --git a/Spigot-Server-Patches/0228-Configurable-Max-Chunk-Gens-per-Tick.patch b/Spigot-Server-Patches/0226-Configurable-Max-Chunk-Gens-per-Tick.patch similarity index 91% rename from Spigot-Server-Patches/0228-Configurable-Max-Chunk-Gens-per-Tick.patch rename to Spigot-Server-Patches/0226-Configurable-Max-Chunk-Gens-per-Tick.patch index 735371a401..7670f18dd5 100644 --- a/Spigot-Server-Patches/0228-Configurable-Max-Chunk-Gens-per-Tick.patch +++ b/Spigot-Server-Patches/0226-Configurable-Max-Chunk-Gens-per-Tick.patch @@ -1,4 +1,4 @@ -From 7214b3b26ab8afcff9c1211da9cbe380200bd705 Mon Sep 17 00:00:00 2001 +From d687cd8f13cfca085b63b6e13c73ecf1f97d2998 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 1 Jan 2018 16:10:24 -0500 Subject: [PATCH] Configurable Max Chunk Gens per Tick @@ -13,10 +13,10 @@ This should result in no noticeable speed reduction in generation for servers no lagging, and let larger servers reduce this value according to their own desires. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 87c0feb25e..f3ab146d3b 100644 +index 9188e49b71..a225b55853 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -377,4 +377,15 @@ public class PaperWorldConfig { +@@ -380,4 +380,15 @@ public class PaperWorldConfig { } log("Max Chunk Sends Per Tick: " + maxChunkSendsPerTick); } @@ -33,7 +33,7 @@ index 87c0feb25e..f3ab146d3b 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 344b95233f..fcd9f5491f 100644 +index 3f4a8f21c0..f8d8a44a88 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -28,6 +28,7 @@ public class PlayerChunk { @@ -44,10 +44,10 @@ index 344b95233f..fcd9f5491f 100644 private boolean loadInProgress = false; private Runnable loadedRunnable = new Runnable() { public void run() { -@@ -49,6 +50,7 @@ public class PlayerChunk { - this.playerChunkMap = playerchunkmap; - this.location = new ChunkCoordIntPair(i, j); - this.chunk = playerchunkmap.getWorld().getChunkProviderServer().getOrLoadChunkAt(i, j); +@@ -52,6 +53,7 @@ public class PlayerChunk { + + chunkproviderserver.a(i, j); + this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); + this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper markChunkUsed(); // Paper - delay chunk unloads } diff --git a/Spigot-Server-Patches/0229-Make-max-squid-spawn-height-configurable.patch b/Spigot-Server-Patches/0227-Make-max-squid-spawn-height-configurable.patch similarity index 86% rename from Spigot-Server-Patches/0229-Make-max-squid-spawn-height-configurable.patch rename to Spigot-Server-Patches/0227-Make-max-squid-spawn-height-configurable.patch index 1394d75fe2..a70c500b62 100644 --- a/Spigot-Server-Patches/0229-Make-max-squid-spawn-height-configurable.patch +++ b/Spigot-Server-Patches/0227-Make-max-squid-spawn-height-configurable.patch @@ -1,4 +1,4 @@ -From 842de20cbb7483504c2cea5400a2fa7cfcfd839b Mon Sep 17 00:00:00 2001 +From 86f848b087c521ba4d031265f069657002f6b29f Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 11 Jan 2018 16:47:28 -0600 Subject: [PATCH] Make max squid spawn height configurable @@ -7,10 +7,10 @@ I don't know why upstream made only the minimum height configurable but whatever diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index f3ab146d3b..128034dbb2 100644 +index a225b55853..63f8f566cb 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -388,4 +388,9 @@ public class PaperWorldConfig { +@@ -391,4 +391,9 @@ public class PaperWorldConfig { log("Max Chunk Gens Per Tick: " + maxChunkGensPerTick); } } @@ -21,13 +21,13 @@ index f3ab146d3b..128034dbb2 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 97de169de2..3099f6aa7a 100644 +index 5d7d0b6910..2dfa794a3f 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -167,7 +167,10 @@ public class EntitySquid extends EntityWaterAnimal { } - public boolean a(GeneratorAccess generatoraccess) { + public boolean a(GeneratorAccess generatoraccess, boolean flag) { - return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < (double) generatoraccess.getSeaLevel(); // Spigot + // Paper - Make max spawn height configurable + final double maxHeight = world.paperConfig.squidMaxSpawnHeight > 0 ? world.paperConfig.squidMaxSpawnHeight : world.getSeaLevel(); diff --git a/Spigot-Server-Patches/0230-PreCreatureSpawnEvent.patch b/Spigot-Server-Patches/0228-PreCreatureSpawnEvent.patch similarity index 97% rename from Spigot-Server-Patches/0230-PreCreatureSpawnEvent.patch rename to Spigot-Server-Patches/0228-PreCreatureSpawnEvent.patch index 2ffdb96e10..5be44b3314 100644 --- a/Spigot-Server-Patches/0230-PreCreatureSpawnEvent.patch +++ b/Spigot-Server-Patches/0228-PreCreatureSpawnEvent.patch @@ -1,4 +1,4 @@ -From 99a4cccfb5bafd478e1aa01bfce9d15fc60045fb Mon Sep 17 00:00:00 2001 +From 0dcf8a51fa0da99cd6365c7cd376aa77b7e3074a Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 14 Jan 2018 17:01:31 -0500 Subject: [PATCH] PreCreatureSpawnEvent @@ -15,7 +15,7 @@ instead and save a lot of server resources. See: https://github.com/PaperMC/Paper/issues/917 diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index c76dbe74ac..d10196fcbd 100644 +index e4598d8314..6ee069cd12 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -1,6 +1,7 @@ @@ -56,7 +56,7 @@ index c76dbe74ac..d10196fcbd 100644 if (entity == null) { diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 342a15db5e..973c3d1e9e 100644 +index f32191c5a2..4a2153b68f 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -160,10 +160,30 @@ public final class SpawnerCreature { diff --git a/Spigot-Server-Patches/0231-PlayerNaturallySpawnCreaturesEvent.patch b/Spigot-Server-Patches/0229-PlayerNaturallySpawnCreaturesEvent.patch similarity index 93% rename from Spigot-Server-Patches/0231-PlayerNaturallySpawnCreaturesEvent.patch rename to Spigot-Server-Patches/0229-PlayerNaturallySpawnCreaturesEvent.patch index 43a9275c69..06cb195ec9 100644 --- a/Spigot-Server-Patches/0231-PlayerNaturallySpawnCreaturesEvent.patch +++ b/Spigot-Server-Patches/0229-PlayerNaturallySpawnCreaturesEvent.patch @@ -1,4 +1,4 @@ -From ab7876c48f88df9f243aa3741e46267c3e56444a Mon Sep 17 00:00:00 2001 +From 92f50e4fd12ec1dd767f7aae96d08be76115976d Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 14 Jan 2018 17:36:02 -0500 Subject: [PATCH] PlayerNaturallySpawnCreaturesEvent @@ -9,7 +9,7 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 973c3d1e9e..f525fd1b42 100644 +index 4a2153b68f..32808558bb 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -47,6 +47,15 @@ public final class SpawnerCreature { diff --git a/Spigot-Server-Patches/0232-Add-setPlayerProfile-API-for-Skulls.patch b/Spigot-Server-Patches/0230-Add-setPlayerProfile-API-for-Skulls.patch similarity index 95% rename from Spigot-Server-Patches/0232-Add-setPlayerProfile-API-for-Skulls.patch rename to Spigot-Server-Patches/0230-Add-setPlayerProfile-API-for-Skulls.patch index a69e00d43a..41ef4de623 100644 --- a/Spigot-Server-Patches/0232-Add-setPlayerProfile-API-for-Skulls.patch +++ b/Spigot-Server-Patches/0230-Add-setPlayerProfile-API-for-Skulls.patch @@ -1,4 +1,4 @@ -From 72c9d4a3673cc9e9bff91d550b9fd598b38df04f Mon Sep 17 00:00:00 2001 +From 76ebd2cdd3c93a57562e1fd0ca13ef9a5266a599 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 19 Jan 2018 00:36:25 -0500 Subject: [PATCH] Add setPlayerProfile API for Skulls @@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo which commonly cause rate limit issues with Mojang API diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java -index f113da713..fdfe101ae 100644 +index f113da713a..fdfe101ae3 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -1,5 +1,7 @@ @@ -48,7 +48,7 @@ index f113da713..fdfe101ae 100644 public BlockFace getRotation() { return ((Rotatable) getBlockData()).getRotation(); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index 7984c68cb..14d8dd65a 100644 +index 7984c68cb0..14d8dd65ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -2,6 +2,8 @@ package org.bukkit.craftbukkit.inventory; @@ -90,5 +90,5 @@ index 7984c68cb..14d8dd65a 100644 public OfflinePlayer getOwningPlayer() { if (hasOwner()) { -- -2.16.1.windows.1 +2.18.0 diff --git a/Spigot-Server-Patches/0233-Fill-Profile-Property-Events.patch b/Spigot-Server-Patches/0231-Fill-Profile-Property-Events.patch similarity index 96% rename from Spigot-Server-Patches/0233-Fill-Profile-Property-Events.patch rename to Spigot-Server-Patches/0231-Fill-Profile-Property-Events.patch index fdbd310623..7bae261849 100644 --- a/Spigot-Server-Patches/0233-Fill-Profile-Property-Events.patch +++ b/Spigot-Server-Patches/0231-Fill-Profile-Property-Events.patch @@ -1,4 +1,4 @@ -From eb99da9cb92561c3f666a1bf94f6a648aa2aa992 Mon Sep 17 00:00:00 2001 +From a1da3b99382c6520db7cdbc74c7e06d2cc17b26c Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 2 Jan 2018 00:31:26 -0500 Subject: [PATCH] Fill Profile Property Events diff --git a/Spigot-Server-Patches/0234-PlayerAdvancementCriterionGrantEvent.patch b/Spigot-Server-Patches/0232-PlayerAdvancementCriterionGrantEvent.patch similarity index 90% rename from Spigot-Server-Patches/0234-PlayerAdvancementCriterionGrantEvent.patch rename to Spigot-Server-Patches/0232-PlayerAdvancementCriterionGrantEvent.patch index 5789e82184..bd5dd9f97c 100644 --- a/Spigot-Server-Patches/0234-PlayerAdvancementCriterionGrantEvent.patch +++ b/Spigot-Server-Patches/0232-PlayerAdvancementCriterionGrantEvent.patch @@ -1,11 +1,11 @@ -From 1540a3dc588cc6eea7741d4728abcd8b6f051e15 Mon Sep 17 00:00:00 2001 +From 2b5a80623f9e37895b767c3b8c827c1d91edcf8d Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 19 Jan 2018 08:15:29 -0600 Subject: [PATCH] PlayerAdvancementCriterionGrantEvent diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java -index d0eb65aaf0..5fe0e947c3 100644 +index eff9589320..26eaa9be90 100644 --- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java @@ -232,6 +232,12 @@ public class AdvancementDataPlayer { diff --git a/Spigot-Server-Patches/0235-Add-ArmorStand-Item-Meta.patch b/Spigot-Server-Patches/0233-Add-ArmorStand-Item-Meta.patch similarity index 97% rename from Spigot-Server-Patches/0235-Add-ArmorStand-Item-Meta.patch rename to Spigot-Server-Patches/0233-Add-ArmorStand-Item-Meta.patch index 00a22b8bee..fed8fd1e2c 100644 --- a/Spigot-Server-Patches/0235-Add-ArmorStand-Item-Meta.patch +++ b/Spigot-Server-Patches/0233-Add-ArmorStand-Item-Meta.patch @@ -1,4 +1,4 @@ -From ce65b11d86cfceb4f0a150f7a1eae6c7075cea87 Mon Sep 17 00:00:00 2001 +From ca55a9c7f338b7af991f01fc6be66f21adedf9a6 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 27 Jan 2018 17:04:14 -0500 Subject: [PATCH] Add ArmorStand Item Meta @@ -13,7 +13,7 @@ starting point for future additions in this area. Fixes GH-559 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 3dbe9d81e..22b9674da 100644 +index 3dbe9d81ea..22b9674da3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -185,6 +185,8 @@ public final class CraftItemFactory implements ItemFactory { @@ -26,7 +26,7 @@ index 3dbe9d81e..22b9674da 100644 case CHEST: case TRAPPED_CHEST: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 69425e838..bdd4bf515 100644 +index 69425e838f..bdd4bf5151 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -397,6 +397,8 @@ public final class CraftItemStack extends ItemStack { @@ -40,7 +40,7 @@ index 69425e838..bdd4bf515 100644 case TRAPPED_CHEST: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java new file mode 100644 -index 000000000..0e8acf12e +index 0000000000..0e8acf12e4 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java @@ -0,0 +1,309 @@ @@ -354,7 +354,7 @@ index 000000000..0e8acf12e + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 3fd208803..360e1fd54 100644 +index 3fd2088039..360e1fd54c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -136,6 +136,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { @@ -383,7 +383,7 @@ index 3fd208803..360e1fd54 100644 } return HANDLED_TAGS; diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index f66cc81d9..eb6cf1bb3 100644 +index 00f89f2296..ef9d40b8a0 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java @@ -6,6 +6,7 @@ import static org.hamcrest.Matchers.*; @@ -392,9 +392,9 @@ index f66cc81d9..eb6cf1bb3 100644 import java.util.List; +import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; // Paper import net.minecraft.server.Block; + import net.minecraft.server.IRegistry; import net.minecraft.server.ITileEntity; - import net.minecraft.server.Item; -@@ -308,7 +309,18 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -309,7 +310,18 @@ public class ItemMetaTest extends AbstractTestingBase { cleanStack.setItemMeta(meta); return cleanStack; } diff --git a/Spigot-Server-Patches/0236-Extend-Player-Interact-cancellation.patch b/Spigot-Server-Patches/0234-Extend-Player-Interact-cancellation.patch similarity index 97% rename from Spigot-Server-Patches/0236-Extend-Player-Interact-cancellation.patch rename to Spigot-Server-Patches/0234-Extend-Player-Interact-cancellation.patch index c432d3e746..2ce34b22de 100644 --- a/Spigot-Server-Patches/0236-Extend-Player-Interact-cancellation.patch +++ b/Spigot-Server-Patches/0234-Extend-Player-Interact-cancellation.patch @@ -1,4 +1,4 @@ -From 861c3fa189510a3970d34c35bd7bf053a6be433e Mon Sep 17 00:00:00 2001 +From 855dba495cb16d5b707c2eb03b7a682a5e6eeae4 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 11 Feb 2018 10:43:46 +0000 Subject: [PATCH] Extend Player Interact cancellation @@ -13,7 +13,7 @@ Update adjacent blocks of doors, double plants, pistons and beds when cancelling interaction. diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 6e524353b5..4a439ef4ca 100644 +index 4e44180329..cae24961fd 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -110,6 +110,11 @@ public class PlayerInteractManager { diff --git a/Spigot-Server-Patches/0237-Tameable-getOwnerUniqueId-API.patch b/Spigot-Server-Patches/0235-Tameable-getOwnerUniqueId-API.patch similarity index 96% rename from Spigot-Server-Patches/0237-Tameable-getOwnerUniqueId-API.patch rename to Spigot-Server-Patches/0235-Tameable-getOwnerUniqueId-API.patch index 0e84073f34..c0e20210f7 100644 --- a/Spigot-Server-Patches/0237-Tameable-getOwnerUniqueId-API.patch +++ b/Spigot-Server-Patches/0235-Tameable-getOwnerUniqueId-API.patch @@ -1,4 +1,4 @@ -From 7e815733a7a41f10d0b3c836a3a30980d515fba8 Mon Sep 17 00:00:00 2001 +From fd3d87725db3ea0854be12e875e0a8d3134d039b Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 24 Feb 2018 01:14:55 -0500 Subject: [PATCH] Tameable#getOwnerUniqueId API diff --git a/Spigot-Server-Patches/0238-Toggleable-player-crits-helps-mitigate-hacked-client.patch b/Spigot-Server-Patches/0236-Toggleable-player-crits-helps-mitigate-hacked-client.patch similarity index 89% rename from Spigot-Server-Patches/0238-Toggleable-player-crits-helps-mitigate-hacked-client.patch rename to Spigot-Server-Patches/0236-Toggleable-player-crits-helps-mitigate-hacked-client.patch index a09d399f0c..ed873b2270 100644 --- a/Spigot-Server-Patches/0238-Toggleable-player-crits-helps-mitigate-hacked-client.patch +++ b/Spigot-Server-Patches/0236-Toggleable-player-crits-helps-mitigate-hacked-client.patch @@ -1,11 +1,11 @@ -From 72bccb47d2ff01d38810adfb8698b5b03a303b11 Mon Sep 17 00:00:00 2001 +From 61310ad17ed62e2a1061f2f39d730a46519374c1 Mon Sep 17 00:00:00 2001 From: MiniDigger Date: Sat, 10 Mar 2018 00:50:24 +0100 Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 128034dbb2..2ce60eb05d 100644 +index 63f8f566cb..c9a44863cc 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -180,6 +180,11 @@ public class PaperWorldConfig { @@ -21,10 +21,10 @@ index 128034dbb2..2ce60eb05d 100644 private void allChunksAreSlimeChunks() { allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 686c61133d..bd25a00d82 100644 +index 380192501e..fcb5f07d78 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1021,6 +1021,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1027,6 +1027,7 @@ public abstract class EntityHuman extends EntityLiving { boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.z_() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && entity instanceof EntityLiving; diff --git a/Spigot-Server-Patches/0239-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch b/Spigot-Server-Patches/0237-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch similarity index 95% rename from Spigot-Server-Patches/0239-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch rename to Spigot-Server-Patches/0237-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch index 626e6d42d0..f8cb2c2a42 100644 --- a/Spigot-Server-Patches/0239-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch +++ b/Spigot-Server-Patches/0237-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch @@ -1,4 +1,4 @@ -From dd5dd86e613a7935327b88a5700f202c941c4872 Mon Sep 17 00:00:00 2001 +From 9b347d1650adeea49d1093c698f8780bc47e1134 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 10 Mar 2018 13:03:49 +0000 Subject: [PATCH] Fix NPE when getting location from InventoryEnderChest opened diff --git a/Spigot-Server-Patches/0240-Prevent-Frosted-Ice-from-loading-holding-chunks.patch b/Spigot-Server-Patches/0238-Prevent-Frosted-Ice-from-loading-holding-chunks.patch similarity index 91% rename from Spigot-Server-Patches/0240-Prevent-Frosted-Ice-from-loading-holding-chunks.patch rename to Spigot-Server-Patches/0238-Prevent-Frosted-Ice-from-loading-holding-chunks.patch index ae4336d3bc..740981a598 100644 --- a/Spigot-Server-Patches/0240-Prevent-Frosted-Ice-from-loading-holding-chunks.patch +++ b/Spigot-Server-Patches/0238-Prevent-Frosted-Ice-from-loading-holding-chunks.patch @@ -1,11 +1,11 @@ -From dd92ca49c7d0e57a4962cda11cad24affab46e5b Mon Sep 17 00:00:00 2001 +From 383a42b10e28e543f3e36282d70a5bec1488ffc7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 10 Mar 2018 16:33:15 -0500 Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index 77cf6b8e9b..9d9671eaec 100644 +index 302d420512..c97937e810 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java @@ -25,6 +25,12 @@ public class BlockIceFrost extends BlockIce { @@ -21,7 +21,7 @@ index 77cf6b8e9b..9d9671eaec 100644 IBlockData iblockdata1 = world.getType(blockposition_b); if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition_b)) { -@@ -89,6 +95,10 @@ public class BlockIceFrost extends BlockIce { +@@ -87,6 +93,10 @@ public class BlockIceFrost extends BlockIce { EnumDirection enumdirection = aenumdirection[l]; blockposition_b.j(blockposition).d(enumdirection); diff --git a/Spigot-Server-Patches/0241-Disable-Explicit-Network-Manager-Flushing.patch b/Spigot-Server-Patches/0239-Disable-Explicit-Network-Manager-Flushing.patch similarity index 93% rename from Spigot-Server-Patches/0241-Disable-Explicit-Network-Manager-Flushing.patch rename to Spigot-Server-Patches/0239-Disable-Explicit-Network-Manager-Flushing.patch index c822b032ad..b7e5de8ed0 100644 --- a/Spigot-Server-Patches/0241-Disable-Explicit-Network-Manager-Flushing.patch +++ b/Spigot-Server-Patches/0239-Disable-Explicit-Network-Manager-Flushing.patch @@ -1,4 +1,4 @@ -From 1c884ab552ea64dad0dd97cecd57f6eb71c5074e Mon Sep 17 00:00:00 2001 +From 436b8ca65261831566f75fcc279c317e6544ee73 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 11 Mar 2018 14:13:33 -0400 Subject: [PATCH] Disable Explicit Network Manager Flushing @@ -12,7 +12,7 @@ flushing on the netty event loop, so it won't do the flush on the main thread. Renable flushing by passing -Dpaper.explicit-flush=true diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 4f3f88ff..f8facddb 100644 +index 4f3f88ff66..f8facddb40 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -66,6 +66,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -33,5 +33,5 @@ index 4f3f88ff..f8facddb 100644 if (this.u++ % 20 == 0) { -- -2.14.1.windows.1 +2.18.0 diff --git a/Spigot-Server-Patches/0242-Implement-extended-PaperServerListPingEvent.patch b/Spigot-Server-Patches/0240-Implement-extended-PaperServerListPingEvent.patch similarity index 91% rename from Spigot-Server-Patches/0242-Implement-extended-PaperServerListPingEvent.patch rename to Spigot-Server-Patches/0240-Implement-extended-PaperServerListPingEvent.patch index 33dfe892e2..5a3094f5f2 100644 --- a/Spigot-Server-Patches/0242-Implement-extended-PaperServerListPingEvent.patch +++ b/Spigot-Server-Patches/0240-Implement-extended-PaperServerListPingEvent.patch @@ -1,4 +1,4 @@ -From 4044f790f6d30ec1c2299647be9200cbe7d76758 Mon Sep 17 00:00:00 2001 +From 4305123c0458309d67e39c873edfaa8df355c881 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 15:56:26 +0200 Subject: [PATCH] Implement extended PaperServerListPingEvent @@ -177,29 +177,37 @@ index 0000000000..350410527b + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a2e685acf7..d6b56d685e 100644 +index 014c923897..76e6b233b1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -915,7 +915,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import co.aikar.timings.Timings; ++import com.destroystokyo.paper.event.server.PaperServerListPingEvent; + import com.google.common.base.Stopwatch; + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; +@@ -935,7 +936,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati if (i - this.Y >= 5000000000L) { this.Y = i; - this.n.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.B(), this.A())); -- GameProfile[] agameprofile = new GameProfile[Math.min(this.A(), 12)]; -+ GameProfile[] agameprofile = new GameProfile[Math.min(this.A(), org.spigotmc.SpigotConfig.playerSample)]; // Paper - int j = MathHelper.nextInt(this.o, 0, this.A() - agameprofile.length); + this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.z(), this.y())); +- GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), 12)]; ++ GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), org.spigotmc.SpigotConfig.playerSample)]; // Paper + int j = MathHelper.nextInt(this.n, 0, this.y() - agameprofile.length); for (int k = 0; k < agameprofile.length; ++k) { -@@ -1280,10 +1280,12 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - return "1.13"; +@@ -1292,10 +1293,12 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + return "1.13.1"; } -+ public int getPlayerCount() { return A(); } // Paper - OBFHELPER - public int A() { ++ public int getPlayerCount() { return y(); } // Paper - OBFHELPER + public int y() { return this.s.getPlayerCount(); } -+ public int getMaxPlayers() { return B(); } // Paper - OBFHELPER - public int B() { ++ public int getMaxPlayers() { return z(); } // Paper - OBFHELPER + public int z() { return this.s.getMaxPlayers(); } diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java @@ -251,7 +259,7 @@ index d7e1ecc031..f20cddc41c 100644 this.c = agameprofile; } diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index abf281c748..4ac0ab9974 100644 +index 9584950c63..eed96c60c5 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -291,7 +291,7 @@ public class SpigotConfig diff --git a/Spigot-Server-Patches/0243-Improved-Async-Task-Scheduler.patch b/Spigot-Server-Patches/0241-Improved-Async-Task-Scheduler.patch similarity index 99% rename from Spigot-Server-Patches/0243-Improved-Async-Task-Scheduler.patch rename to Spigot-Server-Patches/0241-Improved-Async-Task-Scheduler.patch index 4b24725170..b5531192ba 100644 --- a/Spigot-Server-Patches/0243-Improved-Async-Task-Scheduler.patch +++ b/Spigot-Server-Patches/0241-Improved-Async-Task-Scheduler.patch @@ -1,4 +1,4 @@ -From d58c36a41bbd9ae83d44e3e59a43e5cbf0cd8878 Mon Sep 17 00:00:00 2001 +From ce2c24d27c8338ead4b3a78be4434229076b4fb7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 16 Mar 2018 22:59:43 -0400 Subject: [PATCH] Improved Async Task Scheduler diff --git a/Spigot-Server-Patches/0244-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/Spigot-Server-Patches/0242-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch similarity index 96% rename from Spigot-Server-Patches/0244-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch rename to Spigot-Server-Patches/0242-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index a6f01fb505..5476162b3c 100644 --- a/Spigot-Server-Patches/0244-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/Spigot-Server-Patches/0242-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -1,4 +1,4 @@ -From 9f47650e1c37410c3b7bf1effb399a5d1a2672d4 Mon Sep 17 00:00:00 2001 +From 92dcfcd94c4e61d784b7d1e6289187fce514a964 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 18 Mar 2018 11:45:57 -0400 Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent @@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent This will allow you to change the players name or skin on login. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 91cd6e0f61..f02b28059c 100644 +index 1380a14274..ab85fd9a6e 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -1,5 +1,7 @@ diff --git a/Spigot-Server-Patches/0245-Call-PortalCreateEvent-for-exit-portals.patch b/Spigot-Server-Patches/0243-Call-PortalCreateEvent-for-exit-portals.patch similarity index 96% rename from Spigot-Server-Patches/0245-Call-PortalCreateEvent-for-exit-portals.patch rename to Spigot-Server-Patches/0243-Call-PortalCreateEvent-for-exit-portals.patch index 1b6f3edaf4..dcb975b81f 100644 --- a/Spigot-Server-Patches/0245-Call-PortalCreateEvent-for-exit-portals.patch +++ b/Spigot-Server-Patches/0243-Call-PortalCreateEvent-for-exit-portals.patch @@ -1,11 +1,11 @@ -From 0e37166c412ab13ae4514136d1313cf404909ef7 Mon Sep 17 00:00:00 2001 +From a680e60296b2326770e73fdd619db1c3521cf12a Mon Sep 17 00:00:00 2001 From: MiniDigger Date: Sun, 18 Mar 2018 15:44:44 +0100 Subject: [PATCH] Call PortalCreateEvent for exit portals diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index 402d8d7d..72b85bf6 100644 +index 5e899e05cf..20f2a9197c 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -48,6 +48,9 @@ public class PortalTravelAgent { @@ -50,7 +50,7 @@ index 402d8d7d..72b85bf6 100644 + java.util.Map nmsBlocks = new java.util.LinkedHashMap<>(); // Paper + if (d0 < 0.0D) { - i1 = MathHelper.clamp(i1, 70, this.world.aa() - 10); + i1 = MathHelper.clamp(i1, 70, this.world.ab() - 10); j5 = i1; @@ -416,8 +433,11 @@ public class PortalTravelAgent { l3 = j2 + (l2 - 1) * l5 - k2 * k5; @@ -104,5 +104,5 @@ index 402d8d7d..72b85bf6 100644 } -- -2.18.0.windows.1 +2.18.0 diff --git a/Spigot-Server-Patches/0246-Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/0244-Player.setPlayerProfile-API.patch similarity index 94% rename from Spigot-Server-Patches/0246-Player.setPlayerProfile-API.patch rename to Spigot-Server-Patches/0244-Player.setPlayerProfile-API.patch index 59847d2719..4033676703 100644 --- a/Spigot-Server-Patches/0246-Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/0244-Player.setPlayerProfile-API.patch @@ -1,4 +1,4 @@ -From 8095a0224d0740e6fcd2cee575bac1488d3aab67 Mon Sep 17 00:00:00 2001 +From d9019b0d583c4ca557c6faa4a31ee24efec192ce Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 18 Mar 2018 12:29:48 -0400 Subject: [PATCH] Player.setPlayerProfile API @@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index bd25a00d82..55c45973e1 100644 +index fcb5f07d78..0551ae2290 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -67,7 +67,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -19,7 +19,7 @@ index bd25a00d82..55c45973e1 100644 private final ItemCooldown ce; @Nullable diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index f02b28059c..bb33cf3029 100644 +index ab85fd9a6e..5778a5201d 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -38,7 +38,7 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -48,7 +48,7 @@ index f02b28059c..bb33cf3029 100644 uniqueId = i.getId(); // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c7adfaad91..349afa3f33 100644 +index c2016ba003..41bd979797 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,6 +1,8 @@ @@ -60,7 +60,7 @@ index c7adfaad91..349afa3f33 100644 import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.io.BaseEncoding; -@@ -1181,8 +1183,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1179,8 +1181,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { hiddenPlayers.put(player.getUniqueId(), hidingPlugins); // Remove this player from the hidden player's EntityTrackerEntry @@ -76,7 +76,7 @@ index c7adfaad91..349afa3f33 100644 EntityTrackerEntry entry = tracker.trackedEntities.get(other.getId()); if (entry != null) { entry.clear(getHandle()); -@@ -1223,8 +1231,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1221,8 +1229,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } hiddenPlayers.remove(player.getUniqueId()); @@ -91,7 +91,7 @@ index c7adfaad91..349afa3f33 100644 getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other)); -@@ -1233,6 +1246,46 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1231,6 +1244,46 @@ public class CraftPlayer extends CraftHumanEntity implements Player { entry.updatePlayer(getHandle()); } } diff --git a/Spigot-Server-Patches/0247-Fix-Dragon-Server-Crashes.patch b/Spigot-Server-Patches/0245-Fix-Dragon-Server-Crashes.patch similarity index 95% rename from Spigot-Server-Patches/0247-Fix-Dragon-Server-Crashes.patch rename to Spigot-Server-Patches/0245-Fix-Dragon-Server-Crashes.patch index 66e383ad2f..41c12ca244 100644 --- a/Spigot-Server-Patches/0247-Fix-Dragon-Server-Crashes.patch +++ b/Spigot-Server-Patches/0245-Fix-Dragon-Server-Crashes.patch @@ -1,4 +1,4 @@ -From 93d93fef7d1bb9521cfdbf2d5dce725da68aaf36 Mon Sep 17 00:00:00 2001 +From 323d78929cc2fe12158a6d63a430a6bc2ba6295c Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 21 Mar 2018 20:52:07 -0400 Subject: [PATCH] Fix Dragon Server Crashes diff --git a/Spigot-Server-Patches/0248-getPlayerUniqueId-API.patch b/Spigot-Server-Patches/0246-getPlayerUniqueId-API.patch similarity index 90% rename from Spigot-Server-Patches/0248-getPlayerUniqueId-API.patch rename to Spigot-Server-Patches/0246-getPlayerUniqueId-API.patch index 5173f22172..8bd1ff2e6c 100644 --- a/Spigot-Server-Patches/0248-getPlayerUniqueId-API.patch +++ b/Spigot-Server-Patches/0246-getPlayerUniqueId-API.patch @@ -1,4 +1,4 @@ -From d647cc0a5242e0ae7cb053cd4813c410585896e7 Mon Sep 17 00:00:00 2001 +From 2a6250aef74fdfb649919ffe26bde6b0dce53560 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 22 Mar 2018 01:40:24 -0400 Subject: [PATCH] getPlayerUniqueId API @@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b5fd412b74..0552659354 100644 +index 99f4b40f7f..a6d1fde496 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1363,6 +1363,26 @@ public final class CraftServer implements Server { +@@ -1383,6 +1383,26 @@ public final class CraftServer implements Server { return recipients.size(); } diff --git a/Spigot-Server-Patches/0249-Make-player-data-saving-configurable.patch b/Spigot-Server-Patches/0247-Make-player-data-saving-configurable.patch similarity index 91% rename from Spigot-Server-Patches/0249-Make-player-data-saving-configurable.patch rename to Spigot-Server-Patches/0247-Make-player-data-saving-configurable.patch index 1827e2b8c0..03f8758fc7 100644 --- a/Spigot-Server-Patches/0249-Make-player-data-saving-configurable.patch +++ b/Spigot-Server-Patches/0247-Make-player-data-saving-configurable.patch @@ -1,4 +1,4 @@ -From 7a7dd5a48e5b9da6221ea84661d82e459d8510b0 Mon Sep 17 00:00:00 2001 +From 7334becad2b654b234ba959e626462a9e1094e50 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Mon, 26 Mar 2018 18:30:53 +0300 Subject: [PATCH] Make player data saving configurable @@ -23,10 +23,10 @@ index 45863c017c..9bfbaf61e5 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index a562e1e46c..cbfdb3cf79 100644 +index 0fd6efec0b..7553280d21 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -144,6 +144,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { +@@ -141,6 +141,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { } public void save(EntityHuman entityhuman) { diff --git a/Spigot-Server-Patches/0250-Make-legacy-ping-handler-more-reliable.patch b/Spigot-Server-Patches/0248-Make-legacy-ping-handler-more-reliable.patch similarity index 98% rename from Spigot-Server-Patches/0250-Make-legacy-ping-handler-more-reliable.patch rename to Spigot-Server-Patches/0248-Make-legacy-ping-handler-more-reliable.patch index 2d380c8e74..c62f748619 100644 --- a/Spigot-Server-Patches/0250-Make-legacy-ping-handler-more-reliable.patch +++ b/Spigot-Server-Patches/0248-Make-legacy-ping-handler-more-reliable.patch @@ -1,4 +1,4 @@ -From 9c4cb9f0158e6b8a28e5984d91b57381824b38a1 Mon Sep 17 00:00:00 2001 +From bfa21f1ccd2de884b932be3cb954e7e0347fd418 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 18:22:50 +0200 Subject: [PATCH] Make legacy ping handler more reliable @@ -28,7 +28,7 @@ respond to the request. [2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13 diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index 41115108f1..07c53f5057 100644 +index 64fe1d7e83..f7fbf1d76e 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java @@ -14,6 +14,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { diff --git a/Spigot-Server-Patches/0251-Call-PaperServerListPingEvent-for-legacy-pings.patch b/Spigot-Server-Patches/0249-Call-PaperServerListPingEvent-for-legacy-pings.patch similarity index 97% rename from Spigot-Server-Patches/0251-Call-PaperServerListPingEvent-for-legacy-pings.patch rename to Spigot-Server-Patches/0249-Call-PaperServerListPingEvent-for-legacy-pings.patch index 4b8e2ff3c8..f3d58b1c8d 100644 --- a/Spigot-Server-Patches/0251-Call-PaperServerListPingEvent-for-legacy-pings.patch +++ b/Spigot-Server-Patches/0249-Call-PaperServerListPingEvent-for-legacy-pings.patch @@ -1,4 +1,4 @@ -From 23918472ceeac090b7d1dc1cacc894ca722fc0a7 Mon Sep 17 00:00:00 2001 +From d564f907024e4d839cc52657be957872b1f133aa Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 19:30:51 +0200 Subject: [PATCH] Call PaperServerListPingEvent for legacy pings @@ -84,7 +84,7 @@ index 0000000000..74c012fd40 + +} diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index 07c53f5057..91acfceec8 100644 +index f7fbf1d76e..1ed2b193a5 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java @@ -9,6 +9,7 @@ import java.net.InetSocketAddress; @@ -104,7 +104,7 @@ index 07c53f5057..91acfceec8 100644 switch (i) { case 0: LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())); -- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { minecraftserver.getMotd(), Integer.valueOf(minecraftserver.A()), Integer.valueOf(minecraftserver.B())}); +- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { minecraftserver.getMotd(), Integer.valueOf(minecraftserver.y()), Integer.valueOf(minecraftserver.z())}); + // Paper start - Call PaperServerListPingEvent and use results + event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null); + if (event == null) { @@ -122,7 +122,7 @@ index 07c53f5057..91acfceec8 100644 } - LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())); -- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { Integer.valueOf(127), minecraftserver.getVersion(), minecraftserver.getMotd(), Integer.valueOf(minecraftserver.A()), Integer.valueOf(minecraftserver.B())}); +- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { Integer.valueOf(127), minecraftserver.getVersion(), minecraftserver.getMotd(), Integer.valueOf(minecraftserver.y()), Integer.valueOf(minecraftserver.z())}); + // Paper start - Call PaperServerListPingEvent and use results + event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null); + if (event == null) { diff --git a/Spigot-Server-Patches/0252-Flag-to-disable-the-channel-limit.patch b/Spigot-Server-Patches/0250-Flag-to-disable-the-channel-limit.patch similarity index 91% rename from Spigot-Server-Patches/0252-Flag-to-disable-the-channel-limit.patch rename to Spigot-Server-Patches/0250-Flag-to-disable-the-channel-limit.patch index 8643adb5de..6a11f7d411 100644 --- a/Spigot-Server-Patches/0252-Flag-to-disable-the-channel-limit.patch +++ b/Spigot-Server-Patches/0250-Flag-to-disable-the-channel-limit.patch @@ -1,4 +1,4 @@ -From 21cfeb957f9c4c40feb75b5a2b450dd103db5e0e Mon Sep 17 00:00:00 2001 +From 4e6595031c8a8b43495ef22a9fe386b891fbeb75 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 31 Mar 2018 17:04:26 +0100 Subject: [PATCH] Flag to disable the channel limit @@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 349afa3f33..b768327bbb 100644 +index 41bd979797..88caea739c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -133,6 +133,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -20,7 +20,7 @@ index 349afa3f33..b768327bbb 100644 // Paper end public CraftPlayer(CraftServer server, EntityPlayer entity) { -@@ -1448,7 +1449,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1446,7 +1447,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { diff --git a/Spigot-Server-Patches/0253-Add-method-to-open-already-placed-sign.patch b/Spigot-Server-Patches/0251-Add-method-to-open-already-placed-sign.patch similarity index 92% rename from Spigot-Server-Patches/0253-Add-method-to-open-already-placed-sign.patch rename to Spigot-Server-Patches/0251-Add-method-to-open-already-placed-sign.patch index 7c7ca2a0f0..b21cb89b7f 100644 --- a/Spigot-Server-Patches/0253-Add-method-to-open-already-placed-sign.patch +++ b/Spigot-Server-Patches/0251-Add-method-to-open-already-placed-sign.patch @@ -1,11 +1,11 @@ -From 75bf1009398fa01cc65fbebd7c42fcef5ca4c138 Mon Sep 17 00:00:00 2001 +From 8a8d56752da4de54f7753a4c88c3a082b18638e8 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Sun, 1 Apr 2018 02:29:37 +0300 Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 4afff2f262..e9707dfa74 100644 +index 38a886fbd5..92fe80316f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -518,4 +518,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/Spigot-Server-Patches/0254-Load-version-history-at-server-start.patch b/Spigot-Server-Patches/0252-Load-version-history-at-server-start.patch similarity index 89% rename from Spigot-Server-Patches/0254-Load-version-history-at-server-start.patch rename to Spigot-Server-Patches/0252-Load-version-history-at-server-start.patch index 119538c38a..8d73bef560 100644 --- a/Spigot-Server-Patches/0254-Load-version-history-at-server-start.patch +++ b/Spigot-Server-Patches/0252-Load-version-history-at-server-start.patch @@ -1,11 +1,11 @@ -From cd1c078948a4a287bee0d0e1d1beb7ea4d983eb1 Mon Sep 17 00:00:00 2001 +From 3c313649674cd46c02f52d3826dae55a8653d174 Mon Sep 17 00:00:00 2001 From: Kyle Wood Date: Thu, 1 Mar 2018 19:38:14 -0600 Subject: [PATCH] Load version history at server start diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 8c76300185..8e15710caf 100644 +index 50d7ef0b2a..c4e99ef2a9 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -207,6 +207,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/0255-Configurable-sprint-interruption-on-attack.patch b/Spigot-Server-Patches/0253-Configurable-sprint-interruption-on-attack.patch similarity index 86% rename from Spigot-Server-Patches/0255-Configurable-sprint-interruption-on-attack.patch rename to Spigot-Server-Patches/0253-Configurable-sprint-interruption-on-attack.patch index 4b2359dfe5..53a741a000 100644 --- a/Spigot-Server-Patches/0255-Configurable-sprint-interruption-on-attack.patch +++ b/Spigot-Server-Patches/0253-Configurable-sprint-interruption-on-attack.patch @@ -1,4 +1,4 @@ -From bf1f15f2a196b2a87d6e0c8601a472090be4fceb Mon Sep 17 00:00:00 2001 +From 186f491a1291ca298b08c2d9367c3e3e9963d3ef Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Sat, 14 Apr 2018 20:20:46 +0200 Subject: [PATCH] Configurable sprint interruption on attack @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable sprint interruption on attack If the sprint interruption is disabled players continue sprinting when they attack entities. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 2ce60eb05d..9daa8f66a1 100644 +index c9a44863cc..9ff73d531c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -398,4 +398,9 @@ public class PaperWorldConfig { +@@ -401,4 +401,9 @@ public class PaperWorldConfig { private void squidMaxSpawnHeight() { squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D); } @@ -20,10 +20,10 @@ index 2ce60eb05d..9daa8f66a1 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 55c45973e1..015cd553dd 100644 +index 0551ae2290..6ae76477c0 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1073,7 +1073,11 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1079,7 +1079,11 @@ public abstract class EntityHuman extends EntityLiving { this.motX *= 0.6D; this.motZ *= 0.6D; diff --git a/Spigot-Server-Patches/0256-Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/Spigot-Server-Patches/0254-Fix-exploit-that-allowed-colored-signs-to-be-created.patch similarity index 86% rename from Spigot-Server-Patches/0256-Fix-exploit-that-allowed-colored-signs-to-be-created.patch rename to Spigot-Server-Patches/0254-Fix-exploit-that-allowed-colored-signs-to-be-created.patch index 7e39329aa5..22d5825fcf 100644 --- a/Spigot-Server-Patches/0256-Fix-exploit-that-allowed-colored-signs-to-be-created.patch +++ b/Spigot-Server-Patches/0254-Fix-exploit-that-allowed-colored-signs-to-be-created.patch @@ -1,14 +1,14 @@ -From c3434440b096cce951c436d885782e49e87f9e92 Mon Sep 17 00:00:00 2001 +From 19336c64f45b82a2cae113d99c7e9efa320cc568 Mon Sep 17 00:00:00 2001 From: 0x22 <0x22@futureclient.net> Date: Thu, 26 Apr 2018 04:41:11 -0400 Subject: [PATCH] Fix exploit that allowed colored signs to be created diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index a912fb3414..ce8170ea9f 100644 +index 93807ffa62..a7bdb9737b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2504,7 +2504,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -2515,7 +2515,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { String[] lines = new String[4]; for (int i = 0; i < astring.length; ++i) { diff --git a/Spigot-Server-Patches/0257-EndermanEscapeEvent.patch b/Spigot-Server-Patches/0255-EndermanEscapeEvent.patch similarity index 92% rename from Spigot-Server-Patches/0257-EndermanEscapeEvent.patch rename to Spigot-Server-Patches/0255-EndermanEscapeEvent.patch index d7cf0e5d61..1eb905d579 100644 --- a/Spigot-Server-Patches/0257-EndermanEscapeEvent.patch +++ b/Spigot-Server-Patches/0255-EndermanEscapeEvent.patch @@ -1,4 +1,4 @@ -From 412430f9e37c921e7aab7cc69a6785c87fa509b9 Mon Sep 17 00:00:00 2001 +From acc5da67890d22807bc408a8d5f2a67de5405423 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 13:15:55 -0400 Subject: [PATCH] EndermanEscapeEvent @@ -8,7 +8,7 @@ Fires an event anytime an enderman intends to teleport away from the player You may cancel this, enabling ranged attacks to damage the enderman for example. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index ddf64ee6c5..a766b38959 100644 +index 53a3819ee4..6abe45fd6f 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -1,6 +1,7 @@ @@ -33,13 +33,13 @@ index ddf64ee6c5..a766b38959 100644 public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) { if (!super.setGoalTarget(entityliving, reason, fireEvent)) { @@ -168,7 +175,7 @@ public class EntityEnderman extends EntityMonster { - if (this.world.K() && this.ticksLived >= this.bE + 600) { + if (this.world.L() && this.ticksLived >= this.bE + 600) { float f = this.az(); - if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { + if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper this.setGoalTarget((EntityLiving) null); - this.dA(); + this.dz(); } @@ -247,7 +254,7 @@ public class EntityEnderman extends EntityMonster { public boolean damageEntity(DamageSource damagesource, float f) { @@ -48,7 +48,7 @@ index ddf64ee6c5..a766b38959 100644 - } else if (damagesource instanceof EntityDamageSourceIndirect) { + } else if (damagesource instanceof EntityDamageSourceIndirect && tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper for (int i = 0; i < 64; ++i) { - if (this.dA()) { + if (this.dz()) { return true; @@ -258,7 +265,7 @@ public class EntityEnderman extends EntityMonster { } else { @@ -56,7 +56,7 @@ index ddf64ee6c5..a766b38959 100644 - if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0) { + if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0 && tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper - this.dA(); + this.dz(); } @@ -347,7 +354,7 @@ public class EntityEnderman extends EntityMonster { @@ -74,7 +74,7 @@ index ddf64ee6c5..a766b38959 100644 if (this.i.f((EntityHuman) this.d)) { - if (((EntityHuman) this.d).h(this.i) < 16.0D) { + if (((EntityHuman) this.d).h(this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { // Paper - this.i.dA(); + this.i.dz(); } -- diff --git a/Spigot-Server-Patches/0258-Enderman.teleportRandomly.patch b/Spigot-Server-Patches/0256-Enderman.teleportRandomly.patch similarity index 86% rename from Spigot-Server-Patches/0258-Enderman.teleportRandomly.patch rename to Spigot-Server-Patches/0256-Enderman.teleportRandomly.patch index c05ae8b6b0..6f5ee5e2c1 100644 --- a/Spigot-Server-Patches/0258-Enderman.teleportRandomly.patch +++ b/Spigot-Server-Patches/0256-Enderman.teleportRandomly.patch @@ -1,4 +1,4 @@ -From 247294cb19dc83b384646f7a329f44a277022c91 Mon Sep 17 00:00:00 2001 +From 19fb8077e8a6ee70cf6d2c6dcfb8188f1685f3c0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 13:29:44 -0400 Subject: [PATCH] Enderman.teleportRandomly() @@ -6,19 +6,19 @@ Subject: [PATCH] Enderman.teleportRandomly() Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index a766b3895..0f64c8f2b 100644 +index 6abe45fd6f..5f636efb0c 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -184,6 +184,7 @@ public class EntityEnderman extends EntityMonster { super.mobTick(); } -+ public boolean teleportRandomly() { return dA(); } // Paper - OBFHELPER - protected boolean dA() { ++ public boolean teleportRandomly() { return dz(); } // Paper - OBFHELPER + protected boolean dz() { double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D; double d1 = this.locY + (double) (this.random.nextInt(64) - 32); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java -index b81693d9f..9bc6a6c0c 100644 +index b81693d9ff..9bc6a6c0c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java @@ -17,6 +17,7 @@ public class CraftEnderman extends CraftMonster implements Enderman { diff --git a/Spigot-Server-Patches/0259-Block-Enderpearl-Travel-Exploit.patch b/Spigot-Server-Patches/0257-Block-Enderpearl-Travel-Exploit.patch similarity index 93% rename from Spigot-Server-Patches/0259-Block-Enderpearl-Travel-Exploit.patch rename to Spigot-Server-Patches/0257-Block-Enderpearl-Travel-Exploit.patch index f9e830c11f..c5f65aae96 100644 --- a/Spigot-Server-Patches/0259-Block-Enderpearl-Travel-Exploit.patch +++ b/Spigot-Server-Patches/0257-Block-Enderpearl-Travel-Exploit.patch @@ -1,4 +1,4 @@ -From a8c1bf72e67267ee2321ec81a276806b6ecab226 Mon Sep 17 00:00:00 2001 +From cd1da8ec0aaa537d101490c3713e2c21b09682b8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 17:15:26 -0400 Subject: [PATCH] Block Enderpearl Travel Exploit @@ -12,10 +12,10 @@ This disables that by not saving the thrower when the chunk is unloaded. This is mainly useful for survival servers that do not allow freeform teleporting. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 9daa8f66a1..3467da7c8e 100644 +index 9ff73d531c..16e601f7e9 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -403,4 +403,10 @@ public class PaperWorldConfig { +@@ -406,4 +406,10 @@ public class PaperWorldConfig { private void disableSprintInterruptionOnAttack() { disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); } diff --git a/Spigot-Server-Patches/0260-Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-Server-Patches/0258-Expand-World.spawnParticle-API-and-add-Builder.patch similarity index 65% rename from Spigot-Server-Patches/0260-Expand-World.spawnParticle-API-and-add-Builder.patch rename to Spigot-Server-Patches/0258-Expand-World.spawnParticle-API-and-add-Builder.patch index d5811b1100..c34fa7f0df 100644 --- a/Spigot-Server-Patches/0260-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-Server-Patches/0258-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -1,4 +1,4 @@ -From 4efa9bc44f6b6249bea85669ddc94d746343ef1e Mon Sep 17 00:00:00 2001 +From fd03d282fd5195b571293aabe0cce3db74661be5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 15 Aug 2017 22:29:12 -0400 Subject: [PATCH] Expand World.spawnParticle API and add Builder @@ -10,24 +10,20 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 5d5f6f6328..544f789bda 100644 +index e4ba13cec5..d6e330d345 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1205,14 +1205,19 @@ public class WorldServer extends World implements IAsyncTaskHandler { - // CraftBukkit - visibility api support - return sendParticles(null, t0, d0, d1, d2, i, d3, d4, d5, d6); +@@ -1202,12 +1202,17 @@ public class WorldServer extends World implements IAsyncTaskHandler { } -- -+ // Paper start - Particle API Expansion - public int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) { -+ return sendParticles(this.players, sender, t0, false, d0, d1, d2, i, d3, d5, d5, d6); + + public int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { ++ // Paper start - Particle API Expansion ++ return sendParticles(players, sender, t0, d0, d1, d2, i, d3, d4, d5, d6, force); + } -+ -+ public int sendParticles(List receivers, EntityPlayer sender, T t0, boolean force, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) { - // CraftBukkit end -- PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, false, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i); -+ PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, force, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i); ++ public int sendParticles(List receivers, EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { + // Paper end + PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, force, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i); + // CraftBukkit end int j = 0; - for (int k = 0; k < this.players.size(); ++k) { @@ -36,18 +32,18 @@ index 5d5f6f6328..544f789bda 100644 + EntityPlayer entityplayer = (EntityPlayer) entityhuman; // Paper - Particle API Expansion if (sender != null && !entityplayer.getBukkitEntity().canSee(sender.getBukkitEntity())) continue; // CraftBukkit - if (this.a(entityplayer, false, d0, d1, d2, packetplayoutworldparticles)) { + if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 5cadee4ae0..92fadd7f78 100644 +index 6347d3d1f2..63d9130918 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1611,14 +1611,18 @@ public class CraftWorld implements World { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data); - } +@@ -1616,11 +1616,17 @@ public class CraftWorld implements World { -+ // Paper start - Particle API Expansion @Override -- public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { ++ // Paper start - Particle API Expansion ++ spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, force); ++ } + public void spawnParticle(Particle particle, List receivers, Player sender, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { + // Paper end if (data != null && !particle.getDataType().isInstance(data)) { @@ -58,10 +54,8 @@ index 5cadee4ae0..92fadd7f78 100644 + receivers == null ? getHandle().players : receivers.stream().map(player -> ((CraftPlayer) player).getHandle()).collect(java.util.stream.Collectors.toList()), // Paper - Particle API Expansion + sender != null ? ((CraftPlayer) sender).getHandle() : null, // Sender // Paper - Particle API Expansion CraftParticle.toNMS(particle, data), // Particle -+ force , // Extended range // Paper - Particle API Expansion x, y, z, // Position count, // Count - offsetX, offsetY, offsetZ, // Random offset -- 2.18.0 diff --git a/Spigot-Server-Patches/0261-EndermanAttackPlayerEvent.patch b/Spigot-Server-Patches/0259-EndermanAttackPlayerEvent.patch similarity index 93% rename from Spigot-Server-Patches/0261-EndermanAttackPlayerEvent.patch rename to Spigot-Server-Patches/0259-EndermanAttackPlayerEvent.patch index 8435c96662..5193f45872 100644 --- a/Spigot-Server-Patches/0261-EndermanAttackPlayerEvent.patch +++ b/Spigot-Server-Patches/0259-EndermanAttackPlayerEvent.patch @@ -1,4 +1,4 @@ -From a2696a78ce247412f99754292f111edd3c29aa28 Mon Sep 17 00:00:00 2001 +From 853662a4c7ab407b9e74850ec19a49d8a3af097a Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 May 2018 20:18:54 -0400 Subject: [PATCH] EndermanAttackPlayerEvent @@ -8,7 +8,7 @@ Allow control over whether or not an enderman aggros a player. This allows you to override/extend the pumpkin/stare logic. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 0f64c8f2b5..2db0eb4946 100644 +index 5f636efb0c..e5ccd29a08 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -135,7 +135,15 @@ public class EntityEnderman extends EntityMonster { diff --git a/Spigot-Server-Patches/0262-WitchConsumePotionEvent.patch b/Spigot-Server-Patches/0260-WitchConsumePotionEvent.patch similarity index 93% rename from Spigot-Server-Patches/0262-WitchConsumePotionEvent.patch rename to Spigot-Server-Patches/0260-WitchConsumePotionEvent.patch index 4819dbad84..c6c6a2527c 100644 --- a/Spigot-Server-Patches/0262-WitchConsumePotionEvent.patch +++ b/Spigot-Server-Patches/0260-WitchConsumePotionEvent.patch @@ -1,4 +1,4 @@ -From cd75b8fd7c9934a2be702d44325832c739fa7247 Mon Sep 17 00:00:00 2001 +From b56263b8818ba17436b81cd612961a25bafda079 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 16 May 2018 20:35:16 -0400 Subject: [PATCH] WitchConsumePotionEvent @@ -6,7 +6,7 @@ Subject: [PATCH] WitchConsumePotionEvent Fires when a witch consumes the potion in their hand diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index b397636247..790ab11c17 100644 +index a586689acf..6717d3c331 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -67,7 +67,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/0263-WitchThrowPotionEvent.patch b/Spigot-Server-Patches/0261-WitchThrowPotionEvent.patch similarity index 94% rename from Spigot-Server-Patches/0263-WitchThrowPotionEvent.patch rename to Spigot-Server-Patches/0261-WitchThrowPotionEvent.patch index 7e0419ca3e..626510589f 100644 --- a/Spigot-Server-Patches/0263-WitchThrowPotionEvent.patch +++ b/Spigot-Server-Patches/0261-WitchThrowPotionEvent.patch @@ -1,4 +1,4 @@ -From bc07d9c6a79d5f349e261bd83b9af5d948fba703 Mon Sep 17 00:00:00 2001 +From cb8246cce7751f17e828bd96d1a9d45fd9ad9dbf Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 16 May 2018 20:44:58 -0400 Subject: [PATCH] WitchThrowPotionEvent @@ -6,7 +6,7 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 790ab11c17..9d802be18a 100644 +index 6717d3c331..648ed17a30 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -154,7 +154,15 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/0264-Allow-spawning-Item-entities-with-World.spawnEntity.patch b/Spigot-Server-Patches/0262-Allow-spawning-Item-entities-with-World.spawnEntity.patch similarity index 88% rename from Spigot-Server-Patches/0264-Allow-spawning-Item-entities-with-World.spawnEntity.patch rename to Spigot-Server-Patches/0262-Allow-spawning-Item-entities-with-World.spawnEntity.patch index 96bbcbf0c7..a628125e47 100644 --- a/Spigot-Server-Patches/0264-Allow-spawning-Item-entities-with-World.spawnEntity.patch +++ b/Spigot-Server-Patches/0262-Allow-spawning-Item-entities-with-World.spawnEntity.patch @@ -1,4 +1,4 @@ -From 9ffde873101035886f75407eeea2eddbf74113ff Mon Sep 17 00:00:00 2001 +From 9534f2fa43867350aa82203cf3a9be73354ad17f Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 4 Jun 2018 20:39:20 -0400 Subject: [PATCH] Allow spawning Item entities with World.spawnEntity @@ -8,10 +8,10 @@ This API has more capabilities than .dropItem with the Consumer function Item can be set inside of the Consumer pre spawn function. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 62638d4e25..affbb93bfd 100644 +index 63d9130918..c449a9a39b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -932,6 +932,10 @@ public class CraftWorld implements World { +@@ -925,6 +925,10 @@ public class CraftWorld implements World { if (Boat.class.isAssignableFrom(clazz)) { entity = new EntityBoat(world, x, y, z); entity.setPositionRotation(x, y, z, yaw, pitch); diff --git a/Spigot-Server-Patches/0265-Don-t-load-chunks-for-villager-door-checks.patch b/Spigot-Server-Patches/0263-Don-t-load-chunks-for-villager-door-checks.patch similarity index 90% rename from Spigot-Server-Patches/0265-Don-t-load-chunks-for-villager-door-checks.patch rename to Spigot-Server-Patches/0263-Don-t-load-chunks-for-villager-door-checks.patch index 5d1c8c78a2..2a723d469d 100644 --- a/Spigot-Server-Patches/0265-Don-t-load-chunks-for-villager-door-checks.patch +++ b/Spigot-Server-Patches/0263-Don-t-load-chunks-for-villager-door-checks.patch @@ -1,4 +1,4 @@ -From 5e95a59523567260ef94f2ef996f48fc93992cab Mon Sep 17 00:00:00 2001 +From 38175f7ba6ffd4237efc7c3e570ea22bb8ec9d23 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Jun 2018 00:32:22 -0400 Subject: [PATCH] Don't load chunks for villager door checks @@ -6,7 +6,7 @@ Subject: [PATCH] Don't load chunks for villager door checks This avoids villages spam loading chunks sync diff --git a/src/main/java/net/minecraft/server/Village.java b/src/main/java/net/minecraft/server/Village.java -index dfcabb83a1..22fe23e8ed 100644 +index bda67faefe..955041e266 100644 --- a/src/main/java/net/minecraft/server/Village.java +++ b/src/main/java/net/minecraft/server/Village.java @@ -313,6 +313,12 @@ public class Village { diff --git a/Spigot-Server-Patches/0266-WitchReadyPotionEvent.patch b/Spigot-Server-Patches/0264-WitchReadyPotionEvent.patch similarity index 93% rename from Spigot-Server-Patches/0266-WitchReadyPotionEvent.patch rename to Spigot-Server-Patches/0264-WitchReadyPotionEvent.patch index 0a31c62c63..efde55a520 100644 --- a/Spigot-Server-Patches/0266-WitchReadyPotionEvent.patch +++ b/Spigot-Server-Patches/0264-WitchReadyPotionEvent.patch @@ -1,11 +1,11 @@ -From 3dd0c3878333c899a63bd3067484ea28f6ef84f4 Mon Sep 17 00:00:00 2001 +From e5b323663792e28b7436a7459ebb8fd7a807087f Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Jun 2018 22:47:26 -0400 Subject: [PATCH] WitchReadyPotionEvent diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 9d802be18a..0096df5de0 100644 +index 648ed17a30..b5f676f045 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -100,7 +100,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/0267-ItemStack-getMaxItemUseDuration.patch b/Spigot-Server-Patches/0265-ItemStack-getMaxItemUseDuration.patch similarity index 91% rename from Spigot-Server-Patches/0267-ItemStack-getMaxItemUseDuration.patch rename to Spigot-Server-Patches/0265-ItemStack-getMaxItemUseDuration.patch index 85f9b3741c..1d34c17396 100644 --- a/Spigot-Server-Patches/0267-ItemStack-getMaxItemUseDuration.patch +++ b/Spigot-Server-Patches/0265-ItemStack-getMaxItemUseDuration.patch @@ -1,4 +1,4 @@ -From c26f3de491029cd013ce5d6c7d9c9733375fa0ba Mon Sep 17 00:00:00 2001 +From 286a5c3fbb41a4f0c602944c4c3087d4fc0065eb Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Jun 2018 23:00:29 -0400 Subject: [PATCH] ItemStack#getMaxItemUseDuration @@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 4f230975aa..e52014fd8f 100644 +index f71d9ee578..a238388012 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -522,6 +522,7 @@ public final class ItemStack { @@ -18,7 +18,7 @@ index 4f230975aa..e52014fd8f 100644 return this.getItem().c(this); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 83f89a2365..8ca161f0ed 100644 +index bdd4bf5151..911463f5b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -183,6 +183,13 @@ public final class CraftItemStack extends ItemStack { diff --git a/Spigot-Server-Patches/0268-Implement-EntityTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0266-Implement-EntityTeleportEndGatewayEvent.patch similarity index 95% rename from Spigot-Server-Patches/0268-Implement-EntityTeleportEndGatewayEvent.patch rename to Spigot-Server-Patches/0266-Implement-EntityTeleportEndGatewayEvent.patch index 74eff699ba..692428e498 100644 --- a/Spigot-Server-Patches/0268-Implement-EntityTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/0266-Implement-EntityTeleportEndGatewayEvent.patch @@ -1,11 +1,11 @@ -From e6d906a6fbe688cc6883541abd473760ebf460ec Mon Sep 17 00:00:00 2001 +From 90a35f26fc719b3fb0debe1d9718e82618304e46 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 9 Jun 2018 14:08:39 +0200 Subject: [PATCH] Implement EntityTeleportEndGatewayEvent diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index 888bbd7a45..c6632588eb 100644 +index b36dcb4d7d..268e4996bc 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java @@ -138,8 +138,19 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick diff --git a/Spigot-Server-Patches/0269-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch b/Spigot-Server-Patches/0267-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch similarity index 91% rename from Spigot-Server-Patches/0269-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch rename to Spigot-Server-Patches/0267-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch index 9878c57fbf..dac08ab006 100644 --- a/Spigot-Server-Patches/0269-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch +++ b/Spigot-Server-Patches/0267-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch @@ -1,4 +1,4 @@ -From 3141bee0865858ff4f1214a2c78d7347a8cfb255 Mon Sep 17 00:00:00 2001 +From 1f2c5cbbaf468db65d948aff8e0e0332add1a15d Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 10 Jun 2018 01:18:49 -0400 Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event @@ -6,7 +6,7 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event Otherwise the creeper infinite explodes diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 0147054dff..bbb4ca0fe6 100644 +index 765123e3d2..19022b6e24 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -12,7 +12,7 @@ public class EntityCreeper extends EntityMonster { @@ -19,7 +19,7 @@ index 0147054dff..bbb4ca0fe6 100644 private int fuseTicks; public int maxFuseTicks = 30; @@ -205,6 +205,7 @@ public class EntityCreeper extends EntityMonster { - this.dG(); + this.dF(); } else { fuseTicks = 0; + this.datawatcher.set(isIgnitedDW, Boolean.valueOf(false)); // Paper diff --git a/Spigot-Server-Patches/0270-Properly-remove-entities-on-dimension-teleport.patch b/Spigot-Server-Patches/0268-Properly-remove-entities-on-dimension-teleport.patch similarity index 89% rename from Spigot-Server-Patches/0270-Properly-remove-entities-on-dimension-teleport.patch rename to Spigot-Server-Patches/0268-Properly-remove-entities-on-dimension-teleport.patch index 8d0e6696fb..e692243d10 100644 --- a/Spigot-Server-Patches/0270-Properly-remove-entities-on-dimension-teleport.patch +++ b/Spigot-Server-Patches/0268-Properly-remove-entities-on-dimension-teleport.patch @@ -1,4 +1,4 @@ -From 33aa68e9488c4bc9998080f9d743ace73fcb472a Mon Sep 17 00:00:00 2001 +From 99c2e5c47218e10dd063004b0056aba7ce122e0f Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 10 Jun 2018 20:04:42 -0400 Subject: [PATCH] Properly remove entities on dimension teleport @@ -22,10 +22,10 @@ requirement, but plugins (such as my own) use this method to trigger a "reload" of the entity on the client. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index aba517a710..20c2bf16be 100644 +index 0e8c95d96b..111c2c3df6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2596,7 +2596,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2590,7 +2590,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end */ @@ -35,10 +35,10 @@ index aba517a710..20c2bf16be 100644 this.world.methodProfiler.a("reposition"); /* CraftBukkit start - Handled in calculateTarget diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d506503e93..697296acd0 100644 +index d6e330d345..3b3ace52b0 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1025,6 +1025,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1020,6 +1020,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } protected void c(Entity entity) { diff --git a/Spigot-Server-Patches/0271-Fix-CraftEntity-hashCode.patch b/Spigot-Server-Patches/0269-Fix-CraftEntity-hashCode.patch similarity index 96% rename from Spigot-Server-Patches/0271-Fix-CraftEntity-hashCode.patch rename to Spigot-Server-Patches/0269-Fix-CraftEntity-hashCode.patch index a0130f3843..ad53d46805 100644 --- a/Spigot-Server-Patches/0271-Fix-CraftEntity-hashCode.patch +++ b/Spigot-Server-Patches/0269-Fix-CraftEntity-hashCode.patch @@ -1,4 +1,4 @@ -From b4761b06b68b93e1e714d4edeb6b9af9061fa285 Mon Sep 17 00:00:00 2001 +From 2e16f435ec6ab6da2ff4da6794ada6b823dab342 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 10 Jun 2018 20:20:15 -0400 Subject: [PATCH] Fix CraftEntity hashCode diff --git a/Spigot-Server-Patches/0272-Configurable-Alternative-LootPool-Luck-Formula.patch b/Spigot-Server-Patches/0270-Configurable-Alternative-LootPool-Luck-Formula.patch similarity index 88% rename from Spigot-Server-Patches/0272-Configurable-Alternative-LootPool-Luck-Formula.patch rename to Spigot-Server-Patches/0270-Configurable-Alternative-LootPool-Luck-Formula.patch index 4c554ec101..67940d6714 100644 --- a/Spigot-Server-Patches/0272-Configurable-Alternative-LootPool-Luck-Formula.patch +++ b/Spigot-Server-Patches/0270-Configurable-Alternative-LootPool-Luck-Formula.patch @@ -1,4 +1,4 @@ -From 5d0719fe7bd51917d60360673ff1a2019635b87b Mon Sep 17 00:00:00 2001 +From c7b9fab1eac83cdedff92cca952c01acb3499fa1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 15 Jun 2018 00:30:32 -0400 Subject: [PATCH] Configurable Alternative LootPool Luck Formula @@ -52,13 +52,13 @@ index 9bfbaf61e5..bcdf4f91d8 100644 + } + } } -diff --git a/src/main/java/net/minecraft/server/LotoSelectorEntry.java b/src/main/java/net/minecraft/server/LotoSelectorEntry.java -index add618866b..9f8e17b9d3 100644 ---- a/src/main/java/net/minecraft/server/LotoSelectorEntry.java -+++ b/src/main/java/net/minecraft/server/LotoSelectorEntry.java +diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java +index 3d501aee30..464f74b269 100644 +--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java ++++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java @@ -14,8 +14,8 @@ import java.util.Random; - public abstract class LotoSelectorEntry { + public abstract class LootSelectorEntry { - protected final int c; - protected final int d; @@ -66,8 +66,8 @@ index add618866b..9f8e17b9d3 100644 + protected final int d; public int getQuality() { return d; } // Paper - OBFHELPER protected final LootItemCondition[] e; - protected LotoSelectorEntry(int i, int j, LootItemCondition[] alootitemcondition) { -@@ -25,8 +25,34 @@ public abstract class LotoSelectorEntry { + protected LootSelectorEntry(int i, int j, LootItemCondition[] alootitemcondition) { +@@ -25,8 +25,34 @@ public abstract class LootSelectorEntry { } public int a(float f) { diff --git a/Spigot-Server-Patches/0273-Print-Error-details-when-failing-to-save-player-data.patch b/Spigot-Server-Patches/0271-Print-Error-details-when-failing-to-save-player-data.patch similarity index 82% rename from Spigot-Server-Patches/0273-Print-Error-details-when-failing-to-save-player-data.patch rename to Spigot-Server-Patches/0271-Print-Error-details-when-failing-to-save-player-data.patch index 1c067f7411..5cd1f64882 100644 --- a/Spigot-Server-Patches/0273-Print-Error-details-when-failing-to-save-player-data.patch +++ b/Spigot-Server-Patches/0271-Print-Error-details-when-failing-to-save-player-data.patch @@ -1,14 +1,14 @@ -From c6bba334512bd4940f97b853d693527b9ea18e26 Mon Sep 17 00:00:00 2001 +From 21d732869ca78a2868f964c18b9c6c88ea341e22 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 15 Jun 2018 20:37:03 -0400 Subject: [PATCH] Print Error details when failing to save player data diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index cbfdb3cf79..9a243010d0 100644 +index 7553280d21..ab085788ab 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -157,7 +157,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { +@@ -154,7 +154,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { file.renameTo(file1); } catch (Exception exception) { diff --git a/Spigot-Server-Patches/0274-Make-shield-blocking-delay-configurable.patch b/Spigot-Server-Patches/0272-Make-shield-blocking-delay-configurable.patch similarity index 88% rename from Spigot-Server-Patches/0274-Make-shield-blocking-delay-configurable.patch rename to Spigot-Server-Patches/0272-Make-shield-blocking-delay-configurable.patch index 19d74d93cf..814e2de2af 100644 --- a/Spigot-Server-Patches/0274-Make-shield-blocking-delay-configurable.patch +++ b/Spigot-Server-Patches/0272-Make-shield-blocking-delay-configurable.patch @@ -1,14 +1,14 @@ -From 87d2f3be5e69f57374b963a58765bb9e923f5619 Mon Sep 17 00:00:00 2001 +From f12aed9eac0dc15fb9da809485a598f7d50c4083 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 16 Jun 2018 01:18:16 -0500 Subject: [PATCH] Make shield blocking delay configurable diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 3467da7c8e..ddb5ced79d 100644 +index 16e601f7e9..2e3e48637a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -409,4 +409,9 @@ public class PaperWorldConfig { +@@ -412,4 +412,9 @@ public class PaperWorldConfig { disableEnderpearlExploit = getBoolean("game-mechanics.disable-unloaded-chunk-enderpearl-exploit", disableEnderpearlExploit); log("Disable Unloaded Chunk Enderpearl Exploit: " + (disableEnderpearlExploit ? "enabled" : "disabled")); } @@ -19,10 +19,10 @@ index 3467da7c8e..ddb5ced79d 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 3236179a45..f4a7db369f 100644 +index e2ceb7ae4b..ef1a1e5790 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2665,7 +2665,7 @@ public abstract class EntityLiving extends Entity { +@@ -2700,7 +2700,7 @@ public abstract class EntityLiving extends Entity { if (this.isHandRaised() && !this.activeItem.isEmpty()) { Item item = this.activeItem.getItem(); @@ -31,7 +31,7 @@ index 3236179a45..f4a7db369f 100644 } else { return false; } -@@ -2753,4 +2753,16 @@ public abstract class EntityLiving extends Entity { +@@ -2788,4 +2788,16 @@ public abstract class EntityLiving extends Entity { public boolean df() { return true; } @@ -49,7 +49,7 @@ index 3236179a45..f4a7db369f 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 49f515d868..fab1af7159 100644 +index 9acafadbbf..a09cd02403 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -533,5 +533,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/Spigot-Server-Patches/0275-Ignore-Missing-Recipes-in-RecipeBook-to-avoid-data-e.patch b/Spigot-Server-Patches/0273-Ignore-Missing-Recipes-in-RecipeBook-to-avoid-data-e.patch similarity index 96% rename from Spigot-Server-Patches/0275-Ignore-Missing-Recipes-in-RecipeBook-to-avoid-data-e.patch rename to Spigot-Server-Patches/0273-Ignore-Missing-Recipes-in-RecipeBook-to-avoid-data-e.patch index 97c70c4845..8e1ac24b17 100644 --- a/Spigot-Server-Patches/0275-Ignore-Missing-Recipes-in-RecipeBook-to-avoid-data-e.patch +++ b/Spigot-Server-Patches/0273-Ignore-Missing-Recipes-in-RecipeBook-to-avoid-data-e.patch @@ -1,4 +1,4 @@ -From b38aa03f85f1c5e8c3f47b269fd8b7d59c71c6c0 Mon Sep 17 00:00:00 2001 +From 3eabe2d2409ef3d178aa5ff6c4768e05552d2844 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 16 Jun 2018 16:23:38 -0400 Subject: [PATCH] Ignore Missing Recipes in RecipeBook to avoid data errors diff --git a/Spigot-Server-Patches/0276-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-Server-Patches/0274-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch similarity index 95% rename from Spigot-Server-Patches/0276-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch rename to Spigot-Server-Patches/0274-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index 494f8cd6ec..411268ec8c 100644 --- a/Spigot-Server-Patches/0276-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-Server-Patches/0274-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -1,4 +1,4 @@ -From d40788608fa5891d426c26bfc4b4e92832501108 Mon Sep 17 00:00:00 2001 +From 23371c2a5c2b7b93ceba7a3b95ce559d1d8cffa1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 15 Jun 2013 19:51:17 -0400 Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API @@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API Adds ability to get what arrow was shot, and control if it should be consumed. diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java -index 8e1f6427d5..e262ce0969 100644 +index c2bc8060ac..1ae967d1c0 100644 --- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java @@ -160,7 +160,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR @@ -19,7 +19,7 @@ index 8e1f6427d5..e262ce0969 100644 event.getProjectile().remove(); return; diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java -index 8489f45be2..379a7f84a5 100644 +index b0f7649b82..152b179ce1 100644 --- a/src/main/java/net/minecraft/server/ItemBow.java +++ b/src/main/java/net/minecraft/server/ItemBow.java @@ -57,6 +57,7 @@ public class ItemBow extends Item { @@ -51,14 +51,14 @@ index 8489f45be2..379a7f84a5 100644 @@ -112,7 +114,7 @@ public class ItemBow extends Item { } - world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.k.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.i.nextFloat() * 0.4F + 1.2F) + f * 0.5F); - if (!flag1 && !entityhuman.abilities.canInstantlyBuild) { + if (!flag1 && !entityhuman.abilities.canInstantlyBuild && consumeArrow) { // Paper itemstack1.subtract(1); if (itemstack1.isEmpty()) { entityhuman.inventory.f(itemstack1); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8df07536f8..28b156e439 100644 +index 89e765e803..92960eb735 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -244,7 +244,7 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/0277-PlayerReadyArrowEvent.patch b/Spigot-Server-Patches/0275-PlayerReadyArrowEvent.patch similarity index 97% rename from Spigot-Server-Patches/0277-PlayerReadyArrowEvent.patch rename to Spigot-Server-Patches/0275-PlayerReadyArrowEvent.patch index d06cb938a4..16e33365ab 100644 --- a/Spigot-Server-Patches/0277-PlayerReadyArrowEvent.patch +++ b/Spigot-Server-Patches/0275-PlayerReadyArrowEvent.patch @@ -1,4 +1,4 @@ -From 73d7eb479aefb2c9551ac611ddacd39482407cec Mon Sep 17 00:00:00 2001 +From cb33bee0e51b3f4066989130030a6fba79ad29ea Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 18 Jun 2018 01:12:53 -0400 Subject: [PATCH] PlayerReadyArrowEvent @@ -7,7 +7,7 @@ Called when a player is firing a bow and the server is choosing an arrow to use. Plugins can skip selection of certain arrows and control which is used. diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java -index 379a7f84a5..c0caeda362 100644 +index 152b179ce1..797e9ecf11 100644 --- a/src/main/java/net/minecraft/server/ItemBow.java +++ b/src/main/java/net/minecraft/server/ItemBow.java @@ -1,5 +1,6 @@ diff --git a/Spigot-Server-Patches/0278-Fire-EntityShootBowEvent-for-Illusioner.patch b/Spigot-Server-Patches/0276-Fire-EntityShootBowEvent-for-Illusioner.patch similarity index 93% rename from Spigot-Server-Patches/0278-Fire-EntityShootBowEvent-for-Illusioner.patch rename to Spigot-Server-Patches/0276-Fire-EntityShootBowEvent-for-Illusioner.patch index 5fc30dbd35..5ab3019b27 100644 --- a/Spigot-Server-Patches/0278-Fire-EntityShootBowEvent-for-Illusioner.patch +++ b/Spigot-Server-Patches/0276-Fire-EntityShootBowEvent-for-Illusioner.patch @@ -1,11 +1,11 @@ -From e30165f6d7809de56e2df7da8df73cc945590395 Mon Sep 17 00:00:00 2001 +From dcf9d1e286718c711e03027623ee7cbcc3e64bc9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 18 Jun 2018 22:19:36 -0400 Subject: [PATCH] Fire EntityShootBowEvent for Illusioner diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -index 82b36350c4..aebf704664 100644 +index 54c7c95a3b..6db21668d4 100644 --- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java +++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java @@ -123,8 +123,18 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan diff --git a/Spigot-Server-Patches/0279-Implement-EntityKnockbackByEntityEvent.patch b/Spigot-Server-Patches/0277-Implement-EntityKnockbackByEntityEvent.patch similarity index 88% rename from Spigot-Server-Patches/0279-Implement-EntityKnockbackByEntityEvent.patch rename to Spigot-Server-Patches/0277-Implement-EntityKnockbackByEntityEvent.patch index 3ce1d52189..6a8e7b2559 100644 --- a/Spigot-Server-Patches/0279-Implement-EntityKnockbackByEntityEvent.patch +++ b/Spigot-Server-Patches/0277-Implement-EntityKnockbackByEntityEvent.patch @@ -1,4 +1,4 @@ -From 87ab4349feac20b74c3fd1f299dc4e982ae4127d Mon Sep 17 00:00:00 2001 +From d5bf06fc14a67c67a4b226f8e4725e29277c71ee Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Mon, 18 Jun 2018 15:46:23 +0200 Subject: [PATCH] Implement EntityKnockbackByEntityEvent @@ -6,10 +6,10 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent This event is called when an entity receives knockback by another entity. diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index f4a7db369f..faa90e9ee5 100644 +index ef1a1e5790..9f0bc5a8e2 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1248,6 +1248,12 @@ public abstract class EntityLiving extends Entity { +@@ -1251,6 +1251,12 @@ public abstract class EntityLiving extends Entity { this.impulse = true; float f1 = MathHelper.sqrt(d0 * d0 + d1 * d1); @@ -22,7 +22,7 @@ index f4a7db369f..faa90e9ee5 100644 this.motX /= 2.0D; this.motZ /= 2.0D; this.motX -= d0 / (double) f1 * (double) f; -@@ -1260,6 +1266,18 @@ public abstract class EntityLiving extends Entity { +@@ -1263,6 +1269,18 @@ public abstract class EntityLiving extends Entity { } } diff --git a/Spigot-Server-Patches/0280-Expand-Explosions-API.patch b/Spigot-Server-Patches/0278-Expand-Explosions-API.patch similarity index 87% rename from Spigot-Server-Patches/0280-Expand-Explosions-API.patch rename to Spigot-Server-Patches/0278-Expand-Explosions-API.patch index 4c77feb919..8ec1abde05 100644 --- a/Spigot-Server-Patches/0280-Expand-Explosions-API.patch +++ b/Spigot-Server-Patches/0278-Expand-Explosions-API.patch @@ -1,4 +1,4 @@ -From de69a0ffb252b3635df0fbf16115a725311215d3 Mon Sep 17 00:00:00 2001 +From c9237095743ac1234dd75716082c6809783f83c2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 20 Jun 2018 23:17:24 -0400 Subject: [PATCH] Expand Explosions API @@ -6,10 +6,10 @@ Subject: [PATCH] Expand Explosions API Add Entity as a Source capability, and add more API choices, and on Location. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index affbb93bfd..23f0d5cb7d 100644 +index c449a9a39b..b6589fdc68 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -544,6 +544,11 @@ public class CraftWorld implements World { +@@ -537,6 +537,11 @@ public class CraftWorld implements World { public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) { return !world.createExplosion(null, x, y, z, power, setFire, breakBlocks).wasCanceled; } diff --git a/Spigot-Server-Patches/0281-LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-Server-Patches/0279-LivingEntity-Hand-Raised-Item-Use-API.patch similarity index 91% rename from Spigot-Server-Patches/0281-LivingEntity-Hand-Raised-Item-Use-API.patch rename to Spigot-Server-Patches/0279-LivingEntity-Hand-Raised-Item-Use-API.patch index 7c9fb0950d..cfce51c380 100644 --- a/Spigot-Server-Patches/0281-LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-Server-Patches/0279-LivingEntity-Hand-Raised-Item-Use-API.patch @@ -1,4 +1,4 @@ -From 1053725441b357e85f66472abe1b61358e7fe550 Mon Sep 17 00:00:00 2001 +From 1050d9af422c12ea913fe0312ed122fc0aafb85d Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 29 Jun 2018 00:21:28 -0400 Subject: [PATCH] LivingEntity Hand Raised/Item Use API @@ -6,7 +6,7 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API How long an entity has raised hands to charge an attack or use an item diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index faa90e9ee5..a57dcc41bd 100644 +index 9f0bc5a8e2..dd14f99dee 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -106,7 +106,7 @@ public abstract class EntityLiving extends Entity { @@ -18,7 +18,7 @@ index faa90e9ee5..a57dcc41bd 100644 protected int bu; protected int bv; private BlockPosition bL; -@@ -2654,10 +2654,12 @@ public abstract class EntityLiving extends Entity { +@@ -2689,10 +2689,12 @@ public abstract class EntityLiving extends Entity { return this.activeItem; } @@ -32,7 +32,7 @@ index faa90e9ee5..a57dcc41bd 100644 return this.isHandRaised() ? this.activeItem.k() - this.cX() : 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index fab1af7159..71e0da894b 100644 +index a09cd02403..0860f2334d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -543,5 +543,25 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/Spigot-Server-Patches/0282-RangedEntity-API.patch b/Spigot-Server-Patches/0280-RangedEntity-API.patch similarity index 99% rename from Spigot-Server-Patches/0282-RangedEntity-API.patch rename to Spigot-Server-Patches/0280-RangedEntity-API.patch index b0138f271d..00eecebd0d 100644 --- a/Spigot-Server-Patches/0282-RangedEntity-API.patch +++ b/Spigot-Server-Patches/0280-RangedEntity-API.patch @@ -1,4 +1,4 @@ -From 86799475254c4eb7a87e6877465d93d7a88d72e0 Mon Sep 17 00:00:00 2001 +From 9dfb186b44e9a3b90d65f688f83910a87a2ed2e0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 26 Jun 2018 22:00:49 -0400 Subject: [PATCH] RangedEntity API diff --git a/Spigot-Server-Patches/0283-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch b/Spigot-Server-Patches/0281-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch similarity index 92% rename from Spigot-Server-Patches/0283-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch rename to Spigot-Server-Patches/0281-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch index b42be8ff5a..9bacae24bf 100644 --- a/Spigot-Server-Patches/0283-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch +++ b/Spigot-Server-Patches/0281-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch @@ -1,4 +1,4 @@ -From 221ad974750f94575bb9169f2174a6ea9ec2fef9 Mon Sep 17 00:00:00 2001 +From db8ced733dd05196185e76f26de8d91e30c66216 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Sat, 30 Jun 2018 05:45:39 +0200 Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the @@ -6,7 +6,7 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 28b156e439..8ac599b7a2 100644 +index 92960eb735..ea2faf9539 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -823,7 +823,7 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/0284-Add-config-to-disable-ender-dragon-legacy-check.patch b/Spigot-Server-Patches/0282-Add-config-to-disable-ender-dragon-legacy-check.patch similarity index 94% rename from Spigot-Server-Patches/0284-Add-config-to-disable-ender-dragon-legacy-check.patch rename to Spigot-Server-Patches/0282-Add-config-to-disable-ender-dragon-legacy-check.patch index 684715f7c7..c5a437839c 100644 --- a/Spigot-Server-Patches/0284-Add-config-to-disable-ender-dragon-legacy-check.patch +++ b/Spigot-Server-Patches/0282-Add-config-to-disable-ender-dragon-legacy-check.patch @@ -1,14 +1,14 @@ -From 4778b7ea0c0515b083658bc3310e75c84c6887e0 Mon Sep 17 00:00:00 2001 +From 9ca273cb980a3d4803495edd318c6b7b9a208a03 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 22 Jun 2018 10:38:31 -0500 Subject: [PATCH] Add config to disable ender dragon legacy check diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index ddb5ced79d..2701388043 100644 +index 2e3e48637a..8724c2816b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -414,4 +414,9 @@ public class PaperWorldConfig { +@@ -417,4 +417,9 @@ public class PaperWorldConfig { private void shieldBlockingDelay() { shieldBlockingDelay = getInt("game-mechanics.shield-blocking-delay", 5); } diff --git a/Spigot-Server-Patches/0285-Implement-World.getEntity-UUID-API.patch b/Spigot-Server-Patches/0283-Implement-World.getEntity-UUID-API.patch similarity index 82% rename from Spigot-Server-Patches/0285-Implement-World.getEntity-UUID-API.patch rename to Spigot-Server-Patches/0283-Implement-World.getEntity-UUID-API.patch index 083e9c452f..385ba3909f 100644 --- a/Spigot-Server-Patches/0285-Implement-World.getEntity-UUID-API.patch +++ b/Spigot-Server-Patches/0283-Implement-World.getEntity-UUID-API.patch @@ -1,14 +1,14 @@ -From 2db064a175637c05e67c6b63f212c3ce50d3e1ee Mon Sep 17 00:00:00 2001 +From 9a07d4c94b4f9990316709bf12e84dedc3e8fc13 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Tue, 3 Jul 2018 16:08:14 +0200 Subject: [PATCH] Implement World.getEntity(UUID) API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index dee9c01e77..654e7cdfa2 100644 +index b6589fdc68..e4c4cdb980 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -752,6 +752,14 @@ public class CraftWorld implements World { +@@ -745,6 +745,14 @@ public class CraftWorld implements World { return list; } diff --git a/Spigot-Server-Patches/0286-InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/0284-InventoryCloseEvent-Reason-API.patch similarity index 90% rename from Spigot-Server-Patches/0286-InventoryCloseEvent-Reason-API.patch rename to Spigot-Server-Patches/0284-InventoryCloseEvent-Reason-API.patch index d78712efed..1ff244df67 100644 --- a/Spigot-Server-Patches/0286-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/0284-InventoryCloseEvent-Reason-API.patch @@ -1,4 +1,4 @@ -From e1efd932d76924b1ac36bbd9ea7f64a9474e4cef Mon Sep 17 00:00:00 2001 +From 6d03d929461139332ef62d052a6daa7bc7c7eee2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 3 Jul 2018 21:56:23 -0400 Subject: [PATCH] InventoryCloseEvent Reason API @@ -7,10 +7,10 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index f6beb6886d..d2e87693fa 100644 +index fa549cc372..5599025d66 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -894,7 +894,7 @@ public class Chunk implements IChunkAccess { +@@ -893,7 +893,7 @@ public class Chunk implements IChunkAccess { { if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity ) { @@ -19,7 +19,7 @@ index f6beb6886d..d2e87693fa 100644 } } } -@@ -919,7 +919,7 @@ public class Chunk implements IChunkAccess { +@@ -918,7 +918,7 @@ public class Chunk implements IChunkAccess { { if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity ) { @@ -29,7 +29,7 @@ index f6beb6886d..d2e87693fa 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 015cd553dd..f7588c4d44 100644 +index 6ae76477c0..f2bce333d9 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -153,7 +153,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -56,10 +56,10 @@ index 015cd553dd..f7588c4d44 100644 this.activeContainer = this.defaultContainer; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 9b1edab77d..8fd7a0d029 100644 +index 49470bf5f0..781c8abc39 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -356,7 +356,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -355,7 +355,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // Paper end if (!this.world.isClientSide && !this.activeContainer.canUse(this)) { @@ -68,7 +68,7 @@ index 9b1edab77d..8fd7a0d029 100644 this.activeContainer = this.defaultContainer; } -@@ -547,7 +547,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -561,7 +561,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.inventory.clear(); } @@ -77,7 +77,7 @@ index 9b1edab77d..8fd7a0d029 100644 this.setSpectatorTarget(this); // Remove spectated target // CraftBukkit end -@@ -859,7 +859,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -873,7 +873,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.a((new ChatMessage("container.spectatorCantOpen", new Object[0])).a(EnumChatFormat.RED), true); } else { if (this.activeContainer != this.defaultContainer) { @@ -86,7 +86,7 @@ index 9b1edab77d..8fd7a0d029 100644 } if (iinventory instanceof ITileInventory) { -@@ -925,7 +925,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -939,7 +939,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // CraftBukkit end if (this.activeContainer != this.defaultContainer) { @@ -95,7 +95,7 @@ index 9b1edab77d..8fd7a0d029 100644 } this.nextContainerCounter(); -@@ -990,7 +990,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1004,7 +1004,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public void closeInventory() { @@ -110,10 +110,10 @@ index 9b1edab77d..8fd7a0d029 100644 this.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ce8170ea9f..da501a1c5f 100644 +index a7bdb9737b..4fc5e4b7b3 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2040,7 +2040,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -2051,7 +2051,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer()); if (this.player.isFrozen()) return; // CraftBukkit @@ -123,7 +123,7 @@ index ce8170ea9f..da501a1c5f 100644 this.player.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 45e42e9989..7a2b219c67 100644 +index 304cae655d..6d511b6230 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -422,7 +422,7 @@ public abstract class PlayerList { @@ -136,7 +136,7 @@ index 45e42e9989..7a2b219c67 100644 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index e9707dfa74..a16bfc7f65 100644 +index 92fe80316f..70a4dbe26b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -412,8 +412,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -155,10 +155,10 @@ index e9707dfa74..a16bfc7f65 100644 public boolean isBlocking() { return getHandle().isBlocking(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b768327bbb..029d8d8179 100644 +index 88caea739c..b7144c5d2f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -729,7 +729,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -727,7 +727,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Close any foreign inventory if (getHandle().activeContainer != getHandle().defaultContainer) { @@ -168,7 +168,7 @@ index b768327bbb..029d8d8179 100644 // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8ac599b7a2..cf398cd250 100644 +index ea2faf9539..9fb1b75413 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -913,8 +913,19 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/0287-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/0285-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch similarity index 82% rename from Spigot-Server-Patches/0287-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch rename to Spigot-Server-Patches/0285-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index 833e8627b0..acbfd29905 100644 --- a/Spigot-Server-Patches/0287-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/0285-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -1,4 +1,4 @@ -From 679d49837ab776c02a12d6e1a93206606520080b Mon Sep 17 00:00:00 2001 +From cf4f60a3cd37583140595aeb2da25a3a2bbb73b9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 03:39:51 -0400 Subject: [PATCH] Avoid Chunk Lookups for Entity/TileEntity Current Chunk @@ -10,10 +10,10 @@ to the object directly on the Entity/TileEntity object we can directly grab. Use that local value instead to reduce lookups in many hot places. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index d2e87693fa..1997cbdc65 100644 +index 5599025d66..37716447c2 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -721,6 +721,7 @@ public class Chunk implements IChunkAccess { +@@ -718,6 +718,7 @@ public class Chunk implements IChunkAccess { ((HeightMap) this.heightMap.get(heightmap_type)).a(along); } @@ -22,10 +22,10 @@ index d2e87693fa..1997cbdc65 100644 this.a(entity, entity.af); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 852977cab3..fbca973225 100644 +index 32c8fb4531..27d84e3ba9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1221,12 +1221,15 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1245,12 +1245,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int j; // Paper start - Set based removal lists for (Entity e : this.g) { @@ -42,7 +42,7 @@ index 852977cab3..fbca973225 100644 } for (Entity e : this.g) { -@@ -1287,12 +1290,17 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1311,12 +1314,17 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.methodProfiler.e(); this.methodProfiler.a("remove"); if (entity.dead) { @@ -61,7 +61,7 @@ index 852977cab3..fbca973225 100644 guardEntityList = false; // Spigot this.entityList.remove(this.tickPosition--); // CraftBukkit - Use field for loop variable -@@ -1337,7 +1345,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1361,7 +1369,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc BlockPosition blockposition = tileentity.getPosition(); // Paper start - Skip ticking in chunks scheduled for unload @@ -69,8 +69,8 @@ index 852977cab3..fbca973225 100644 + net.minecraft.server.Chunk chunk = tileentity.getCurrentChunk(); boolean shouldTick = chunk != null; if(this.paperConfig.skipEntityTickingInChunksScheduledForUnload) - shouldTick = shouldTick && !chunk.isUnloading() && chunk.scheduledForUnload == null; -@@ -1373,8 +1381,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + shouldTick = shouldTick && chunk.scheduledForUnload == null; +@@ -1397,8 +1405,11 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); //this.tileEntityList.remove(tileentity); // Paper - remove unused list diff --git a/Spigot-Server-Patches/0288-Configurable-Bed-Search-Radius.patch b/Spigot-Server-Patches/0286-Configurable-Bed-Search-Radius.patch similarity index 92% rename from Spigot-Server-Patches/0288-Configurable-Bed-Search-Radius.patch rename to Spigot-Server-Patches/0286-Configurable-Bed-Search-Radius.patch index 8c6430b3f4..803cdf5a40 100644 --- a/Spigot-Server-Patches/0288-Configurable-Bed-Search-Radius.patch +++ b/Spigot-Server-Patches/0286-Configurable-Bed-Search-Radius.patch @@ -1,4 +1,4 @@ -From 5705ddf5f4e423bef566a802eb60759d24ea8de1 Mon Sep 17 00:00:00 2001 +From d05da60b77c74b53dab47f6dffb3896a8c99aefe Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 15:22:06 -0400 Subject: [PATCH] Configurable Bed Search Radius @@ -10,10 +10,10 @@ player at their bed should it of became obstructed. Defaults to vanilla 1. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 2701388043..7bd7aa0d94 100644 +index 8724c2816b..fb2467636a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -419,4 +419,15 @@ public class PaperWorldConfig { +@@ -422,4 +422,15 @@ public class PaperWorldConfig { private void scanForLegacyEnderDragon() { scanForLegacyEnderDragon = getBoolean("game-mechanics.scan-for-legacy-ender-dragon", true); } @@ -30,10 +30,10 @@ index 2701388043..7bd7aa0d94 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java -index 6832eaac5d..b9cb59fa72 100644 +index 4e60509891..47cf1db6ae 100644 --- a/src/main/java/net/minecraft/server/BlockBed.java +++ b/src/main/java/net/minecraft/server/BlockBed.java -@@ -172,7 +172,54 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { +@@ -174,7 +174,54 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { @Nullable public static BlockPosition a(IBlockAccess iblockaccess, BlockPosition blockposition, int i) { @@ -88,7 +88,7 @@ index 6832eaac5d..b9cb59fa72 100644 int j = blockposition.getX(); int k = blockposition.getY(); int l = blockposition.getZ(); -@@ -198,9 +245,12 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { +@@ -200,9 +247,12 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { } } diff --git a/Spigot-Server-Patches/0289-Vex-getSummoner-API.patch b/Spigot-Server-Patches/0287-Vex-getSummoner-API.patch similarity index 94% rename from Spigot-Server-Patches/0289-Vex-getSummoner-API.patch rename to Spigot-Server-Patches/0287-Vex-getSummoner-API.patch index 96505ed08c..138eec7171 100644 --- a/Spigot-Server-Patches/0289-Vex-getSummoner-API.patch +++ b/Spigot-Server-Patches/0287-Vex-getSummoner-API.patch @@ -1,4 +1,4 @@ -From 65b79177e208a769352174caf4a4c377bf144534 Mon Sep 17 00:00:00 2001 +From c4ca9f930e0b992c6c92ae7ec4c48c83e1a03894 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 15:30:22 -0400 Subject: [PATCH] Vex#getSummoner API @@ -6,7 +6,7 @@ Subject: [PATCH] Vex#getSummoner API Get's the NPC that summoned this Vex diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java -index 80403473c8..36f8c315b5 100644 +index 9c08b3e182..6e029ff44c 100644 --- a/src/main/java/net/minecraft/server/EntityVex.java +++ b/src/main/java/net/minecraft/server/EntityVex.java @@ -86,6 +86,7 @@ public class EntityVex extends EntityMonster { diff --git a/Spigot-Server-Patches/0290-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/Spigot-Server-Patches/0288-Refresh-player-inventory-when-cancelling-PlayerInter.patch similarity index 88% rename from Spigot-Server-Patches/0290-Refresh-player-inventory-when-cancelling-PlayerInter.patch rename to Spigot-Server-Patches/0288-Refresh-player-inventory-when-cancelling-PlayerInter.patch index 561e041b1d..099e004f7c 100644 --- a/Spigot-Server-Patches/0290-Refresh-player-inventory-when-cancelling-PlayerInter.patch +++ b/Spigot-Server-Patches/0288-Refresh-player-inventory-when-cancelling-PlayerInter.patch @@ -1,4 +1,4 @@ -From 8089c06f056dfa1024a675cca101536679379a2f Mon Sep 17 00:00:00 2001 +From d9159d08bdb72ab7d7b82edbd72b18e75dd160c2 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 13 Jul 2018 14:54:43 +0200 Subject: [PATCH] Refresh player inventory when cancelling @@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is cancelled to avoid this problem. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index da501a1c5f..f7401f5c98 100644 +index 4fc5e4b7b3..66e01b8131 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1954,6 +1954,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1965,6 +1965,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } if (event.isCancelled()) { diff --git a/Spigot-Server-Patches/0291-Don-t-change-the-Entity-Random-seed-for-squids.patch b/Spigot-Server-Patches/0289-Don-t-change-the-Entity-Random-seed-for-squids.patch similarity index 88% rename from Spigot-Server-Patches/0291-Don-t-change-the-Entity-Random-seed-for-squids.patch rename to Spigot-Server-Patches/0289-Don-t-change-the-Entity-Random-seed-for-squids.patch index 877946eeb7..36f30f7672 100644 --- a/Spigot-Server-Patches/0291-Don-t-change-the-Entity-Random-seed-for-squids.patch +++ b/Spigot-Server-Patches/0289-Don-t-change-the-Entity-Random-seed-for-squids.patch @@ -1,11 +1,11 @@ -From 824c5696960b503feb9de1abea56665fd9daabd7 Mon Sep 17 00:00:00 2001 +From e529a591e153fd45fdf6fed065a2ed03f6a93d44 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 19 Jul 2018 01:05:00 -0400 Subject: [PATCH] Don't change the Entity Random seed for squids diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 3099f6aa7a..2205932295 100644 +index 2dfa794a3f..522ce36cba 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -22,7 +22,7 @@ public class EntitySquid extends EntityWaterAnimal { diff --git a/Spigot-Server-Patches/0292-Re-add-vanilla-entity-warnings-for-duplicates.patch b/Spigot-Server-Patches/0290-Re-add-vanilla-entity-warnings-for-duplicates.patch similarity index 87% rename from Spigot-Server-Patches/0292-Re-add-vanilla-entity-warnings-for-duplicates.patch rename to Spigot-Server-Patches/0290-Re-add-vanilla-entity-warnings-for-duplicates.patch index 37b4fb50b3..e936fb5ba0 100644 --- a/Spigot-Server-Patches/0292-Re-add-vanilla-entity-warnings-for-duplicates.patch +++ b/Spigot-Server-Patches/0290-Re-add-vanilla-entity-warnings-for-duplicates.patch @@ -1,4 +1,4 @@ -From 0b3286a2f8d6a1e584132c98cc882edbdbc045b5 Mon Sep 17 00:00:00 2001 +From 546db42ce5fc34676e0c072fb35b879d2b6b9791 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 19 Jul 2018 01:08:05 -0400 Subject: [PATCH] Re-add vanilla entity warnings for duplicates @@ -8,10 +8,10 @@ These are a critical sign that somethin went wrong, and you've lost some data... We should kind of know about these things you know. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 697296acd0..b048343b7c 100644 +index 3b3ace52b0..6987d9423c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -979,7 +979,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -974,7 +974,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { private boolean j(Entity entity) { if (entity.dead) { @@ -20,7 +20,7 @@ index 697296acd0..b048343b7c 100644 return false; } else { UUID uuid = entity.getUniqueID(); -@@ -991,7 +991,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -986,7 +986,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.g.remove(entity1); } else { if (!(entity instanceof EntityHuman)) { diff --git a/Spigot-Server-Patches/0293-Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch b/Spigot-Server-Patches/0291-Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch similarity index 82% rename from Spigot-Server-Patches/0293-Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch rename to Spigot-Server-Patches/0291-Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch index 93065ee003..2e8da2cf8f 100644 --- a/Spigot-Server-Patches/0293-Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch +++ b/Spigot-Server-Patches/0291-Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch @@ -1,4 +1,4 @@ -From c498e07e52c5d44cca3ed15d15d78405c368fc41 Mon Sep 17 00:00:00 2001 +From a9019db13cb7580b4cf30d940575446f0964854e Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 19 Jul 2018 01:23:00 -0400 Subject: [PATCH] Don't process despawn if entity is in a chunk scheduled for @@ -12,7 +12,7 @@ keep it vanilla in behavior a player may teleport away, and trigger instant despawn diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index bca2aa8298..903434e5f4 100644 +index d4c86c2d65..4a8c3a428d 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -622,6 +622,8 @@ public abstract class EntityInsentient extends EntityLiving { @@ -20,7 +20,7 @@ index bca2aa8298..903434e5f4 100644 this.ticksFarFromPlayer = 0; } else { + Chunk currentChunk = getChunkAtLocation(); // Paper -+ if (currentChunk != null && (currentChunk.isUnloading() || currentChunk.scheduledForUnload != null)) return; // Paper ++ if (currentChunk != null && currentChunk.scheduledForUnload != null) return; // Paper EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D); if (entityhuman != null && entityhuman.affectsSpawning) { // Paper - Affects Spawning API diff --git a/Spigot-Server-Patches/0294-Avoid-item-merge-if-stack-size-above-max-stack-size.patch b/Spigot-Server-Patches/0292-Avoid-item-merge-if-stack-size-above-max-stack-size.patch similarity index 90% rename from Spigot-Server-Patches/0294-Avoid-item-merge-if-stack-size-above-max-stack-size.patch rename to Spigot-Server-Patches/0292-Avoid-item-merge-if-stack-size-above-max-stack-size.patch index 6ac4c8ee24..2d79068222 100644 --- a/Spigot-Server-Patches/0294-Avoid-item-merge-if-stack-size-above-max-stack-size.patch +++ b/Spigot-Server-Patches/0292-Avoid-item-merge-if-stack-size-above-max-stack-size.patch @@ -1,11 +1,11 @@ -From d1c13d0946fc2ae99baa7ba2d5a7a97e49ebe0ff Mon Sep 17 00:00:00 2001 +From be48296836606dd109f71db805c9389d0c27268b Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Mon, 16 Jul 2018 12:42:20 +0200 Subject: [PATCH] Avoid item merge if stack size above max stack size diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index d232bab745..b0f22f8f09 100644 +index 946e59753e..f596b4351b 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -173,6 +173,10 @@ public class EntityItem extends Entity { diff --git a/Spigot-Server-Patches/0295-Use-asynchronous-Log4j-2-loggers.patch b/Spigot-Server-Patches/0293-Use-asynchronous-Log4j-2-loggers.patch similarity index 76% rename from Spigot-Server-Patches/0295-Use-asynchronous-Log4j-2-loggers.patch rename to Spigot-Server-Patches/0293-Use-asynchronous-Log4j-2-loggers.patch index d0a1f7b240..84eda8594c 100644 --- a/Spigot-Server-Patches/0295-Use-asynchronous-Log4j-2-loggers.patch +++ b/Spigot-Server-Patches/0293-Use-asynchronous-Log4j-2-loggers.patch @@ -1,17 +1,17 @@ -From 5086970e5888c6c57f9cf7c49c5d682c60e6a67f Mon Sep 17 00:00:00 2001 +From f167d9d6bdf144edbae9b3349e1a774dc7328410 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Tue, 17 Jul 2018 16:42:17 +0200 Subject: [PATCH] Use asynchronous Log4j 2 loggers diff --git a/pom.xml b/pom.xml -index a319cfe3b8..ddee1b0488 100644 +index 3be49ee7f4..1e7d2b5506 100644 --- a/pom.xml +++ b/pom.xml -@@ -102,6 +102,14 @@ +@@ -73,6 +73,13 @@ + log4j-iostreams 2.8.1 - + + + com.lmax @@ -19,10 +19,9 @@ index a319cfe3b8..ddee1b0488 100644 + 3.4.2 + runtime + -+ - - junit + org.ow2.asm + asm diff --git a/src/main/resources/log4j2.component.properties b/src/main/resources/log4j2.component.properties new file mode 100644 index 0000000000..ee7c90784c diff --git a/Spigot-Server-Patches/0296-add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/0294-add-more-information-to-Entity.toString.patch similarity index 89% rename from Spigot-Server-Patches/0296-add-more-information-to-Entity.toString.patch rename to Spigot-Server-Patches/0294-add-more-information-to-Entity.toString.patch index 520fdaabc4..9d022f33f2 100644 --- a/Spigot-Server-Patches/0296-add-more-information-to-Entity.toString.patch +++ b/Spigot-Server-Patches/0294-add-more-information-to-Entity.toString.patch @@ -1,4 +1,4 @@ -From 871e7ad9a8470149c08aa94e53d521ae16ec7aa2 Mon Sep 17 00:00:00 2001 +From 304398689959004f9b12d46a8d8d288bda1b4583 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 19 Jul 2018 01:13:28 -0400 Subject: [PATCH] add more information to Entity.toString() @@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString() UUID, ticks lived, valid, dead diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 20c2bf16be..835d329f91 100644 +index 111c2c3df6..58f7489ebd 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2495,7 +2495,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2493,7 +2493,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public String toString() { diff --git a/Spigot-Server-Patches/0297-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/0295-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch similarity index 83% rename from Spigot-Server-Patches/0297-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch rename to Spigot-Server-Patches/0295-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index 4832828a60..f07d16b3c4 100644 --- a/Spigot-Server-Patches/0297-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/0295-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -1,4 +1,4 @@ -From bc734010ef31a9093bc265f2be31acfae3933af0 Mon Sep 17 00:00:00 2001 +From 3a78019334a467c5c52b1fe79c8ba47a82b4293c Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 08:25:40 -0400 Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues @@ -6,10 +6,10 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Add -Ddebug.entities=true to your JVM flags to gain more information diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 835d329f91..ff22feee4d 100644 +index 58f7489ebd..d974cb5c61 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -72,6 +72,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -73,6 +73,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke protected CraftEntity bukkitEntity; EntityTrackerEntry tracker; // Paper @@ -18,21 +18,21 @@ index 835d329f91..ff22feee4d 100644 if (bukkitEntity == null) { bukkitEntity = CraftEntity.getEntity(world.getServer(), this); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b048343b7c..747d99dbe6 100644 +index 6987d9423c..8e8cf659f8 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -53,6 +53,10 @@ public class WorldServer extends World implements IAsyncTaskHandler { - private boolean Q; +@@ -55,6 +55,10 @@ public class WorldServer extends World implements IAsyncTaskHandler { // CraftBukkit start + public final DimensionManager dimension; + private static final boolean DEBUG_ENTITIES = Boolean.getBoolean("debug.entities"); // Paper + private static Throwable getAddToWorldStackTrace(Entity entity) { + return new Throwable(entity + " Added to world at " + new java.util.Date()); + } - public final int dimension; // Add env and gen to constructor -@@ -980,6 +984,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, PersistentCollection persistentcollection, WorldData worlddata, DimensionManager dimensionmanager, MethodProfiler methodprofiler, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { +@@ -975,6 +979,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { private boolean j(Entity entity) { if (entity.dead) { WorldServer.a.warn("Tried to add entity {} but it was marked as removed already: " + entity); // CraftBukkit // Paper @@ -40,7 +40,7 @@ index b048343b7c..747d99dbe6 100644 return false; } else { UUID uuid = entity.getUniqueID(); -@@ -991,8 +996,14 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -986,8 +991,14 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.g.remove(entity1); } else { if (!(entity instanceof EntityHuman)) { @@ -56,7 +56,7 @@ index b048343b7c..747d99dbe6 100644 return false; } -@@ -1009,7 +1020,25 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1004,7 +1015,25 @@ public class WorldServer extends World implements IAsyncTaskHandler { protected void b(Entity entity) { super.b(entity); this.entitiesById.a(entity.getId(), entity); diff --git a/Spigot-Server-Patches/0298-EnderDragon-Events.patch b/Spigot-Server-Patches/0296-EnderDragon-Events.patch similarity index 97% rename from Spigot-Server-Patches/0298-EnderDragon-Events.patch rename to Spigot-Server-Patches/0296-EnderDragon-Events.patch index cfc1a76f95..528b7dc0b2 100644 --- a/Spigot-Server-Patches/0298-EnderDragon-Events.patch +++ b/Spigot-Server-Patches/0296-EnderDragon-Events.patch @@ -1,4 +1,4 @@ -From df132de1040b328a574f3e2bce351d7bfb2d7766 Mon Sep 17 00:00:00 2001 +From 8f7eca760bb5d7e6a932cf26fa200c680f7288cc Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jul 2018 01:51:27 -0500 Subject: [PATCH] EnderDragon Events @@ -27,7 +27,7 @@ index b78d3fe508..ef8b0e765f 100644 if (this.d != null) { this.d.die(); diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java -index f741ada670..a9954c12e9 100644 +index 9c158fd588..b4887d6586 100644 --- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java +++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java @@ -67,7 +67,9 @@ public class DragonControllerStrafe extends AbstractDragonController { diff --git a/Spigot-Server-Patches/0299-PlayerElytraBoostEvent.patch b/Spigot-Server-Patches/0297-PlayerElytraBoostEvent.patch similarity index 96% rename from Spigot-Server-Patches/0299-PlayerElytraBoostEvent.patch rename to Spigot-Server-Patches/0297-PlayerElytraBoostEvent.patch index 358ce54ebf..592c5de1d4 100644 --- a/Spigot-Server-Patches/0299-PlayerElytraBoostEvent.patch +++ b/Spigot-Server-Patches/0297-PlayerElytraBoostEvent.patch @@ -1,4 +1,4 @@ -From 4cc922d68ece12295ec360bcb317d19169f0bf74 Mon Sep 17 00:00:00 2001 +From 79bf51175409a0f147e0e122f4cdaddbeb24b22e Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jul 2018 01:59:59 -0500 Subject: [PATCH] PlayerElytraBoostEvent diff --git a/Spigot-Server-Patches/0300-PlayerLaunchProjectileEvent.patch b/Spigot-Server-Patches/0298-PlayerLaunchProjectileEvent.patch similarity index 90% rename from Spigot-Server-Patches/0300-PlayerLaunchProjectileEvent.patch rename to Spigot-Server-Patches/0298-PlayerLaunchProjectileEvent.patch index dae4d503b9..4b485df9d0 100644 --- a/Spigot-Server-Patches/0300-PlayerLaunchProjectileEvent.patch +++ b/Spigot-Server-Patches/0298-PlayerLaunchProjectileEvent.patch @@ -1,11 +1,11 @@ -From 1709b17b36eafb7b2773189efa340bbe2cde6c77 Mon Sep 17 00:00:00 2001 +From 7d913989b8a65f7e3739673c2ddb9221caf9aadc Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jul 2018 03:11:03 -0500 Subject: [PATCH] PlayerLaunchProjectileEvent diff --git a/src/main/java/net/minecraft/server/ItemEgg.java b/src/main/java/net/minecraft/server/ItemEgg.java -index 771e809fb..ab4fdb7f0 100644 +index 9ae1f5b318..0a9680bf5d 100644 --- a/src/main/java/net/minecraft/server/ItemEgg.java +++ b/src/main/java/net/minecraft/server/ItemEgg.java @@ -9,16 +9,34 @@ public class ItemEgg extends Item { @@ -16,13 +16,13 @@ index 771e809fb..ab4fdb7f0 100644 - itemstack.subtract(1); - } - -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.k.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.i.nextFloat() * 0.4F + 0.8F)); + // Paper start - moved down + //if (!entityhuman.abilities.canInstantlyBuild) { + // itemstack.subtract(1); + //} + // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.k.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.i.nextFloat() * 0.4F + 0.8F)); + // Paper end if (!world.isClientSide) { EntityEgg entityegg = new EntityEgg(world, entityhuman); @@ -38,7 +38,7 @@ index 771e809fb..ab4fdb7f0 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); @@ -50,7 +50,7 @@ index 771e809fb..ab4fdb7f0 100644 entityhuman.b(StatisticList.ITEM_USED.b(this)); diff --git a/src/main/java/net/minecraft/server/ItemEnderPearl.java b/src/main/java/net/minecraft/server/ItemEnderPearl.java -index 5559a5abe..cf1ba7ec9 100644 +index 876384f37b..8b8bc8ec1c 100644 --- a/src/main/java/net/minecraft/server/ItemEnderPearl.java +++ b/src/main/java/net/minecraft/server/ItemEnderPearl.java @@ -14,7 +14,19 @@ public class ItemEnderPearl extends Item { @@ -67,7 +67,7 @@ index 5559a5abe..cf1ba7ec9 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + entityhuman.getCooldownTracker().a(this, 20); + } else { + // Paper end @@ -82,7 +82,7 @@ index 5559a5abe..cf1ba7ec9 100644 - itemstack.subtract(1); - } - -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.k.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.i.nextFloat() * 0.4F + 0.8F)); - entityhuman.getCooldownTracker().a(this, 20); - // CraftBukkit end + // Paper start - moved up @@ -90,7 +90,7 @@ index 5559a5abe..cf1ba7ec9 100644 + // itemstack.subtract(1); + //} + // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.k.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.i.nextFloat() * 0.4F + 0.8F)); + //entityhuman.getCooldownTracker().a(this, 20); + // // CraftBukkit end + // Paper end @@ -98,7 +98,7 @@ index 5559a5abe..cf1ba7ec9 100644 entityhuman.b(StatisticList.ITEM_USED.b(this)); return new InteractionResultWrapper(EnumInteractionResult.SUCCESS, itemstack); diff --git a/src/main/java/net/minecraft/server/ItemExpBottle.java b/src/main/java/net/minecraft/server/ItemExpBottle.java -index c16456c4d..49c58fee7 100644 +index 5312c473ea..7b5eca925f 100644 --- a/src/main/java/net/minecraft/server/ItemExpBottle.java +++ b/src/main/java/net/minecraft/server/ItemExpBottle.java @@ -9,16 +9,34 @@ public class ItemExpBottle extends Item { @@ -109,13 +109,13 @@ index c16456c4d..49c58fee7 100644 - itemstack.subtract(1); - } - -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.k.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.i.nextFloat() * 0.4F + 0.8F)); + // Paper start - moved down + //if (!entityhuman.abilities.canInstantlyBuild) { + // itemstack.subtract(1); + //} + // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.k.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.i.nextFloat() * 0.4F + 0.8F)); + // Paper end if (!world.isClientSide) { EntityThrownExpBottle entitythrownexpbottle = new EntityThrownExpBottle(world, entityhuman); @@ -131,7 +131,7 @@ index c16456c4d..49c58fee7 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); @@ -143,7 +143,7 @@ index c16456c4d..49c58fee7 100644 entityhuman.b(StatisticList.ITEM_USED.b(this)); diff --git a/src/main/java/net/minecraft/server/ItemLingeringPotion.java b/src/main/java/net/minecraft/server/ItemLingeringPotion.java -index 8d3969b5f..44af46cbf 100644 +index e1c6ad80f0..7acdb63f7b 100644 --- a/src/main/java/net/minecraft/server/ItemLingeringPotion.java +++ b/src/main/java/net/minecraft/server/ItemLingeringPotion.java @@ -8,14 +8,38 @@ public class ItemLingeringPotion extends ItemPotion { @@ -151,12 +151,11 @@ index 8d3969b5f..44af46cbf 100644 public InteractionResultWrapper a(World world, EntityHuman entityhuman, EnumHand enumhand) { ItemStack itemstack = entityhuman.b(enumhand); - ItemStack itemstack1 = entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack.cloneAndSubtract(1); -- -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.k.nextFloat() * 0.4F + 0.8F)); + // Paper start - moved down + //ItemStack itemstack1 = entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack.cloneAndSubtract(1); -+ // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.k.nextFloat() * 0.4F + 0.8F)); + +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.i.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.i.nextFloat() * 0.4F + 0.8F)); + // Paper end if (!world.isClientSide) { + // Paper start - ensure stack count matches vanilla behavior without modifying original stack yet @@ -178,7 +177,7 @@ index 8d3969b5f..44af46cbf 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); @@ -190,7 +189,7 @@ index 8d3969b5f..44af46cbf 100644 entityhuman.b(StatisticList.ITEM_USED.b(this)); diff --git a/src/main/java/net/minecraft/server/ItemSnowball.java b/src/main/java/net/minecraft/server/ItemSnowball.java -index 597413f25..9d316bde3 100644 +index 332145c32b..5c23c9ae0c 100644 --- a/src/main/java/net/minecraft/server/ItemSnowball.java +++ b/src/main/java/net/minecraft/server/ItemSnowball.java @@ -21,15 +21,23 @@ public class ItemSnowball extends Item { @@ -208,9 +207,10 @@ index 597413f25..9d316bde3 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); } - world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.k.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.i.nextFloat() * 0.4F + 0.8F)); - } else if (entityhuman instanceof EntityPlayer) { - ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); @@ -222,7 +222,7 @@ index 597413f25..9d316bde3 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ItemSplashPotion.java b/src/main/java/net/minecraft/server/ItemSplashPotion.java -index 7427f97d5..bc90d8936 100644 +index 593009579b..d935ae834f 100644 --- a/src/main/java/net/minecraft/server/ItemSplashPotion.java +++ b/src/main/java/net/minecraft/server/ItemSplashPotion.java @@ -8,14 +8,38 @@ public class ItemSplashPotion extends ItemPotion { @@ -230,12 +230,11 @@ index 7427f97d5..bc90d8936 100644 public InteractionResultWrapper a(World world, EntityHuman entityhuman, EnumHand enumhand) { ItemStack itemstack = entityhuman.b(enumhand); - ItemStack itemstack1 = entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack.cloneAndSubtract(1); -- -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemSplashPotion.k.nextFloat() * 0.4F + 0.8F)); -+ // Paper start - moved down ++ // Paper start - moved sound down, clone handled diff + //ItemStack itemstack1 = entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack.cloneAndSubtract(1); -+ // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemSplashPotion.k.nextFloat() * 0.4F + 0.8F)); + +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemSplashPotion.i.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemSplashPotion.i.nextFloat() * 0.4F + 0.8F)); + // Paper end if (!world.isClientSide) { + // Paper start - ensure stack count matches vanilla behavior without modifying original stack yet @@ -257,7 +256,7 @@ index 7427f97d5..bc90d8936 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); diff --git a/Spigot-Server-Patches/0301-Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/0299-Duplicate-UUID-Resolve-Option.patch similarity index 90% rename from Spigot-Server-Patches/0301-Duplicate-UUID-Resolve-Option.patch rename to Spigot-Server-Patches/0299-Duplicate-UUID-Resolve-Option.patch index d0dd48d7cb..27691a0377 100644 --- a/Spigot-Server-Patches/0301-Duplicate-UUID-Resolve-Option.patch +++ b/Spigot-Server-Patches/0299-Duplicate-UUID-Resolve-Option.patch @@ -1,4 +1,4 @@ -From 412b93e0d85701941c2de34ee4bf4ec1b1492ebe Mon Sep 17 00:00:00 2001 +From 6b2efbb1443f37b298c2417b94875d1dfbe894e0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 14:27:34 -0400 Subject: [PATCH] Duplicate UUID Resolve Option @@ -33,10 +33,10 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA It is recommended you regenerate the entities, as these were legit entities, and deserve your love. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 7bd7aa0d94..37315233e1 100644 +index fb2467636a..3aa6f031f3 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -430,4 +430,47 @@ public class PaperWorldConfig { +@@ -433,4 +433,47 @@ public class PaperWorldConfig { log("Bed Search Radius: " + bedSearchRadius); } } @@ -85,7 +85,7 @@ index 7bd7aa0d94..37315233e1 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 1997cbdc65..117a3c517a 100644 +index 37716447c2..4eb08553c6 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -1,5 +1,10 @@ @@ -99,23 +99,23 @@ index 1997cbdc65..117a3c517a 100644 import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.collect.Maps; import com.google.common.collect.Queues; -@@ -40,6 +45,7 @@ public class Chunk implements IChunkAccess { +@@ -38,6 +43,7 @@ public class Chunk implements IChunkAccess { public final World world; public final Map heightMap; public Long scheduledForUnload; // Paper - delay chunk unloads + private static final Logger logger = LogManager.getLogger(); // Paper public final int locX; public final int locZ; - private boolean m; -@@ -689,6 +695,7 @@ public class Chunk implements IChunkAccess { + private boolean l; +@@ -686,6 +692,7 @@ public class Chunk implements IChunkAccess { if (i != this.locX || j != this.locZ) { - Chunk.e.warn("Wrong location! ({}, {}) should be ({}, {}), {}", Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(this.locX), Integer.valueOf(this.locZ), entity); + Chunk.d.warn("Wrong location! ({}, {}) should be ({}, {}), {}", Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(this.locX), Integer.valueOf(this.locZ), entity); entity.die(); + return; // Paper } int k = MathHelper.floor(entity.locY / 16.0D); -@@ -865,6 +872,51 @@ public class Chunk implements IChunkAccess { +@@ -862,6 +869,51 @@ public class Chunk implements IChunkAccess { for (int j = 0; j < i; ++j) { List entityslice = aentityslice[j]; // Spigot @@ -165,13 +165,13 @@ index 1997cbdc65..117a3c517a 100644 + } + // Paper end - this.world.a((Collection) entityslice); - } + this.world.a(entityslice.stream().filter((entity) -> { + return !(entity instanceof EntityHuman); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ff22feee4d..9ab6350587 100644 +index d974cb5c61..d86a23d71d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2724,6 +2724,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2718,6 +2718,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke }); } @@ -180,32 +180,32 @@ index ff22feee4d..9ab6350587 100644 this.uniqueID = uuid; this.au = this.uniqueID.toString(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index fbca973225..064c31c035 100644 +index 27d84e3ba9..2ad02b0a61 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -72,7 +72,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -75,7 +75,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } }; // Spigot end -- protected final Set g = Sets.newHashSet(); // Paper -+ protected final Set g = Sets.newHashSet(); public Set getEntityUnloadQueue() { return g; };// Paper - OBFHELPER +- protected final Set g = com.google.common.collect.Sets.newHashSet(); // Paper ++ protected final Set g = com.google.common.collect.Sets.newHashSet(); public Set getEntityUnloadQueue() { return g; };// Paper - OBFHELPER //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list public final List tileEntityListTick = Lists.newArrayList(); private final List c = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 817915a0c0..6b5b2c8258 100644 +index 8e8cf659f8..6579387623 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -40,7 +40,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -41,7 +41,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { private final MinecraftServer server; public EntityTracker tracker; private final PlayerChunkMap manager; - private final Map entitiesByUUID = Maps.newHashMap(); + public final Map entitiesByUUID = Maps.newHashMap(); // Paper public boolean savingDisabled; - private boolean K; + private boolean J; private int emptyTime; -@@ -996,14 +996,17 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -991,14 +991,17 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.g.remove(entity1); } else { if (!(entity instanceof EntityHuman)) { @@ -229,7 +229,7 @@ index 817915a0c0..6b5b2c8258 100644 return false; } -@@ -1026,7 +1029,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1021,7 +1024,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } Entity old = this.entitiesByUUID.put(entity.getUniqueID(), entity); diff --git a/Spigot-Server-Patches/0302-Add-async-chunk-load-API.patch b/Spigot-Server-Patches/0300-Add-async-chunk-load-API.patch similarity index 85% rename from Spigot-Server-Patches/0302-Add-async-chunk-load-API.patch rename to Spigot-Server-Patches/0300-Add-async-chunk-load-API.patch index 45509c7dc7..87ff26159e 100644 --- a/Spigot-Server-Patches/0302-Add-async-chunk-load-API.patch +++ b/Spigot-Server-Patches/0300-Add-async-chunk-load-API.patch @@ -1,11 +1,11 @@ -From 6d356bb9a74eecd9bd4f08f3b9c9f4bf882e927f Mon Sep 17 00:00:00 2001 +From 1bd10f722ce808327480228cfa9924c43dd9e989 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 16:55:04 -0400 Subject: [PATCH] Add async chunk load API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f94830838..9294d1707 100644 +index e4c4cdb980..af977b171a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -156,6 +156,27 @@ public class CraftWorld implements World { @@ -15,7 +15,7 @@ index f94830838..9294d1707 100644 + // Paper start - Async chunk load API + public void getChunkAtAsync(final int x, final int z, final ChunkLoadCallback callback) { + final ChunkProviderServer cps = this.world.getChunkProviderServer(); -+ callback.onLoad(cps.getChunkAt(x, z).bukkitChunk); // TODO: Add back async variant ++ callback.onLoad(cps.getChunkAt(x, z, true, true).bukkitChunk); // TODO: Add back async variant + /*cps.getChunkAt(x, z, new Runnable() { + @Override + public void run() { @@ -34,7 +34,7 @@ index f94830838..9294d1707 100644 + // Paper end + public Chunk getChunkAt(int x, int z) { - return this.world.getChunkProviderServer().getChunkAt(x, z).bukkitChunk; + return this.world.getChunkProviderServer().getChunkAt(x, z, true, true).bukkitChunk; } -- 2.18.0 diff --git a/Spigot-Server-Patches/0304-Speedup-BlockPos-by-fixing-inlining.patch b/Spigot-Server-Patches/0301-Speedup-BlockPos-by-fixing-inlining.patch similarity index 93% rename from Spigot-Server-Patches/0304-Speedup-BlockPos-by-fixing-inlining.patch rename to Spigot-Server-Patches/0301-Speedup-BlockPos-by-fixing-inlining.patch index 3a3dc46416..8e142c4818 100644 --- a/Spigot-Server-Patches/0304-Speedup-BlockPos-by-fixing-inlining.patch +++ b/Spigot-Server-Patches/0301-Speedup-BlockPos-by-fixing-inlining.patch @@ -1,4 +1,4 @@ -From 538a27fa51bcb0bacd20f3c17a1e54d7618a6999 Mon Sep 17 00:00:00 2001 +From 5915dd6d1ddf969a6103b5674c0baab8e1c27b02 Mon Sep 17 00:00:00 2001 From: Techcable Date: Wed, 30 Nov 2016 20:56:58 -0600 Subject: [PATCH] Speedup BlockPos by fixing inlining @@ -21,7 +21,7 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt They had 'callq' (invoke) instead of 'mov' (get from memory) instructions. diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index 58f8b4b72..98992513d 100644 +index 58f8b4b720..98992513da 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -7,22 +7,22 @@ import javax.annotation.concurrent.Immutable; @@ -80,10 +80,10 @@ index 58f8b4b72..98992513d 100644 public BaseBlockPosition d(BaseBlockPosition baseblockposition) { return new BaseBlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX()); diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 252e00e16..f769b178c 100644 +index 42e5e9ad8f..936a49a3e8 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -207,18 +207,20 @@ public class BlockPosition extends BaseBlockPosition { +@@ -208,18 +208,20 @@ public class BlockPosition extends BaseBlockPosition { if (this.g == null) { this.g = new BlockPosition.MutableBlockPosition(i, j, k); return this.g; @@ -114,7 +114,7 @@ index 252e00e16..f769b178c 100644 } return this.g; -@@ -338,10 +340,12 @@ public class BlockPosition extends BaseBlockPosition { +@@ -339,10 +341,12 @@ public class BlockPosition extends BaseBlockPosition { public static class MutableBlockPosition extends BlockPosition { @@ -128,7 +128,7 @@ index 252e00e16..f769b178c 100644 @Override public boolean isValidLocation() { return b >= -30000000 && d >= -30000000 && b < 30000000 && d < 30000000 && c >= 0 && c < 256; -@@ -350,6 +354,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -351,6 +355,7 @@ public class BlockPosition extends BaseBlockPosition { public boolean isInvalidYLocation() { return c < 0 || c >= 256; } @@ -136,7 +136,7 @@ index 252e00e16..f769b178c 100644 // Paper end public MutableBlockPosition() { -@@ -361,10 +366,13 @@ public class BlockPosition extends BaseBlockPosition { +@@ -362,10 +367,13 @@ public class BlockPosition extends BaseBlockPosition { } public MutableBlockPosition(int i, int j, int k) { @@ -152,7 +152,7 @@ index 252e00e16..f769b178c 100644 } public BlockPosition a(double d0, double d1, double d2) { -@@ -383,6 +391,8 @@ public class BlockPosition extends BaseBlockPosition { +@@ -384,6 +392,8 @@ public class BlockPosition extends BaseBlockPosition { return super.a(enumblockrotation).h(); } @@ -161,7 +161,7 @@ index 252e00e16..f769b178c 100644 public int getX() { return this.b; } -@@ -393,13 +403,16 @@ public class BlockPosition extends BaseBlockPosition { +@@ -394,13 +404,16 @@ public class BlockPosition extends BaseBlockPosition { public int getZ() { return this.d; @@ -182,7 +182,7 @@ index 252e00e16..f769b178c 100644 return this; } -@@ -417,15 +430,15 @@ public class BlockPosition extends BaseBlockPosition { +@@ -418,15 +431,15 @@ public class BlockPosition extends BaseBlockPosition { } public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) { diff --git a/Spigot-Server-Patches/0305-Don-t-save-Proto-Chunks.patch b/Spigot-Server-Patches/0302-Don-t-save-Proto-Chunks.patch similarity index 64% rename from Spigot-Server-Patches/0305-Don-t-save-Proto-Chunks.patch rename to Spigot-Server-Patches/0302-Don-t-save-Proto-Chunks.patch index a57c4e539e..dc7102b084 100644 --- a/Spigot-Server-Patches/0305-Don-t-save-Proto-Chunks.patch +++ b/Spigot-Server-Patches/0302-Don-t-save-Proto-Chunks.patch @@ -1,4 +1,4 @@ -From 2b358efe73c8290c49ba53ace56360cea3ea7c11 Mon Sep 17 00:00:00 2001 +From 8bd54fac08b3ade04b63583ce9d8cc2173fa851f Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 22 Jul 2018 21:21:41 -0400 Subject: [PATCH] Don't save Proto Chunks @@ -8,30 +8,38 @@ the loadChunk method refuses to acknoledge they exists, and will restart a new chunk generation process to begin with, so saving them serves no benefit. diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index ea8684747..a97e024ec 100644 +index 110c9ef520..3074aa50e8 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -282,6 +282,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -289,6 +289,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } - public synchronized void saveChunk(World world, IChunkAccess ichunkaccess, boolean unloaded) throws IOException, ExceptionWorldConflict { + public void saveChunk(World world, IChunkAccess ichunkaccess, boolean unloaded) throws IOException, ExceptionWorldConflict { + if (ichunkaccess.i().d() == ChunkStatus.Type.PROTOCHUNK) { return; } // Paper - don't save proto chunks // Spigot end world.checkSession(); diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index 5d9118daa..7629e0d05 100644 +index 22af9c1885..95eb1a84ac 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -@@ -23,7 +23,7 @@ public class ChunkTaskScheduler extends Scheduler -Date: Sat, 21 Apr 2018 11:21:48 -0400 -Subject: [PATCH] Configurable Allowance of Permanent Chunk Loaders - -This disables the behavior that allows players to keep chunks permanently loaded -by default and allows server operators to enable it if they wish. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 37315233e..044da2754 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -473,4 +473,9 @@ public class PaperWorldConfig { - break; - } - } -+ public boolean allowPermaChunkLoaders = false; -+ private void allowPermaChunkLoaders() { -+ allowPermaChunkLoaders = getBoolean("game-mechanics.allow-permanent-chunk-loaders", allowPermaChunkLoaders); -+ log("Allow Perma Chunk Loaders: " + (allowPermaChunkLoaders ? "enabled" : "disabled")); -+ } - } -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 497372124..0e0c7b1ab 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -111,7 +111,7 @@ public class ChunkProviderServer implements IChunkProvider { - Long2ObjectMap long2objectmap = this.chunks; - - synchronized (this.chunks) { -- Chunk chunk = this.getLoadedChunkAt(i, j); -+ Chunk chunk = world.paperConfig.allowPermaChunkLoaders ? getLoadedChunkAt(i, j) : getChunkIfLoaded(i, j); // Paper - Configurable perma chunk loaders - - return chunk != null ? chunk : this.loadChunkAt(i, j); - } --- -2.18.0 - diff --git a/Spigot-Server-Patches/0306-Optimize-RegistryID.c.patch b/Spigot-Server-Patches/0303-Optimize-RegistryID.c.patch similarity index 95% rename from Spigot-Server-Patches/0306-Optimize-RegistryID.c.patch rename to Spigot-Server-Patches/0303-Optimize-RegistryID.c.patch index 96fdebdcfb..11a803b025 100644 --- a/Spigot-Server-Patches/0306-Optimize-RegistryID.c.patch +++ b/Spigot-Server-Patches/0303-Optimize-RegistryID.c.patch @@ -1,4 +1,4 @@ -From 4c81bab2e17f5e9c8afb165cab5b58681596325c Mon Sep 17 00:00:00 2001 +From fa670184f6b30408f73ebe46e89578a4bd2b68b4 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 23 Jul 2018 13:08:19 -0400 Subject: [PATCH] Optimize RegistryID.c() @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize RegistryID.c() This is a frequent hotspot for world loading/saving. diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java -index bde5714dd..a01cda9d8 100644 +index bde5714dd6..a01cda9d81 100644 --- a/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java @@ -14,12 +14,14 @@ public class RegistryID implements Registry { // Paper - decompile fix diff --git a/Spigot-Server-Patches/0307-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/0304-Option-to-prevent-armor-stands-from-doing-entity-loo.patch similarity index 75% rename from Spigot-Server-Patches/0307-Option-to-prevent-armor-stands-from-doing-entity-loo.patch rename to Spigot-Server-Patches/0304-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 59bdb94500..400079ea1d 100644 --- a/Spigot-Server-Patches/0307-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/0304-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -1,14 +1,14 @@ -From 742fffc7037d32a9903dd48a621a3079cdfa7a61 Mon Sep 17 00:00:00 2001 +From d1ba66ffb95eb8a9116f5c0e0cef4de0e9b38efb Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Mon, 23 Jul 2018 12:57:39 +0200 Subject: [PATCH] Option to prevent armor stands from doing entity lookups diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 044da2754..61c8b58b1 100644 +index 3aa6f031f3..58f87794d6 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -350,6 +350,11 @@ public class PaperWorldConfig { +@@ -353,6 +353,11 @@ public class PaperWorldConfig { } } @@ -21,18 +21,10 @@ index 044da2754..61c8b58b1 100644 private void maxEntityCollision() { maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 064c31c03..4b03f1965 100644 +index 2ad02b0a61..73cd2d015b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -11,6 +11,7 @@ import java.util.Iterator; - import java.util.List; - import java.util.Random; - import java.util.UUID; -+ - import java.util.function.Function; - import java.util.function.Predicate; - import java.util.function.Supplier; -@@ -1575,6 +1576,14 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1599,6 +1599,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } diff --git a/Spigot-Server-Patches/0308-Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/0305-Vanished-players-don-t-have-rights.patch similarity index 89% rename from Spigot-Server-Patches/0308-Vanished-players-don-t-have-rights.patch rename to Spigot-Server-Patches/0305-Vanished-players-don-t-have-rights.patch index 7def6c4632..c8db38503a 100644 --- a/Spigot-Server-Patches/0308-Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/0305-Vanished-players-don-t-have-rights.patch @@ -1,14 +1,14 @@ -From ea8f644f21fb302f74c22ceb661138121379104b Mon Sep 17 00:00:00 2001 +From 171d1bef3552c5868aa5af2566a0ac7d87e2b675 Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Mon, 23 Jul 2018 14:22:26 +0200 Subject: [PATCH] Vanished players don't have rights diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 9ab635058..4315804dd 100644 +index d86a23d71d..4a2faa314e 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -93,7 +93,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -94,7 +94,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke private static int entityCount; private final EntityTypes g; public EntityTypes getEntityType() { return g; } // Paper - OBFHELPER private int id; @@ -16,9 +16,9 @@ index 9ab635058..4315804dd 100644 + public boolean j; public boolean blocksEntitySpawning() { return j; } // Paper - OBFHELPER public final List passengers; protected int k; - private Entity ax; + private Entity vehicle; diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index c8f305e6d..b57f6efb3 100644 +index 0a4ee39d67..6f80876990 100644 --- a/src/main/java/net/minecraft/server/IBlockData.java +++ b/src/main/java/net/minecraft/server/IBlockData.java @@ -179,6 +179,7 @@ public interface IBlockData extends IBlockDataHolder { @@ -30,7 +30,7 @@ index c8f305e6d..b57f6efb3 100644 return this.getBlock().f(this, iblockaccess, blockposition); } diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java -index 1cecccef2..afc881d9a 100644 +index 1cecccef23..afc881d9af 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -70,7 +70,8 @@ public class ItemBlock extends Item { @@ -44,18 +44,18 @@ index 1cecccef2..afc881d9a 100644 BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(blockactioncontext.getWorld(), blockactioncontext.getClickPosition()), CraftBlockData.fromData(iblockdata), defaultReturn); blockactioncontext.getWorld().getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java -index 53c9f2188..71e408432 100644 +index 700900256b..b7d2fa2f0e 100644 --- a/src/main/java/net/minecraft/server/VoxelShape.java +++ b/src/main/java/net/minecraft/server/VoxelShape.java -@@ -22,6 +22,7 @@ public abstract class VoxelShape { - return this.a(enumdirection_enumaxis, this.a.b(enumdirection_enumaxis)); +@@ -28,6 +28,7 @@ public abstract class VoxelShape { + return i <= 0 ? Double.NEGATIVE_INFINITY : this.a(enumdirection_enumaxis, i); } + public AxisAlignedBB getBounds() { return a(); } // Paper - OBFHELPER public AxisAlignedBB a() { if (this.b()) { throw new UnsupportedOperationException("No bounds for empty shape."); -@@ -40,6 +41,7 @@ public abstract class VoxelShape { +@@ -42,6 +43,7 @@ public abstract class VoxelShape { protected abstract DoubleList a(EnumDirection.EnumAxis enumdirection_enumaxis); @@ -64,10 +64,10 @@ index 53c9f2188..71e408432 100644 return this.a.a(); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 4b03f1965..921add1dc 100644 +index 73cd2d015b..3ea26d5ad8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1558,6 +1558,37 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1581,6 +1581,37 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } @@ -106,7 +106,7 @@ index 4b03f1965..921add1dc 100644 if (voxelshape.b()) { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index cf398cd25..140ddae0d 100644 +index 9fb1b75413..1f3774c249 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -804,6 +804,14 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/0310-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch b/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch similarity index 79% rename from Spigot-Server-Patches/0310-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch rename to Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch index 4edbc5c603..cd7b14ea7e 100644 --- a/Spigot-Server-Patches/0310-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch +++ b/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch @@ -1,4 +1,4 @@ -From f839267a9bd602133ddec1f7a7f09992f178a81f Mon Sep 17 00:00:00 2001 +From 609b90d3e67f3dd186e4cd7fd802a7b53d5da412 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 23 Jul 2018 22:18:31 -0400 Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it @@ -6,10 +6,10 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 724c1f572..67e2158ca 100644 +index 4eb08553c6..404b7d21c2 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -714,6 +714,7 @@ public class Chunk implements IChunkAccess { +@@ -711,6 +711,7 @@ public class Chunk implements IChunkAccess { entity.ag = this.locZ; this.entitySlices[k].add(entity); // Paper start @@ -17,7 +17,7 @@ index 724c1f572..67e2158ca 100644 if (entity instanceof EntityItem) { itemCounts[k]++; } else if (entity instanceof IInventory) { -@@ -745,6 +746,7 @@ public class Chunk implements IChunkAccess { +@@ -742,6 +743,7 @@ public class Chunk implements IChunkAccess { if (!this.entitySlices[i].remove(entity)) { return; } diff --git a/Spigot-Server-Patches/0311-Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/0307-Add-some-Debug-to-Chunk-Entity-slices.patch similarity index 91% rename from Spigot-Server-Patches/0311-Add-some-Debug-to-Chunk-Entity-slices.patch rename to Spigot-Server-Patches/0307-Add-some-Debug-to-Chunk-Entity-slices.patch index 51ae779272..99d396cd5e 100644 --- a/Spigot-Server-Patches/0311-Add-some-Debug-to-Chunk-Entity-slices.patch +++ b/Spigot-Server-Patches/0307-Add-some-Debug-to-Chunk-Entity-slices.patch @@ -1,4 +1,4 @@ -From fdf7978f1bbee6b38b095758b84082876ece68a8 Mon Sep 17 00:00:00 2001 +From bb0df40633fb71648d08dc23220231ef2eec19cd Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 23 Jul 2018 22:44:23 -0400 Subject: [PATCH] Add some Debug to Chunk Entity slices @@ -9,10 +9,10 @@ This should hopefully avoid duplicate entities ever being created if the entity was to end up in 2 different chunk slices diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index abdcf7745a..bd31a7dcab 100644 +index 404b7d21c2..7b6b8f4824 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -712,8 +712,34 @@ public class Chunk implements IChunkAccess { +@@ -709,8 +709,34 @@ public class Chunk implements IChunkAccess { entity.ae = this.locX; entity.af = k; entity.ag = this.locZ; @@ -48,7 +48,7 @@ index abdcf7745a..bd31a7dcab 100644 this.markDirty(); if (entity instanceof EntityItem) { itemCounts[k]++; -@@ -743,9 +769,13 @@ public class Chunk implements IChunkAccess { +@@ -740,9 +766,13 @@ public class Chunk implements IChunkAccess { i = this.entitySlices.length - 1; } // Paper start @@ -64,7 +64,7 @@ index abdcf7745a..bd31a7dcab 100644 this.markDirty(); if (entity instanceof EntityItem) { itemCounts[i]--; -@@ -980,6 +1010,7 @@ public class Chunk implements IChunkAccess { +@@ -979,6 +1009,7 @@ public class Chunk implements IChunkAccess { } // Spigot End entity.setCurrentChunk(null); // Paper @@ -73,7 +73,7 @@ index abdcf7745a..bd31a7dcab 100644 // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4315804ddb..166abea704 100644 +index 4a2faa314e..f5d5f38232 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -64,6 +64,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0312-Optimize-Region-File-Cache.patch b/Spigot-Server-Patches/0308-Optimize-Region-File-Cache.patch similarity index 86% rename from Spigot-Server-Patches/0312-Optimize-Region-File-Cache.patch rename to Spigot-Server-Patches/0308-Optimize-Region-File-Cache.patch index 69f423f4d3..f738830685 100644 --- a/Spigot-Server-Patches/0312-Optimize-Region-File-Cache.patch +++ b/Spigot-Server-Patches/0308-Optimize-Region-File-Cache.patch @@ -1,4 +1,4 @@ -From 6f0a09ca79e5781043e323821dc960f61a5bf6bb Mon Sep 17 00:00:00 2001 +From c033b7ac3b55f3523700a96a450368327b68c2d9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 23 Jul 2018 23:40:04 -0400 Subject: [PATCH] Optimize Region File Cache @@ -32,10 +32,10 @@ synchronized context, reducing lock times. Ultimately: This brings us back to Vanilla, which has had no indication of region file loss. diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 3b8d01ea1..609d6c355 100644 +index c0ab543b91..15666325ea 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -97,7 +97,7 @@ public class RegionFileCache { +@@ -99,7 +99,7 @@ public class RegionFileCache { @Nullable // CraftBukkit start - call sites hoisted for synchronization @@ -44,18 +44,18 @@ index 3b8d01ea1..609d6c355 100644 RegionFile regionfile = a(file, i, j); DataInputStream datainputstream = regionfile.a(i & 31, j & 31); -@@ -110,7 +110,7 @@ public class RegionFileCache { +@@ -112,7 +112,7 @@ public class RegionFileCache { } @Nullable - public static synchronized void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { -+ public static void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { // Paper - remove synchronization ++ public static void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { + int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper RegionFile regionfile = a(file, i, j); - DataOutputStream dataoutputstream = regionfile.c(i & 31, j & 31); -@@ -119,7 +119,7 @@ public class RegionFileCache { +@@ -138,7 +138,7 @@ public class RegionFileCache { + // Paper end } - // CraftBukkit end - public static synchronized boolean chunkExists(File file, int i, int j) { + public static boolean chunkExists(File file, int i, int j) { // Paper - remove synchronization diff --git a/Spigot-Server-Patches/0314-EntityTransformedEvent.patch b/Spigot-Server-Patches/0309-EntityTransformedEvent.patch similarity index 92% rename from Spigot-Server-Patches/0314-EntityTransformedEvent.patch rename to Spigot-Server-Patches/0309-EntityTransformedEvent.patch index 24e3a01a9e..4272912b73 100644 --- a/Spigot-Server-Patches/0314-EntityTransformedEvent.patch +++ b/Spigot-Server-Patches/0309-EntityTransformedEvent.patch @@ -1,11 +1,11 @@ -From c7e7b3da0039230bfce36229ca4753ef1277aa29 Mon Sep 17 00:00:00 2001 +From a088adbba3accae04e91e53618a5a71edb2b3c7f Mon Sep 17 00:00:00 2001 From: Anthony MacAllister Date: Thu, 26 Jul 2018 15:30:03 -0400 Subject: [PATCH] EntityTransformedEvent diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index c6babe6af..a7159ef96 100644 +index 5b856aea2f..13a6ddac59 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java @@ -43,7 +43,7 @@ public class EntityMushroomCow extends EntityCow { @@ -18,7 +18,7 @@ index c6babe6af..a7159ef96 100644 for (int i = 0; i < 5; ++i) { diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index b51543ea7..51be54684 100644 +index 8fe68c2eb4..3b5d95945a 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -623,7 +623,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -31,10 +31,10 @@ index b51543ea7..51be54684 100644 this.die(); } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 2818ded92..d2d17094d 100644 +index e5170bff5b..04d25ad76a 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -233,7 +233,7 @@ public class EntityZombie extends EntityMonster { +@@ -234,7 +234,7 @@ public class EntityZombie extends EntityMonster { entityzombie.setCustomName(this.getCustomName()); entityzombie.setCustomNameVisible(this.getCustomNameVisible()); } @@ -43,7 +43,7 @@ index 2818ded92..d2d17094d 100644 this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.DROWNED); // CraftBukkit - added spawn reason this.die(); } -@@ -392,6 +392,7 @@ public class EntityZombie extends EntityMonster { +@@ -393,6 +393,7 @@ public class EntityZombie extends EntityMonster { entityzombievillager.setCustomNameVisible(entityvillager.getCustomNameVisible()); } @@ -52,7 +52,7 @@ index 2818ded92..d2d17094d 100644 this.world.a((EntityHuman) null, 1026, new BlockPosition(this), 0); } diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index 9f61523be..b8b0d6592 100644 +index bf136a6aa3..94bd3c5b37 100644 --- a/src/main/java/net/minecraft/server/EntityZombieVillager.java +++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java @@ -130,7 +130,7 @@ public class EntityZombieVillager extends EntityZombie { diff --git a/Spigot-Server-Patches/0309-Thread-Safe-Iteration-of-Chunk-Scheduler.patch b/Spigot-Server-Patches/0309-Thread-Safe-Iteration-of-Chunk-Scheduler.patch deleted file mode 100644 index ee2cae6684..0000000000 --- a/Spigot-Server-Patches/0309-Thread-Safe-Iteration-of-Chunk-Scheduler.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 45ee83d420ff59370323cd99ace9e65a1579884b Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 23 Jul 2018 19:13:06 -0400 -Subject: [PATCH] Thread Safe Iteration of Chunk Scheduler - - -diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index 7629e0d05..5ee8bedf3 100644 ---- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -@@ -1,8 +1,10 @@ - package net.minecraft.server; - -+import com.google.common.collect.Lists; - import it.unimi.dsi.fastutil.longs.Long2ObjectMap; - import it.unimi.dsi.fastutil.longs.Long2ObjectMaps; - import java.io.IOException; -+import java.util.ArrayList; - import java.util.EnumMap; - import java.util.Map; - import java.util.function.Consumer; -@@ -85,7 +87,13 @@ public class ChunkTaskScheduler extends Scheduler { -+ // Paper start -+ ArrayList list; -+ synchronized (this.g) { -+ list = Lists.newArrayList(this.g.values()); -+ } -+ list.forEach((scheduler_a) -> { -+ // Paper end - ProtoChunk protochunk = (ProtoChunk) scheduler_a.a(); - - if (protochunk.h() && protochunk.i().d() == ChunkStatus.Type.PROTOCHUNK) { -@@ -93,6 +101,7 @@ public class ChunkTaskScheduler extends Scheduler Date: Fri, 27 Jul 2018 22:36:31 -0500 Subject: [PATCH] SkeletonHorse Additions diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index 70985bf52..9fb86eefd 100644 +index e643201ebf..edd272eabd 100644 --- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java @@ -6,7 +6,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { @@ -21,8 +21,8 @@ index 70985bf52..9fb86eefd 100644 return 0.96F; } -+ public boolean isTrap() { return this.dz(); } // Paper - OBFHELPER - public boolean dz() { ++ public boolean isTrap() { return this.dy(); } // Paper - OBFHELPER + public boolean dy() { return this.bN; } @@ -31,7 +31,7 @@ index 70985bf52..9fb86eefd 100644 if (flag != this.bN) { this.bN = flag; diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java -index f69170559..cba8b91e5 100644 +index 82403c8165..2ee91bbb02 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java @@ -13,6 +13,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { @@ -43,7 +43,7 @@ index f69170559..cba8b91e5 100644 this.a.s(false); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java -index e822c2200..496d0c0ca 100644 +index e822c2200d..496d0c0cac 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java @@ -26,4 +26,23 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo diff --git a/Spigot-Server-Patches/0316-Prevent-Saving-Bad-entities-to-chunks.patch b/Spigot-Server-Patches/0311-Prevent-Saving-Bad-entities-to-chunks.patch similarity index 90% rename from Spigot-Server-Patches/0316-Prevent-Saving-Bad-entities-to-chunks.patch rename to Spigot-Server-Patches/0311-Prevent-Saving-Bad-entities-to-chunks.patch index f4e9e597f0..79e3687c4e 100644 --- a/Spigot-Server-Patches/0316-Prevent-Saving-Bad-entities-to-chunks.patch +++ b/Spigot-Server-Patches/0311-Prevent-Saving-Bad-entities-to-chunks.patch @@ -1,4 +1,4 @@ -From 26e17e3fae4ec2b114fbd0fe973eb26dc53c1d32 Mon Sep 17 00:00:00 2001 +From 06711c8f124e0f94a22fb27ab4041bdfffdc676a Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 26 Jul 2018 00:11:12 -0400 Subject: [PATCH] Prevent Saving Bad entities to chunks @@ -18,10 +18,10 @@ an invalid entity. This should reduce log occurrences of dupe uuid messages. diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index a97e024ec..bd52bf656 100644 +index a3b7d359dc..ffa94ea674 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -561,11 +561,22 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -547,11 +547,22 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { Iterator iterator; @@ -44,7 +44,7 @@ index a97e024ec..bd52bf656 100644 NBTTagCompound nbttagcompound1 = new NBTTagCompound(); if (entity.d(nbttagcompound1)) { -@@ -574,6 +585,11 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -560,6 +571,11 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } } } diff --git a/Spigot-Server-Patches/0317-Don-t-call-getItemMeta-on-hasItemMeta.patch b/Spigot-Server-Patches/0312-Don-t-call-getItemMeta-on-hasItemMeta.patch similarity index 95% rename from Spigot-Server-Patches/0317-Don-t-call-getItemMeta-on-hasItemMeta.patch rename to Spigot-Server-Patches/0312-Don-t-call-getItemMeta-on-hasItemMeta.patch index bc11df80e9..edc17e4721 100644 --- a/Spigot-Server-Patches/0317-Don-t-call-getItemMeta-on-hasItemMeta.patch +++ b/Spigot-Server-Patches/0312-Don-t-call-getItemMeta-on-hasItemMeta.patch @@ -1,4 +1,4 @@ -From 09f252112d9099a08fd7a70dd245e3e3ca68f14d Mon Sep 17 00:00:00 2001 +From 0ed60fd7f609781ed5996993d982914ee61eff27 Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Thu, 26 Jul 2018 14:10:23 +0200 Subject: [PATCH] Don't call getItemMeta on hasItemMeta @@ -11,7 +11,7 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set. Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 911463f5b..974321df8 100644 +index 911463f5b2..974321df82 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -519,7 +519,7 @@ public final class CraftItemStack extends ItemStack { @@ -24,7 +24,7 @@ index 911463f5b..974321df8 100644 static boolean hasItemMeta(net.minecraft.server.ItemStack item) { diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index eb6cf1bb3..79ce3752e 100644 +index ef9d40b8a0..a161993876 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java @@ -5,6 +5,7 @@ import static org.hamcrest.Matchers.*; @@ -35,7 +35,7 @@ index eb6cf1bb3..79ce3752e 100644 import java.util.List; import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; // Paper import net.minecraft.server.Block; -@@ -154,8 +155,47 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -155,8 +156,47 @@ public class ItemMetaTest extends AbstractTestingBase { ItemStack pureBukkit = new ItemStack(Material.SHEARS); assertThat("Bukkit and craft stacks should be similar", craft.isSimilar(pureBukkit), is(true)); assertThat("Bukkit and craft stacks should be equal", craft.equals(pureBukkit), is(true)); diff --git a/Spigot-Server-Patches/0318-Always-process-chunk-removal-in-removeEntity.patch b/Spigot-Server-Patches/0313-Always-process-chunk-removal-in-removeEntity.patch similarity index 80% rename from Spigot-Server-Patches/0318-Always-process-chunk-removal-in-removeEntity.patch rename to Spigot-Server-Patches/0313-Always-process-chunk-removal-in-removeEntity.patch index a8edb32c48..cd77de4ae3 100644 --- a/Spigot-Server-Patches/0318-Always-process-chunk-removal-in-removeEntity.patch +++ b/Spigot-Server-Patches/0313-Always-process-chunk-removal-in-removeEntity.patch @@ -1,4 +1,4 @@ -From fe6d2dda85fd9986c6c9b5cbfaa4eaaa60fead62 Mon Sep 17 00:00:00 2001 +From 0073935df3eb903a5cb29a7c5dadebd260e30d73 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 28 Jul 2018 12:09:20 -0400 Subject: [PATCH] Always process chunk removal in removeEntity @@ -8,10 +8,10 @@ which can keep them in the chunk when they shouldnt be if done during entity ticking. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 921add1dc..ff0112c52 100644 +index 3ea26d5ad8..c2d404b813 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1136,7 +1136,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1159,7 +1159,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.everyoneSleeping(); } @@ -20,7 +20,7 @@ index 921add1dc..ff0112c52 100644 int i = entity.ae; int j = entity.ag; -@@ -1144,6 +1144,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1167,6 +1167,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.getChunkAt(i, j).b(entity); } diff --git a/Spigot-Server-Patches/0313-repair-bad-rcon.ip-settings-temporarily.patch b/Spigot-Server-Patches/0313-repair-bad-rcon.ip-settings-temporarily.patch deleted file mode 100644 index bdfd2cb5f3..0000000000 --- a/Spigot-Server-Patches/0313-repair-bad-rcon.ip-settings-temporarily.patch +++ /dev/null @@ -1,24 +0,0 @@ -From bb296a9d83fdd412c04f308442a7c7460187d553 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 25 Jul 2018 01:21:05 -0400 -Subject: [PATCH] repair bad rcon.ip settings temporarily - -accidently missed mapping change, and we defaulted rcon.ip to the server.properties file path - -clean up values for people, drop this patch after like 2 weeks. - -diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java -index c237f239f..1319b3b91 100644 ---- a/src/main/java/net/minecraft/server/RemoteControlListener.java -+++ b/src/main/java/net/minecraft/server/RemoteControlListener.java -@@ -25,6 +25,7 @@ public class RemoteControlListener extends RemoteConnectionThread { - this.h = iminecraftserver.a("rcon.port", 0); - this.l = iminecraftserver.a("rcon.password", ""); - this.j = iminecraftserver.a("rcon.ip", ((DedicatedServer) iminecraftserver).getServerIp()); // Paper -+ if (this.j.equals(iminecraftserver.d_())) this.j = ((DedicatedServer) iminecraftserver).getServerIp(); // Paper - temporary - remove this after like 2 weeks - repair bad settings - this.i = iminecraftserver.f(); - if (0 == this.h) { - this.h = this.i + 10; --- -2.18.0 - diff --git a/Spigot-Server-Patches/0319-Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/0314-Ignore-Dead-Entities-in-entityList-iteration.patch similarity index 84% rename from Spigot-Server-Patches/0319-Ignore-Dead-Entities-in-entityList-iteration.patch rename to Spigot-Server-Patches/0314-Ignore-Dead-Entities-in-entityList-iteration.patch index a12cad6dd8..f34614f602 100644 --- a/Spigot-Server-Patches/0319-Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/0314-Ignore-Dead-Entities-in-entityList-iteration.patch @@ -1,4 +1,4 @@ -From f10e7ff6485116d84387c75904aca336a4bfc89c Mon Sep 17 00:00:00 2001 +From 46802d69757545e315c417c9092a0ed5d4568100 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 28 Jul 2018 12:18:27 -0400 Subject: [PATCH] Ignore Dead Entities in entityList iteration @@ -11,7 +11,7 @@ This will ensure that dead entities are skipped from iteration since they shouldn't of been in the list in the first place. diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 7ff8e70b2..4e854c6db 100644 +index 56700fc596..9b9c8361e9 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -172,6 +172,7 @@ public class PaperCommand extends Command { @@ -23,10 +23,10 @@ index 7ff8e70b2..4e854c6db 100644 MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 785c31089..6b0ca4eb9 100644 +index f5d5f38232..e558197623 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -122,6 +122,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -123,6 +123,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke protected boolean F; private boolean az; public boolean dead; @@ -35,10 +35,10 @@ index 785c31089..6b0ca4eb9 100644 public float length; public float J; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ff0112c52..82f4f00a7 100644 +index c2d404b813..255829b0b5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1078,6 +1078,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1098,6 +1098,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } entity.valid = true; // CraftBukkit @@ -46,7 +46,7 @@ index ff0112c52..82f4f00a7 100644 new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid } -@@ -1143,6 +1144,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1166,6 +1167,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (entity.inChunk && this.isChunkLoaded(i, j, true)) { this.getChunkAt(i, j).b(entity); } @@ -54,7 +54,7 @@ index ff0112c52..82f4f00a7 100644 if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking // Paper - always remove from current chunk above // CraftBukkit start - Decrement loop variable field if we've already ticked this entity -@@ -2350,6 +2352,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2376,6 +2378,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -62,7 +62,7 @@ index ff0112c52..82f4f00a7 100644 if (oclass.isAssignableFrom(entity.getClass()) && predicate.test((T) entity)) { arraylist.add(entity); -@@ -2436,6 +2439,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2462,6 +2465,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -71,10 +71,10 @@ index ff0112c52..82f4f00a7 100644 if (entity instanceof EntityInsentient) { EntityInsentient entityinsentient = (EntityInsentient) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9294d1707..b09f0353a 100644 +index af977b171a..80fd49b6e1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -660,6 +660,7 @@ public class CraftWorld implements World { +@@ -653,6 +653,7 @@ public class CraftWorld implements World { for (Object o : world.entityList) { if (o instanceof net.minecraft.server.Entity) { net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity) o; @@ -82,7 +82,7 @@ index 9294d1707..b09f0353a 100644 Entity bukkitEntity = mcEnt.getBukkitEntity(); // Assuming that bukkitEntity isn't null -@@ -678,6 +679,7 @@ public class CraftWorld implements World { +@@ -671,6 +672,7 @@ public class CraftWorld implements World { for (Object o : world.entityList) { if (o instanceof net.minecraft.server.Entity) { net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity) o; @@ -90,7 +90,7 @@ index 9294d1707..b09f0353a 100644 Entity bukkitEntity = mcEnt.getBukkitEntity(); // Assuming that bukkitEntity isn't null -@@ -702,6 +704,7 @@ public class CraftWorld implements World { +@@ -695,6 +697,7 @@ public class CraftWorld implements World { for (Object entity: world.entityList) { if (entity instanceof net.minecraft.server.Entity) { @@ -98,7 +98,7 @@ index 9294d1707..b09f0353a 100644 Entity bukkitEntity = ((net.minecraft.server.Entity) entity).getBukkitEntity(); if (bukkitEntity == null) { -@@ -724,6 +727,7 @@ public class CraftWorld implements World { +@@ -717,6 +720,7 @@ public class CraftWorld implements World { for (Object entity: world.entityList) { if (entity instanceof net.minecraft.server.Entity) { diff --git a/Spigot-Server-Patches/0320-Always-process-chunk-registration-after-moving.patch b/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch similarity index 89% rename from Spigot-Server-Patches/0320-Always-process-chunk-registration-after-moving.patch rename to Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch index f227c3b8c9..8eff1880c0 100644 --- a/Spigot-Server-Patches/0320-Always-process-chunk-registration-after-moving.patch +++ b/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch @@ -1,4 +1,4 @@ -From 303b6a7fc904210a40901143571f794a631bc7de Mon Sep 17 00:00:00 2001 +From 45c2e68e9628f6f94d284c5c84138f928f112aad Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 29 Jul 2018 11:58:05 -0400 Subject: [PATCH] Always process chunk registration after moving @@ -7,10 +7,10 @@ This will help guarantee that entities are always in the chunk that they are currently located at. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6b0ca4eb9..68b4a902e 100644 +index e558197623..f5e66aaf90 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -340,6 +340,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -341,6 +341,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.locX = d0; this.locY = d1; this.locZ = d2; @@ -18,7 +18,7 @@ index 6b0ca4eb9..68b4a902e 100644 float f = this.width / 2.0F; float f1 = this.length; -@@ -938,6 +939,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -935,6 +936,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.locX = (axisalignedbb.a + axisalignedbb.d) / 2.0D; this.locY = axisalignedbb.b; this.locZ = (axisalignedbb.c + axisalignedbb.f) / 2.0D; @@ -27,7 +27,7 @@ index 6b0ca4eb9..68b4a902e 100644 protected SoundEffect ad() { diff --git a/src/main/java/net/minecraft/server/EntityLeash.java b/src/main/java/net/minecraft/server/EntityLeash.java -index f2d3d0b4c..f20060614 100644 +index f2d3d0b4c7..f20060614d 100644 --- a/src/main/java/net/minecraft/server/EntityLeash.java +++ b/src/main/java/net/minecraft/server/EntityLeash.java @@ -31,6 +31,7 @@ public class EntityLeash extends EntityHanging { @@ -39,7 +39,7 @@ index f2d3d0b4c..f20060614 100644 public void setDirection(EnumDirection enumdirection) {} diff --git a/src/main/java/net/minecraft/server/EntityShulker.java b/src/main/java/net/minecraft/server/EntityShulker.java -index 95c6cd897..bc11e7da2 100644 +index 24de5f0172..06e51d5b81 100644 --- a/src/main/java/net/minecraft/server/EntityShulker.java +++ b/src/main/java/net/minecraft/server/EntityShulker.java @@ -385,6 +385,7 @@ public class EntityShulker extends EntityGolem implements IMonster { diff --git a/Spigot-Server-Patches/0321-Provide-option-to-use-a-versioned-world-folder-for-t.patch b/Spigot-Server-Patches/0316-Provide-option-to-use-a-versioned-world-folder-for-t.patch similarity index 88% rename from Spigot-Server-Patches/0321-Provide-option-to-use-a-versioned-world-folder-for-t.patch rename to Spigot-Server-Patches/0316-Provide-option-to-use-a-versioned-world-folder-for-t.patch index b92302c186..cd8962a54a 100644 --- a/Spigot-Server-Patches/0321-Provide-option-to-use-a-versioned-world-folder-for-t.patch +++ b/Spigot-Server-Patches/0316-Provide-option-to-use-a-versioned-world-folder-for-t.patch @@ -1,4 +1,4 @@ -From 10445a67042efb7969d2c60484cd0c5179619467 Mon Sep 17 00:00:00 2001 +From 418328efab0770b7cbfe3eff814e54a7314731d1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 29 Jul 2018 15:48:50 -0400 Subject: [PATCH] Provide option to use a versioned world folder for testing @@ -19,7 +19,7 @@ may be some delay there, but region files are only copied on demand. This is highly experiemental so backup your world before relying on this to not modify it diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index bcdf4f91d..c457d0711 100644 +index bcdf4f91d8..c457d07110 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -13,6 +13,7 @@ import java.util.List; @@ -59,10 +59,10 @@ index bcdf4f91d..c457d0711 100644 + } } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index bd52bf656..54840851b 100644 +index ffa94ea674..68a3169c31 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -55,8 +55,56 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -52,8 +52,52 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { private PersistentStructureLegacy e; // private boolean f; // CraftBukkit private static final double SAVE_QUEUE_TARGET_SIZE = 625; // Spigot @@ -71,10 +71,6 @@ index bd52bf656..54840851b 100644 + private final File actualWorld; + private final boolean useAltWorld; + -+ private boolean chunkExists0(int x, int z) { -+ copyIfNeeded(x, z); -+ return RegionFileCache.chunkExists(this.actualWorld, x, z); -+ } + private synchronized void copyIfNeeded(int x, int z) { + if (!useAltWorld) { + return; @@ -119,37 +115,44 @@ index bd52bf656..54840851b 100644 this.c = file; this.d = datafixer; } -@@ -77,7 +125,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -72,7 +116,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } } - if (RegionFileCache.chunkExists(this.c, x, z)) { -+ if (chunkExists0(x, z)) { // Paper ++ if (chunkExists(x, z)) { // Paper NBTTagCompound nbt = RegionFileCache.read(this.c, x, z); if (nbt != null) { NBTTagCompound level = nbt.getCompound("Level"); -@@ -97,6 +145,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -92,6 +136,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @Nullable private NBTTagCompound a(DimensionManager dimensionmanager, @Nullable PersistentCollection persistentcollection, int i, int j, @Nullable GeneratorAccess generatoraccess) throws IOException { + copyIfNeeded(i, j); // Paper - NBTTagCompound nbttagcompound = RegionFileCache.read(this.c, i, j); + NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(this.b.get(new ChunkCoordIntPair(i, j))); // Spigot - if (nbttagcompound == null) { -@@ -205,7 +254,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); - Supplier nbttagcompound = this.b.get(chunkcoordintpair); // Spigot - -- return nbttagcompound != null ? true : RegionFileCache.chunkExists(this.c, i, j); -+ return nbttagcompound != null ? true : chunkExists0(i, j); // Paper + if (nbttagcompound != null) { +@@ -215,6 +260,15 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } } ++ public boolean chunkExists(int x, int z) { ++ ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z); ++ if (this.b.containsKey(chunkcoordintpair)) { ++ return true; ++ } ++ copyIfNeeded(x, z); ++ return RegionFileCache.chunkExists(this.actualWorld, x, z); ++ } ++ @Nullable + protected Object[] a(GeneratorAccess generatoraccess, int i, int j, NBTTagCompound nbttagcompound) { // CraftBukkit - return Chunk -> Object[] + if (nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8)) { diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 609d6c355..f1fa7c717 100644 +index 15666325ea..3501b87f75 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -74,6 +74,13 @@ public class RegionFileCache { +@@ -76,6 +76,13 @@ public class RegionFileCache { itr.remove(); } } @@ -164,10 +167,10 @@ index 609d6c355..f1fa7c717 100644 public static synchronized void a() { diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index 9a243010d..3fabbe94f 100644 +index ab085788ab..c84e6acdbe 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -33,6 +33,58 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { +@@ -32,6 +32,58 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { public WorldNBTStorage(File file, String s, @Nullable MinecraftServer minecraftserver, DataFixer datafixer) { this.a = datafixer; diff --git a/Spigot-Server-Patches/0322-MC-111480-Start-Entity-ID-s-at-1.patch b/Spigot-Server-Patches/0317-MC-111480-Start-Entity-ID-s-at-1.patch similarity index 86% rename from Spigot-Server-Patches/0322-MC-111480-Start-Entity-ID-s-at-1.patch rename to Spigot-Server-Patches/0317-MC-111480-Start-Entity-ID-s-at-1.patch index dd066a4102..2a986fffbf 100644 --- a/Spigot-Server-Patches/0322-MC-111480-Start-Entity-ID-s-at-1.patch +++ b/Spigot-Server-Patches/0317-MC-111480-Start-Entity-ID-s-at-1.patch @@ -1,4 +1,4 @@ -From b8552d001501bd5afd095ed3d3308db8e93dbbce Mon Sep 17 00:00:00 2001 +From 0ee43fd09448733a29c41dcb66161b63b0c4f5b3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 29 Jul 2018 22:58:47 -0400 Subject: [PATCH] MC-111480: Start Entity ID's at 1 @@ -7,10 +7,10 @@ DataWatchers that store Entity ID's treat 0 as special, and can break things such as Elytra Fireworks. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 68b4a902e..ce33cd5b8 100644 +index f5e66aaf90..7b07fe1990 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -91,7 +91,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -92,7 +92,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke private static final List a = Collections.emptyList(); private static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); private static double c = 1.0D; diff --git a/Spigot-Server-Patches/0323-Implement-Expanded-ArmorStand-API.patch b/Spigot-Server-Patches/0318-Implement-Expanded-ArmorStand-API.patch similarity index 93% rename from Spigot-Server-Patches/0323-Implement-Expanded-ArmorStand-API.patch rename to Spigot-Server-Patches/0318-Implement-Expanded-ArmorStand-API.patch index f20b0bb167..bf8934d3ea 100644 --- a/Spigot-Server-Patches/0323-Implement-Expanded-ArmorStand-API.patch +++ b/Spigot-Server-Patches/0318-Implement-Expanded-ArmorStand-API.patch @@ -1,4 +1,4 @@ -From a519ebd148ad0aa865562e84a88203a0af8c7584 Mon Sep 17 00:00:00 2001 +From 7450cf5daad9de361e9b12a6a5c26bb9ddfae332 Mon Sep 17 00:00:00 2001 From: willies952002 Date: Thu, 26 Jul 2018 02:25:46 -0400 Subject: [PATCH] Implement Expanded ArmorStand API @@ -8,7 +8,7 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index e9a746f13..3b2b94d8c 100644 +index 6628af7778..7647311dfd 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -36,7 +36,7 @@ public class EntityArmorStand extends EntityLiving { @@ -20,16 +20,16 @@ index e9a746f13..3b2b94d8c 100644 private boolean bI; public Vector3f headPose; public Vector3f bodyPose; -@@ -362,6 +362,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -364,6 +364,7 @@ public class EntityArmorStand extends EntityLiving { return enumitemslot; } + public boolean isSlotDisabled(EnumItemSlot slot) { return this.c(slot); } // Paper - OBFHELPER - private boolean c(EnumItemSlot enumitemslot) { - return (this.bH & 1 << enumitemslot.c()) != 0; + public boolean c(EnumItemSlot enumitemslot) { + return (this.bH & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms(); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 124c3185b..9f5c3b92e 100644 +index 124c3185bc..9f5c3b92e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java @@ -30,11 +30,13 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { diff --git a/Spigot-Server-Patches/0324-AnvilDamageEvent.patch b/Spigot-Server-Patches/0319-AnvilDamageEvent.patch similarity index 89% rename from Spigot-Server-Patches/0324-AnvilDamageEvent.patch rename to Spigot-Server-Patches/0319-AnvilDamageEvent.patch index c9d1a77fe1..e3e6868250 100644 --- a/Spigot-Server-Patches/0324-AnvilDamageEvent.patch +++ b/Spigot-Server-Patches/0319-AnvilDamageEvent.patch @@ -1,16 +1,16 @@ -From de37067ca509b2e45d2aaefb6c72f589b5240cd3 Mon Sep 17 00:00:00 2001 +From f5e36a5efb5e916787352dc928206fb436e943cf Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 20 Jul 2018 23:37:03 -0500 Subject: [PATCH] AnvilDamageEvent diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java -index fb3413d81..3b23ef986 100644 +index f2e15fa545..96fcd35bfe 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvil.java +++ b/src/main/java/net/minecraft/server/ContainerAnvil.java @@ -73,6 +73,16 @@ public class ContainerAnvil extends Container { if (!world.isClientSide) { - if (!entityhuman.abilities.canInstantlyBuild && iblockdata.a(TagsBlock.y) && entityhuman.getRandom().nextFloat() < 0.12F) { + if (!entityhuman.abilities.canInstantlyBuild && iblockdata.a(TagsBlock.ANVIL) && entityhuman.getRandom().nextFloat() < 0.12F) { IBlockData iblockdata1 = BlockAnvil.a_(iblockdata); + // Paper start + com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), iblockdata1 != null ? org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1) : null); diff --git a/Spigot-Server-Patches/0325-World-EntityHuman-Lookup-Optimizations.patch b/Spigot-Server-Patches/0320-World-EntityHuman-Lookup-Optimizations.patch similarity index 70% rename from Spigot-Server-Patches/0325-World-EntityHuman-Lookup-Optimizations.patch rename to Spigot-Server-Patches/0320-World-EntityHuman-Lookup-Optimizations.patch index b6712f74cd..f1d6d0252f 100644 --- a/Spigot-Server-Patches/0325-World-EntityHuman-Lookup-Optimizations.patch +++ b/Spigot-Server-Patches/0320-World-EntityHuman-Lookup-Optimizations.patch @@ -1,22 +1,22 @@ -From 75d4f66b13ee5467d0726fa0497069072c3cee0c Mon Sep 17 00:00:00 2001 +From 3d8f1b41f66faf392991e817b0954bc7d5841738 Mon Sep 17 00:00:00 2001 From: willies952002 Date: Mon, 30 Jul 2018 02:42:49 -0400 Subject: [PATCH] World EntityHuman Lookup Optimizations diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 82f4f00a7..b0053e5e6 100644 +index 255829b0b5..26007862ab 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -79,6 +79,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -81,6 +81,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc private final List c = Lists.newArrayList(); - private final Set tileEntityListUnload = Sets.newHashSet(); // Paper + private final Set tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper public final List players = Lists.newArrayList(); + public final Map playersByName = Maps.newHashMap(); // Paper - World EntityHuman Lookup Optimizations public final List k = Lists.newArrayList(); protected final IntHashMap entitiesById = new IntHashMap(); - private final long G = 16777215L; -@@ -1062,6 +1063,8 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + private final long F = 16777215L; +@@ -1082,6 +1083,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc EntityHuman entityhuman = (EntityHuman) entity; this.players.add(entityhuman); @@ -25,15 +25,15 @@ index 82f4f00a7..b0053e5e6 100644 this.everyoneSleeping(); } -@@ -1104,6 +1107,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1124,6 +1127,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.die(); if (entity instanceof EntityHuman) { this.players.remove(entity); + this.playersByName.remove(entity.getName()); // Paper - World EntityHuman Lookup Optimizations // Spigot start - for ( Object o : worldMaps.d ) + for ( WorldPersistentData worldData : worldMaps.a.values() ) { -@@ -1134,6 +1138,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1157,6 +1161,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.die(); if (entity instanceof EntityHuman) { this.players.remove(entity); @@ -41,7 +41,7 @@ index 82f4f00a7..b0053e5e6 100644 this.everyoneSleeping(); } -@@ -2662,6 +2667,8 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2706,6 +2711,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @Nullable public EntityHuman a(String s) { @@ -50,7 +50,7 @@ index 82f4f00a7..b0053e5e6 100644 for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -@@ -2671,10 +2678,15 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2715,10 +2722,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } return null; @@ -66,7 +66,7 @@ index 82f4f00a7..b0053e5e6 100644 for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -@@ -2684,6 +2696,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -2728,6 +2740,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } return null; diff --git a/Spigot-Server-Patches/0326-Add-TNTPrimeEvent.patch b/Spigot-Server-Patches/0321-Add-TNTPrimeEvent.patch similarity index 78% rename from Spigot-Server-Patches/0326-Add-TNTPrimeEvent.patch rename to Spigot-Server-Patches/0321-Add-TNTPrimeEvent.patch index c876f9a93b..d2189b3735 100644 --- a/Spigot-Server-Patches/0326-Add-TNTPrimeEvent.patch +++ b/Spigot-Server-Patches/0321-Add-TNTPrimeEvent.patch @@ -1,11 +1,11 @@ -From fb461afc173ce4cfab4a85a5fb3f9b0ba222d778 Mon Sep 17 00:00:00 2001 +From 9227efe8d5f87f4f0fb0e99a16833f62531808dc Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Mon, 16 Jul 2018 00:05:05 +0300 Subject: [PATCH] Add TNTPrimeEvent diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java -index 25a8a1afd..108006d58 100644 +index 24573b4704..ea428e2daf 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -16,7 +16,7 @@ index 25a8a1afd..108006d58 100644 import java.util.Map; import java.util.Random; import java.util.Map.Entry; -@@ -234,12 +235,18 @@ public class BlockFire extends Block { +@@ -234,12 +235,19 @@ public class BlockFire extends Block { world.setTypeAndData(blockposition, (IBlockData) this.a((IBlockAccess) world, blockposition).set(BlockFire.AGE, Integer.valueOf(l)), 3); } else { @@ -28,16 +28,17 @@ index 25a8a1afd..108006d58 100644 if (block instanceof BlockTNT) { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); -+ if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.FIRE, null).callEvent()) ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition); ++ if (!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.FIRE, null).callEvent()) { + return; ++ } + world.setAir(blockposition); // setair after non cancelled event, it would usually be air by now + // Paper end ((BlockTNT) block).a(world, blockposition); } } diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java -index 0c48a0cfe..c3eeee263 100644 +index 81c5b60ea1..5fddb29612 100644 --- a/src/main/java/net/minecraft/server/BlockTNT.java +++ b/src/main/java/net/minecraft/server/BlockTNT.java @@ -1,6 +1,7 @@ @@ -48,36 +49,36 @@ index 0c48a0cfe..c3eeee263 100644 public class BlockTNT extends Block { -@@ -11,6 +12,11 @@ public class BlockTNT extends Block { +@@ -14,6 +15,11 @@ public class BlockTNT extends Block { public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1) { if (iblockdata1.getBlock() != iblockdata.getBlock()) { if (world.isBlockIndirectlyPowered(blockposition)) { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition);; + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.REDSTONE, null).callEvent()) + return; + // Paper end this.a(world, blockposition); world.setAir(blockposition); } -@@ -20,6 +26,11 @@ public class BlockTNT extends Block { +@@ -23,6 +29,11 @@ public class BlockTNT extends Block { public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (world.isBlockIndirectlyPowered(blockposition)) { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition);; + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.REDSTONE, null).callEvent()) + return; + // Paper end this.a(world, blockposition); world.setAir(blockposition); } -@@ -28,6 +39,12 @@ public class BlockTNT extends Block { +@@ -45,6 +56,12 @@ public class BlockTNT extends Block { public void wasExploded(World world, BlockPosition blockposition, Explosion explosion) { if (!world.isClientSide) { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition);; + org.bukkit.entity.Entity source = explosion.source != null ? explosion.source.bukkitEntity : null; + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.EXPLOSION, source).callEvent()) + return; @@ -85,32 +86,33 @@ index 0c48a0cfe..c3eeee263 100644 EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource()); entitytntprimed.setFuseTicks((short) (world.random.nextInt(entitytntprimed.getFuseTicks() / 4) + entitytntprimed.getFuseTicks() / 8)); -@@ -55,6 +72,11 @@ public class BlockTNT extends Block { +@@ -72,6 +89,11 @@ public class BlockTNT extends Block { if (item != Items.FLINT_AND_STEEL && item != Items.FIRE_CHARGE) { return super.interact(iblockdata, world, blockposition, entityhuman, enumhand, enumdirection, f, f1, f2); } else { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition); + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.ITEM, entityhuman.bukkitEntity).callEvent()) + return true; + // Paper end this.a(world, blockposition, (EntityLiving) entityhuman); world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 11); if (item == Items.FLINT_AND_STEEL) { -@@ -77,6 +99,11 @@ public class BlockTNT extends Block { +@@ -95,6 +117,12 @@ public class BlockTNT extends Block { return; } // CraftBukkit end + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); -+ if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.PROJECTILE, entityarrow.bukkitEntity).callEvent()) ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition); ++ if (!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.PROJECTILE, entityarrow.bukkitEntity).callEvent()) { + return; ++ } + // Paper end - this.a(world, blockposition, entityarrow.shooter instanceof EntityLiving ? (EntityLiving) entityarrow.shooter : null); + this.a(world, blockposition, entity1 instanceof EntityLiving ? (EntityLiving) entity1 : null); world.setAir(blockposition); } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index d8ab87e21..d5e2a0251 100644 +index 2c735a920d..74d96a2f09 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -9,6 +9,7 @@ import org.apache.logging.log4j.Logger; diff --git a/Spigot-Server-Patches/0327-Break-up-and-make-tab-spam-limits-configurable.patch b/Spigot-Server-Patches/0322-Break-up-and-make-tab-spam-limits-configurable.patch similarity index 92% rename from Spigot-Server-Patches/0327-Break-up-and-make-tab-spam-limits-configurable.patch rename to Spigot-Server-Patches/0322-Break-up-and-make-tab-spam-limits-configurable.patch index f299ae2bed..17a8e6be32 100644 --- a/Spigot-Server-Patches/0327-Break-up-and-make-tab-spam-limits-configurable.patch +++ b/Spigot-Server-Patches/0322-Break-up-and-make-tab-spam-limits-configurable.patch @@ -1,4 +1,4 @@ -From 7d712b29921683cae6cd092b79c8755be117c923 Mon Sep 17 00:00:00 2001 +From f82212d687248903ef0e0b2ec58013f9c3c5b7ee Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 29 Jul 2018 05:02:15 +0100 Subject: [PATCH] Break up and make tab spam limits configurable @@ -22,7 +22,7 @@ to take the burden of this into their own hand without having to rely on plugins doing unsafe things. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index c457d0711..046bf33f6 100644 +index c457d07110..046bf33f66 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -327,4 +327,18 @@ public class PaperConfig { @@ -45,10 +45,10 @@ index c457d0711..046bf33f6 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index f7401f5c9..6ebc0a95e 100644 +index 66e01b8131..b7949ac256 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -75,6 +75,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -77,6 +77,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { // CraftBukkit start - multithreaded fields private volatile int chatThrottle; private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); @@ -56,7 +56,7 @@ index f7401f5c9..6ebc0a95e 100644 // CraftBukkit end private int j; private final IntHashMap k = new IntHashMap(); -@@ -204,6 +205,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -206,6 +207,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { this.minecraftServer.methodProfiler.e(); // CraftBukkit start for (int spam; (spam = this.chatThrottle) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1); ) ; @@ -64,7 +64,7 @@ index f7401f5c9..6ebc0a95e 100644 /* Use thread-safe field access instead if (this.chatThrottle > 0) { --this.chatThrottle; -@@ -506,7 +508,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -508,7 +510,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { public void a(PacketPlayInTabComplete packetplayintabcomplete) { // PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async // CraftBukkit start diff --git a/Spigot-Server-Patches/0328-Make-portal-teleportation-adjustment-math-more-accur.patch b/Spigot-Server-Patches/0323-Make-portal-teleportation-adjustment-math-more-accur.patch similarity index 95% rename from Spigot-Server-Patches/0328-Make-portal-teleportation-adjustment-math-more-accur.patch rename to Spigot-Server-Patches/0323-Make-portal-teleportation-adjustment-math-more-accur.patch index 86785cf397..a699239123 100644 --- a/Spigot-Server-Patches/0328-Make-portal-teleportation-adjustment-math-more-accur.patch +++ b/Spigot-Server-Patches/0323-Make-portal-teleportation-adjustment-math-more-accur.patch @@ -1,11 +1,11 @@ -From 609a84e34e2803bc1cd1695dc985cc052b78d999 Mon Sep 17 00:00:00 2001 +From 00e6ceab7ffd6294c820ac08362954f8e9774078 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 31 Jul 2018 19:32:57 -0500 Subject: [PATCH] Make portal teleportation adjustment math more accurate diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 854ad49b6..3ee310a9a 100644 +index 854ad49b6c..3ee310a9aa 100644 --- a/src/main/java/net/minecraft/server/EnumDirection.java +++ b/src/main/java/net/minecraft/server/EnumDirection.java @@ -85,6 +85,7 @@ public enum EnumDirection implements INamable { @@ -33,7 +33,7 @@ index 854ad49b6..3ee310a9a 100644 return this.c; } diff --git a/src/main/java/net/minecraft/server/MathHelper.java b/src/main/java/net/minecraft/server/MathHelper.java -index f52b9c6f0..3adbfb820 100644 +index 5329102dd7..2e5b89af82 100644 --- a/src/main/java/net/minecraft/server/MathHelper.java +++ b/src/main/java/net/minecraft/server/MathHelper.java @@ -82,6 +82,7 @@ public class MathHelper { @@ -45,7 +45,7 @@ index f52b9c6f0..3adbfb820 100644 return d0 < d1 ? d1 : (d0 > d2 ? d2 : d0); } diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index 72b85bf60..67938e39c 100644 +index 20f2a9197c..fd372103be 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -208,11 +208,27 @@ public class PortalTravelAgent { @@ -79,7 +79,7 @@ index 72b85bf60..67938e39c 100644 float f1 = 0.0F; float f2 = 0.0F; diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java -index 3faf74a22..4e1f8c211 100644 +index 3faf74a22f..4e1f8c211d 100644 --- a/src/main/java/net/minecraft/server/ShapeDetector.java +++ b/src/main/java/net/minecraft/server/ShapeDetector.java @@ -140,6 +140,7 @@ public class ShapeDetector { diff --git a/Spigot-Server-Patches/0329-Add-hand-to-bucket-events.patch b/Spigot-Server-Patches/0324-Add-hand-to-bucket-events.patch similarity index 94% rename from Spigot-Server-Patches/0329-Add-hand-to-bucket-events.patch rename to Spigot-Server-Patches/0324-Add-hand-to-bucket-events.patch index 08e88384a9..da27029a22 100644 --- a/Spigot-Server-Patches/0329-Add-hand-to-bucket-events.patch +++ b/Spigot-Server-Patches/0324-Add-hand-to-bucket-events.patch @@ -1,11 +1,11 @@ -From b6e21438024c2fecf60c11b928939450135483c5 Mon Sep 17 00:00:00 2001 +From 6d8e6a49a7721155163e3b0639970957d5f46899 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Thu, 2 Aug 2018 08:44:35 -0500 Subject: [PATCH] Add hand to bucket events diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index b2010ffa6..3493c4c44 100644 +index 5f4f107d5a..b2e50f8532 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java @@ -65,7 +65,7 @@ public class EntityCow extends EntityAnimal { @@ -18,10 +18,10 @@ index b2010ffa6..3493c4c44 100644 if (event.isCancelled()) { return false; diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java -index 2c36c3990..b38ee2853 100644 +index b63da71512..b0dd30dd12 100644 --- a/src/main/java/net/minecraft/server/ItemBucket.java +++ b/src/main/java/net/minecraft/server/ItemBucket.java -@@ -37,7 +37,7 @@ public class ItemBucket extends Item { +@@ -35,7 +35,7 @@ public class ItemBucket extends Item { if (iblockdata.getBlock() instanceof IFluidSource) { // CraftBukkit start FluidType dummyFluid = ((IFluidSource) iblockdata.getBlock()).a(DummyGeneratorAccess.INSTANCE, blockposition, iblockdata); @@ -30,7 +30,7 @@ index 2c36c3990..b38ee2853 100644 if (event.isCancelled()) { return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack); -@@ -63,7 +63,7 @@ public class ItemBucket extends Item { +@@ -61,7 +61,7 @@ public class ItemBucket extends Item { iblockdata = world.getType(blockposition); BlockPosition blockposition1 = this.a(iblockdata, blockposition, movingobjectposition); @@ -50,14 +50,14 @@ index 2c36c3990..b38ee2853 100644 + public boolean a(EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPosition movingobjectposition, EnumDirection enumdirection, BlockPosition clicked, ItemStack itemstack, EnumHand enumhand) { + // Paper end // CraftBukkit end - if (!(this.a instanceof FluidTypeFlowing)) { + if (!(this.fluidType instanceof FluidTypeFlowing)) { return false; @@ -127,11 +133,11 @@ public class ItemBucket extends Item { boolean flag1 = material.isReplaceable(); - if (!world.isEmpty(blockposition) && !flag && !flag1 && (!(iblockdata.getBlock() instanceof IFluidContainer) || !((IFluidContainer) iblockdata.getBlock()).a((IBlockAccess) world, blockposition, iblockdata, this.a))) { + if (!world.isEmpty(blockposition) && !flag && !flag1 && (!(iblockdata.getBlock() instanceof IFluidContainer) || !((IFluidContainer) iblockdata.getBlock()).canPlace(world, blockposition, iblockdata, this.fluidType))) { - return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null, enumdirection, clicked, itemstack); // CraftBukkit -+ return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumHand ++ return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumhand } else { // CraftBukkit start if (entityhuman != null) { @@ -67,7 +67,7 @@ index 2c36c3990..b38ee2853 100644 ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity // TODO: inventory not updated diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 140ddae0d..9037a1233 100644 +index 1f3774c249..e0a012a82b 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -168,6 +168,20 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/0330-MC-135506-Experience-should-save-as-Integers.patch b/Spigot-Server-Patches/0325-MC-135506-Experience-should-save-as-Integers.patch similarity index 92% rename from Spigot-Server-Patches/0330-MC-135506-Experience-should-save-as-Integers.patch rename to Spigot-Server-Patches/0325-MC-135506-Experience-should-save-as-Integers.patch index 2e92b45c14..9bcf24f7b4 100644 --- a/Spigot-Server-Patches/0330-MC-135506-Experience-should-save-as-Integers.patch +++ b/Spigot-Server-Patches/0325-MC-135506-Experience-should-save-as-Integers.patch @@ -1,11 +1,11 @@ -From 74402109b3a2465c23b7f0d01973a1e7d5e92ca9 Mon Sep 17 00:00:00 2001 +From 653015c30b67e491a1472ccac1a88a0fedf26eb1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 3 Aug 2018 00:04:54 -0400 Subject: [PATCH] MC-135506: Experience should save as Integers diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index b8bfc7577..13299ad10 100644 +index 53cfc10017..904c6e1a7d 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -205,14 +205,14 @@ public class EntityExperienceOrb extends Entity { diff --git a/Spigot-Server-Patches/0331-Entity-add-to-world-fixes.patch b/Spigot-Server-Patches/0326-Entity-add-to-world-fixes.patch similarity index 67% rename from Spigot-Server-Patches/0331-Entity-add-to-world-fixes.patch rename to Spigot-Server-Patches/0326-Entity-add-to-world-fixes.patch index 1b5be8c2bf..45c50c7e61 100644 --- a/Spigot-Server-Patches/0331-Entity-add-to-world-fixes.patch +++ b/Spigot-Server-Patches/0326-Entity-add-to-world-fixes.patch @@ -1,4 +1,4 @@ -From c2f6872c419c0bab2865724c87b1badc9ee59ef5 Mon Sep 17 00:00:00 2001 +From 9dc4ad8cef4b26e7d210716d9c96fb367193b6b6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 3 Aug 2018 22:47:46 -0400 Subject: [PATCH] Entity add to world fixes @@ -14,37 +14,38 @@ Fix this by differing entity add to world for all entities at the same time the original entity is dead, overwrite it as the logic does for unloaod queued entities. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index bd31a7dcab..8b80830933 100644 +index 7b6b8f4824..eed37198b0 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -901,6 +901,7 @@ public class Chunk implements IChunkAccess { - this.world.b(this.tileEntities.values()); +@@ -898,6 +898,7 @@ public class Chunk implements IChunkAccess { + this.world.a(this.tileEntities.values()); List[] aentityslice = this.entitySlices; // Spigot int i = aentityslice.length; + List toAdd = new java.util.ArrayList<>(32); // Paper for (int j = 0; j < i; ++j) { List entityslice = aentityslice[j]; // Spigot -@@ -948,10 +949,12 @@ public class Chunk implements IChunkAccess { +@@ -945,12 +946,11 @@ public class Chunk implements IChunkAccess { thisChunk.put(entity.uniqueID, entity); } } - // Paper end -- this.world.a((Collection) entityslice); -+ //this.world.a((Collection) entityslice); // Move down, add all entities at same time +- this.world.a(entityslice.stream().filter((entity) -> { +- return !(entity instanceof EntityHuman); +- })); + toAdd.addAll(entityslice); + // Paper end } -+ this.world.addChunkEntities(toAdd); // Paper - add all at same time to avoid entities adding to world modifying slice state ++ this.world.addChunkEntities(toAdd.stream().filter((entity) -> !(entity instanceof EntityHuman))); // Paper - add all at same time to avoid entities adding to world modifying slice state // CraftBukkit start org.bukkit.Server server = this.world.getServer(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b0053e5e63..004c3ec474 100644 +index 26007862ab..4ea31bc201 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1069,6 +1069,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1089,6 +1089,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } this.getChunkAt(i, j).a(entity); @@ -52,28 +53,25 @@ index b0053e5e63..004c3ec474 100644 this.entityList.add(entity); this.b(entity); return true; -@@ -2463,6 +2464,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - return i; +@@ -2494,9 +2495,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + return j; } -+ public void addChunkEntities(Collection collection) { a(collection); } // Paper - OBFHELPER - public void a(Collection collection) { ++ public void addChunkEntities(Stream collection) { a(collection); } // Paper - OBFHELPER + public void a(Stream stream) { org.spigotmc.AsyncCatcher.catchOp( "entity world add"); // Spigot - // CraftBukkit start -@@ -2472,7 +2474,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - while (iterator.hasNext()) { - Entity entity = (Entity) iterator.next(); - -- if (entity == null) { + stream.forEach((entity) -> { + if (entity == null || entity.dead || entity.valid) { // Paper - prevent adding already added or dead entities - continue; - } ++ return; ++ } this.entityList.add(entity); + this.b(entity); + }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 6b5b2c8258..f5911fbf08 100644 +index 6579387623..788ab40d0e 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -992,7 +992,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -987,7 +987,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (this.entitiesByUUID.containsKey(uuid)) { Entity entity1 = (Entity) this.entitiesByUUID.get(uuid); diff --git a/Spigot-Server-Patches/0332-Fix-client-rendering-skulls-from-same-user.patch b/Spigot-Server-Patches/0327-Fix-client-rendering-skulls-from-same-user.patch similarity index 91% rename from Spigot-Server-Patches/0332-Fix-client-rendering-skulls-from-same-user.patch rename to Spigot-Server-Patches/0327-Fix-client-rendering-skulls-from-same-user.patch index 8d3f16844a..5e9e0cd251 100644 --- a/Spigot-Server-Patches/0332-Fix-client-rendering-skulls-from-same-user.patch +++ b/Spigot-Server-Patches/0327-Fix-client-rendering-skulls-from-same-user.patch @@ -1,4 +1,4 @@ -From 3fdfd99ebcc2cac066c31c9fdce78f10675898e0 Mon Sep 17 00:00:00 2001 +From 8791766f99dac3a0544b3da3a695b80bafceb1b9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 22 Nov 2016 00:40:42 -0500 Subject: [PATCH] Fix client rendering skulls from same user @@ -12,7 +12,7 @@ This allows the client to render multiple skull textures from the same user, for when different skins were used when skull was made. diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index e52014fd8..da11ec167 100644 +index a238388012..9326eaa2a9 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -44,7 +44,7 @@ public final class ItemStack { @@ -25,7 +25,7 @@ index e52014fd8..da11ec167 100644 private EntityItemFrame i; private ShapeDetectorBlock j; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index d04afceb7..b0e8ffc4b 100644 +index a63a5811d6..cab8374832 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -252,6 +252,15 @@ public class PacketDataSerializer extends ByteBuf { @@ -62,7 +62,7 @@ index d04afceb7..b0e8ffc4b 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 1aa36156a..c5f0b8530 100644 +index 33436ac65b..6321010246 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -38,6 +38,7 @@ public class PacketPlayOutMapChunk implements Packet { @@ -77,16 +77,16 @@ index 1aa36156a..c5f0b8530 100644 BiomeBase[] abiomebase = chunk.getBiomeIndex(); for (l = 0; l < abiomebase.length; ++l) { -- packetdataserializer.writeInt(BiomeBase.REGISTRY_ID.a((Object) abiomebase[l])); -+ packetdataserializer.writeInt(BiomeBase.REGISTRY_ID.a(abiomebase[l])); // Paper - decompile fix +- packetdataserializer.writeInt(IRegistry.BIOME.a((Object) abiomebase[l])); ++ packetdataserializer.writeInt(IRegistry.BIOME.a(abiomebase[l])); // Paper - decompile fix } } diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index 85fd8dab6..16a5537ce 100644 +index e59f3c21d7..05fca47f34 100644 --- a/src/main/java/net/minecraft/server/TileEntitySkull.java +++ b/src/main/java/net/minecraft/server/TileEntitySkull.java -@@ -143,9 +143,37 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa +@@ -142,9 +142,37 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa return this.a; } @@ -126,5 +126,5 @@ index 85fd8dab6..16a5537ce 100644 public NBTTagCompound aa_() { -- -2.14.1.windows.1 +2.18.0 diff --git a/Spigot-Server-Patches/0333-Add-Early-Warning-Feature-to-WatchDog.patch b/Spigot-Server-Patches/0328-Add-Early-Warning-Feature-to-WatchDog.patch similarity index 93% rename from Spigot-Server-Patches/0333-Add-Early-Warning-Feature-to-WatchDog.patch rename to Spigot-Server-Patches/0328-Add-Early-Warning-Feature-to-WatchDog.patch index 79e2720abb..b2559b4cc9 100644 --- a/Spigot-Server-Patches/0333-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/Spigot-Server-Patches/0328-Add-Early-Warning-Feature-to-WatchDog.patch @@ -1,4 +1,4 @@ -From 57634937a40e3d655037eb5f2115d855d756221b Mon Sep 17 00:00:00 2001 +From d4c5e43320dbff2bf15ef805d550dcdbaf078273 Mon Sep 17 00:00:00 2001 From: miclebrick Date: Wed, 8 Aug 2018 15:30:52 -0400 Subject: [PATCH] Add Early Warning Feature to WatchDog @@ -9,7 +9,7 @@ thread dumps at an interval until the point of crash. This will help diagnose what was going on in that time before the crash. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 046bf33f6..b23d45f7d 100644 +index 046bf33f66..b23d45f7df 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -24,6 +24,8 @@ import org.bukkit.configuration.InvalidConfigurationException; @@ -37,19 +37,19 @@ index 046bf33f6..b23d45f7d 100644 public static int tabSpamLimit = 500; private static void tabSpamLimiters() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 74c97b5db..5fdd65b08 100644 +index 76e6b233b1..24e8b5ed14 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -768,6 +768,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.a(this.n); +@@ -788,6 +788,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + this.a(this.m); // Spigot start + org.spigotmc.WatchdogThread.hasStarted = true; // Paper Arrays.fill( recentTps, 20 ); - long start = System.nanoTime(), lastTick = start - TICK_TIME, catchupTime = 0, curTime, wait, tickSection = start; // Paper - Further improve server tick loop - while (this.isRunning) { + long start = System.nanoTime(), curTime, wait, tickSection = start; // Paper - Further improve server tick loop + lastTick = start - TICK_TIME; // Paper diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 4ac0ab997..0c45d75ad 100644 +index eed96c60c5..496c5cbdff 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -226,7 +226,7 @@ public class SpigotConfig @@ -62,7 +62,7 @@ index 4ac0ab997..0c45d75ad 100644 public static boolean bungee; diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 57a4748a3..19df383e0 100644 +index 57a4748a30..19df383e06 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -5,6 +5,7 @@ import java.lang.management.MonitorInfo; diff --git a/Spigot-Server-Patches/0334-Make-EnderDragon-implement-Mob.patch b/Spigot-Server-Patches/0329-Make-EnderDragon-implement-Mob.patch similarity index 93% rename from Spigot-Server-Patches/0334-Make-EnderDragon-implement-Mob.patch rename to Spigot-Server-Patches/0329-Make-EnderDragon-implement-Mob.patch index c511d03617..87f74cdf09 100644 --- a/Spigot-Server-Patches/0334-Make-EnderDragon-implement-Mob.patch +++ b/Spigot-Server-Patches/0329-Make-EnderDragon-implement-Mob.patch @@ -1,11 +1,11 @@ -From bd078ea2b755e78c6c7830d4be134225354c80cc Mon Sep 17 00:00:00 2001 +From 4828bc789a5e2bc611a4326fda55a39d2d8753a1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 10 Aug 2018 22:11:49 -0400 Subject: [PATCH] Make EnderDragon implement Mob diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java -index cc115cc36..4947249da 100644 +index cc115cc368..4947249da2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java @@ -1,17 +1,18 @@ diff --git a/Spigot-Server-Patches/0335-Detect-and-repair-corrupt-Region-Files.patch b/Spigot-Server-Patches/0330-Detect-and-repair-corrupt-Region-Files.patch similarity index 94% rename from Spigot-Server-Patches/0335-Detect-and-repair-corrupt-Region-Files.patch rename to Spigot-Server-Patches/0330-Detect-and-repair-corrupt-Region-Files.patch index d70f81ca4c..170565bce4 100644 --- a/Spigot-Server-Patches/0335-Detect-and-repair-corrupt-Region-Files.patch +++ b/Spigot-Server-Patches/0330-Detect-and-repair-corrupt-Region-Files.patch @@ -1,4 +1,4 @@ -From 8873bfb4859720886eccaa3b3b4c929249a9a68f Mon Sep 17 00:00:00 2001 +From af0e968ff12e7722492e40654510e740fbaa2652 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 11 Aug 2018 00:49:20 -0400 Subject: [PATCH] Detect and repair corrupt Region Files @@ -11,7 +11,7 @@ I don't know why mojang only checks for 4096, when anything less than 8192 is a But to be safe, it will attempt to back up the file. diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index cba237312..070392233 100644 +index cba2373125..0703922332 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -41,7 +41,20 @@ public class RegionFile { diff --git a/Spigot-Server-Patches/0336-Use-ConcurrentHashMap-in-JsonList.patch b/Spigot-Server-Patches/0331-Use-ConcurrentHashMap-in-JsonList.patch similarity index 97% rename from Spigot-Server-Patches/0336-Use-ConcurrentHashMap-in-JsonList.patch rename to Spigot-Server-Patches/0331-Use-ConcurrentHashMap-in-JsonList.patch index b7bdffc0cd..4e03c6dca6 100644 --- a/Spigot-Server-Patches/0336-Use-ConcurrentHashMap-in-JsonList.patch +++ b/Spigot-Server-Patches/0331-Use-ConcurrentHashMap-in-JsonList.patch @@ -1,4 +1,4 @@ -From 14c3fc13ab5d20894148bdf85a6eb21fefe908db Mon Sep 17 00:00:00 2001 +From 834bc0ee635f4f0a3bc44e22c3865a91bb3985cf Mon Sep 17 00:00:00 2001 From: egg82 Date: Tue, 7 Aug 2018 01:24:23 -0600 Subject: [PATCH] Use ConcurrentHashMap in JsonList @@ -25,7 +25,7 @@ The point of this is readability, but does have a side-benefit of a small microp Finally, added a couple obfhelpers for the modified code diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java -index 6700e68c0..a2815b91f 100644 +index 6700e68c06..a2815b91fd 100644 --- a/src/main/java/net/minecraft/server/JsonList.java +++ b/src/main/java/net/minecraft/server/JsonList.java @@ -36,7 +36,8 @@ public class JsonList> { diff --git a/Spigot-Server-Patches/0337-Use-a-Queue-for-Queueing-Commands.patch b/Spigot-Server-Patches/0332-Use-a-Queue-for-Queueing-Commands.patch similarity index 86% rename from Spigot-Server-Patches/0337-Use-a-Queue-for-Queueing-Commands.patch rename to Spigot-Server-Patches/0332-Use-a-Queue-for-Queueing-Commands.patch index 39d275dd55..f8843a40f8 100644 --- a/Spigot-Server-Patches/0337-Use-a-Queue-for-Queueing-Commands.patch +++ b/Spigot-Server-Patches/0332-Use-a-Queue-for-Queueing-Commands.patch @@ -1,4 +1,4 @@ -From 4653eb3c1d85d35db694fb5e0ec08ccc5d1d4bef Mon Sep 17 00:00:00 2001 +From f1fdb755227722e5cb406941e482ad07dcc8f994 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 12 Aug 2018 02:33:39 -0400 Subject: [PATCH] Use a Queue for Queueing Commands @@ -6,21 +6,21 @@ Subject: [PATCH] Use a Queue for Queueing Commands Lists are bad as Queues mmmkay. diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 8e15710ca..eae83ab9f 100644 +index c4e99ef2a9..98d3bad378 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -39,7 +39,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer private static final Logger LOGGER = LogManager.getLogger(); - private static final Pattern i = Pattern.compile("^[a-fA-F0-9]{40}$"); + private static final Pattern h = Pattern.compile("^[a-fA-F0-9]{40}$"); - private final List serverCommandQueue = Collections.synchronizedList(Lists.newArrayList()); // CraftBukkit - fix decompile error + private final java.util.Queue serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue<>(); // Paper - use a proper queue - private RemoteStatusListener k; + private RemoteStatusListener j; public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this); - private RemoteControlListener m; + private RemoteControlListener l; @@ -457,8 +457,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - public void aW() { + public void aU() { MinecraftTimings.serverCommandTimer.startTiming(); // Spigot - while (!this.serverCommandQueue.isEmpty()) { - ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); diff --git a/Spigot-Server-Patches/0338-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/Spigot-Server-Patches/0333-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch similarity index 92% rename from Spigot-Server-Patches/0338-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch rename to Spigot-Server-Patches/0333-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index cdd43995d8..af494d274e 100644 --- a/Spigot-Server-Patches/0338-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/Spigot-Server-Patches/0333-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -1,11 +1,11 @@ -From 9cb417dcd3c77e4104ea9628013560ec19ffe518 Mon Sep 17 00:00:00 2001 +From 31da49d27c56548c3381a2aeda3548d6f89e088a Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 15 Aug 2018 01:16:34 -0400 Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 0a47353b4..3238ca742 100644 +index 0a47353b48..3238ca7420 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -96,7 +96,12 @@ public class CraftChunk implements Chunk { diff --git a/Spigot-Server-Patches/0339-Pass-World-to-Tile-Entity-Snapshots.patch b/Spigot-Server-Patches/0334-Pass-World-to-Tile-Entity-Snapshots.patch similarity index 89% rename from Spigot-Server-Patches/0339-Pass-World-to-Tile-Entity-Snapshots.patch rename to Spigot-Server-Patches/0334-Pass-World-to-Tile-Entity-Snapshots.patch index 5e960ca571..1f8d921ce9 100644 --- a/Spigot-Server-Patches/0339-Pass-World-to-Tile-Entity-Snapshots.patch +++ b/Spigot-Server-Patches/0334-Pass-World-to-Tile-Entity-Snapshots.patch @@ -1,11 +1,11 @@ -From 7b82f52eaee912f0f66890193ac72a3634d2f6d6 Mon Sep 17 00:00:00 2001 +From e5409f10fa941e455b5b24dbf61405519dcc1ef1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 15 Aug 2018 01:19:04 -0400 Subject: [PATCH] Pass World to Tile Entity Snapshots diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -index d4d9c5fc5..a72bbdbed 100644 +index d4d9c5fc50..a72bbdbedb 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -50,7 +50,7 @@ public class CraftBlockEntityState extends CraftBlockState diff --git a/Spigot-Server-Patches/0341-Allow-disabling-armour-stand-ticking.patch b/Spigot-Server-Patches/0335-Allow-disabling-armour-stand-ticking.patch similarity index 84% rename from Spigot-Server-Patches/0341-Allow-disabling-armour-stand-ticking.patch rename to Spigot-Server-Patches/0335-Allow-disabling-armour-stand-ticking.patch index 0a1fbc880d..5077227ca1 100644 --- a/Spigot-Server-Patches/0341-Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-Server-Patches/0335-Allow-disabling-armour-stand-ticking.patch @@ -1,16 +1,16 @@ -From bf9011addc8b350feb0b7de1e019e8dbdf8ffabe Mon Sep 17 00:00:00 2001 +From 00c82216240081350df85a95ed50e9c6368029bc Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 15 Aug 2018 01:26:09 -0700 Subject: [PATCH] Allow disabling armour stand ticking diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 61c8b58b1..458baf444 100644 +index 58f87794d6..06c949ef06 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -483,4 +483,10 @@ public class PaperWorldConfig { - allowPermaChunkLoaders = getBoolean("game-mechanics.allow-permanent-chunk-loaders", allowPermaChunkLoaders); - log("Allow Perma Chunk Loaders: " + (allowPermaChunkLoaders ? "enabled" : "disabled")); +@@ -481,4 +481,10 @@ public class PaperWorldConfig { + break; + } } + + public boolean armorStandTick = true; @@ -20,7 +20,7 @@ index 61c8b58b1..458baf444 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 3b2b94d8c..7edeb9bb0 100644 +index 7647311dfd..35afffedef 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -45,6 +45,7 @@ public class EntityArmorStand extends EntityLiving { @@ -39,7 +39,7 @@ index 3b2b94d8c..7edeb9bb0 100644 this.setSize(0.5F, 1.975F); this.Q = 0.0F; } -@@ -554,6 +556,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -556,6 +558,7 @@ public class EntityArmorStand extends EntityLiving { } public void tick() { @@ -48,7 +48,7 @@ index 3b2b94d8c..7edeb9bb0 100644 Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.b); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 9f5c3b92e..07ce93f17 100644 +index 9f5c3b92e3..07ce93f17c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java @@ -297,5 +297,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { diff --git a/Spigot-Server-Patches/0342-Ensure-chunks-are-always-loaded-on-hard-position-set.patch b/Spigot-Server-Patches/0336-Ensure-chunks-are-always-loaded-on-hard-position-set.patch similarity index 87% rename from Spigot-Server-Patches/0342-Ensure-chunks-are-always-loaded-on-hard-position-set.patch rename to Spigot-Server-Patches/0336-Ensure-chunks-are-always-loaded-on-hard-position-set.patch index b283518d7a..da240f9315 100644 --- a/Spigot-Server-Patches/0342-Ensure-chunks-are-always-loaded-on-hard-position-set.patch +++ b/Spigot-Server-Patches/0336-Ensure-chunks-are-always-loaded-on-hard-position-set.patch @@ -1,4 +1,4 @@ -From 2ecc0414a79b9dc4e06d70a918ace76e8277f349 Mon Sep 17 00:00:00 2001 +From 5d6a52b580d179bcd59043c97967d4e500819a61 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 16 Aug 2018 17:36:41 -0400 Subject: [PATCH] Ensure chunks are always loaded on hard position sets @@ -17,10 +17,10 @@ guaranteeing that the entity will be properly registered into its new home comfortably. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ce33cd5b8..41a951d58 100644 +index 7b07fe1990..de34a70e9b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1367,6 +1367,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1364,6 +1364,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.lastYaw -= 360.0F; } diff --git a/Spigot-Server-Patches/0343-Optimize-BlockPosition-helper-methods.patch b/Spigot-Server-Patches/0337-Optimize-BlockPosition-helper-methods.patch similarity index 97% rename from Spigot-Server-Patches/0343-Optimize-BlockPosition-helper-methods.patch rename to Spigot-Server-Patches/0337-Optimize-BlockPosition-helper-methods.patch index 38392cea5d..2a98247cbe 100644 --- a/Spigot-Server-Patches/0343-Optimize-BlockPosition-helper-methods.patch +++ b/Spigot-Server-Patches/0337-Optimize-BlockPosition-helper-methods.patch @@ -1,4 +1,4 @@ -From 50228d68672ea49b571450b44a52b9603bf68242 Mon Sep 17 00:00:00 2001 +From 76e318afd422c05c58c4ba5e761ce6d7c8cb38c8 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Wed, 15 Aug 2018 12:05:12 -0700 Subject: [PATCH] Optimize BlockPosition helper methods @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize BlockPosition helper methods Resolves #1338 diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index f769b178c..bff8fcd47 100644 +index 936a49a3e8..7215056bd1 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -58,59 +58,96 @@ public class BlockPosition extends BaseBlockPosition { +@@ -59,59 +59,96 @@ public class BlockPosition extends BaseBlockPosition { } public BlockPosition up() { diff --git a/Spigot-Server-Patches/0344-Send-nearby-packets-from-world-player-list-not-serve.patch b/Spigot-Server-Patches/0338-Send-nearby-packets-from-world-player-list-not-serve.patch similarity index 87% rename from Spigot-Server-Patches/0344-Send-nearby-packets-from-world-player-list-not-serve.patch rename to Spigot-Server-Patches/0338-Send-nearby-packets-from-world-player-list-not-serve.patch index af6cc230f0..e1b2c10254 100644 --- a/Spigot-Server-Patches/0344-Send-nearby-packets-from-world-player-list-not-serve.patch +++ b/Spigot-Server-Patches/0338-Send-nearby-packets-from-world-player-list-not-serve.patch @@ -1,28 +1,28 @@ -From 1fd3e10ebd10b9df74b467451f1c81098e6f0e91 Mon Sep 17 00:00:00 2001 +From 7832ef53a12cd1129da407349dd935f12f05d1fb Mon Sep 17 00:00:00 2001 From: Mystiflow Date: Fri, 6 Jul 2018 13:21:30 +0100 Subject: [PATCH] Send nearby packets from world player list not server list diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 7a2b219c6..41c187084 100644 +index 6d511b6230..d8eb2e9864 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1207,8 +1207,25 @@ public abstract class PlayerList { +@@ -1201,8 +1201,25 @@ public abstract class PlayerList { } - public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, int i, Packet packet) { -- for (int j = 0; j < this.players.size(); ++j) { -- EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); + public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, DimensionManager dimensionmanager, Packet packet) { +- for (int i = 0; i < this.players.size(); ++i) { +- EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); + // Paper start - Use world list instead of server list where preferable -+ sendPacketNearby(entityhuman, d0, d1, d2, d3, i, null, packet); // Retained for compatibility ++ sendPacketNearby(entityhuman, d0, d1, d2, d3, dimensionmanager, null, packet); // Retained for compatibility + } + + public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, WorldServer world, Packet packet) { + sendPacketNearby(entityhuman, d0, d1, d2, d3, world.dimension, world, packet); + } + -+ public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, int i, @Nullable WorldServer world, Packet packet) { ++ public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, DimensionManager dimensionmanager, @Nullable WorldServer world, Packet packet) { + if (world == null && entityhuman != null && entityhuman.world instanceof WorldServer) { + world = (WorldServer) entityhuman.world; + } @@ -31,22 +31,22 @@ index 7a2b219c6..41c187084 100644 + for (int j = 0; j < players1.size(); ++j) { + EntityHuman entity = players1.get(j); + if (!(entity instanceof EntityPlayer)) continue; -+ EntityPlayer entityplayer = (EntityPlayer) players1.get(j); ++ EntityPlayer entityplayer = (EntityPlayer) entity; + // Paper end // CraftBukkit start - Test if player receiving packet can see the source of the packet if (entityhuman != null && entityhuman instanceof EntityPlayer && !entityplayer.getBukkitEntity().canSee(((EntityPlayer) entityhuman).getBukkitEntity())) { -@@ -1216,7 +1233,7 @@ public abstract class PlayerList { +@@ -1210,7 +1227,7 @@ public abstract class PlayerList { } // CraftBukkit end -- if (entityplayer != entityhuman && entityplayer.dimension == i) { -+ if (entityplayer != entityhuman && (world != null || entityplayer.dimension == i)) { // Paper +- if (entityplayer != entityhuman && entityplayer.dimension == dimensionmanager) { ++ if (entityplayer != entityhuman && (world != null || entityplayer.dimension == dimensionmanager)) { // Paper double d4 = d0 - entityplayer.locX; double d5 = d1 - entityplayer.locY; double d6 = d2 - entityplayer.locZ; diff --git a/src/main/java/net/minecraft/server/WorldManager.java b/src/main/java/net/minecraft/server/WorldManager.java -index e26405d34..23f390c22 100644 +index e26405d341..23f390c221 100644 --- a/src/main/java/net/minecraft/server/WorldManager.java +++ b/src/main/java/net/minecraft/server/WorldManager.java @@ -35,8 +35,8 @@ public class WorldManager implements IWorldAccess { @@ -95,10 +95,10 @@ index e26405d34..23f390c22 100644 if (entityplayer != null && entityplayer.world == this.world && entityplayer.getId() != i) { double d0 = (double) blockposition.getX() - entityplayer.locX; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f5911fbf0..377831cdf 100644 +index 788ab40d0e..1e30ba0548 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1087,7 +1087,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1082,7 +1082,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } // CraftBukkit end if (super.strikeLightning(entity)) { @@ -107,7 +107,7 @@ index f5911fbf0..377831cdf 100644 return true; } else { return false; -@@ -1147,8 +1147,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1142,8 +1142,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { BlockActionData blockactiondata = (BlockActionData) this.d.removeFirst(); if (this.a(blockactiondata)) { @@ -119,10 +119,10 @@ index f5911fbf0..377831cdf 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b09f0353a..aa0b1f5fa 100644 +index 80fd49b6e1..ba2e768594 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1519,7 +1519,7 @@ public class CraftWorld implements World { +@@ -1512,7 +1512,7 @@ public class CraftWorld implements World { double z = loc.getZ(); PacketPlayOutCustomSoundEffect packet = new PacketPlayOutCustomSoundEffect(new MinecraftKey(sound), SoundCategory.valueOf(category.name()), new Vec3D(x, y, z), volume, pitch); diff --git a/Spigot-Server-Patches/0345-Cache-World-Entity-Type-counts.patch b/Spigot-Server-Patches/0339-Cache-World-Entity-Type-counts.patch similarity index 85% rename from Spigot-Server-Patches/0345-Cache-World-Entity-Type-counts.patch rename to Spigot-Server-Patches/0339-Cache-World-Entity-Type-counts.patch index a5232d19de..c52b5cd2db 100644 --- a/Spigot-Server-Patches/0345-Cache-World-Entity-Type-counts.patch +++ b/Spigot-Server-Patches/0339-Cache-World-Entity-Type-counts.patch @@ -1,4 +1,4 @@ -From 6b1a04d156cb28c9c7c99de5dcb2c420936ebd0d Mon Sep 17 00:00:00 2001 +From 23a40a084921d02b074659229d6b03d7fd331700 Mon Sep 17 00:00:00 2001 From: Colin Godsey Date: Wed, 8 Aug 2018 10:10:06 -0600 Subject: [PATCH] Cache World Entity Type counts @@ -133,10 +133,10 @@ index 0000000000..35104542c5 + } +} diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 41a951d580..03d54a7ef4 100644 +index de34a70e9b..5e87ee9726 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -123,6 +123,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -124,6 +124,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke private boolean az; public boolean dead; public boolean shouldBeRemoved; // Paper @@ -145,7 +145,7 @@ index 41a951d580..03d54a7ef4 100644 public float length; public float J; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 903434e5f4..68765d2aad 100644 +index 4a8c3a428d..8f610c013a 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -614,6 +614,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -170,23 +170,23 @@ index 79e52f7bac..42f6a6a93a 100644 return this.e; } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index f525fd1b42..2f20dfcfcf 100644 +index 32808558bb..0a57b26551 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -113,7 +113,7 @@ public final class SpawnerCreature { - // CraftBukkit end +@@ -114,7 +114,7 @@ public final class SpawnerCreature { if ((!enumcreaturetype.c() || flag1) && (enumcreaturetype.c() || flag) && (!enumcreaturetype.d() || flag2)) { -- k = worldserver.a(enumcreaturetype.a()); -+ k = worldserver.entityList.getCreatureCount(enumcreaturetype); // Paper - entity count cache - int l1 = limit * i / b; // CraftBukkit - use per-world limits + k = limit * i / SpawnerCreature.b; // CraftBukkit - use per-world limits +- int l1 = worldserver.a(enumcreaturetype.a(), k); ++ int l1 = k = worldserver.entityList.getCreatureCount(enumcreaturetype); // Paper - entity count cache - if (k <= l1) { + if (l1 <= k) { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 004c3ec474..16d0c0d45b 100644 +index 4ea31bc201..abf3796d91 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -48,7 +48,8 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -50,7 +50,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc private static final EnumDirection[] a = EnumDirection.values(); private int b = 63; // Spigot start - guard entity list from removals @@ -196,15 +196,15 @@ index 004c3ec474..16d0c0d45b 100644 { @Override public Entity remove(int index) -@@ -72,6 +73,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -74,6 +75,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } }; + */ // Paper end // Spigot end - protected final Set g = Sets.newHashSet(); public Set getEntityUnloadQueue() { return g; };// Paper - OBFHELPER + protected final Set g = com.google.common.collect.Sets.newHashSet(); public Set getEntityUnloadQueue() { return g; };// Paper - OBFHELPER //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list -@@ -140,7 +142,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -143,7 +145,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper public final co.aikar.timings.WorldTimingsHandler timings; // Paper @@ -213,7 +213,7 @@ index 004c3ec474..16d0c0d45b 100644 public static boolean haveWeSilencedAPhysicsCrash; public static String blockLocation; private org.spigotmc.TickLimiter entityLimiter; -@@ -1151,6 +1153,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -1174,6 +1176,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.getChunkAt(i, j).b(entity); } entity.shouldBeRemoved = true; // Paper diff --git a/Spigot-Server-Patches/0340-Fix-NPE-Potential-in-CraftBanner.patch b/Spigot-Server-Patches/0340-Fix-NPE-Potential-in-CraftBanner.patch deleted file mode 100644 index 68d18e3085..0000000000 --- a/Spigot-Server-Patches/0340-Fix-NPE-Potential-in-CraftBanner.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 61cfeaadf39c294557e456dd4d5a0b1d7a165cb1 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 15 Aug 2018 08:46:20 -0400 -Subject: [PATCH] Fix NPE Potential in CraftBanner - - -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -index 4332a03a4..448832101 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -@@ -30,7 +30,7 @@ public class CraftBanner extends CraftBlockEntityState impleme - public void load(TileEntityBanner banner) { - super.load(banner); - -- base = DyeColor.getByWoolData((byte) banner.color.getColorIndex()); -+ base = banner.color != null ? DyeColor.getByWoolData((byte) banner.color.getColorIndex()) : null; // Paper - patterns = new ArrayList(); - - if (banner.patterns != null) { --- -2.18.0 - diff --git a/Spigot-Server-Patches/0346-Restore-vanlla-default-mob-spawn-range.patch b/Spigot-Server-Patches/0340-Restore-vanlla-default-mob-spawn-range.patch similarity index 92% rename from Spigot-Server-Patches/0346-Restore-vanlla-default-mob-spawn-range.patch rename to Spigot-Server-Patches/0340-Restore-vanlla-default-mob-spawn-range.patch index a4e33e5ee6..2a91fdc684 100644 --- a/Spigot-Server-Patches/0346-Restore-vanlla-default-mob-spawn-range.patch +++ b/Spigot-Server-Patches/0340-Restore-vanlla-default-mob-spawn-range.patch @@ -1,4 +1,4 @@ -From 30e2f287295313f6e643cfbd2297dd9795e59b22 Mon Sep 17 00:00:00 2001 +From e2792cb439fa463c11c4f2419034debd8a9019b5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 18 Aug 2018 12:43:16 -0400 Subject: [PATCH] Restore vanlla default mob-spawn-range diff --git a/Spigot-Server-Patches/0347-Optimize-Hoppers.patch b/Spigot-Server-Patches/0341-Optimize-Hoppers.patch similarity index 93% rename from Spigot-Server-Patches/0347-Optimize-Hoppers.patch rename to Spigot-Server-Patches/0341-Optimize-Hoppers.patch index b49881507a..5f6d6444c1 100644 --- a/Spigot-Server-Patches/0347-Optimize-Hoppers.patch +++ b/Spigot-Server-Patches/0341-Optimize-Hoppers.patch @@ -1,4 +1,4 @@ -From 7f3ca691279fafa7f54168bc9ac43b491196285b Mon Sep 17 00:00:00 2001 +From 96715633ee7969f4452cfe39f33ab4534a02725b Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 27 Apr 2016 22:09:52 -0400 Subject: [PATCH] Optimize Hoppers @@ -11,10 +11,10 @@ Subject: [PATCH] Optimize Hoppers * Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 458baf4442..a87258bbed 100644 +index 06c949ef06..19f4c61cdc 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -404,6 +404,15 @@ public class PaperWorldConfig { +@@ -407,6 +407,15 @@ public class PaperWorldConfig { squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D); } @@ -31,7 +31,7 @@ index 458baf4442..a87258bbed 100644 private void disableSprintInterruptionOnAttack() { disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index da11ec1672..d96fdad668 100644 +index 9326eaa2a9..4641113f9d 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -459,8 +459,9 @@ public final class ItemStack { @@ -47,19 +47,21 @@ index da11ec1672..d96fdad668 100644 itemstack.d(this.B()); if (this.tag != null) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5fdd65b083..f8a1c3b8fa 100644 +index 24e8b5ed14..42e0e16949 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1023,6 +1023,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - - if (true || i == 0 || this.getAllowNether()) { // CraftBukkit - WorldServer worldserver = this.worlds.get(i); -+ TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper +@@ -1042,7 +1042,8 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + // CraftBukkit - dropTickTime + for (Iterator iterator = this.getWorlds().iterator(); iterator.hasNext();) { +- WorldServer worldserver = (WorldServer) iterator.next(); ++ WorldServer worldserver = (WorldServer) iterator.next(); ++ TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper + i = SystemUtils.c(); + if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit this.methodProfiler.a(() -> { - return worldserver.getWorldData().getName(); diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 536fd37254..d2359a30f8 100644 +index 29fe031d85..d67fd92d9d 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -52,6 +52,7 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -79,7 +81,7 @@ index 536fd37254..d2359a30f8 100644 this.world.b(this.position, this); if (!this.f.isAir()) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index bb41d4780f..ef0f8d5c27 100644 +index 5ba009c7cf..a8cf160fe4 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -190,6 +190,154 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi diff --git a/Spigot-Server-Patches/0348-Optimize-CraftBlockData-Creation.patch b/Spigot-Server-Patches/0342-Optimize-CraftBlockData-Creation.patch similarity index 93% rename from Spigot-Server-Patches/0348-Optimize-CraftBlockData-Creation.patch rename to Spigot-Server-Patches/0342-Optimize-CraftBlockData-Creation.patch index 4374921be1..ba6f4cd9bb 100644 --- a/Spigot-Server-Patches/0348-Optimize-CraftBlockData-Creation.patch +++ b/Spigot-Server-Patches/0342-Optimize-CraftBlockData-Creation.patch @@ -1,4 +1,4 @@ -From 74f68b921eaba613b8368d573d6cc02e80d0a2c1 Mon Sep 17 00:00:00 2001 +From 60322b509f65a591ad5dcce5985e6895cd7b26bc Mon Sep 17 00:00:00 2001 From: miclebrick Date: Thu, 23 Aug 2018 11:45:32 -0400 Subject: [PATCH] Optimize CraftBlockData Creation @@ -34,7 +34,7 @@ index 4dd6c32761..1b226a77e0 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index b57f6efb3a..7b1d750f3a 100644 +index 6f80876990..726b178fd8 100644 --- a/src/main/java/net/minecraft/server/IBlockData.java +++ b/src/main/java/net/minecraft/server/IBlockData.java @@ -28,6 +28,8 @@ public interface IBlockData extends IBlockDataHolder { @@ -47,10 +47,10 @@ index b57f6efb3a..7b1d750f3a 100644 return this.getBlock().n(this); } diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index a4f3dd1b03..baaace6937 100644 +index d470e2b34a..b9279d925c 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -494,7 +494,17 @@ public class CraftBlockData implements BlockData { +@@ -501,7 +501,17 @@ public class CraftBlockData implements BlockData { return craft; } diff --git a/Spigot-Server-Patches/0349-Fix-MC-124320.patch b/Spigot-Server-Patches/0343-Fix-MC-124320.patch similarity index 91% rename from Spigot-Server-Patches/0349-Fix-MC-124320.patch rename to Spigot-Server-Patches/0343-Fix-MC-124320.patch index d44aaca955..7c528eadf5 100644 --- a/Spigot-Server-Patches/0349-Fix-MC-124320.patch +++ b/Spigot-Server-Patches/0343-Fix-MC-124320.patch @@ -1,14 +1,14 @@ -From 8035824774474a755f5d868bf3fdea79940db2df Mon Sep 17 00:00:00 2001 +From c7d0c523d9cd4e4d524b76b6418b3321524276ef Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Thu, 23 Aug 2018 09:25:30 -0500 Subject: [PATCH] Fix MC-124320 diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index fd1aec43b..1dc2b11e3 100644 +index d55b076f5d..297f674d08 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -172,6 +172,7 @@ public class Block implements IMaterial { +@@ -155,6 +155,7 @@ public class Block implements IMaterial { return tag.isTagged(this); } @@ -17,11 +17,11 @@ index fd1aec43b..1dc2b11e3 100644 IBlockData iblockdata1 = iblockdata; BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 2db0eb494..9e708f1fa 100644 +index e5ccd29a08..9116e52911 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -313,8 +313,9 @@ public class EntityEnderman extends EntityMonster { - if (block.a(TagsBlock.G) && flag) { + if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) { // CraftBukkit start - Pickup event if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { - this.enderman.setCarried(iblockdata); diff --git a/Spigot-Server-Patches/0350-Slime-Pathfinder-Events.patch b/Spigot-Server-Patches/0344-Slime-Pathfinder-Events.patch similarity index 97% rename from Spigot-Server-Patches/0350-Slime-Pathfinder-Events.patch rename to Spigot-Server-Patches/0344-Slime-Pathfinder-Events.patch index ab124e3c4c..dd6b36ef91 100644 --- a/Spigot-Server-Patches/0350-Slime-Pathfinder-Events.patch +++ b/Spigot-Server-Patches/0344-Slime-Pathfinder-Events.patch @@ -1,11 +1,11 @@ -From f61af69c38c8da6ea99150bcdb063c12cf6491e2 Mon Sep 17 00:00:00 2001 +From a68f2567d3a973df7563af421acec948f7e19251 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 24 Aug 2018 08:18:42 -0500 Subject: [PATCH] Slime Pathfinder Events diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index eeaf98e8..8752c62b 100644 +index 238f3c7926..cfa4710b78 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -57,6 +57,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { @@ -23,7 +23,7 @@ index eeaf98e8..8752c62b 100644 + this.canWander = nbttagcompound.getBoolean("Paper.canWander"); // Paper } - public boolean dz() { + public boolean dy() { @@ -308,7 +310,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { } @@ -115,7 +115,7 @@ index eeaf98e8..8752c62b 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java -index 18e7ef80..8403c1e0 100644 +index 18e7ef80ac..8403c1e01c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java @@ -33,4 +33,14 @@ public class CraftSlime extends CraftMob implements Slime { diff --git a/Spigot-Server-Patches/0351-isChunkGenerated-API.patch b/Spigot-Server-Patches/0345-isChunkGenerated-API.patch similarity index 63% rename from Spigot-Server-Patches/0351-isChunkGenerated-API.patch rename to Spigot-Server-Patches/0345-isChunkGenerated-API.patch index 1e84eedb61..7de089cf52 100644 --- a/Spigot-Server-Patches/0351-isChunkGenerated-API.patch +++ b/Spigot-Server-Patches/0345-isChunkGenerated-API.patch @@ -1,4 +1,4 @@ -From cca0a12cca8a970b2a885d93e976d9159b2072ad Mon Sep 17 00:00:00 2001 +From 007fad111fa8eb2e98ae7de91d7e2c2020b883f5 Mon Sep 17 00:00:00 2001 From: cswhite2000 <18whitechristop@gmail.com> Date: Tue, 21 Aug 2018 19:44:10 -0700 Subject: [PATCH] isChunkGenerated API @@ -6,27 +6,24 @@ Subject: [PATCH] isChunkGenerated API Resolves #1329 diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 0e0c7b1ab..cb4a2a0b9 100644 +index 5e8a20fdd6..5eaef413a6 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -74,6 +74,12 @@ public class ChunkProviderServer implements IChunkProvider { - - } - -+ // Paper start +@@ -34,6 +34,9 @@ public class ChunkProviderServer implements IChunkProvider { + private long lastQueuedSaves = 0L; // Paper + private long lastProcessedSaves = 0L; // Paper + private long lastSaveStatPrinted = System.currentTimeMillis(); + public boolean isChunkGenerated(int x, int z) { -+ return this.chunks.containsKey(ChunkCoordIntPair.asLong(x, z)) || this.chunkLoader.chunkExists(x, z); ++ return this.chunks.containsKey(ChunkCoordIntPair.asLong(x, z)) || ((ChunkRegionLoader) this.chunkLoader).chunkExists(x, z); + } -+ // Paper end -+ - @Nullable - public Chunk getLoadedChunkAt(int i, int j) { - long k = ChunkCoordIntPair.a(i, j); + // Paper end + public final Long2ObjectMap chunks = Long2ObjectMaps.synchronize(new ChunkMap(8192)); + private Chunk lastChunk; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index aa0b1f5fa..9a78fa687 100644 +index ba2e768594..1ccf2a7609 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -612,6 +612,12 @@ public class CraftWorld implements World { +@@ -605,6 +605,12 @@ public class CraftWorld implements World { return getChunkAt(location.getBlockX() >> 4, location.getBlockZ() >> 4); } diff --git a/Spigot-Server-Patches/0352-Add-source-block-to-BlockPhysicsEvent.patch b/Spigot-Server-Patches/0346-Add-source-block-to-BlockPhysicsEvent.patch similarity index 85% rename from Spigot-Server-Patches/0352-Add-source-block-to-BlockPhysicsEvent.patch rename to Spigot-Server-Patches/0346-Add-source-block-to-BlockPhysicsEvent.patch index e91cfd67f1..a7b2e457ab 100644 --- a/Spigot-Server-Patches/0352-Add-source-block-to-BlockPhysicsEvent.patch +++ b/Spigot-Server-Patches/0346-Add-source-block-to-BlockPhysicsEvent.patch @@ -1,14 +1,14 @@ -From 33452d6bc4fe6ab71a2340e3d370af273de30a33 Mon Sep 17 00:00:00 2001 +From 7b67e82d351a4ed6eae20287a100ce6e76bc3e82 Mon Sep 17 00:00:00 2001 From: Sotr Date: Thu, 23 Aug 2018 16:14:12 +0800 Subject: [PATCH] Add source block to BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 16d0c0d45..a4d9f0d5f 100644 +index abf3796d91..2a7abae942 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -603,7 +603,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -623,7 +623,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit start CraftWorld world = ((WorldServer) this).getWorld(); if (world != null && !((WorldServer)this).stopPhysicsEvent) { // Paper diff --git a/Spigot-Server-Patches/0353-Anti-Xray.patch b/Spigot-Server-Patches/0347-Anti-Xray.patch similarity index 94% rename from Spigot-Server-Patches/0353-Anti-Xray.patch rename to Spigot-Server-Patches/0347-Anti-Xray.patch index 38fbc90c03..8f981cd81a 100644 --- a/Spigot-Server-Patches/0353-Anti-Xray.patch +++ b/Spigot-Server-Patches/0347-Anti-Xray.patch @@ -1,11 +1,11 @@ -From fa8181ae204e0f66de22dcec2ff7cb737d10f0cb Mon Sep 17 00:00:00 2001 +From 349718eb80d6bb44b5bc6f411058af66381bd318 Mon Sep 17 00:00:00 2001 From: stonar96 Date: Mon, 20 Aug 2018 03:03:58 +0200 Subject: [PATCH] Anti-Xray diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a87258bbe..a395406d5 100644 +index 19f4c61cdc..3acb1ff9fd 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -1,7 +1,10 @@ @@ -19,7 +19,7 @@ index a87258bbe..a395406d5 100644 import net.minecraft.server.MinecraftServer; import org.bukkit.Bukkit; import org.bukkit.configuration.file.YamlConfiguration; -@@ -498,4 +501,27 @@ public class PaperWorldConfig { +@@ -496,4 +499,27 @@ public class PaperWorldConfig { this.armorStandTick = this.getBoolean("armor-stands-tick", this.armorStandTick); log("ArmorStand ticking is " + (this.armorStandTick ? "enabled" : "disabled") + " by default"); } @@ -30,8 +30,8 @@ index a87258bbe..a395406d5 100644 + public ChunkEdgeMode chunkEdgeMode; + public int maxChunkSectionIndex; + public int updateRadius; -+ public List hiddenBlocks; -+ public List replacementBlocks; ++ public List hiddenBlocks; ++ public List replacementBlocks; + private void antiXray() { + antiXray = getBoolean("anti-xray.enabled", false); + asynchronous = true; @@ -42,14 +42,14 @@ index a87258bbe..a395406d5 100644 + maxChunkSectionIndex = getInt("anti-xray.max-chunk-section-index", 3); + maxChunkSectionIndex = maxChunkSectionIndex > 15 ? 15 : maxChunkSectionIndex; + updateRadius = getInt("anti-xray.update-radius", 2); -+ hiddenBlocks = getList("anti-xray.hidden-blocks", Arrays.asList((Object) "gold_ore", "iron_ore", "coal_ore", "lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "redstone_ore", "lit_redstone_ore", "clay", "emerald_ore", "ender_chest")); -+ replacementBlocks = getList("anti-xray.replacement-blocks", Arrays.asList((Object) "stone", "planks")); ++ hiddenBlocks = getList("anti-xray.hidden-blocks", Arrays.asList("gold_ore", "iron_ore", "coal_ore", "lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "redstone_ore", "lit_redstone_ore", "clay", "emerald_ore", "ender_chest")); ++ replacementBlocks = getList("anti-xray.replacement-blocks", Arrays.asList("stone", "planks")); + log("Anti-Xray: " + (antiXray ? "enabled" : "disabled") + " / Engine Mode: " + engineMode.getDescription() + " / Chunk Edge Mode: " + chunkEdgeMode.getDescription() + " / Up to " + ((maxChunkSectionIndex + 1) * 16) + " blocks / Update Radius: " + updateRadius); + } } diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java new file mode 100644 -index 000000000..1ba8477bf +index 0000000000..1ba8477bf9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java @@ -0,0 +1,45 @@ @@ -100,10 +100,10 @@ index 000000000..1ba8477bf +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java new file mode 100644 -index 000000000..ed21f8515 +index 0000000000..65d3e88c3b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java -@@ -0,0 +1,668 @@ +@@ -0,0 +1,670 @@ +package com.destroystokyo.paper.antixray; + +import java.util.HashSet; @@ -111,6 +111,8 @@ index 000000000..ed21f8515 +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + ++import net.minecraft.server.IRegistry; ++import net.minecraft.server.MinecraftKey; +import org.bukkit.World.Environment; + +import com.destroystokyo.paper.PaperWorldConfig; @@ -177,8 +179,8 @@ index 000000000..ed21f8515 + } else { + Set predefinedBlockDataSet = new HashSet(); + -+ for (Object id : paperWorldConfig.hiddenBlocks) { -+ Block block = Block.getByName(String.valueOf(id)); ++ for (String id : paperWorldConfig.hiddenBlocks) { ++ Block block = IRegistry.BLOCK.get(new MinecraftKey(id)); + + if (block != null && !block.isTileEntity()) { + predefinedBlockDataSet.add(block.getBlockData()); @@ -200,8 +202,8 @@ index 000000000..ed21f8515 + predefinedBlockDataBitsEndStoneGlobal = null; + } + -+ for (Object id : (engineMode == EngineMode.HIDE) ? paperWorldConfig.hiddenBlocks : paperWorldConfig.replacementBlocks) { -+ Block block = Block.getByName(String.valueOf(id)); ++ for (String id : (engineMode == EngineMode.HIDE) ? paperWorldConfig.hiddenBlocks : paperWorldConfig.replacementBlocks) { ++ Block block = IRegistry.BLOCK.get(new MinecraftKey(id)); + + if (block != null) { + obfuscateGlobal[ChunkSection.GLOBAL_PALETTE.getDataBits(block.getBlockData())] = true; @@ -774,7 +776,7 @@ index 000000000..ed21f8515 +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java new file mode 100644 -index 000000000..41618994b +index 0000000000..41618994b4 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java @@ -0,0 +1,81 @@ @@ -861,7 +863,7 @@ index 000000000..41618994b +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java new file mode 100644 -index 000000000..e255a45fa +index 0000000000..e255a45fa3 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java @@ -0,0 +1,29 @@ @@ -896,7 +898,7 @@ index 000000000..e255a45fa +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java new file mode 100644 -index 000000000..cc586827a +index 0000000000..cc586827aa --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java @@ -0,0 +1,56 @@ @@ -958,7 +960,7 @@ index 000000000..cc586827a +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java new file mode 100644 -index 000000000..37093419c +index 0000000000..37093419cf --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java @@ -0,0 +1,84 @@ @@ -1047,10 +1049,10 @@ index 000000000..37093419c + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 8b8083093..358934455 100644 +index eed37198b0..b88d232c85 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -537,7 +537,7 @@ public class Chunk implements IChunkAccess { +@@ -534,7 +534,7 @@ public class Chunk implements IChunkAccess { return null; } @@ -1059,7 +1061,7 @@ index 8b8083093..358934455 100644 this.sections[j >> 4] = chunksection; flag1 = j >= l; } -@@ -637,7 +637,7 @@ public class Chunk implements IChunkAccess { +@@ -634,7 +634,7 @@ public class Chunk implements IChunkAccess { return; } @@ -1069,10 +1071,10 @@ index 8b8083093..358934455 100644 this.initLighting(); } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 54840851b..0f1423c9a 100644 +index 68a3169c31..6a33bbb231 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -852,7 +852,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -843,7 +843,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } ChunkConverter chunkconverter = nbttagcompound.hasKeyOfType("UpgradeData", 10) ? new ChunkConverter(nbttagcompound.getCompound("UpgradeData")) : ChunkConverter.a; @@ -1081,7 +1083,7 @@ index 54840851b..0f1423c9a 100644 protochunk.a(abiomebase); protochunk.b(nbttagcompound.getLong("InhabitedTime")); -@@ -958,7 +958,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -949,7 +949,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { for (int i = 0; i < nbttaglist.size(); ++i) { NBTTagCompound nbttagcompound = nbttaglist.getCompound(i); byte b0 = nbttagcompound.getByte("Y"); @@ -1091,7 +1093,7 @@ index 54840851b..0f1423c9a 100644 chunksection.getBlocks().a(nbttagcompound, "Palette", "BlockStates"); chunksection.a(new NibbleArray(nbttagcompound.getByteArray("BlockLight"))); diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index 233cbb6d6..8c116b74c 100644 +index 233cbb6d60..8c116b74c5 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -13,9 +13,15 @@ public class ChunkSection { @@ -1112,29 +1114,29 @@ index 233cbb6d6..8c116b74c 100644 if (flag) { this.skyLight = new NibbleArray(); diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index ed20454d0..2b14e0051 100644 +index 99e752ddd6..c2dd61248d 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -@@ -43,7 +43,7 @@ public class ChunkTaskScheduler extends Scheduler> { @@ -1332,7 +1334,7 @@ index f8facddb4..b2afec5e4 100644 public void a() { this.o(); diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 9787f5b06..d666685c5 100644 +index 6321010246..d0ff96812e 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -1,5 +1,6 @@ @@ -1421,10 +1423,10 @@ index 9787f5b06..d666685c5 100644 if (flag) { packetdataserializer.writeBytes(chunksection.getSkyLightArray().asBytes()); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index fcd9f5491..346367b68 100644 +index f8d8a44a88..e7d465fb8a 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -110,6 +110,8 @@ public class PlayerChunk { +@@ -108,6 +108,8 @@ public class PlayerChunk { return false; } else if (!this.chunk.isReady()) { return false; @@ -1452,7 +1454,7 @@ index fcd9f5491..346367b68 100644 } else { this.a((Packet) (new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, this.chunk))); diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 4a439ef4c..063f2b920 100644 +index cae24961fd..a9690fb1c3 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -206,6 +206,8 @@ public class PlayerInteractManager { @@ -1465,7 +1467,7 @@ index 4a439ef4c..063f2b920 100644 public void a(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 584a86c11..62a7d3c23 100644 +index 541435d3e5..0b4f0d2414 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -44,12 +44,24 @@ public class ProtoChunk implements IChunkAccess { @@ -1494,6 +1496,24 @@ index 584a86c11..62a7d3c23 100644 this.d = new AtomicInteger(); this.f = Maps.newEnumMap(HeightMap.Type.class); this.g = ChunkStatus.EMPTY; +@@ -74,7 +86,7 @@ public class ProtoChunk implements IChunkAccess { + IRegistry iregistry1 = IRegistry.BLOCK; + + IRegistry.BLOCK.getClass(); +- this.q = new ProtoChunkTickList(predicate, function, iregistry1::getOrDefault, chunkcoordintpair); ++ this.q = new ProtoChunkTickList(predicate, function, IRegistry.BLOCK::getOrDefault, chunkcoordintpair); // Paper - decompile fix + predicate = (fluidtype) -> { + return fluidtype == null || fluidtype == FluidTypes.a; + }; +@@ -83,7 +95,7 @@ public class ProtoChunk implements IChunkAccess { + function = iregistry::getKey; + iregistry1 = IRegistry.FLUID; + IRegistry.FLUID.getClass(); +- this.r = new ProtoChunkTickList(predicate, function, iregistry1::getOrDefault, chunkcoordintpair); ++ this.r = new ProtoChunkTickList(predicate, function, IRegistry.FLUID::getOrDefault, chunkcoordintpair); // Paper - decompile fix + } + + public static ShortList a(ShortList[] ashortlist, int i) { @@ -152,7 +164,7 @@ public class ProtoChunk implements IChunkAccess { return iblockdata; } @@ -1513,7 +1533,7 @@ index 584a86c11..62a7d3c23 100644 if (enumskyblock == EnumSkyBlock.SKY) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a4d9f0d5f..7b694efb6 100644 +index 2a7abae942..17b5ef00f5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1,6 +1,8 @@ @@ -1525,7 +1545,7 @@ index a4d9f0d5f..7b694efb6 100644 import com.destroystokyo.paper.event.server.ServerExceptionEvent; import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.base.MoreObjects; -@@ -140,6 +142,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -143,6 +145,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper @@ -1533,15 +1553,15 @@ index a4d9f0d5f..7b694efb6 100644 public final co.aikar.timings.WorldTimingsHandler timings; // Paper public boolean guardEntityList; // Spigot // Paper - public -@@ -165,6 +168,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - protected World(IDataManager idatamanager, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag, ChunkGenerator gen, org.bukkit.World.Environment env) { +@@ -168,6 +171,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + protected World(IDataManager idatamanager, @Nullable PersistentCollection persistentcollection, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag, ChunkGenerator gen, org.bukkit.World.Environment env) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper + this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit -@@ -384,6 +388,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -404,6 +408,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit end IBlockData iblockdata1 = chunk.a(blockposition, iblockdata, (i & 64) != 0); @@ -1550,7 +1570,7 @@ index a4d9f0d5f..7b694efb6 100644 if (iblockdata1 == null) { // CraftBukkit start - remove blockstate if failed diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java -index c26f0ed16..f6915d32a 100644 +index c26f0ed16b..f6915d32ab 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java @@ -17,9 +17,11 @@ import org.bukkit.material.MaterialData; @@ -1575,5 +1595,5 @@ index c26f0ed16..f6915d32a 100644 return section; } -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0354-Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/0348-Configurable-speed-for-water-flowing-over-lava.patch similarity index 61% rename from Spigot-Server-Patches/0354-Configurable-speed-for-water-flowing-over-lava.patch rename to Spigot-Server-Patches/0348-Configurable-speed-for-water-flowing-over-lava.patch index d0cfab8fb8..50f17abc47 100644 --- a/Spigot-Server-Patches/0354-Configurable-speed-for-water-flowing-over-lava.patch +++ b/Spigot-Server-Patches/0348-Configurable-speed-for-water-flowing-over-lava.patch @@ -1,14 +1,14 @@ -From a882a84e7b989a1e6587ed9bff06fb9cecfb64be Mon Sep 17 00:00:00 2001 +From d95c11e875b62bed044078961d8a8529a2f5e258 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 8 Aug 2018 16:33:21 -0600 Subject: [PATCH] Configurable speed for water flowing over lava diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a395406d5..db2bfb851 100644 +index 3acb1ff9fd..24f353d6fc 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -448,6 +448,12 @@ public class PaperWorldConfig { +@@ -451,6 +451,12 @@ public class PaperWorldConfig { } } @@ -22,45 +22,47 @@ index a395406d5..db2bfb851 100644 SAFE_REGEN, REGEN, DELETE, NOTHING, WARN } diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java -index 6ecc1f84e..7c4986fab 100644 +index 5346eaa348..ec77cbd57e 100644 --- a/src/main/java/net/minecraft/server/BlockFluids.java +++ b/src/main/java/net/minecraft/server/BlockFluids.java -@@ -67,11 +67,25 @@ public class BlockFluids extends Block implements IFluidSource { +@@ -78,11 +78,27 @@ public class BlockFluids extends Block implements IFluidSource { public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1) { if (this.a(world, blockposition, iblockdata)) { -- world.H().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); -+ world.H().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper +- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); ++ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper } } -+ /** -+ * Paper - Get flow speed. Throttle if its water and flowing adjacent to lava -+ */ ++ // Paper start - Get flow speed. Throttle if its water and flowing adjacent to lava + public int getFlowSpeed(World world, BlockPosition blockposition) { -+ if (this.material == Material.WATER && ( -+ world.getType(blockposition.north(1)).getBlock().material == Material.LAVA || -+ world.getType(blockposition.south(1)).getBlock().material == Material.LAVA || -+ world.getType(blockposition.west(1)).getBlock().material == Material.LAVA || -+ world.getType(blockposition.east(1)).getBlock().material == Material.LAVA)) { -+ return world.paperConfig.waterOverLavaFlowSpeed; ++ if (this.material == Material.WATER) { ++ if ( ++ world.getMaterialIfLoaded(blockposition.north(1)) == Material.LAVA || ++ world.getMaterialIfLoaded(blockposition.south(1)) == Material.LAVA || ++ world.getMaterialIfLoaded(blockposition.west(1)) == Material.LAVA || ++ world.getMaterialIfLoaded(blockposition.east(1)) == Material.LAVA ++ ) { ++ return world.paperConfig.waterOverLavaFlowSpeed; ++ } + } + return this.a(world); + } ++ // Paper end + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { if (iblockdata.s().d() || iblockdata1.s().d()) { - generatoraccess.H().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess)); -@@ -82,7 +96,7 @@ public class BlockFluids extends Block implements IFluidSource { + generatoraccess.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess)); +@@ -93,7 +109,7 @@ public class BlockFluids extends Block implements IFluidSource { public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (this.a(world, blockposition, iblockdata)) { -- world.H().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); -+ world.H().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper +- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); ++ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper } } -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0349-Optimize-RegistryMaterials.patch b/Spigot-Server-Patches/0349-Optimize-RegistryMaterials.patch new file mode 100644 index 0000000000..1496d1af3c --- /dev/null +++ b/Spigot-Server-Patches/0349-Optimize-RegistryMaterials.patch @@ -0,0 +1,36 @@ +From 02c2f6575eb8ecea97cbd43517c6cdabb2879174 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 26 Aug 2018 20:49:50 -0400 +Subject: [PATCH] Optimize RegistryMaterials + +Use larger initial sizes to increase bucket capacity on the BiMap + +BiMap.get was seen to be using a good bit of CPU time. + +diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java +index 2aa6f89c18..1974baff83 100644 +--- a/src/main/java/net/minecraft/server/RegistryMaterials.java ++++ b/src/main/java/net/minecraft/server/RegistryMaterials.java +@@ -14,8 +14,8 @@ import org.apache.logging.log4j.Logger; + public class RegistryMaterials implements IRegistry { + + protected static final Logger a = LogManager.getLogger(); +- protected final RegistryID b = new RegistryID(256); +- protected final BiMap c = HashBiMap.create(); ++ protected final RegistryID b = new RegistryID<>(2048); // Paper - use bigger expected size to reduce collisions ++ protected final BiMap c = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions + protected Object[] d; + private int x; + +@@ -92,7 +92,7 @@ public class RegistryMaterials implements IRegistry { + this.d = set.toArray(new Object[set.size()]); + } + +- return this.d[random.nextInt(this.d.length)]; ++ return (V) this.d[random.nextInt(this.d.length)]; // Paper - decompile fix + } + + public boolean c(MinecraftKey minecraftkey) { +-- +2.18.0 + diff --git a/work/BuildData b/work/BuildData index 351106b633..83455962ed 160000 --- a/work/BuildData +++ b/work/BuildData @@ -1 +1 @@ -Subproject commit 351106b6336fc52f6acf94aabd34ac54fc772432 +Subproject commit 83455962edb05fea080f04d6708eede4fa8be7b1 diff --git a/work/Bukkit b/work/Bukkit index 23c1a2ba03..2dcc44dcec 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 23c1a2ba03b96b52f69a93e07706f9ccc33fd683 +Subproject commit 2dcc44dcec8a985ef4da59f6c95ea4ed732f9444 diff --git a/work/CraftBukkit b/work/CraftBukkit index 162bda93ff..479ec05e3b 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 162bda93ff76fe96a6138a14176807f21a6ddef4 +Subproject commit 479ec05e3b15937ae7e988d9050d167fc6ba307d diff --git a/work/Spigot b/work/Spigot index fe3ab0d858..2440e18926 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit fe3ab0d858960183da1da1b1378c363c3da94bbb +Subproject commit 2440e18926007124b1b968b7d81b0aa29627c332