diff --git a/Spigot-API-Patches/0001-POM-changes.patch b/Spigot-API-Patches/0001-POM-changes.patch index 661bbe396c..b3a5921d3b 100644 --- a/Spigot-API-Patches/0001-POM-changes.patch +++ b/Spigot-API-Patches/0001-POM-changes.patch @@ -1,14 +1,14 @@ -From 19a0ed42ec75273fa4ccab45bb726f5d1a90c4c2 Mon Sep 17 00:00:00 2001 +From 7439e7e3c94eb559415193440a9e1515335819c7 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 99ff13b3..cc8fca48 100644 +index 3e6c8707..c2d0651e 100644 --- a/pom.xml +++ b/pom.xml -@@ -3,13 +3,19 @@ +@@ -3,29 +3,35 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 @@ -20,9 +20,8 @@ index 99ff13b3..cc8fca48 100644 + dev-SNAPSHOT + + -+ com.destroystokyo.paper + paper-api - 1.13-pre5-R0.1-SNAPSHOT + 1.13-pre7-R0.1-SNAPSHOT jar - Spigot-API @@ -32,7 +31,13 @@ index 99ff13b3..cc8fca48 100644 An enhanced plugin API for Minecraft servers. -@@ -20,12 +26,12 @@ +- 1.7 +- 1.7 ++ ++ 1.8 ++ 1.8 + UTF-8 + @@ -111,7 +116,7 @@ index 99ff13b3..cc8fca48 100644 - - org.codehaus.mojo - animal-sniffer-maven-plugin -- 1.16 +- 1.17 - - - process-classes @@ -123,7 +128,7 @@ index 99ff13b3..cc8fca48 100644 - - - org.codehaus.mojo.signature -- java18 +- java17 - 1.0 - - diff --git a/Spigot-API-Patches/0003-Timings-v2.patch b/Spigot-API-Patches/0003-Timings-v2.patch index af8d223233..19d04d97aa 100644 --- a/Spigot-API-Patches/0003-Timings-v2.patch +++ b/Spigot-API-Patches/0003-Timings-v2.patch @@ -1,4 +1,4 @@ -From 53fb6f06b531517937c55be04dc33916403c6c5c Mon Sep 17 00:00:00 2001 +From 0845d92e6aa2ddf0d67519da4af0713f77e9eed0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 18:48:17 -0600 Subject: [PATCH] Timings v2 @@ -3529,10 +3529,10 @@ index bba914d7..00000000 - // Spigot end -} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 86eca9e1..116a1e7a 100644 +index 115c5b0b..90b22bcc 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1541,6 +1541,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1535,6 +1535,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } @@ -3602,7 +3602,7 @@ index 8b130abb..80c152ba 100644 } } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 80c6a72e..759c4617 100644 +index 113b899c..81b42822 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -40,7 +40,6 @@ import org.bukkit.plugin.PluginLoader; @@ -3621,7 +3621,7 @@ index 80c6a72e..759c4617 100644 /** * This class was not meant to be constructed explicitly -@@ -289,26 +287,20 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -291,26 +289,20 @@ public final class JavaPluginLoader implements PluginLoader { } } diff --git a/Spigot-API-Patches/0007-Entity-Origin-API.patch b/Spigot-API-Patches/0007-Entity-Origin-API.patch index f40d54e503..d6d800d532 100644 --- a/Spigot-API-Patches/0007-Entity-Origin-API.patch +++ b/Spigot-API-Patches/0007-Entity-Origin-API.patch @@ -1,4 +1,4 @@ -From 2964c90dcc4e0304b7c77475523c9a7eab2ea98b Mon Sep 17 00:00:00 2001 +From 6930a5ac9c5a9fba958a9d72769f6be40c406fd0 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Mon, 29 Feb 2016 17:50:31 -0600 Subject: [PATCH] Entity Origin API @@ -25,10 +25,10 @@ index 28b169d2..9b0f97f1 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java -index 0b5c062f..48d6c951 100644 +index 9d34e691..b0b1defc 100644 --- a/src/main/java/org/bukkit/entity/FallingBlock.java +++ b/src/main/java/org/bukkit/entity/FallingBlock.java -@@ -50,4 +50,15 @@ public interface FallingBlock extends Entity { +@@ -52,4 +52,15 @@ public interface FallingBlock extends Entity { * @param hurtEntities whether entities will be damaged by this block. */ void setHurtEntities(boolean hurtEntities); diff --git a/Spigot-API-Patches/0014-Automatically-disable-plugins-that-fail-to-load.patch b/Spigot-API-Patches/0014-Automatically-disable-plugins-that-fail-to-load.patch index 3d83245932..fc6a5cc467 100644 --- a/Spigot-API-Patches/0014-Automatically-disable-plugins-that-fail-to-load.patch +++ b/Spigot-API-Patches/0014-Automatically-disable-plugins-that-fail-to-load.patch @@ -1,14 +1,14 @@ -From 90e6868ac669e61bc3b0e176b452181dcf078c2c Mon Sep 17 00:00:00 2001 +From a550e7f0f5f00bea6d9b453614818877a470ebb6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 19:45:21 -0600 Subject: [PATCH] Automatically disable plugins that fail to load diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 759c461..d8b9c24 100644 +index 81b42822..3af99b5b 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -329,6 +329,10 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -331,6 +331,10 @@ public final class JavaPluginLoader implements PluginLoader { jPlugin.setEnabled(true); } catch (Throwable ex) { server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); @@ -20,5 +20,5 @@ index 759c461..d8b9c24 100644 // Perhaps abort here, rather than continue going, but as it stands, -- -2.10.0.windows.1 +2.18.0 diff --git a/Spigot-API-Patches/0021-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/Spigot-API-Patches/0021-Add-methods-for-working-with-arrows-stuck-in-living-.patch index b12d0be715..6b2b6a7a39 100644 --- a/Spigot-API-Patches/0021-Add-methods-for-working-with-arrows-stuck-in-living-.patch +++ b/Spigot-API-Patches/0021-Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -1,14 +1,14 @@ -From 983f39e99a72d696cce6d90cd3688cbffbf5bf22 Mon Sep 17 00:00:00 2001 +From 627bc079ead8a9849e8b0046a4045aa8ff3a69f8 Mon Sep 17 00:00:00 2001 From: mrapple Date: Sun, 25 Nov 2012 13:47:27 -0600 Subject: [PATCH] Add methods for working with arrows stuck in living entities diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 5a30fa93..be51e389 100644 +index 97c2172b..f6ae0a6d 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -360,4 +360,19 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti +@@ -376,4 +376,19 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti * @return collision status */ boolean isCollidable(); @@ -29,5 +29,5 @@ index 5a30fa93..be51e389 100644 + // Paper end } -- -2.13.3.windows.1 +2.18.0 diff --git a/Spigot-API-Patches/0022-Complete-resource-pack-API.patch b/Spigot-API-Patches/0022-Complete-resource-pack-API.patch index d0536e235a..18a18ad6ce 100644 --- a/Spigot-API-Patches/0022-Complete-resource-pack-API.patch +++ b/Spigot-API-Patches/0022-Complete-resource-pack-API.patch @@ -1,11 +1,11 @@ -From 38ccae5eed9ac184d71461d0b9fce2b7659bb80e Mon Sep 17 00:00:00 2001 +From 25ab827755fbe15e9f3c4165140a16be9689ed81 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sat, 4 Apr 2015 22:59:54 -0400 Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5955b20c..f1876a05 100644 +index 1837a14c..5638a077 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -1206,7 +1206,9 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline @@ -77,30 +77,34 @@ index 5955b20c..f1876a05 100644 public class Spigot extends Entity.Spigot { diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java -index 4c498016..4c838519 100644 +index 4c498016..aa18a766 100644 --- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java -@@ -10,13 +10,28 @@ import org.bukkit.event.HandlerList; +@@ -10,13 +10,32 @@ import org.bukkit.event.HandlerList; public class PlayerResourcePackStatusEvent extends PlayerEvent { private static final HandlerList handlers = new HandlerList(); ++ @Deprecated + private final String hash; // Paper private final Status status; -+ @Deprecated // Paper public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus) { super(who); + this.hash = null; // Paper this.status = resourcePackStatus; } -+ // Paper start ++ @Deprecated // Paper + public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus, String hash) { + super(who); + this.hash = hash; // Paper + this.status = resourcePackStatus; + } + ++ @Deprecated ++ /** ++ * @deprecated Hash does not seem to ever be set ++ */ + public String getHash() { + return this.hash; + } diff --git a/Spigot-API-Patches/0023-Use-ASM-for-event-executors.patch b/Spigot-API-Patches/0023-Use-ASM-for-event-executors.patch index 1199ea4f74..a0fc6b1aae 100644 --- a/Spigot-API-Patches/0023-Use-ASM-for-event-executors.patch +++ b/Spigot-API-Patches/0023-Use-ASM-for-event-executors.patch @@ -1,4 +1,4 @@ -From e3d8a0f30c3e83f2308268ca6221478f46a82008 Mon Sep 17 00:00:00 2001 +From 39bd1036ea8a04cd417c8bab59421ef5e7ba6e0c Mon Sep 17 00:00:00 2001 From: Techcable Date: Thu, 3 Mar 2016 13:20:33 -0700 Subject: [PATCH] Use ASM for event executors. @@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors. Uses method handles for private or static methods. diff --git a/pom.xml b/pom.xml -index f5e8d49d..dfc6c9b5 100644 +index 5e2024ca..bd9146dd 100644 --- a/pom.xml +++ b/pom.xml @@ -127,6 +127,17 @@ @@ -401,10 +401,10 @@ index 3b2c99ea..b45b6c1c 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index d8b9c244..40fd71dc 100644 +index 3af99b5b..72d506d1 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -287,20 +287,7 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -289,20 +289,7 @@ public final class JavaPluginLoader implements PluginLoader { } } diff --git a/Spigot-API-Patches/0043-Add-String-based-Action-Bar-API.patch b/Spigot-API-Patches/0043-Add-String-based-Action-Bar-API.patch index 1a2a4ee3da..33e0bb4b0f 100644 --- a/Spigot-API-Patches/0043-Add-String-based-Action-Bar-API.patch +++ b/Spigot-API-Patches/0043-Add-String-based-Action-Bar-API.patch @@ -1,11 +1,11 @@ -From e859235a5d23ac1232b75122a23aa4dc605a3d1c Mon Sep 17 00:00:00 2001 +From 08d440055e45edea4106415945fcfe5b7c3d1318 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 20 Dec 2016 15:55:55 -0500 Subject: [PATCH] Add String based Action Bar API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index f1876a05..d06f26b9 100644 +index 5638a077..bc2f9621 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -394,6 +394,26 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline @@ -47,7 +47,7 @@ index f1876a05..d06f26b9 100644 public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { spigot().sendMessage(position, components); } -@@ -1749,9 +1771,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1743,9 +1765,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline /** * Sends the component to the specified screen position of this player * @@ -59,7 +59,7 @@ index f1876a05..d06f26b9 100644 public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1759,9 +1783,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1753,9 +1777,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline /** * Sends an array of components as a single message to the specified screen position of this player * diff --git a/Spigot-API-Patches/0052-Fix-upstream-javadoc-warnings-and-errors.patch b/Spigot-API-Patches/0052-Fix-upstream-javadoc-warnings-and-errors.patch index 8fb1c2b6b8..1a1134f9ec 100644 --- a/Spigot-API-Patches/0052-Fix-upstream-javadoc-warnings-and-errors.patch +++ b/Spigot-API-Patches/0052-Fix-upstream-javadoc-warnings-and-errors.patch @@ -1,4 +1,4 @@ -From 569e6283060854cef2140d7a3ad0b2690911215b Mon Sep 17 00:00:00 2001 +From bc65fcc9a464b4c8d7b28758d6fad8d98eefa05d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 10 Jun 2017 16:59:40 -0500 Subject: [PATCH] Fix upstream javadoc warnings and errors @@ -6,10 +6,10 @@ Subject: [PATCH] Fix upstream javadoc warnings and errors Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues. diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java -index 19632d17..de1b1112 100644 +index 1ed8f7e4..bd5238ce 100644 --- a/src/main/java/org/bukkit/NamespacedKey.java +++ b/src/main/java/org/bukkit/NamespacedKey.java -@@ -27,8 +27,8 @@ public final class NamespacedKey { +@@ -38,8 +38,8 @@ public final class NamespacedKey { /** * Create a key in a specific namespace. * @@ -21,10 +21,10 @@ index 19632d17..de1b1112 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 65156e80..6417cefa 100644 +index 1e980d2d..4cc70326 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1365,6 +1365,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1376,6 +1376,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param count the number of particles * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -32,7 +32,7 @@ index 65156e80..6417cefa 100644 */ public void spawnParticle(Particle particle, Location location, int count, T data); -@@ -1380,6 +1381,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1391,6 +1392,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param count the number of particles * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -40,7 +40,7 @@ index 65156e80..6417cefa 100644 */ public void spawnParticle(Particle particle, double x, double y, double z, int count, T data); -@@ -1429,6 +1431,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1440,6 +1442,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param offsetZ the maximum random offset on the Z axis * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -48,7 +48,7 @@ index 65156e80..6417cefa 100644 */ public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data); -@@ -1448,6 +1451,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1459,6 +1462,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param offsetZ the maximum random offset on the Z axis * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -56,7 +56,7 @@ index 65156e80..6417cefa 100644 */ public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data); -@@ -1503,6 +1507,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1514,6 +1518,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * particle used (normally speed) * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -64,7 +64,7 @@ index 65156e80..6417cefa 100644 */ public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); -@@ -1524,6 +1529,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1535,6 +1540,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * particle used (normally speed) * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -112,7 +112,7 @@ index cfce8fa5..8660070b 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d06f26b9..5c29c11e 100644 +index bc2f9621..47a12d71 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -409,7 +409,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline diff --git a/Spigot-API-Patches/0061-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch b/Spigot-API-Patches/0061-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch deleted file mode 100644 index 2740b47427..0000000000 --- a/Spigot-API-Patches/0061-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 3fe26d396837d1f3aad927133722332e4d1f7b51 Mon Sep 17 00:00:00 2001 -From: willies952002 -Date: Thu, 20 Jul 2017 18:05:36 -0400 -Subject: [PATCH] Allow Changing of Player Sample in ServerListPingEvent - - -diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java -index 3c38d857..cb8d0fcd 100644 ---- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java -+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java -@@ -2,6 +2,7 @@ package org.bukkit.event.server; - - import java.net.InetAddress; - import java.util.Iterator; -+import java.util.List; - - import org.apache.commons.lang.Validate; - import org.bukkit.entity.Player; -@@ -145,4 +146,25 @@ public class ServerListPingEvent extends ServerEvent implements Iterable - public Iterator iterator() throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } -+ -+ // Paper start -+ private java.util.List sample; -+ -+ /** -+ * @deprecated Will be replaced in 1.13 -+ */ -+ @Deprecated -+ public void setSampleText(java.util.List sample) { -+ this.sample = sample; -+ } -+ -+ /** -+ * @deprecated Will be replaced in 1.13 -+ */ -+ @Deprecated -+ public java.util.List getSampleText() { -+ return sample; -+ } -+ // Paper end -+ - } --- -2.15.1 - diff --git a/Spigot-API-Patches/0062-Improve-the-Saddle-API-for-Horses.patch b/Spigot-API-Patches/0061-Improve-the-Saddle-API-for-Horses.patch similarity index 97% rename from Spigot-API-Patches/0062-Improve-the-Saddle-API-for-Horses.patch rename to Spigot-API-Patches/0061-Improve-the-Saddle-API-for-Horses.patch index b56967dd56..377b3c316e 100644 --- a/Spigot-API-Patches/0062-Improve-the-Saddle-API-for-Horses.patch +++ b/Spigot-API-Patches/0061-Improve-the-Saddle-API-for-Horses.patch @@ -1,4 +1,4 @@ -From 5b40b7e3f882c44f18249d89dbbeb93298af3535 Mon Sep 17 00:00:00 2001 +From d64ec328014274efa75dfacaf6b37cb11f642f69 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 10 Dec 2016 16:12:48 -0500 Subject: [PATCH] Improve the Saddle API for Horses @@ -78,5 +78,5 @@ index 00000000..7944f26a + +public interface SaddledHorseInventory extends AbstractHorseInventory {} -- -2.16.1 +2.18.0 diff --git a/Spigot-API-Patches/0063-ensureServerConversions-API.patch b/Spigot-API-Patches/0062-ensureServerConversions-API.patch similarity index 96% rename from Spigot-API-Patches/0063-ensureServerConversions-API.patch rename to Spigot-API-Patches/0062-ensureServerConversions-API.patch index 35b2c25d85..f99c9f8ed2 100644 --- a/Spigot-API-Patches/0063-ensureServerConversions-API.patch +++ b/Spigot-API-Patches/0062-ensureServerConversions-API.patch @@ -1,4 +1,4 @@ -From 575bbab52d06b324acd9b8758d454d74a859c8d0 Mon Sep 17 00:00:00 2001 +From ac29eaf3c0dc567bfbe8e20a323cdfaefd6242b8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 May 2016 23:55:48 -0400 Subject: [PATCH] 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/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index f74f8ae9..ab33e09e 100644 +index 762c43d6..045c26d9 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -134,4 +134,16 @@ public interface ItemFactory { diff --git a/Spigot-API-Patches/0064-Add-getI18NDisplayName-API.patch b/Spigot-API-Patches/0063-Add-getI18NDisplayName-API.patch similarity index 95% rename from Spigot-API-Patches/0064-Add-getI18NDisplayName-API.patch rename to Spigot-API-Patches/0063-Add-getI18NDisplayName-API.patch index 775a829704..71cfc8b218 100644 --- a/Spigot-API-Patches/0064-Add-getI18NDisplayName-API.patch +++ b/Spigot-API-Patches/0063-Add-getI18NDisplayName-API.patch @@ -1,4 +1,4 @@ -From 83009175cba71dcdd63ac621aeb5453073fe2c7f Mon Sep 17 00:00:00 2001 +From b2d5adef80eed3964ab16df2c98789763d150fd7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 May 2016 23:55:48 -0400 Subject: [PATCH] Add getI18NDisplayName API @@ -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/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index ab33e09e..061954f9 100644 +index 045c26d9..47bbc0f9 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -145,5 +145,15 @@ public interface ItemFactory { diff --git a/Spigot-API-Patches/0065-ProfileWhitelistVerifyEvent.patch b/Spigot-API-Patches/0064-ProfileWhitelistVerifyEvent.patch similarity index 98% rename from Spigot-API-Patches/0065-ProfileWhitelistVerifyEvent.patch rename to Spigot-API-Patches/0064-ProfileWhitelistVerifyEvent.patch index 8fe430b482..ea1fa9cb34 100644 --- a/Spigot-API-Patches/0065-ProfileWhitelistVerifyEvent.patch +++ b/Spigot-API-Patches/0064-ProfileWhitelistVerifyEvent.patch @@ -1,4 +1,4 @@ -From 69a0afed643918933b0ad8f6d81780dafa33cf6b Mon Sep 17 00:00:00 2001 +From 1dfa87d569f72303f04c3a29130145c91f25f506 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 3 Jul 2017 18:11:34 -0500 Subject: [PATCH] ProfileWhitelistVerifyEvent @@ -134,5 +134,5 @@ index 00000000..662e79e3 + } +} -- -2.15.1 +2.18.0 diff --git a/Spigot-API-Patches/0066-Make-plugins-list-alphabetical.patch b/Spigot-API-Patches/0065-Make-plugins-list-alphabetical.patch similarity index 96% rename from Spigot-API-Patches/0066-Make-plugins-list-alphabetical.patch rename to Spigot-API-Patches/0065-Make-plugins-list-alphabetical.patch index ba7231cc7a..d4c4bdb34a 100644 --- a/Spigot-API-Patches/0066-Make-plugins-list-alphabetical.patch +++ b/Spigot-API-Patches/0065-Make-plugins-list-alphabetical.patch @@ -1,4 +1,4 @@ -From 665b880ec9616fbc2aea0aee0d2d2dbf2a3613e8 Mon Sep 17 00:00:00 2001 +From 86390176ccf85c98f464e5ff6bb90f27952ae60a Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 02:08:55 -0500 Subject: [PATCH] Make /plugins list alphabetical @@ -50,5 +50,5 @@ index e40b03a7..b1d384e8 100644 } } -- -2.15.1 +2.18.0 diff --git a/Spigot-API-Patches/0067-LivingEntity-setKiller.patch b/Spigot-API-Patches/0066-LivingEntity-setKiller.patch similarity index 94% rename from Spigot-API-Patches/0067-LivingEntity-setKiller.patch rename to Spigot-API-Patches/0066-LivingEntity-setKiller.patch index 9ac08e8c39..0958b7fff9 100644 --- a/Spigot-API-Patches/0067-LivingEntity-setKiller.patch +++ b/Spigot-API-Patches/0066-LivingEntity-setKiller.patch @@ -1,4 +1,4 @@ -From ac9baf5c2739f255205d959cc519be2db01773da Mon Sep 17 00:00:00 2001 +From 7963cbbdb5c04bb9f749576c89573aaf1c2279bb Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 01:49:43 -0500 Subject: [PATCH] LivingEntity#setKiller diff --git a/Spigot-API-Patches/0068-Handle-plugin-prefixes-in-implementation-logging-con.patch b/Spigot-API-Patches/0067-Handle-plugin-prefixes-in-implementation-logging-con.patch similarity index 96% rename from Spigot-API-Patches/0068-Handle-plugin-prefixes-in-implementation-logging-con.patch rename to Spigot-API-Patches/0067-Handle-plugin-prefixes-in-implementation-logging-con.patch index 26eefb5c0f..a2afc77712 100644 --- a/Spigot-API-Patches/0068-Handle-plugin-prefixes-in-implementation-logging-con.patch +++ b/Spigot-API-Patches/0067-Handle-plugin-prefixes-in-implementation-logging-con.patch @@ -1,4 +1,4 @@ -From f27a613d49050d6941376ec69d0efa182cab743c Mon Sep 17 00:00:00 2001 +From 99c169a9b437e6bd0088d70cb74c81a221808521 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 21 Sep 2017 16:14:13 +0200 Subject: [PATCH] Handle plugin prefixes in implementation logging @@ -40,5 +40,5 @@ index 16b1eb37..0abad9ad 100644 /** -- -2.15.1 +2.18.0 diff --git a/Spigot-API-Patches/0069-Allow-plugins-to-use-SLF4J-for-logging.patch b/Spigot-API-Patches/0068-Allow-plugins-to-use-SLF4J-for-logging.patch similarity index 94% rename from Spigot-API-Patches/0069-Allow-plugins-to-use-SLF4J-for-logging.patch rename to Spigot-API-Patches/0068-Allow-plugins-to-use-SLF4J-for-logging.patch index 568b0d78f2..2088c28880 100644 --- a/Spigot-API-Patches/0069-Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/Spigot-API-Patches/0068-Allow-plugins-to-use-SLF4J-for-logging.patch @@ -1,4 +1,4 @@ -From 8ae719b2fa6b1e3a270d8cdc7ecea48d8137f2a4 Mon Sep 17 00:00:00 2001 +From 78649d9322cf676aeca08d8f43053600d34a619d Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 21 Sep 2017 16:33:12 +0200 Subject: [PATCH] Allow plugins to use SLF4J for logging @@ -14,7 +14,7 @@ it without having to shade it in the plugin and going through several layers of logging abstraction. diff --git a/pom.xml b/pom.xml -index e1a39bfe..db9a57b0 100644 +index 44a8b2a5..c176dd7b 100644 --- a/pom.xml +++ b/pom.xml @@ -121,6 +121,14 @@ diff --git a/Spigot-API-Patches/0070-Add-workaround-for-plugins-modifying-the-parent-of-t.patch b/Spigot-API-Patches/0069-Add-workaround-for-plugins-modifying-the-parent-of-t.patch similarity index 98% rename from Spigot-API-Patches/0070-Add-workaround-for-plugins-modifying-the-parent-of-t.patch rename to Spigot-API-Patches/0069-Add-workaround-for-plugins-modifying-the-parent-of-t.patch index da9bcb9cb2..8c87429084 100644 --- a/Spigot-API-Patches/0070-Add-workaround-for-plugins-modifying-the-parent-of-t.patch +++ b/Spigot-API-Patches/0069-Add-workaround-for-plugins-modifying-the-parent-of-t.patch @@ -1,4 +1,4 @@ -From 4c8bb1fd1597ec5da47cec0832b705ee68572209 Mon Sep 17 00:00:00 2001 +From 0f5f1f61e5e6128993289722564719846613ed1b Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 21 Sep 2017 19:41:20 +0200 Subject: [PATCH] Add workaround for plugins modifying the parent of the plugin diff --git a/Spigot-API-Patches/0071-Add-PlayerJumpEvent.patch b/Spigot-API-Patches/0070-Add-PlayerJumpEvent.patch similarity index 98% rename from Spigot-API-Patches/0071-Add-PlayerJumpEvent.patch rename to Spigot-API-Patches/0070-Add-PlayerJumpEvent.patch index 1a819e586a..655b8acb66 100644 --- a/Spigot-API-Patches/0071-Add-PlayerJumpEvent.patch +++ b/Spigot-API-Patches/0070-Add-PlayerJumpEvent.patch @@ -1,4 +1,4 @@ -From 01c9b5fa055b84a9b62c60cc067cbe2cdd35d18f Mon Sep 17 00:00:00 2001 +From cb37a11f62d5ad49044c57e9364911f5914708d9 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 28 Sep 2017 17:21:32 -0400 Subject: [PATCH] Add PlayerJumpEvent @@ -112,5 +112,5 @@ index 00000000..dd24f9b0 + } +} -- -2.15.1 +2.18.0 diff --git a/Spigot-API-Patches/0072-Expose-client-protocol-version-and-virtual-host.patch b/Spigot-API-Patches/0071-Expose-client-protocol-version-and-virtual-host.patch similarity index 96% rename from Spigot-API-Patches/0072-Expose-client-protocol-version-and-virtual-host.patch rename to Spigot-API-Patches/0071-Expose-client-protocol-version-and-virtual-host.patch index ab4a399087..bb7824783e 100644 --- a/Spigot-API-Patches/0072-Expose-client-protocol-version-and-virtual-host.patch +++ b/Spigot-API-Patches/0071-Expose-client-protocol-version-and-virtual-host.patch @@ -1,4 +1,4 @@ -From d40adbcb5398dc21486b6b6c8817d751fe9ced12 Mon Sep 17 00:00:00 2001 +From e3792c13f6e712593072cb31dc951110ff1e6632 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Tue, 10 Oct 2017 18:44:42 +0200 Subject: [PATCH] Expose client protocol version and virtual host @@ -55,7 +55,7 @@ index 00000000..9072e384 + +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5c29c11e..60cdd620 100644 +index 47a12d71..362467e5 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -31,7 +31,7 @@ import org.bukkit.scoreboard.Scoreboard; diff --git a/Spigot-API-Patches/0073-Add-PlayerArmorChangeEvent.patch b/Spigot-API-Patches/0072-Add-PlayerArmorChangeEvent.patch similarity index 98% rename from Spigot-API-Patches/0073-Add-PlayerArmorChangeEvent.patch rename to Spigot-API-Patches/0072-Add-PlayerArmorChangeEvent.patch index 20e33d4de1..22fdb88e4b 100644 --- a/Spigot-API-Patches/0073-Add-PlayerArmorChangeEvent.patch +++ b/Spigot-API-Patches/0072-Add-PlayerArmorChangeEvent.patch @@ -1,4 +1,4 @@ -From 62575a75cec03d048cabfce9933dc35c93532832 Mon Sep 17 00:00:00 2001 +From a19dc4df4d2e6230616f78cc0eec847092cded18 Mon Sep 17 00:00:00 2001 From: pkt77 Date: Fri, 10 Nov 2017 23:45:59 -0500 Subject: [PATCH] Add PlayerArmorChangeEvent diff --git a/Spigot-API-Patches/0074-API-to-get-a-BlockState-without-a-snapshot.patch b/Spigot-API-Patches/0073-API-to-get-a-BlockState-without-a-snapshot.patch similarity index 91% rename from Spigot-API-Patches/0074-API-to-get-a-BlockState-without-a-snapshot.patch rename to Spigot-API-Patches/0073-API-to-get-a-BlockState-without-a-snapshot.patch index df3dac21a7..2f844fa647 100644 --- a/Spigot-API-Patches/0074-API-to-get-a-BlockState-without-a-snapshot.patch +++ b/Spigot-API-Patches/0073-API-to-get-a-BlockState-without-a-snapshot.patch @@ -1,4 +1,4 @@ -From e0beaa49adfc67cd4d5144e22f2c3e3c20f13b3b Mon Sep 17 00:00:00 2001 +From 5b78e31d0aeb0cfcf2d3e108326c660d3cfd7aa1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 6 Nov 2017 21:10:01 -0500 Subject: [PATCH] API to get a BlockState without a snapshot @@ -9,7 +9,7 @@ on the real tile entity. This is useful for where performance is needed diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index bda9900e..d5d0e255 100644 +index 1aa3373f..9aab043c 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -242,6 +242,15 @@ public interface Block extends Metadatable { diff --git a/Spigot-API-Patches/0075-AsyncTabCompleteEvent.patch b/Spigot-API-Patches/0074-AsyncTabCompleteEvent.patch similarity index 99% rename from Spigot-API-Patches/0075-AsyncTabCompleteEvent.patch rename to Spigot-API-Patches/0074-AsyncTabCompleteEvent.patch index a224514c3e..b2f8ed36a7 100644 --- a/Spigot-API-Patches/0075-AsyncTabCompleteEvent.patch +++ b/Spigot-API-Patches/0074-AsyncTabCompleteEvent.patch @@ -1,4 +1,4 @@ -From ce5e52c29872bfca3e47d91777b075db4ce21d20 Mon Sep 17 00:00:00 2001 +From 2fe82eb2c39bc39aa0264a02db45e8bf643d1d26 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 26 Nov 2017 13:17:09 -0500 Subject: [PATCH] AsyncTabCompleteEvent @@ -247,5 +247,5 @@ index 6ac437d5..df6eb53d 100644 @Override -- -2.15.1 +2.18.0 diff --git a/Spigot-API-Patches/0076-Display-warning-on-deprecated-recipe-API.patch b/Spigot-API-Patches/0075-Display-warning-on-deprecated-recipe-API.patch similarity index 96% rename from Spigot-API-Patches/0076-Display-warning-on-deprecated-recipe-API.patch rename to Spigot-API-Patches/0075-Display-warning-on-deprecated-recipe-API.patch index 6c90c5df3c..599b38ac7c 100644 --- a/Spigot-API-Patches/0076-Display-warning-on-deprecated-recipe-API.patch +++ b/Spigot-API-Patches/0075-Display-warning-on-deprecated-recipe-API.patch @@ -1,4 +1,4 @@ -From 252d7dcf7c5531b482ea92f756a6847d9b26ad84 Mon Sep 17 00:00:00 2001 +From 92fba1efc29b3550577a18bcf74cb41327f59019 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 9 Dec 2017 12:40:25 -0500 Subject: [PATCH] Display warning on deprecated recipe API @@ -34,5 +34,5 @@ index ca5c09b8..f2dd46f2 100644 } -- -2.15.1 +2.18.0 diff --git a/Spigot-API-Patches/0077-PlayerPickupExperienceEvent.patch b/Spigot-API-Patches/0076-PlayerPickupExperienceEvent.patch similarity index 97% rename from Spigot-API-Patches/0077-PlayerPickupExperienceEvent.patch rename to Spigot-API-Patches/0076-PlayerPickupExperienceEvent.patch index e825e10240..1cb06e31a5 100644 --- a/Spigot-API-Patches/0077-PlayerPickupExperienceEvent.patch +++ b/Spigot-API-Patches/0076-PlayerPickupExperienceEvent.patch @@ -1,4 +1,4 @@ -From 1dcc1f273169ef66f371e8d44ae5133bc314b7df Mon Sep 17 00:00:00 2001 +From 6acec34388a520536f958b9c92c632892c2cef27 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 22:00:41 -0500 Subject: [PATCH] PlayerPickupExperienceEvent @@ -88,5 +88,5 @@ index 00000000..f9ef95cd + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0078-ExperienceOrbMergeEvent.patch b/Spigot-API-Patches/0077-ExperienceOrbMergeEvent.patch similarity index 98% rename from Spigot-API-Patches/0078-ExperienceOrbMergeEvent.patch rename to Spigot-API-Patches/0077-ExperienceOrbMergeEvent.patch index 6e9d51a18c..a483ca9363 100644 --- a/Spigot-API-Patches/0078-ExperienceOrbMergeEvent.patch +++ b/Spigot-API-Patches/0077-ExperienceOrbMergeEvent.patch @@ -1,4 +1,4 @@ -From 796e5d95f60258b2f2c2e8d665f09c5d01fb9823 Mon Sep 17 00:00:00 2001 +From 51c1f56626683e98d9c9728d6ebc399e0123a91b Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 22:56:24 -0500 Subject: [PATCH] ExperienceOrbMergeEvent @@ -96,5 +96,5 @@ index 00000000..fb5b4b86 + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0079-Ability-to-apply-mending-to-XP-API.patch b/Spigot-API-Patches/0078-Ability-to-apply-mending-to-XP-API.patch similarity index 94% rename from Spigot-API-Patches/0079-Ability-to-apply-mending-to-XP-API.patch rename to Spigot-API-Patches/0078-Ability-to-apply-mending-to-XP-API.patch index ce2b3116dc..e0c592a60f 100644 --- a/Spigot-API-Patches/0079-Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-API-Patches/0078-Ability-to-apply-mending-to-XP-API.patch @@ -1,4 +1,4 @@ -From 3fda9a76e026397bae881455bd5ec05d774be252 Mon Sep 17 00:00:00 2001 +From 468f4768ac979bb546fe16cc286ed533ac26e04e Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 20 Dec 2017 17:38:07 -0500 Subject: [PATCH] Ability to apply mending to XP API @@ -10,7 +10,7 @@ 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/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 60cdd620..32ead009 100644 +index 362467e5..6709168b 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -916,12 +916,33 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline diff --git a/Spigot-API-Patches/0080-PreCreatureSpawnEvent.patch b/Spigot-API-Patches/0079-PreCreatureSpawnEvent.patch similarity index 98% rename from Spigot-API-Patches/0080-PreCreatureSpawnEvent.patch rename to Spigot-API-Patches/0079-PreCreatureSpawnEvent.patch index 12ae3e2f65..523147f3f6 100644 --- a/Spigot-API-Patches/0080-PreCreatureSpawnEvent.patch +++ b/Spigot-API-Patches/0079-PreCreatureSpawnEvent.patch @@ -1,4 +1,4 @@ -From 3c047d4917be9616b971aa725a2682d45f814b6d Mon Sep 17 00:00:00 2001 +From 4171ce67cc2901442e728da492533f9fec795711 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 14 Jan 2018 16:59:43 -0500 Subject: [PATCH] PreCreatureSpawnEvent @@ -119,5 +119,5 @@ index 00000000..bac1cef3 + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0081-PlayerNaturallySpawnCreaturesEvent.patch b/Spigot-API-Patches/0080-PlayerNaturallySpawnCreaturesEvent.patch similarity index 97% rename from Spigot-API-Patches/0081-PlayerNaturallySpawnCreaturesEvent.patch rename to Spigot-API-Patches/0080-PlayerNaturallySpawnCreaturesEvent.patch index 085872b524..68a449a916 100644 --- a/Spigot-API-Patches/0081-PlayerNaturallySpawnCreaturesEvent.patch +++ b/Spigot-API-Patches/0080-PlayerNaturallySpawnCreaturesEvent.patch @@ -1,4 +1,4 @@ -From 54bc8edf2d329bbfeb5e48fda52d44bf6fe8a47e Mon Sep 17 00:00:00 2001 +From ce4a90e4f24108e85f7c66050711c1b5667085bb Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 14 Jan 2018 17:31:37 -0500 Subject: [PATCH] PlayerNaturallySpawnCreaturesEvent @@ -76,5 +76,5 @@ index 00000000..7c6953a7 + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0082-Add-SkullMeta.setPlayerProfile-API.patch b/Spigot-API-Patches/0081-Add-SkullMeta.setPlayerProfile-API.patch similarity index 82% rename from Spigot-API-Patches/0082-Add-SkullMeta.setPlayerProfile-API.patch rename to Spigot-API-Patches/0081-Add-SkullMeta.setPlayerProfile-API.patch index 87d6405a05..354a062fa4 100644 --- a/Spigot-API-Patches/0082-Add-SkullMeta.setPlayerProfile-API.patch +++ b/Spigot-API-Patches/0081-Add-SkullMeta.setPlayerProfile-API.patch @@ -1,4 +1,4 @@ -From 96d8312552c442c8489d6dbb914f0623ad74b66b Mon Sep 17 00:00:00 2001 +From fd43f9fb69c2e0792c33ee16e007134728a3df2d Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 19 Jan 2018 00:29:28 -0500 Subject: [PATCH] Add SkullMeta.setPlayerProfile API @@ -7,22 +7,21 @@ 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/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java -index c60860e1..3eea5909 100644 +index 15c1dfd9..a458000f 100644 --- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java -@@ -1,8 +1,11 @@ +@@ -1,7 +1,10 @@ package org.bukkit.inventory.meta; +import com.destroystokyo.paper.profile.PlayerProfile; - import org.bukkit.Material; ++import javax.annotation.Nullable; import org.bukkit.OfflinePlayer; -+import javax.annotation.Nullable; + /** - * Represents a skull ({@link Material#SKULL_ITEM}) that can have an owner. + * Represents a skull that can have an owner. */ -@@ -37,6 +40,20 @@ public interface SkullMeta extends ItemMeta { +@@ -36,6 +39,20 @@ public interface SkullMeta extends ItemMeta { @Deprecated boolean setOwner(String owner); @@ -44,5 +43,5 @@ index c60860e1..3eea5909 100644 * Gets the owner of the skull. * -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0083-Fill-Profile-Property-Events.patch b/Spigot-API-Patches/0082-Fill-Profile-Property-Events.patch similarity index 98% rename from Spigot-API-Patches/0083-Fill-Profile-Property-Events.patch rename to Spigot-API-Patches/0082-Fill-Profile-Property-Events.patch index df29bee08b..d72966c05e 100644 --- a/Spigot-API-Patches/0083-Fill-Profile-Property-Events.patch +++ b/Spigot-API-Patches/0082-Fill-Profile-Property-Events.patch @@ -1,4 +1,4 @@ -From 6411e77da00dacbe848850db4660c86130fda955 Mon Sep 17 00:00:00 2001 +From f932e1e9c552db09887c010fbb179ddf05d4a416 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 2 Jan 2018 00:31:08 -0500 Subject: [PATCH] Fill Profile Property Events @@ -169,5 +169,5 @@ index 00000000..aba0c087 + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0084-PlayerAdvancementCriterionGrantEvent.patch b/Spigot-API-Patches/0083-PlayerAdvancementCriterionGrantEvent.patch similarity index 96% rename from Spigot-API-Patches/0084-PlayerAdvancementCriterionGrantEvent.patch rename to Spigot-API-Patches/0083-PlayerAdvancementCriterionGrantEvent.patch index 40f235cfd7..7975c6c45e 100644 --- a/Spigot-API-Patches/0084-PlayerAdvancementCriterionGrantEvent.patch +++ b/Spigot-API-Patches/0083-PlayerAdvancementCriterionGrantEvent.patch @@ -1,4 +1,4 @@ -From afa05f7fef0d3337d684319325143b4d441cea16 Mon Sep 17 00:00:00 2001 +From b19e61438f5405ee5e004322bed0fea411f18924 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 19 Jan 2018 08:15:14 -0600 Subject: [PATCH] PlayerAdvancementCriterionGrantEvent @@ -69,5 +69,5 @@ index 00000000..b65ee9e5 + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0085-Add-ArmorStand-Item-Meta.patch b/Spigot-API-Patches/0084-Add-ArmorStand-Item-Meta.patch similarity index 97% rename from Spigot-API-Patches/0085-Add-ArmorStand-Item-Meta.patch rename to Spigot-API-Patches/0084-Add-ArmorStand-Item-Meta.patch index e2535aa76e..88d1069f99 100644 --- a/Spigot-API-Patches/0085-Add-ArmorStand-Item-Meta.patch +++ b/Spigot-API-Patches/0084-Add-ArmorStand-Item-Meta.patch @@ -1,4 +1,4 @@ -From f8f9ee57846ba4838769c0eb20ef870dc14cb793 Mon Sep 17 00:00:00 2001 +From 68d7994d386398bd6ad0a51efbb58f1d1357ba0d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 27 Jan 2018 17:06:24 -0500 Subject: [PATCH] Add ArmorStand Item Meta @@ -95,5 +95,5 @@ index 00000000..7e4acfff + void setMarker(boolean marker); +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0086-Optimize-Hoppers.patch b/Spigot-API-Patches/0085-Optimize-Hoppers.patch similarity index 96% rename from Spigot-API-Patches/0086-Optimize-Hoppers.patch rename to Spigot-API-Patches/0085-Optimize-Hoppers.patch index 8c0ae573c0..39edb6f613 100644 --- a/Spigot-API-Patches/0086-Optimize-Hoppers.patch +++ b/Spigot-API-Patches/0085-Optimize-Hoppers.patch @@ -1,4 +1,4 @@ -From cd7a3c2d083750dfd3c520841072a4b7ed8c469b Mon Sep 17 00:00:00 2001 +From 3d903c7ed998ce99c37f5b392021b982b9283955 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 18 Jan 2018 01:00:27 -0500 Subject: [PATCH] Optimize Hoppers @@ -38,5 +38,5 @@ index 06ec99ae..b44cc45b 100644 } -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0087-Tameable-getOwnerUniqueId-API.patch b/Spigot-API-Patches/0086-Tameable-getOwnerUniqueId-API.patch similarity index 94% rename from Spigot-API-Patches/0087-Tameable-getOwnerUniqueId-API.patch rename to Spigot-API-Patches/0086-Tameable-getOwnerUniqueId-API.patch index cb25895261..f9a4857e47 100644 --- a/Spigot-API-Patches/0087-Tameable-getOwnerUniqueId-API.patch +++ b/Spigot-API-Patches/0086-Tameable-getOwnerUniqueId-API.patch @@ -1,4 +1,4 @@ -From 3ff6fc393591f3a29c98ae084e1c67be2eacdee6 Mon Sep 17 00:00:00 2001 +From bc63e16534cb5f723604669f5acb8b70ad600eab Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 24 Feb 2018 00:55:52 -0500 Subject: [PATCH] Tameable#getOwnerUniqueId API @@ -33,5 +33,5 @@ index 44497aa3..0987c1e8 100644 */ public AnimalTamer getOwner(); -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0088-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/Spigot-API-Patches/0087-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch similarity index 96% rename from Spigot-API-Patches/0088-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch rename to Spigot-API-Patches/0087-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index e1578fcf89..2edaf26818 100644 --- a/Spigot-API-Patches/0088-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/Spigot-API-Patches/0087-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -1,4 +1,4 @@ -From 41c7e4edd8c9d6e23f7a546ccee245eea652f073 Mon Sep 17 00:00:00 2001 +From c438100df0d0e3f2210c8a932e596c0dd327ca29 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 18 Mar 2018 11:43:30 -0400 Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent @@ -51,5 +51,5 @@ index 1d571889..0c16128e 100644 this.message = ""; this.name = name; -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0089-Add-extended-PaperServerListPingEvent.patch b/Spigot-API-Patches/0088-Add-extended-PaperServerListPingEvent.patch similarity index 99% rename from Spigot-API-Patches/0089-Add-extended-PaperServerListPingEvent.patch rename to Spigot-API-Patches/0088-Add-extended-PaperServerListPingEvent.patch index 1ffaaf98bf..25bfa6180f 100644 --- a/Spigot-API-Patches/0089-Add-extended-PaperServerListPingEvent.patch +++ b/Spigot-API-Patches/0088-Add-extended-PaperServerListPingEvent.patch @@ -1,4 +1,4 @@ -From d2e267fceb2a1990a2a95c57fd50e653212e5260 Mon Sep 17 00:00:00 2001 +From cbeaccc81b0cf819614ee7f57c7ec2f63aa3477f Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 15:55:38 +0200 Subject: [PATCH] Add extended PaperServerListPingEvent @@ -366,5 +366,5 @@ index 04804706..44563482 100644 + // Paper end } -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0091-Player.setPlayerProfile-API.patch b/Spigot-API-Patches/0089-Player.setPlayerProfile-API.patch similarity index 93% rename from Spigot-API-Patches/0091-Player.setPlayerProfile-API.patch rename to Spigot-API-Patches/0089-Player.setPlayerProfile-API.patch index b9a91b68e6..b808653e89 100644 --- a/Spigot-API-Patches/0091-Player.setPlayerProfile-API.patch +++ b/Spigot-API-Patches/0089-Player.setPlayerProfile-API.patch @@ -1,4 +1,4 @@ -From 8ccc5f587f1e755b7136c87160b2134637905d98 Mon Sep 17 00:00:00 2001 +From dff56416f41aa3ed9bfe8eb38174279b2c189ac4 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 18 Mar 2018 12:28:55 -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/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 32ead009..cd82ff64 100644 +index 6709168b..99080b27 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -3,6 +3,7 @@ package org.bukkit.entity; diff --git a/Spigot-API-Patches/0090-Implement-deprecated-player-sample-API.patch b/Spigot-API-Patches/0090-Implement-deprecated-player-sample-API.patch deleted file mode 100644 index def57f4a6b..0000000000 --- a/Spigot-API-Patches/0090-Implement-deprecated-player-sample-API.patch +++ /dev/null @@ -1,77 +0,0 @@ -From d35e326f5e55fa14cdf9b1eacba970704ddcc16e Mon Sep 17 00:00:00 2001 -From: Minecrell -Date: Mon, 27 Nov 2017 16:21:19 +0100 -Subject: [PATCH] Implement deprecated player sample API - - -diff --git a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java -index dd1deafd..db992df2 100644 ---- a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java -+++ b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java -@@ -4,6 +4,7 @@ import static java.util.Objects.requireNonNull; - - import com.destroystokyo.paper.network.StatusClient; - import com.destroystokyo.paper.profile.PlayerProfile; -+import com.google.common.base.Strings; - import org.bukkit.Bukkit; - import org.bukkit.entity.Player; - import org.bukkit.event.Cancellable; -@@ -316,4 +317,25 @@ public class PaperServerListPingEvent extends ServerListPingEvent implements Can - } - } - -+ // TODO: Remove in 1.13 -+ -+ @Override -+ @Deprecated -+ public List getSampleText() { -+ List sampleText = new ArrayList<>(); -+ for (PlayerProfile profile : getPlayerSample()) { -+ sampleText.add(Strings.nullToEmpty(profile.getName())); -+ } -+ return sampleText; -+ } -+ -+ @Override -+ @Deprecated -+ public void setSampleText(List sample) { -+ getPlayerSample().clear(); -+ for (String name : sample) { -+ getPlayerSample().add(Bukkit.createProfile(name)); -+ } -+ } -+ - } -diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java -index cb8d0fcd..116d7c7a 100644 ---- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java -+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java -@@ -4,6 +4,7 @@ import java.net.InetAddress; - import java.util.Iterator; - import java.util.List; - -+import com.destroystokyo.paper.event.server.PaperServerListPingEvent; - import org.apache.commons.lang.Validate; - import org.bukkit.entity.Player; - import org.bukkit.event.HandlerList; -@@ -151,7 +152,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable - private java.util.List sample; - - /** -- * @deprecated Will be replaced in 1.13 -+ * @deprecated Will be removed in 1.13, use {@link PaperServerListPingEvent#getPlayerSample()} - */ - @Deprecated - public void setSampleText(java.util.List sample) { -@@ -159,7 +160,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable - } - - /** -- * @deprecated Will be replaced in 1.13 -+ * @deprecated Will be removed in 1.13, use {@link PaperServerListPingEvent#getPlayerSample()} - */ - @Deprecated - public java.util.List getSampleText() { --- -2.17.1 - diff --git a/Spigot-API-Patches/0092-getPlayerUniqueId-API.patch b/Spigot-API-Patches/0090-getPlayerUniqueId-API.patch similarity index 97% rename from Spigot-API-Patches/0092-getPlayerUniqueId-API.patch rename to Spigot-API-Patches/0090-getPlayerUniqueId-API.patch index d5c5cc8f21..3cf09f19b1 100644 --- a/Spigot-API-Patches/0092-getPlayerUniqueId-API.patch +++ b/Spigot-API-Patches/0090-getPlayerUniqueId-API.patch @@ -1,4 +1,4 @@ -From 154ed7732b789705984e91d137eb41bd27e6857e Mon Sep 17 00:00:00 2001 +From 9a6d0e5ca85f0cc9a82b7eaa2dc4435cffc6c3d7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 22 Mar 2018 01:39:28 -0400 Subject: [PATCH] getPlayerUniqueId API diff --git a/Spigot-API-Patches/0093-Add-legacy-ping-support-to-PaperServerListPingEvent.patch b/Spigot-API-Patches/0091-Add-legacy-ping-support-to-PaperServerListPingEvent.patch similarity index 94% rename from Spigot-API-Patches/0093-Add-legacy-ping-support-to-PaperServerListPingEvent.patch rename to Spigot-API-Patches/0091-Add-legacy-ping-support-to-PaperServerListPingEvent.patch index 25e0e757d4..a69fa1af2b 100644 --- a/Spigot-API-Patches/0093-Add-legacy-ping-support-to-PaperServerListPingEvent.patch +++ b/Spigot-API-Patches/0091-Add-legacy-ping-support-to-PaperServerListPingEvent.patch @@ -1,4 +1,4 @@ -From b37f3ff8e0ccb80a8f8b5931561cb6b022ac4f41 Mon Sep 17 00:00:00 2001 +From 9889b9a859949be8666d55e15aeff843c5a80d2b Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 19:30:20 +0200 Subject: [PATCH] Add legacy ping support to PaperServerListPingEvent @@ -29,5 +29,5 @@ index 517d1523..ffda9f6a 100644 + } -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0094-Add-method-to-open-already-placed-sign.patch b/Spigot-API-Patches/0092-Add-method-to-open-already-placed-sign.patch similarity index 92% rename from Spigot-API-Patches/0094-Add-method-to-open-already-placed-sign.patch rename to Spigot-API-Patches/0092-Add-method-to-open-already-placed-sign.patch index 6c3ee0aff9..b3f95de743 100644 --- a/Spigot-API-Patches/0094-Add-method-to-open-already-placed-sign.patch +++ b/Spigot-API-Patches/0092-Add-method-to-open-already-placed-sign.patch @@ -1,4 +1,4 @@ -From 184976102b7c58792c87b7092f76f9ed9a4c5d4e Mon Sep 17 00:00:00 2001 +From c8afd6a6b8a7485805ed3eab9cd3b5faf59f6b28 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Sun, 1 Apr 2018 02:28:43 +0300 Subject: [PATCH] Add method to open already placed sign @@ -23,5 +23,5 @@ index 3939d4af..dd95773e 100644 + // Paper end } -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0095-Add-version-history-to-version-command.patch b/Spigot-API-Patches/0093-Add-version-history-to-version-command.patch similarity index 99% rename from Spigot-API-Patches/0095-Add-version-history-to-version-command.patch rename to Spigot-API-Patches/0093-Add-version-history-to-version-command.patch index 8423eafcc1..24d4472a2e 100644 --- a/Spigot-API-Patches/0095-Add-version-history-to-version-command.patch +++ b/Spigot-API-Patches/0093-Add-version-history-to-version-command.patch @@ -1,4 +1,4 @@ -From 2b7db879b8f87e7539717559348c34dfcee58f70 Mon Sep 17 00:00:00 2001 +From df28e17f5f2d148f78f8ae0c03a3a7b51da7b081 Mon Sep 17 00:00:00 2001 From: Kyle Wood Date: Thu, 1 Mar 2018 19:37:52 -0600 Subject: [PATCH] Add version history to version command @@ -197,5 +197,5 @@ index 044361af..c45faf4c 100644 PluginDescriptionFile desc = plugin.getDescription(); sender.sendMessage(ChatColor.GREEN + desc.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + desc.getVersion()); -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0096-Add-Ban-Methods-to-Player-Objects.patch b/Spigot-API-Patches/0094-Add-Ban-Methods-to-Player-Objects.patch similarity index 98% rename from Spigot-API-Patches/0096-Add-Ban-Methods-to-Player-Objects.patch rename to Spigot-API-Patches/0094-Add-Ban-Methods-to-Player-Objects.patch index 1966736500..0d338fefc9 100644 --- a/Spigot-API-Patches/0096-Add-Ban-Methods-to-Player-Objects.patch +++ b/Spigot-API-Patches/0094-Add-Ban-Methods-to-Player-Objects.patch @@ -1,4 +1,4 @@ -From 68981606bad552b49cd120b84b751263dd27c5dc Mon Sep 17 00:00:00 2001 +From 78be1ecf7b7a0c39cef11e710ab52f7257805913 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 28 Apr 2018 10:28:50 -0400 Subject: [PATCH] Add Ban Methods to Player Objects @@ -69,7 +69,7 @@ index 3ab2e4c7..8daf2ddc 100644 /** * Checks if this player is whitelisted or not diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index cd82ff64..2dd9ecfb 100644 +index 99080b27..59c6a097 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -1,10 +1,14 @@ diff --git a/Spigot-API-Patches/0097-EndermanEscapeEvent.patch b/Spigot-API-Patches/0095-EndermanEscapeEvent.patch similarity index 97% rename from Spigot-API-Patches/0097-EndermanEscapeEvent.patch rename to Spigot-API-Patches/0095-EndermanEscapeEvent.patch index fc5a8f2a18..dfc8e6bf56 100644 --- a/Spigot-API-Patches/0097-EndermanEscapeEvent.patch +++ b/Spigot-API-Patches/0095-EndermanEscapeEvent.patch @@ -1,4 +1,4 @@ -From 83671e59f09544a3abe88beef5ed74eb454489f9 Mon Sep 17 00:00:00 2001 +From a76bc604a4fc380fd9fbadf1c30959c6724bc8e0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 13:14:30 -0400 Subject: [PATCH] EndermanEscapeEvent @@ -96,5 +96,5 @@ index 00000000..0d15a8ab + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0098-Enderman.teleportRandomly.patch b/Spigot-API-Patches/0096-Enderman.teleportRandomly.patch similarity index 83% rename from Spigot-API-Patches/0098-Enderman.teleportRandomly.patch rename to Spigot-API-Patches/0096-Enderman.teleportRandomly.patch index 9d876fa664..7dcd6a62ac 100644 --- a/Spigot-API-Patches/0098-Enderman.teleportRandomly.patch +++ b/Spigot-API-Patches/0096-Enderman.teleportRandomly.patch @@ -1,4 +1,4 @@ -From 285b525bcd3fb261160e811c4174086878e58d58 Mon Sep 17 00:00:00 2001 +From ae31d989fe8cdbe48cb5f36db3e9fd7e1a913a97 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 13:29:15 -0400 Subject: [PATCH] Enderman.teleportRandomly() @@ -6,7 +6,7 @@ Subject: [PATCH] Enderman.teleportRandomly() Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java -index c8b4efde..bc2df752 100644 +index ab827f83..459ec0c9 100644 --- a/src/main/java/org/bukkit/entity/Enderman.java +++ b/src/main/java/org/bukkit/entity/Enderman.java @@ -8,6 +8,17 @@ import org.bukkit.material.MaterialData; @@ -25,7 +25,7 @@ index c8b4efde..bc2df752 100644 + // Paper end + /** - * Get the id and data of the block that the Enderman is carrying. + * Gets the id and data of the block that the Enderman is carrying. * -- 2.18.0 diff --git a/Spigot-API-Patches/0099-Additional-world.getNearbyEntities-API-s.patch b/Spigot-API-Patches/0097-Additional-world.getNearbyEntities-API-s.patch similarity index 98% rename from Spigot-API-Patches/0099-Additional-world.getNearbyEntities-API-s.patch rename to Spigot-API-Patches/0097-Additional-world.getNearbyEntities-API-s.patch index ecb4fbbd07..a1c4f3a45b 100644 --- a/Spigot-API-Patches/0099-Additional-world.getNearbyEntities-API-s.patch +++ b/Spigot-API-Patches/0097-Additional-world.getNearbyEntities-API-s.patch @@ -1,4 +1,4 @@ -From b2de08cdbc2ad955bf2f000aa9377b6c23d82b8b Mon Sep 17 00:00:00 2001 +From 5dbaacdda092901a3fbc3dc89d42fa53f9869cfe Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 17:55:28 -0400 Subject: [PATCH] Additional world.getNearbyEntities API's @@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's Provides more methods to get nearby entities, and filter by types and predicates diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 6417cefa..9b49ed38 100644 +index 4cc70326..97badc63 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -2,11 +2,14 @@ package org.bukkit; @@ -24,7 +24,7 @@ index 6417cefa..9b49ed38 100644 import org.bukkit.block.Biome; import org.bukkit.block.Block; -@@ -492,6 +495,205 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -503,6 +506,205 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public Collection getEntitiesByClasses(Class... classes); diff --git a/Spigot-API-Patches/0100-Location.isChunkLoaded-API.patch b/Spigot-API-Patches/0098-Location.isChunkLoaded-API.patch similarity index 90% rename from Spigot-API-Patches/0100-Location.isChunkLoaded-API.patch rename to Spigot-API-Patches/0098-Location.isChunkLoaded-API.patch index 807cddb49f..288e0e9ed3 100644 --- a/Spigot-API-Patches/0100-Location.isChunkLoaded-API.patch +++ b/Spigot-API-Patches/0098-Location.isChunkLoaded-API.patch @@ -1,4 +1,4 @@ -From fab29e96a141caa798cc94404c6625cee93401c8 Mon Sep 17 00:00:00 2001 +From 35e2de767d021fbac9df464ada1422955342bfd6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 19:27:31 -0400 Subject: [PATCH] Location.isChunkLoaded() API @@ -17,5 +17,5 @@ index 5c3d42cc..1ddebf3c 100644 public boolean equals(Object obj) { if (obj == null) { -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0101-Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-API-Patches/0099-Expand-World.spawnParticle-API-and-add-Builder.patch similarity index 99% rename from Spigot-API-Patches/0101-Expand-World.spawnParticle-API-and-add-Builder.patch rename to Spigot-API-Patches/0099-Expand-World.spawnParticle-API-and-add-Builder.patch index ebfd0eb676..6db406028a 100644 --- a/Spigot-API-Patches/0101-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-API-Patches/0099-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -1,4 +1,4 @@ -From 571654be037ad2ec4d0457f75787e01209855415 Mon Sep 17 00:00:00 2001 +From c6a4a37ea77dbc070c7c5297f41a2331a519968a 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 @@ -410,10 +410,10 @@ index 4d0acaf5..0ae85d85 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 9b49ed38..cc74cf53 100644 +index 97badc63..a22e47ea 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1733,7 +1733,31 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1744,7 +1744,31 @@ public interface World extends PluginMessageRecipient, Metadatable { * the type of this depends on {@link Particle#getDataType()} * @param Type */ diff --git a/Spigot-API-Patches/0102-EndermanAttackPlayerEvent.patch b/Spigot-API-Patches/0100-EndermanAttackPlayerEvent.patch similarity index 98% rename from Spigot-API-Patches/0102-EndermanAttackPlayerEvent.patch rename to Spigot-API-Patches/0100-EndermanAttackPlayerEvent.patch index 11f9411e9e..c18675116c 100644 --- a/Spigot-API-Patches/0102-EndermanAttackPlayerEvent.patch +++ b/Spigot-API-Patches/0100-EndermanAttackPlayerEvent.patch @@ -1,4 +1,4 @@ -From e92bcc778ef8292d527034e43d8621ce6759eb4c Mon Sep 17 00:00:00 2001 +From 954a377e0960f18820e9ef8a3098d5f0358a284d Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 May 2018 20:17:44 -0400 Subject: [PATCH] EndermanAttackPlayerEvent @@ -106,5 +106,5 @@ index 00000000..55912659 + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0103-Close-Plugin-Class-Loaders-on-Disable.patch b/Spigot-API-Patches/0101-Close-Plugin-Class-Loaders-on-Disable.patch similarity index 95% rename from Spigot-API-Patches/0103-Close-Plugin-Class-Loaders-on-Disable.patch rename to Spigot-API-Patches/0101-Close-Plugin-Class-Loaders-on-Disable.patch index 9881e33aa5..753dc343c9 100644 --- a/Spigot-API-Patches/0103-Close-Plugin-Class-Loaders-on-Disable.patch +++ b/Spigot-API-Patches/0101-Close-Plugin-Class-Loaders-on-Disable.patch @@ -1,4 +1,4 @@ -From 13d2ed50d6346f5c8eb7833dd99f7c61e8fd0b29 Mon Sep 17 00:00:00 2001 +From 9e505b4488cc6cb5a94d213092c949a2895c7cad Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 May 2018 21:33:35 -0400 Subject: [PATCH] Close Plugin Class Loaders on Disable @@ -100,10 +100,10 @@ index bd0588a2..cb2b0b9c 100644 lookupNames.clear(); HandlerList.unregisterAll(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 40fd71dc..3e87c3dd 100644 +index 72d506d1..3cff01b6 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -317,7 +317,7 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -319,7 +319,7 @@ public final class JavaPluginLoader implements PluginLoader { } catch (Throwable ex) { server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); // Paper start - Disable plugins that fail to load @@ -112,7 +112,7 @@ index 40fd71dc..3e87c3dd 100644 return; // Paper end } -@@ -328,7 +328,13 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -330,7 +330,13 @@ public final class JavaPluginLoader implements PluginLoader { } } @@ -126,7 +126,7 @@ index 40fd71dc..3e87c3dd 100644 Validate.isTrue(plugin instanceof JavaPlugin, "Plugin is not associated with this PluginLoader"); if (plugin.isEnabled()) { -@@ -355,6 +361,16 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -357,6 +363,16 @@ public final class JavaPluginLoader implements PluginLoader { for (String name : names) { removeClass(name); } @@ -144,5 +144,5 @@ index 40fd71dc..3e87c3dd 100644 } } -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0104-WitchConsumePotionEvent.patch b/Spigot-API-Patches/0102-WitchConsumePotionEvent.patch similarity index 97% rename from Spigot-API-Patches/0104-WitchConsumePotionEvent.patch rename to Spigot-API-Patches/0102-WitchConsumePotionEvent.patch index 89e6d56cb6..8f325aa2c2 100644 --- a/Spigot-API-Patches/0104-WitchConsumePotionEvent.patch +++ b/Spigot-API-Patches/0102-WitchConsumePotionEvent.patch @@ -1,4 +1,4 @@ -From 7afba907835ff028bc6df4bbc8a61c721913e328 Mon Sep 17 00:00:00 2001 +From be2efe30ca0ea347d901f873e416d2e9b4973156 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 16 May 2018 20:26:16 -0400 Subject: [PATCH] WitchConsumePotionEvent @@ -115,5 +115,5 @@ index 00000000..6ef6367b + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0105-WitchThrowPotionEvent.patch b/Spigot-API-Patches/0103-WitchThrowPotionEvent.patch similarity index 97% rename from Spigot-API-Patches/0105-WitchThrowPotionEvent.patch rename to Spigot-API-Patches/0103-WitchThrowPotionEvent.patch index e96eca5d34..d04653f5e1 100644 --- a/Spigot-API-Patches/0105-WitchThrowPotionEvent.patch +++ b/Spigot-API-Patches/0103-WitchThrowPotionEvent.patch @@ -1,4 +1,4 @@ -From 56bcd520031264156557ee37406ad31801e4615e Mon Sep 17 00:00:00 2001 +From 4b9da1b2e0d668e73dba9a673984af7d0be648cd Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 16 May 2018 20:39:09 -0400 Subject: [PATCH] WitchThrowPotionEvent @@ -79,5 +79,5 @@ index 6ef6367b..77487e28 100644 @Override -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0106-Location.toBlockLocation-toCenterLocation.patch b/Spigot-API-Patches/0104-Location.toBlockLocation-toCenterLocation.patch similarity index 95% rename from Spigot-API-Patches/0106-Location.toBlockLocation-toCenterLocation.patch rename to Spigot-API-Patches/0104-Location.toBlockLocation-toCenterLocation.patch index 22bc12d302..2a046aae94 100644 --- a/Spigot-API-Patches/0106-Location.toBlockLocation-toCenterLocation.patch +++ b/Spigot-API-Patches/0104-Location.toBlockLocation-toCenterLocation.patch @@ -1,4 +1,4 @@ -From b3a03a0fef09bf81b68cda7d9bbeca9fbe0620f8 Mon Sep 17 00:00:00 2001 +From fedd7fd91d2e697183c38f16f58ba29791a4ab28 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 24 May 2018 21:01:13 -0400 Subject: [PATCH] Location.toBlockLocation/toCenterLocation() @@ -40,5 +40,5 @@ index 1ddebf3c..916238c4 100644 public boolean equals(Object obj) { if (obj == null) { -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0107-PotionEffect-clone-methods.patch b/Spigot-API-Patches/0105-PotionEffect-clone-methods.patch similarity index 96% rename from Spigot-API-Patches/0107-PotionEffect-clone-methods.patch rename to Spigot-API-Patches/0105-PotionEffect-clone-methods.patch index 60e44cc86e..50e3684671 100644 --- a/Spigot-API-Patches/0107-PotionEffect-clone-methods.patch +++ b/Spigot-API-Patches/0105-PotionEffect-clone-methods.patch @@ -1,4 +1,4 @@ -From 65451a70d7b009c6be27094e4bce37b1fa9e0055 Mon Sep 17 00:00:00 2001 +From c6aee3dcccadea3bd3d205b5a57976282695ffd6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 3 Jun 2018 04:10:13 -0400 Subject: [PATCH] PotionEffect clone methods @@ -40,5 +40,5 @@ index e7b86f85..53fb428f 100644 int type = getInt(map, TYPE); PotionEffectType effect = PotionEffectType.getById(type); -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0108-WitchReadyPotionEvent.patch b/Spigot-API-Patches/0106-WitchReadyPotionEvent.patch similarity index 97% rename from Spigot-API-Patches/0108-WitchReadyPotionEvent.patch rename to Spigot-API-Patches/0106-WitchReadyPotionEvent.patch index a15e0f3599..30099bc76e 100644 --- a/Spigot-API-Patches/0108-WitchReadyPotionEvent.patch +++ b/Spigot-API-Patches/0106-WitchReadyPotionEvent.patch @@ -1,4 +1,4 @@ -From 2f1e07e1372f23f43228dfa883f7c68b3693efc0 Mon Sep 17 00:00:00 2001 +From 22191113338e641960b5fa666940463514f187cb Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Jun 2018 22:47:08 -0400 Subject: [PATCH] WitchReadyPotionEvent @@ -83,5 +83,5 @@ index 00000000..5082662a + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0109-ItemStack-getMaxItemUseDuration.patch b/Spigot-API-Patches/0107-ItemStack-getMaxItemUseDuration.patch similarity index 93% rename from Spigot-API-Patches/0109-ItemStack-getMaxItemUseDuration.patch rename to Spigot-API-Patches/0107-ItemStack-getMaxItemUseDuration.patch index 04ab07806d..950f9000dd 100644 --- a/Spigot-API-Patches/0109-ItemStack-getMaxItemUseDuration.patch +++ b/Spigot-API-Patches/0107-ItemStack-getMaxItemUseDuration.patch @@ -1,4 +1,4 @@ -From bcf7365a6ac997f6b7e3276a64c010a244d5d642 Mon Sep 17 00:00:00 2001 +From a51daa61f1e96d6ddce2e5a205da53be66293ba2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Jun 2018 22:59:50 -0400 Subject: [PATCH] ItemStack#getMaxItemUseDuration diff --git a/Spigot-API-Patches/0110-Add-EntityTeleportEndGatewayEvent.patch b/Spigot-API-Patches/0108-Add-EntityTeleportEndGatewayEvent.patch similarity index 94% rename from Spigot-API-Patches/0110-Add-EntityTeleportEndGatewayEvent.patch rename to Spigot-API-Patches/0108-Add-EntityTeleportEndGatewayEvent.patch index d8407d9e07..445fe7c342 100644 --- a/Spigot-API-Patches/0110-Add-EntityTeleportEndGatewayEvent.patch +++ b/Spigot-API-Patches/0108-Add-EntityTeleportEndGatewayEvent.patch @@ -1,4 +1,4 @@ -From 68c89dbfd099490e99b0c394d263cb6f7ca05c7e Mon Sep 17 00:00:00 2001 +From 15c16def63477471b46d0e8620061f60a87afb9e Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 9 Jun 2018 13:08:21 +0100 Subject: [PATCH] Add EntityTeleportEndGatewayEvent @@ -40,5 +40,5 @@ index 00000000..80899ecb + +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0111-Add-SentientNPC-Interface-to-Entities.patch b/Spigot-API-Patches/0109-Add-SentientNPC-Interface-to-Entities.patch similarity index 92% rename from Spigot-API-Patches/0111-Add-SentientNPC-Interface-to-Entities.patch rename to Spigot-API-Patches/0109-Add-SentientNPC-Interface-to-Entities.patch index a073233651..8b1e2cde25 100644 --- a/Spigot-API-Patches/0111-Add-SentientNPC-Interface-to-Entities.patch +++ b/Spigot-API-Patches/0109-Add-SentientNPC-Interface-to-Entities.patch @@ -1,4 +1,4 @@ -From 80cc0c18e993c665f6aaf581b65e6c627a4a5805 Mon Sep 17 00:00:00 2001 +From 3945a9c95cb03bb2b784ca479a563e7c58dcfeb8 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 @@ -152,17 +152,6 @@ index 0d87d203..d4eee19c 100644 /** * @return The size of the slime -diff --git a/src/main/java/org/bukkit/entity/WaterMob.java b/src/main/java/org/bukkit/entity/WaterMob.java -index 3e89ca0c..8d105e72 100644 ---- a/src/main/java/org/bukkit/entity/WaterMob.java -+++ b/src/main/java/org/bukkit/entity/WaterMob.java -@@ -3,4 +3,5 @@ package org.bukkit.entity; - /** - * Represents a Water Mob - */ --public interface WaterMob extends LivingEntity {} -+public interface WaterMob extends LivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper -+} -- 2.18.0 diff --git a/Spigot-API-Patches/0112-Make-shield-blocking-delay-configurable.patch b/Spigot-API-Patches/0110-Make-shield-blocking-delay-configurable.patch similarity index 84% rename from Spigot-API-Patches/0112-Make-shield-blocking-delay-configurable.patch rename to Spigot-API-Patches/0110-Make-shield-blocking-delay-configurable.patch index 6f4edc3805..fa75bd794c 100644 --- a/Spigot-API-Patches/0112-Make-shield-blocking-delay-configurable.patch +++ b/Spigot-API-Patches/0110-Make-shield-blocking-delay-configurable.patch @@ -1,14 +1,14 @@ -From cfe3f366cacec9477b3f69fdf9da3e70c11d1b09 Mon Sep 17 00:00:00 2001 +From 118e1b69d8392749b045d2022d9acc9ccef3de5e 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/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 42cf95e1..5921c952 100644 +index 700ed29f..7ea7ccf0 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -385,5 +385,19 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti +@@ -401,5 +401,19 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti * @param arrows Number of arrows to stick in this entity */ void setArrowsStuck(int arrows); @@ -29,5 +29,5 @@ index 42cf95e1..5921c952 100644 // Paper end } -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0113-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-API-Patches/0111-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch similarity index 95% rename from Spigot-API-Patches/0113-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch rename to Spigot-API-Patches/0111-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index 5cbcc04ef0..9d83c76d71 100644 --- a/Spigot-API-Patches/0113-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-API-Patches/0111-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -1,4 +1,4 @@ -From 700930b99045dbef4f1c65e7edda7d67edb3680c Mon Sep 17 00:00:00 2001 +From c80d0e0381e3d1b215422e47bb2d3006a14eaf92 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 @@ -39,5 +39,5 @@ index f8c91a13..c9eb75aa 100644 this.projectile = projectile; this.force = force; -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0114-Add-getNearbyXXX-methods-to-Location.patch b/Spigot-API-Patches/0112-Add-getNearbyXXX-methods-to-Location.patch similarity index 99% rename from Spigot-API-Patches/0114-Add-getNearbyXXX-methods-to-Location.patch rename to Spigot-API-Patches/0112-Add-getNearbyXXX-methods-to-Location.patch index 2ed0857f95..a50888a255 100644 --- a/Spigot-API-Patches/0114-Add-getNearbyXXX-methods-to-Location.patch +++ b/Spigot-API-Patches/0112-Add-getNearbyXXX-methods-to-Location.patch @@ -1,4 +1,4 @@ -From 8dae21e28f695e73fa04d18e1bdc00d2436cbf22 Mon Sep 17 00:00:00 2001 +From a709f75d9481442be8e2c93a1aea4d952ae0ea0b 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 @@ -220,5 +220,5 @@ index 916238c4..c1689168 100644 @Override public boolean equals(Object obj) { -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0115-PlayerReadyArrowEvent.patch b/Spigot-API-Patches/0113-PlayerReadyArrowEvent.patch similarity index 98% rename from Spigot-API-Patches/0115-PlayerReadyArrowEvent.patch rename to Spigot-API-Patches/0113-PlayerReadyArrowEvent.patch index ebaaac60e1..ba6aa6a05b 100644 --- a/Spigot-API-Patches/0115-PlayerReadyArrowEvent.patch +++ b/Spigot-API-Patches/0113-PlayerReadyArrowEvent.patch @@ -1,4 +1,4 @@ -From 464e3985e5e2c29198f15414c94c9abb75d8aed3 Mon Sep 17 00:00:00 2001 +From 92facfd2330948fd4cce26393a114a210833044c Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 18 Jun 2018 01:09:27 -0400 Subject: [PATCH] PlayerReadyArrowEvent @@ -101,5 +101,5 @@ index 00000000..c6add1b1 + } +} -- -2.17.1 +2.18.0 diff --git a/Spigot-API-Patches/0116-Add-EntityKnockbackByEntityEvent.patch b/Spigot-API-Patches/0114-Add-EntityKnockbackByEntityEvent.patch similarity index 96% rename from Spigot-API-Patches/0116-Add-EntityKnockbackByEntityEvent.patch rename to Spigot-API-Patches/0114-Add-EntityKnockbackByEntityEvent.patch index b386cf694d..1e5f9ae91b 100644 --- a/Spigot-API-Patches/0116-Add-EntityKnockbackByEntityEvent.patch +++ b/Spigot-API-Patches/0114-Add-EntityKnockbackByEntityEvent.patch @@ -1,4 +1,4 @@ -From ec1d10299d09e368cbafa5917ea3f34d11ad6ef5 Mon Sep 17 00:00:00 2001 +From 09c65738e9deb67f2f09af03f8fdf7e55030239a Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Mon, 18 Jun 2018 15:40:39 +0200 Subject: [PATCH] Add EntityKnockbackByEntityEvent @@ -78,5 +78,5 @@ index 00000000..99f7ef70 + } +} -- -2.16.1.windows.1 +2.18.0 diff --git a/Spigot-API-Patches/0117-Expand-Explosions-API.patch b/Spigot-API-Patches/0115-Expand-Explosions-API.patch similarity index 98% rename from Spigot-API-Patches/0117-Expand-Explosions-API.patch rename to Spigot-API-Patches/0115-Expand-Explosions-API.patch index 2d33acefcc..bc64fbf3f7 100644 --- a/Spigot-API-Patches/0117-Expand-Explosions-API.patch +++ b/Spigot-API-Patches/0115-Expand-Explosions-API.patch @@ -1,4 +1,4 @@ -From 8e19f89eca90b5ea616a877f3a0d9c2379a42bda Mon Sep 17 00:00:00 2001 +From fecce987f570eaaf23ffd3482a77dd263e98060f Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 16:24:42 -0500 Subject: [PATCH] Expand Explosions API @@ -95,10 +95,10 @@ index c1689168..d0d86e1a 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 cc74cf53..2c1056d1 100644 +index a22e47ea..04c174f7 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -914,6 +914,99 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -925,6 +925,99 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public boolean createExplosion(Location loc, float power, boolean setFire); diff --git a/Spigot-API-Patches/0118-ItemStack-API-additions-for-quantity-flags-lore.patch b/Spigot-API-Patches/0116-ItemStack-API-additions-for-quantity-flags-lore.patch similarity index 98% rename from Spigot-API-Patches/0118-ItemStack-API-additions-for-quantity-flags-lore.patch rename to Spigot-API-Patches/0116-ItemStack-API-additions-for-quantity-flags-lore.patch index 978dcfefd5..d8da7feb28 100644 --- a/Spigot-API-Patches/0118-ItemStack-API-additions-for-quantity-flags-lore.patch +++ b/Spigot-API-Patches/0116-ItemStack-API-additions-for-quantity-flags-lore.patch @@ -1,4 +1,4 @@ -From 4de5eaeaa68379e316e7c851d6e6e66f2ccdd996 Mon Sep 17 00:00:00 2001 +From 88883a05c172e4fcf52f583bee5640675156df5b 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/Spigot-API-Patches/0119-LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-API-Patches/0117-LivingEntity-Hand-Raised-Item-Use-API.patch similarity index 90% rename from Spigot-API-Patches/0119-LivingEntity-Hand-Raised-Item-Use-API.patch rename to Spigot-API-Patches/0117-LivingEntity-Hand-Raised-Item-Use-API.patch index 33038f84ca..4ad598d7e6 100644 --- a/Spigot-API-Patches/0119-LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-API-Patches/0117-LivingEntity-Hand-Raised-Item-Use-API.patch @@ -1,4 +1,4 @@ -From d76f522b7f164a56a7f9651170e439739ef6e015 Mon Sep 17 00:00:00 2001 +From b438ad8c47194fc97e310672e407a79feeee73dd 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 @@ -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/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 5921c952..5ccb8ef3 100644 +index 7ea7ccf0..fea831e6 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -10,6 +10,7 @@ import org.bukkit.Material; @@ -17,7 +17,7 @@ index 5921c952..5ccb8ef3 100644 import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.projectiles.ProjectileSource; -@@ -399,5 +400,27 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti +@@ -415,5 +416,27 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti * @param delay Delay in ticks */ void setShieldBlockingDelay(int delay); diff --git a/Spigot-API-Patches/0120-RangedEntity-API.patch b/Spigot-API-Patches/0118-RangedEntity-API.patch similarity index 98% rename from Spigot-API-Patches/0120-RangedEntity-API.patch rename to Spigot-API-Patches/0118-RangedEntity-API.patch index 74579a448f..3517621da3 100644 --- a/Spigot-API-Patches/0120-RangedEntity-API.patch +++ b/Spigot-API-Patches/0118-RangedEntity-API.patch @@ -1,4 +1,4 @@ -From d2a1657e1c25dc241d143ee6486513c024a5695b Mon Sep 17 00:00:00 2001 +From c803b354f0aafbc01e813d8c2c1dae0c933251ba Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 26 Jun 2018 21:34:40 -0400 Subject: [PATCH] RangedEntity API diff --git a/Spigot-API-Patches/0121-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch b/Spigot-API-Patches/0119-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch similarity index 96% rename from Spigot-API-Patches/0121-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch rename to Spigot-API-Patches/0119-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch index f0ad8f81f8..68394d20c3 100644 --- a/Spigot-API-Patches/0121-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch +++ b/Spigot-API-Patches/0119-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch @@ -1,4 +1,4 @@ -From 664f399ae92f6c74e4dd132d24c7abe3181c9fc6 Mon Sep 17 00:00:00 2001 +From 24a9e71e950ac0ff3a753f35aed71fa638f71290 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 @@ -53,5 +53,5 @@ index 35f4148b..db105e76 100644 * Gets the entity that was hit, if it was an entity that was hit. * -- -2.16.1.windows.1 +2.18.0 diff --git a/Spigot-API-Patches/0122-Add-World.getEntity-UUID-API.patch b/Spigot-API-Patches/0120-Add-World.getEntity-UUID-API.patch similarity index 83% rename from Spigot-API-Patches/0122-Add-World.getEntity-UUID-API.patch rename to Spigot-API-Patches/0120-Add-World.getEntity-UUID-API.patch index 6102746845..61bcc34f16 100644 --- a/Spigot-API-Patches/0122-Add-World.getEntity-UUID-API.patch +++ b/Spigot-API-Patches/0120-Add-World.getEntity-UUID-API.patch @@ -1,14 +1,14 @@ -From 0db5338a2f3a427e6341c3e7bef58f9ec644a1e7 Mon Sep 17 00:00:00 2001 +From e4c6eec43f3bdf6061fd52063aeb259f0de63da2 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 2c1056d1..c98349cc 100644 +index 04c174f7..121033e9 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -714,6 +714,16 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -725,6 +725,16 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public Collection getNearbyEntities(Location location, double x, double y, double z); diff --git a/Spigot-API-Patches/0123-InventoryCloseEvent-Reason-API.patch b/Spigot-API-Patches/0121-InventoryCloseEvent-Reason-API.patch similarity index 97% rename from Spigot-API-Patches/0123-InventoryCloseEvent-Reason-API.patch rename to Spigot-API-Patches/0121-InventoryCloseEvent-Reason-API.patch index d3e8be94ad..85790fc418 100644 --- a/Spigot-API-Patches/0123-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-API-Patches/0121-InventoryCloseEvent-Reason-API.patch @@ -1,4 +1,4 @@ -From eeec38e29cc2041734e18b87f80400f63fa7734c Mon Sep 17 00:00:00 2001 +From 97af6ce4d4a8a8b3fdf945fb6c9b7e474def6c4c 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/0124-Entity-getChunk-API.patch b/Spigot-API-Patches/0122-Entity-getChunk-API.patch similarity index 93% rename from Spigot-API-Patches/0124-Entity-getChunk-API.patch rename to Spigot-API-Patches/0122-Entity-getChunk-API.patch index f3d37c49f3..ab597021b6 100644 --- a/Spigot-API-Patches/0124-Entity-getChunk-API.patch +++ b/Spigot-API-Patches/0122-Entity-getChunk-API.patch @@ -1,4 +1,4 @@ -From 99dd52878fbaede269af3c5cf38c179688506099 Mon Sep 17 00:00:00 2001 +From 094ab21aca5c9ccbd61e95bf8f247a7f51526c03 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 02:25:48 -0400 Subject: [PATCH] Entity#getChunk API diff --git a/Spigot-API-Patches/0125-Vex-getOwner-API.patch b/Spigot-API-Patches/0123-Vex-getOwner-API.patch similarity index 92% rename from Spigot-API-Patches/0125-Vex-getOwner-API.patch rename to Spigot-API-Patches/0123-Vex-getOwner-API.patch index 4c9818eba6..3471cbd129 100644 --- a/Spigot-API-Patches/0125-Vex-getOwner-API.patch +++ b/Spigot-API-Patches/0123-Vex-getOwner-API.patch @@ -1,4 +1,4 @@ -From 02a5c50ac1f88560d7555bc299b4d785f9aa63a4 Mon Sep 17 00:00:00 2001 +From b906caf7828cd434767fed31635d853b077d7d09 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 15:29:21 -0400 Subject: [PATCH] Vex#getOwner API diff --git a/Spigot-Server-Patches/0001-POM-Changes.patch b/Spigot-Server-Patches/0001-POM-Changes.patch index 3db7c07cee..5200e9fa86 100644 --- a/Spigot-Server-Patches/0001-POM-Changes.patch +++ b/Spigot-Server-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From 5258658fb54ee446f0043988e56a589b2e9ffdae Mon Sep 17 00:00:00 2001 +From 05b70bbd7bf543c94832d486d58987b490016c8d 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 1278c628e..4abf8dde7 100644 +index 958eb763a..17bc80776 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,12 @@ @@ -17,7 +17,7 @@ index 1278c628e..4abf8dde7 100644 + com.destroystokyo.paper + paper jar - 1.12.2-R0.1-SNAPSHOT + 1.13-pre7-R0.1-SNAPSHOT - Spigot - http://www.spigotmc.org + Paper @@ -25,7 +25,7 @@ index 1278c628e..4abf8dde7 100644 UTF-8 -@@ -21,8 +21,8 @@ +@@ -21,16 +21,16 @@ @@ -36,9 +36,8 @@ index 1278c628e..4abf8dde7 100644 dev-SNAPSHOT ../pom.xml -@@ -36,8 +36,8 @@ - compile - + + - org.spigotmc - spigot-api @@ -47,7 +46,7 @@ index 1278c628e..4abf8dde7 100644 ${project.version} compile -@@ -108,34 +108,22 @@ +@@ -101,34 +101,22 @@ @@ -93,9 +92,9 @@ index 1278c628e..4abf8dde7 100644 -@@ -145,11 +133,12 @@ +@@ -138,11 +126,12 @@ maven-jar-plugin - 3.0.2 + 2.4 + true @@ -107,7 +106,7 @@ index 1278c628e..4abf8dde7 100644 ${maven.build.timestamp} Bukkit ${api.version} -@@ -189,19 +178,22 @@ +@@ -182,19 +171,22 @@ shade @@ -138,7 +137,7 @@ index 1278c628e..4abf8dde7 100644 org.bukkit.craftbukkit org.bukkit.craftbukkit.v${minecraft_version} -@@ -227,18 +219,6 @@ +@@ -220,18 +212,6 @@ org.apache.maven.plugins maven-compiler-plugin 3.7.0 @@ -157,7 +156,7 @@ index 1278c628e..4abf8dde7 100644 org.apache.maven.plugins -@@ -258,6 +238,11 @@ +@@ -250,6 +230,11 @@ development @@ -183,5 +182,5 @@ index 93046379d..674096cab 100644 if (stream != null) { -- -2.15.0 +2.18.0 diff --git a/Spigot-Server-Patches/0002-Paper-config-files.patch b/Spigot-Server-Patches/0002-Paper-config-files.patch index dca9b0c0d5..8efd41c0f8 100644 --- a/Spigot-Server-Patches/0002-Paper-config-files.patch +++ b/Spigot-Server-Patches/0002-Paper-config-files.patch @@ -1,4 +1,4 @@ -From ea90973fc4de71ac189efc820005ea00590223b5 Mon Sep 17 00:00:00 2001 +From 95d232b2294d238a0e77279b32e6870003ab28ba 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,12 +6,15 @@ 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 00000000..ecd1c65a +index 000000000..e8f7b7292 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java -@@ -0,0 +1,193 @@ +@@ -0,0 +1,237 @@ +package com.destroystokyo.paper; + ++import com.google.common.base.Functions; ++import com.google.common.collect.Iterables; ++import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import net.minecraft.server.*; +import org.apache.commons.lang3.tuple.MutablePair; @@ -44,20 +47,61 @@ index 00000000..ecd1c65a + @Override + public List tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException { + if (args.length <= 1) -+ return CommandAbstract.getListMatchingLast(args, "heap", "entity", "reload", "version"); ++ return getListMatchingLast(args, "heap", "entity", "reload", "version"); + + switch (args[0].toLowerCase(Locale.ENGLISH)) + { + case "entity": + if (args.length == 2) -+ return CommandAbstract.getListMatchingLast(args, "help", "list"); ++ return getListMatchingLast(args, "help", "list"); + if (args.length == 3) -+ return CommandAbstract.getListMatchingLast(args, EntityTypes.getEntityNameList().stream().map(MinecraftKey::toString).sorted().toArray(String[]::new)); ++ return getListMatchingLast(args, EntityTypes.getEntityNameList().stream().map(MinecraftKey::toString).sorted().toArray(String[]::new)); + break; + } + return Collections.emptyList(); + } + ++ // Code from Mojang - copyright them ++ public static List getListMatchingLast(String[] args, String... matches) { ++ return getListMatchingLast(args, (Collection) Arrays.asList(matches)); ++ } ++ ++ public static boolean matches(String s, String s1) { ++ return s1.regionMatches(true, 0, s, 0, s.length()); ++ } ++ ++ public static List getListMatchingLast(String[] strings, Collection collection) { ++ String last = strings[strings.length - 1]; ++ ArrayList results = Lists.newArrayList(); ++ ++ if (!collection.isEmpty()) { ++ Iterator iterator = Iterables.transform(collection, Functions.toStringFunction()).iterator(); ++ ++ while (iterator.hasNext()) { ++ String s1 = (String) iterator.next(); ++ ++ if (matches(last, s1)) { ++ results.add(s1); ++ } ++ } ++ ++ if (results.isEmpty()) { ++ iterator = collection.iterator(); ++ ++ while (iterator.hasNext()) { ++ Object object = iterator.next(); ++ ++ if (object instanceof MinecraftKey && matches(last, ((MinecraftKey) object).getKey())) { ++ results.add(String.valueOf(object)); ++ } ++ } ++ } ++ } ++ ++ return results; ++ } ++ // end copy stuff ++ + @Override + public boolean execute(CommandSender sender, String commandLabel, String[] args) { + if (!testPermission(sender)) return true; @@ -139,7 +183,7 @@ index 00000000..ecd1c65a + + List entities = world.entityList; + entities.forEach(e -> { -+ MinecraftKey key = EntityTypes.getKey(e); ++ MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch + + MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); @@ -205,7 +249,7 @@ index 00000000..ecd1c65a +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java new file mode 100644 -index 00000000..3d8ee9ed +index 000000000..3d8ee9ed3 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +1,173 @@ @@ -384,7 +428,7 @@ index 00000000..3d8ee9ed +} 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 00000000..621bf705 +index 000000000..621bf7051 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +1,66 @@ @@ -454,23 +498,11 @@ index 00000000..621bf705 + return config.getString("world-settings." + worldName + "." + path, config.getString("world-settings.default." + path)); + } +} -diff --git a/src/main/java/net/minecraft/server/CommandAbstract.java b/src/main/java/net/minecraft/server/CommandAbstract.java -index 76501e29..76bf04f5 100644 ---- a/src/main/java/net/minecraft/server/CommandAbstract.java -+++ b/src/main/java/net/minecraft/server/CommandAbstract.java -@@ -634,6 +634,7 @@ public abstract class CommandAbstract implements ICommand { - return s1.regionMatches(true, 0, s, 0, s.length()); - } - -+ public static List getListMatchingLast(String[] args, String... matches) { return a(args, matches); } // Paper - OBFHELPER - public static List a(String[] astring, String... astring1) { - return a(astring, (Collection) Arrays.asList(astring1)); - } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 8c5361d6..e1cb96a8 100644 +index 8563712d9..9155aa727 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -184,6 +184,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -192,6 +192,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer org.spigotmc.SpigotConfig.init((File) options.valueOf("spigot-settings")); org.spigotmc.SpigotConfig.registerCommands(); // Spigot end @@ -482,47 +514,51 @@ index 8c5361d6..e1cb96a8 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 b944be5c..40f06c5b 100644 +index 015959b9f..f3f8b65be 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -122,9 +122,9 @@ public abstract class Entity implements ICommandListener { - private static final DataWatcherObject aD = DataWatcher.a(Entity.class, DataWatcherRegistry.h); - private static final DataWatcherObject aE = DataWatcher.a(Entity.class, DataWatcherRegistry.h); - public boolean aa; -- public int ab; -- public int ac; -- public int ad; -+ public int ab; public int getChunkX() { return ab; } // Paper - OBFHELPER -+ public int ac; public int getChunkY() { return ac; } // Paper - OBFHELPER -+ public int ad; public int getChunkZ() { return ad; } // Paper - OBFHELPER - public boolean ah; +@@ -134,9 +134,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { + private static final DataWatcherObject aG = DataWatcher.a(Entity.class, DataWatcherRegistry.i); + private static final DataWatcherObject aH = DataWatcher.a(Entity.class, DataWatcherRegistry.i); + public boolean inChunk; +- public int ae; +- public int af; +- public int ag; ++ public int ae; public int getChunkX() { return ae; } // Paper - OBFHELPER ++ public int af; public int getChunkY() { return af; } // Paper - OBFHELPER ++ public int ag; public int getChunkZ() { return ag; } // Paper - OBFHELPER + public boolean ak; 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 eb6a955e..77b81a57 100644 +index a0c701f35..557a3f97f 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -21,6 +21,7 @@ public class EntityTypes { - public static final Set d = Sets.newHashSet(); - private static final List g = Lists.newArrayList(); +@@ -2,6 +2,8 @@ package net.minecraft.server; -+ @Nullable public static MinecraftKey getKey(Entity entity) { return a(entity); } // Paper - OBFHELPER - @Nullable - public static MinecraftKey a(Entity entity) { - return getName(entity.getClass()); -@@ -78,6 +79,7 @@ public class EntityTypes { - return entity; - } - -+ public static Set getEntityNameList() { return a(); } // Paper - OBFHELPER - public static Set a() { - return EntityTypes.d; + import com.mojang.datafixers.DataFixUtils; + import com.mojang.datafixers.types.Type; ++ ++import java.util.Set; + import java.util.UUID; + import java.util.function.Function; + import javax.annotation.Nullable; +@@ -323,4 +325,10 @@ public class EntityTypes { + return new EntityTypes(this.a, this.b, this.c, this.d, type); + } } ++ ++ // Paper start ++ public static Set getEntityNameList() { ++ return REGISTRY.keySet(); ++ } ++ // Paper end + } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 740633d9..843320ff 100644 +index c7f5cba2d..330ea4e72 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -129,6 +129,8 @@ public abstract class World implements IBlockAccess { +@@ -127,6 +127,8 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose private int tickPosition; public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot @@ -531,7 +567,7 @@ index 740633d9..843320ff 100644 public final SpigotTimings.WorldTimingsHandler timings; // Spigot private boolean guardEntityList; // Spigot public static boolean haveWeSilencedAPhysicsCrash; -@@ -151,6 +153,7 @@ public abstract class World implements IBlockAccess { +@@ -149,6 +151,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) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot @@ -540,10 +576,10 @@ index 740633d9..843320ff 100644 this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0d320baa..b2bbccb5 100644 +index 8b118e81e..dad2dc959 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -699,6 +699,7 @@ public final class CraftServer implements Server { +@@ -742,6 +742,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot @@ -551,7 +587,7 @@ index 0d320baa..b2bbccb5 100644 for (WorldServer world : console.worlds) { world.worldData.setDifficulty(difficulty); world.setSpawnFlags(monsters, animals); -@@ -714,6 +715,7 @@ public final class CraftServer implements Server { +@@ -757,6 +758,7 @@ public final class CraftServer implements Server { world.ticksPerMonsterSpawns = this.getTicksPerMonsterSpawns(); } world.spigotConfig.init(); // Spigot @@ -559,15 +595,15 @@ index 0d320baa..b2bbccb5 100644 } pluginManager.clearPlugins(); -@@ -721,6 +723,7 @@ public final class CraftServer implements Server { +@@ -764,6 +766,7 @@ public final class CraftServer implements Server { resetRecipes(); reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot + com.destroystokyo.paper.PaperConfig.registerCommands(); // Paper overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); + ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions"); - int pollCount = 0; -@@ -1783,4 +1786,26 @@ public final class CraftServer implements Server { +@@ -1879,4 +1882,26 @@ public final class CraftServer implements Server { { return spigot; } @@ -595,7 +631,7 @@ index 0d320baa..b2bbccb5 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index a151451d..0c5862a3 100644 +index c234b8749..5e49bca8a 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -126,6 +126,14 @@ public class Main { @@ -614,7 +650,7 @@ index a151451d..0c5862a3 100644 }; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 01e73eb8..0b66f5e3 100644 +index 9128f7754..7b1a9a8a0 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -39,31 +39,31 @@ public class SpigotWorldConfig @@ -655,5 +691,5 @@ index 01e73eb8..0b66f5e3 100644 config.addDefault( "world-settings.default." + path, def ); return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) ); -- -2.15.1.windows.2 +2.18.0 diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch index 1599093c0f..465c820e8c 100644 --- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch @@ -1,256 +1,19 @@ -From f4214b8d94c5a9690fa2e41f7b547545dec26549 Mon Sep 17 00:00:00 2001 +From 79ef4326d4c33e7ce3ee139aa0ed5c101762af81 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 d4f412742..d55e180d7 100644 ---- a/src/main/java/net/minecraft/server/BaseBlockPosition.java -+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java -@@ -89,7 +89,7 @@ public class BaseBlockPosition implements Comparable { - return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); - } +diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java +index e8f7b7292..a0ebc1eaa 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java ++++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java +@@ -234,4 +234,5 @@ public class PaperCommand extends Command { -- public int compareTo(Object object) { -+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix - return this.l((BaseBlockPosition) object); + Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Paper config reload complete."); } ++ } -diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index 62a9c92f8..1b7599769 100644 ---- a/src/main/java/net/minecraft/server/BiomeBase.java -+++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -46,7 +46,7 @@ public abstract class BiomeBase { - protected List w; - - public static int a(BiomeBase biomebase) { -- return BiomeBase.REGISTRY_ID.a((Object) biomebase); -+ return BiomeBase.REGISTRY_ID.a(biomebase); // Paper - decompile fix - } - - @Nullable -diff --git a/src/main/java/net/minecraft/server/CommandAbstract.java b/src/main/java/net/minecraft/server/CommandAbstract.java -index 76bf04f56..a99d0f870 100644 ---- a/src/main/java/net/minecraft/server/CommandAbstract.java -+++ b/src/main/java/net/minecraft/server/CommandAbstract.java -@@ -231,7 +231,7 @@ public abstract class CommandAbstract implements ICommand { - } - - if (object != null && oclass.isAssignableFrom(object.getClass())) { -- return (Entity) object; -+ return (T) object; // Paper - fix decompile error - } else { - throw new ExceptionEntityNotFound(s); - } -@@ -448,7 +448,7 @@ public abstract class CommandAbstract implements ICommand { - } - - private static > IBlockData a(IBlockData iblockdata, IBlockState iblockstate, Comparable comparable) { -- return iblockdata.set(iblockstate, comparable); -+ return iblockdata.set(iblockstate, (T) comparable); // Paper - fix decompiler error - } - - public static Predicate b(final Block block, String s) throws ExceptionInvalidBlockState { -@@ -541,7 +541,7 @@ public abstract class CommandAbstract implements ICommand { - - @Nullable - private static > T a(IBlockState iblockstate, String s) { -- return (Comparable) iblockstate.b(s).orNull(); -+ return iblockstate.b(s).orNull(); // Paper - fix decompiler error - } - - public static String a(Object[] aobject) { -@@ -693,7 +693,7 @@ public abstract class CommandAbstract implements ICommand { - return this.getCommand().compareTo(icommand.getCommand()); - } - -- public int compareTo(Object object) { -+ public int compareTo(ICommand object) { // Paper - fix decompile error - return this.a((ICommand) object); - } - -diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 77b81a575..ba461ad48 100644 ---- a/src/main/java/net/minecraft/server/EntityTypes.java -+++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -34,7 +34,7 @@ public class EntityTypes { - - @Nullable - public static String b(Entity entity) { -- int i = EntityTypes.b.a((Object) entity.getClass()); -+ int i = EntityTypes.b.a(entity.getClass()); // Paper - Decompile fix - - return i == -1 ? null : (String) EntityTypes.g.get(i); - } -@@ -254,7 +254,7 @@ public class EntityTypes { - EntityTypes.d.add(minecraftkey); - - while (EntityTypes.g.size() <= i) { -- EntityTypes.g.add((Object) null); -+ EntityTypes.g.add(null); // Paper - Decompile fix - } - - EntityTypes.g.set(i, s1); -diff --git a/src/main/java/net/minecraft/server/LotoSelectorEntry.java b/src/main/java/net/minecraft/server/LotoSelectorEntry.java -index a540167d6..b2860555d 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) { - 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 { - return this.a(jsonelement, type, jsondeserializationcontext); - } - } -diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java -index 58f47d0de..8860a0129 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 - Fix decompile error - - private final IdentityHashMap a; - private final List b; -@@ -26,7 +26,7 @@ public class RegistryBlockID implements Registry { - this.a.put(t0, Integer.valueOf(i)); - - while (this.b.size() <= i) { -- this.b.add((Object) null); -+ this.b.add(null); // Paper - Fix decompile error - } - - this.b.set(i, t0); -diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index 2179664a0..981582212 100644 ---- a/src/main/java/net/minecraft/server/ServerPing.java -+++ b/src/main/java/net/minecraft/server/ServerPing.java -@@ -57,7 +57,8 @@ public class ServerPing { - - public Serializer() {} - -- public ServerPing a(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ // Paper - decompile fix -+ public ServerPing deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { - JsonObject jsonobject = ChatDeserializer.m(jsonelement, "status"); - ServerPing serverping = new ServerPing(); - -@@ -80,7 +81,8 @@ public class ServerPing { - return serverping; - } - -- public JsonElement a(ServerPing serverping, Type type, JsonSerializationContext jsonserializationcontext) { -+ // Paper - decompile fix -+ public JsonElement serialize(ServerPing serverping, Type type, JsonSerializationContext jsonserializationcontext) { - JsonObject jsonobject = new JsonObject(); - - if (serverping.a() != null) { -@@ -101,14 +103,6 @@ public class ServerPing { - - return jsonobject; - } -- -- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -- return this.a((ServerPing) object, type, jsonserializationcontext); -- } -- -- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -- return this.a(jsonelement, type, jsondeserializationcontext); -- } - } - - public static class ServerData { -@@ -133,27 +127,21 @@ public class ServerPing { - - public Serializer() {} - -- public ServerPing.ServerData a(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ // Paper - decompile fix -+ public ServerPing.ServerData deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { - JsonObject jsonobject = ChatDeserializer.m(jsonelement, "version"); - - return new ServerPing.ServerData(ChatDeserializer.h(jsonobject, "name"), ChatDeserializer.n(jsonobject, "protocol")); - } - -- public JsonElement a(ServerPing.ServerData serverping_serverdata, Type type, JsonSerializationContext jsonserializationcontext) { -+ // Paper - decompile fix -+ public JsonElement serialize(ServerPing.ServerData serverping_serverdata, Type type, JsonSerializationContext jsonserializationcontext) { - JsonObject jsonobject = new JsonObject(); - - jsonobject.addProperty("name", serverping_serverdata.a()); - jsonobject.addProperty("protocol", Integer.valueOf(serverping_serverdata.getProtocolVersion())); - return jsonobject; - } -- -- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -- return this.a((ServerPing.ServerData) object, type, jsonserializationcontext); -- } -- -- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -- return this.a(jsonelement, type, jsondeserializationcontext); -- } - } - } - -@@ -188,7 +176,8 @@ public class ServerPing { - - public Serializer() {} - -- public ServerPing.ServerPingPlayerSample a(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ // Paper - decompile fix -+ public ServerPing.ServerPingPlayerSample deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { - JsonObject jsonobject = ChatDeserializer.m(jsonelement, "players"); - ServerPing.ServerPingPlayerSample serverping_serverpingplayersample = new ServerPing.ServerPingPlayerSample(ChatDeserializer.n(jsonobject, "max"), ChatDeserializer.n(jsonobject, "online")); - -@@ -212,7 +201,8 @@ public class ServerPing { - return serverping_serverpingplayersample; - } - -- public JsonElement a(ServerPing.ServerPingPlayerSample serverping_serverpingplayersample, Type type, JsonSerializationContext jsonserializationcontext) { -+ // Paper - decompile fix -+ public JsonElement serialize(ServerPing.ServerPingPlayerSample serverping_serverpingplayersample, Type type, JsonSerializationContext jsonserializationcontext) { - JsonObject jsonobject = new JsonObject(); - - jsonobject.addProperty("max", Integer.valueOf(serverping_serverpingplayersample.a())); -@@ -234,14 +224,6 @@ public class ServerPing { - - return jsonobject; - } -- -- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -- return this.a((ServerPing.ServerPingPlayerSample) object, type, jsonserializationcontext); -- } -- -- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -- return this.a(jsonelement, type, jsondeserializationcontext); -- } - } - } - } -diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java -index f5bcbdbe1..3190cadfc 100644 ---- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java -+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java -@@ -20,7 +20,7 @@ public class ItemFactoryTest extends AbstractTestingBase { - - @Test - public void testKnownAttributes() throws Throwable { -- final ZipInputStream nmsZipStream = new ZipInputStream(CommandAbstract.class/* Magic class that isn't imported! */.getProtectionDomain().getCodeSource().getLocation().openStream()); -+ final ZipInputStream nmsZipStream = new ZipInputStream(net.minecraft.server.HttpUtilities.class/* Magic class that isn't imported! */.getProtectionDomain().getCodeSource().getLocation().openStream()); // Paper - final Collection names = new HashSet(); - for (ZipEntry clazzEntry; (clazzEntry = nmsZipStream.getNextEntry()) != null; ) { - final String entryName = clazzEntry.getName(); -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0004-Paper-Metrics.patch b/Spigot-Server-Patches/0004-Paper-Metrics.patch index b5ac1984bf..dfed421da9 100644 --- a/Spigot-Server-Patches/0004-Paper-Metrics.patch +++ b/Spigot-Server-Patches/0004-Paper-Metrics.patch @@ -1,4 +1,4 @@ -From 41ab68c2065785eadb3187c52f0f1711df713537 Mon Sep 17 00:00:00 2001 +From c6779cede78872af84c68078b5c44deff9b32089 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 24 Mar 2017 23:56:01 -0500 Subject: [PATCH] Paper Metrics @@ -671,10 +671,10 @@ index 3d8ee9ed3..5ab2cf6ee 100644 static void readConfig(Class clazz, Object instance) { diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 1b5158c0d..9ce3e1365 100644 +index ac36ea08e..09100408e 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java -@@ -83,6 +83,7 @@ public class SpigotConfig +@@ -84,6 +84,7 @@ public class SpigotConfig MinecraftServer.getServer().server.getCommandMap().register( entry.getKey(), "Spigot", entry.getValue() ); } @@ -682,7 +682,7 @@ index 1b5158c0d..9ce3e1365 100644 if ( metrics == null ) { try -@@ -94,6 +95,7 @@ public class SpigotConfig +@@ -95,6 +96,7 @@ public class SpigotConfig Bukkit.getServer().getLogger().log( Level.SEVERE, "Could not start metrics service", ex ); } } @@ -691,5 +691,5 @@ index 1b5158c0d..9ce3e1365 100644 static void readConfig(Class clazz, Object instance) -- -2.17.1 +2.18.0 diff --git a/Spigot-Server-Patches/0005-Add-MinecraftKey-Information-to-Objects.patch b/Spigot-Server-Patches/0005-Add-MinecraftKey-Information-to-Objects.patch index 7822e2dad5..ed6d118426 100644 --- a/Spigot-Server-Patches/0005-Add-MinecraftKey-Information-to-Objects.patch +++ b/Spigot-Server-Patches/0005-Add-MinecraftKey-Information-to-Objects.patch @@ -1,30 +1,70 @@ -From 471ff10805ee8ef1b93d19bd05a91b9f372417c9 Mon Sep 17 00:00:00 2001 +From a0f2f840d13536973078d4e2700e65ceff320081 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 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 a0ebc1eaa..e4c771a39 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 { + + List entities = world.entityList; + entities.forEach(e -> { +- MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch ++ MinecraftKey key = e.getMinecraftKey(); + + MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); +@@ -234,5 +234,5 @@ public class PaperCommand extends Command { + + Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Paper config reload complete."); + } +- ++ + } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ed39b122e..3a8902bf1 100644 +index 515c9d875..53fc37088 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -41,7 +41,7 @@ import org.bukkit.event.entity.EntityPortalEvent; +@@ -45,7 +45,7 @@ import org.bukkit.event.entity.EntityPortalEvent; import org.bukkit.plugin.PluginManager; // CraftBukkit end --public abstract class Entity implements ICommandListener { -+public abstract class Entity implements ICommandListener, KeyedObject { // Paper +-public abstract class Entity implements INamableTileEntity, ICommandListener { ++public abstract class Entity implements INamableTileEntity, ICommandListener, KeyedObject { // Paper // CraftBukkit start private static final int CURRENT_LEVEL = 2; -@@ -1702,11 +1702,23 @@ public abstract class Entity implements ICommandListener { +@@ -73,7 +73,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { + 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; + private static int entityCount; +- private final EntityTypes g; ++ private final EntityTypes g; public EntityTypes getEntityType() { return g; } // Paper - OBFHELPER + private int id; + public boolean j; + public final List passengers; +@@ -197,6 +197,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { + } else { + this.defaultActivationState = false; + } ++ // Paper start ++ this.entityKey = EntityTypes.getName(entitytypes); ++ this.entityKeyString = this.entityKey != null ? this.entityKey.toString() : null; ++ // Paper end + // Spigot end + + this.datawatcher = new DataWatcher(this); +@@ -1781,12 +1785,24 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { return true; } + // Paper start -+ public final MinecraftKey entityKey = EntityTypes.getKey(this); -+ public final String entityKeyString = entityKey != null ? entityKey.toString() : null; ++ public final MinecraftKey entityKey; ++ public final String entityKeyString; + + @Override + public MinecraftKey getMinecraftKey() { @@ -37,14 +77,28 @@ index ed39b122e..3a8902bf1 100644 + } @Nullable public final String getSaveID() { -- MinecraftKey minecraftkey = EntityTypes.a(this); +- EntityTypes entitytypes = this.P(); +- MinecraftKey minecraftkey = EntityTypes.getName(entitytypes); - -- return minecraftkey == null ? null : minecraftkey.toString(); -+ return entityKeyString; +- return entitytypes.a() && minecraftkey != null ? minecraftkey.toString() : null; ++ EntityTypes type = this.getEntityType(); ++ return type != null && type.isPersistable() ? entityKeyString : null; + // Paper end } 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 557a3f97f..97cfd6695 100644 +--- a/src/main/java/net/minecraft/server/EntityTypes.java ++++ b/src/main/java/net/minecraft/server/EntityTypes.java +@@ -226,6 +226,7 @@ public class EntityTypes { + } + } + ++ public boolean isPersistable() { return a(); } // Paper - OBFHELPER + public boolean a() { + return this.aV; + } 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..61c2b993c @@ -60,10 +114,10 @@ index 000000000..61c2b993c + } +} diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 5a5a588e7..672ba3134 100644 +index 093e7eb7f..b09325097 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java -@@ -7,7 +7,7 @@ import org.apache.logging.log4j.Logger; +@@ -7,11 +7,11 @@ import org.apache.logging.log4j.Logger; import org.spigotmc.CustomTimingsHandler; // Spigot import org.bukkit.inventory.InventoryHolder; // CraftBukkit @@ -72,15 +126,22 @@ index 5a5a588e7..672ba3134 100644 public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot private static final Logger a = LogManager.getLogger(); -@@ -27,8 +27,21 @@ public abstract class TileEntity { - TileEntity.f.a(new MinecraftKey(s), oclass); +- private final TileEntityTypes e; ++ private final TileEntityTypes e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER + protected World world; + protected BlockPosition position; + protected boolean d; +@@ -21,8 +21,25 @@ public abstract class TileEntity { + public TileEntity(TileEntityTypes tileentitytypes) { + this.position = BlockPosition.ZERO; + this.e = tileentitytypes; ++ // Paper start ++ this.tileEntityKey = TileEntityTypes.a(tileentitytypes); ++ this.tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null; } -- @Nullable -- public static MinecraftKey a(Class oclass) { -+ // Paper start -+ public final MinecraftKey tileEntityKey = getKey(this.getClass()); -+ public final String tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null; ++ public final MinecraftKey tileEntityKey; ++ public final String tileEntityKeyString; + + @Override + public MinecraftKey getMinecraftKey() { @@ -91,11 +152,11 @@ index 5a5a588e7..672ba3134 100644 + public String getMinecraftKeyString() { + return tileEntityKeyString; + } -+ @Nullable public static MinecraftKey getKey(Class oclass) { return a(oclass); } // Paper - OBFHELPER -+ @Nullable public static MinecraftKey a(Class oclass) { - return (MinecraftKey) TileEntity.f.b(oclass); - } - ++ // Paper end ++ + @Nullable + public World getWorld() { + return this.world; -- 2.18.0 diff --git a/Spigot-Server-Patches/0006-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/0006-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index 4310e716a6..8f60c65ff8 100644 --- a/Spigot-Server-Patches/0006-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/0006-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -1,4 +1,4 @@ -From 8613a4e2ae9a4bb6faef75b90d69728a88692dc1 Mon Sep 17 00:00:00 2001 +From 9f15dcf160d9412793b5069dfa9d92e692ac1abc 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,22 +8,22 @@ 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 4bbebb25a..68008fe6a 100644 +index 9500c456d..120e66c78 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -25,7 +25,7 @@ public class Chunk { - private final byte[] g; - private final int[] h; - private final boolean[] i; +@@ -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 public final World world; - public final int[] heightMap; + public final Map heightMap; public final int locX; -@@ -33,6 +33,30 @@ public class Chunk { - private boolean m; - public final Map tileEntities; - public final List[] entitySlices; // Spigot +@@ -63,7 +63,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; + // Paper start + private class TileEntityHashMap extends java.util.HashMap { + @Override @@ -37,7 +37,7 @@ index 4bbebb25a..68008fe6a 100644 + } + return replaced; + } -+ + + @Override + public TileEntity remove(Object key) { + TileEntity removed = super.remove(key); @@ -48,46 +48,52 @@ index 4bbebb25a..68008fe6a 100644 + } + } + // Paper end - private boolean done; - private boolean lit; - private boolean r; -@@ -80,7 +104,7 @@ public class Chunk { - this.g = new byte[256]; - this.h = new int[256]; - this.i = new boolean[256]; + 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(); + this.heightMap = Maps.newHashMap(); - this.tileEntities = Maps.newHashMap(); + this.tileEntities = new TileEntityHashMap(); // Paper - this.x = 4096; - this.y = Queues.newConcurrentLinkedQueue(); - this.entitySlices = (List[]) (new List[16]); // Spigot -@@ -624,6 +648,9 @@ public class Chunk { - this.entityCount.adjustOrPutValue( creatureType.a(), 1, 1 ); - } - } + this.q = Maps.newHashMap(); + this.r = Maps.newHashMap(); + this.s = new ShortList[16]; +@@ -646,6 +669,9 @@ public class Chunk implements IChunkAccess { + entity.af = k; + entity.ag = this.locZ; + this.entitySlices[k].add(entity); + // Paper start + entity.setCurrentChunk(this); + // Paper end - // Spigot end } -@@ -656,6 +683,9 @@ public class Chunk { - this.entityCount.adjustValue( creatureType.a(), -1 ); - } + public void a(HeightMap.Type heightmap_type, long[] along) { +@@ -664,8 +690,12 @@ public class Chunk implements IChunkAccess { + if (i >= this.entitySlices.length) { + i = this.entitySlices.length - 1; } +- +- this.entitySlices[i].remove(entity); + // Paper start ++ if (!this.entitySlices[i].remove(entity)) { ++ return; ++ } + entity.setCurrentChunk(null); + // Paper end - // Spigot end } + public boolean c(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 3a8902bf1..4af566b36 100644 +index 53fc37088..1ef52cc6d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1703,6 +1703,38 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -1786,6 +1786,40 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // Paper start ++ + private java.lang.ref.WeakReference currentChunk = null; + + public void setCurrentChunk(Chunk chunk) { @@ -120,17 +126,19 @@ index 3a8902bf1..4af566b36 100644 + public Chunk getChunkAtLocation() { + return getCurrentChunkAt((int)Math.floor(locX) >> 4, (int)Math.floor(locZ) >> 4); + } - public final MinecraftKey entityKey = EntityTypes.getKey(this); - public final String entityKeyString = entityKey != null ? entityKey.toString() : null; ++ + public final MinecraftKey entityKey; + public final String entityKeyString; diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 672ba3134..d7132c3c0 100644 +index b09325097..b992360ac 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java -@@ -28,6 +28,14 @@ public abstract class TileEntity implements KeyedObject { +@@ -38,6 +38,15 @@ public abstract class TileEntity implements KeyedObject { + public String getMinecraftKeyString() { + return tileEntityKeyString; } - - // Paper start ++ + private java.lang.ref.WeakReference currentChunk = null; + public Chunk getCurrentChunk() { + final Chunk chunk = currentChunk != null ? currentChunk.get() : world.getChunkIfLoaded(position.getX() >> 4, position.getZ() >> 4); @@ -139,11 +147,11 @@ index 672ba3134..d7132c3c0 100644 + public void setCurrentChunk(Chunk chunk) { + this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null; + } - public final MinecraftKey tileEntityKey = getKey(this.getClass()); - public final String tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null; + // Paper end + @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index c5a194ffe..833e3111d 100644 +index 70143c4d3..1e3675e4f 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; @@ -154,7 +162,7 @@ index c5a194ffe..833e3111d 100644 import org.bukkit.EntityEffect; import org.bukkit.Location; import org.bukkit.Server; -@@ -39,6 +40,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -40,6 +41,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { this.entity = entity; } diff --git a/Spigot-Server-Patches/0007-Store-counts-for-each-Entity-Block-Entity-Type.patch b/Spigot-Server-Patches/0007-Store-counts-for-each-Entity-Block-Entity-Type.patch index 56f8ca0add..807ae934d2 100644 --- a/Spigot-Server-Patches/0007-Store-counts-for-each-Entity-Block-Entity-Type.patch +++ b/Spigot-Server-Patches/0007-Store-counts-for-each-Entity-Block-Entity-Type.patch @@ -1,4 +1,4 @@ -From 9638089fa0dcff84f21fc77d17a984b430eb3423 Mon Sep 17 00:00:00 2001 +From fd0ed98b73db46e809681e54d3b823d7b710b507 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,12 +6,12 @@ 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 b40e60942..952c96c0c 100644 +index 120e66c78..0ae780c8e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -34,15 +34,19 @@ public class Chunk { - public final Map tileEntities; - public final List[] entitySlices; // Spigot +@@ -64,15 +64,19 @@ public class Chunk implements IChunkAccess { + private int neighbors = 0x1 << 12; + public long chunkKey; // Paper start + public final co.aikar.util.Counter entityCounts = new co.aikar.util.Counter<>(); + public final co.aikar.util.Counter tileEntityCounts = new co.aikar.util.Counter<>(); @@ -29,7 +29,7 @@ index b40e60942..952c96c0c 100644 } return replaced; } -@@ -52,6 +56,7 @@ public class Chunk { +@@ -82,6 +86,7 @@ public class Chunk implements IChunkAccess { TileEntity removed = super.remove(key); if (removed != null) { removed.setCurrentChunk(null); @@ -37,22 +37,22 @@ index b40e60942..952c96c0c 100644 } return removed; } -@@ -650,6 +655,7 @@ public class Chunk { - } +@@ -671,6 +676,7 @@ public class Chunk implements IChunkAccess { + this.entitySlices[k].add(entity); // Paper start entity.setCurrentChunk(this); + entityCounts.increment(entity.entityKeyString); // Paper end - // Spigot end } -@@ -685,6 +691,7 @@ public class Chunk { + +@@ -695,6 +701,7 @@ public class Chunk implements IChunkAccess { + return; } - // Paper start entity.setCurrentChunk(null); + entityCounts.decrement(entity.entityKeyString); // Paper end - // Spigot end } + -- 2.18.0 diff --git a/Spigot-Server-Patches/0008-MC-Utils.patch b/Spigot-Server-Patches/0008-MC-Utils.patch index c7fd99a993..e59f9a9f1a 100644 --- a/Spigot-Server-Patches/0008-MC-Utils.patch +++ b/Spigot-Server-Patches/0008-MC-Utils.patch @@ -1,24 +1,24 @@ -From 5e79bbc7dee8f1a2e42930e6899b7cf8e928b548 Mon Sep 17 00:00:00 2001 +From d39477408cd88601ee08c0c33ba9a3e56a588f8b 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/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 952c96c0c..cbb1f2cae 100644 +index 0ae780c8e..3b97981bc 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -20,7 +20,7 @@ import org.bukkit.Server; // CraftBukkit - public class Chunk { +@@ -28,7 +28,7 @@ import com.google.common.collect.Lists; // CraftBukkit + public class Chunk implements IChunkAccess { private static final Logger e = 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 byte[] g; - private final int[] h; -@@ -712,6 +712,7 @@ public class Chunk { - return !block.isTileEntity() ? null : ((ITileEntity) block).a(this.world, iblockdata.getBlock().toLegacyData(iblockdata)); + private final BiomeBase[] g; + private final boolean[] h; +@@ -730,6 +730,7 @@ public class Chunk implements IChunkAccess { + return this.a(blockposition, Chunk.EnumTileEntityState.CHECK); } + @Nullable public final TileEntity getTileEntityImmediately(BlockPosition pos) { return this.a(pos, EnumTileEntityState.IMMEDIATE); } // Paper - OBFHELPER @@ -26,11 +26,11 @@ index 952c96c0c..cbb1f2cae 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 239440888..aafd23beb 100644 +index 00a530c51..2947d9ff6 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -@@ -15,6 +15,8 @@ public class ChunkCoordIntPair { - this.z = blockposition.getZ() >> 4; +@@ -24,6 +24,8 @@ public class ChunkCoordIntPair { + return a(this.x, this.z); } + public static long asLong(final BlockPosition pos) { return a(pos.getX() >> 4, pos.getZ() >> 4); } // Paper - OBFHELPER @@ -38,49 +38,51 @@ index 239440888..aafd23beb 100644 public static long a(int i, int j) { return (long) i & 4294967295L | ((long) j & 4294967295L) << 32; } -diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 1f2fe87b6..2cb462b8e 100644 ---- a/src/main/java/net/minecraft/server/DataPaletteBlock.java -+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java -@@ -5,7 +5,7 @@ import javax.annotation.Nullable; - public class DataPaletteBlock implements DataPaletteExpandable { - - private static final DataPalette d = new DataPaletteGlobal(); -- protected static final IBlockData a = Blocks.AIR.getBlockData(); -+ protected static final IBlockData a = Blocks.AIR.getBlockData(); public static final IBlockData DEFAULT_BLOCK_DATA = DataPaletteBlock.a; // Paper - OBFHELPER - protected DataBits b; - protected DataPalette c; - private int e; diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index ba461ad48..2359b31f4 100644 +index 97cfd6695..05ed0abe7 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -13,6 +13,11 @@ import org.apache.logging.log4j.Logger; +@@ -3,6 +3,7 @@ package net.minecraft.server; + import com.mojang.datafixers.DataFixUtils; + import com.mojang.datafixers.types.Type; - public class EntityTypes { ++import java.util.Map; + import java.util.Set; + import java.util.UUID; + import java.util.function.Function; +@@ -121,9 +122,17 @@ public class EntityTypes { + public static EntityTypes a(String s, EntityTypes.a entitytypes_a) { + EntityTypes entitytypes = entitytypes_a.a(s); -+ // Paper start +- EntityTypes.REGISTRY.a(new MinecraftKey(s), entitytypes); ++ // Paper start ++ MinecraftKey key = new MinecraftKey(s); ++ Class entityClass = entitytypes_a.getEntityClass(); ++ EntityTypes.REGISTRY.a(key, entitytypes); ++ clsToKeyMap.put(entityClass, key); ++ clsToTypeMap.put(entityClass, org.bukkit.entity.EntityType.fromName(s)); + return entitytypes; + } + public static Map, MinecraftKey> clsToKeyMap = new java.util.HashMap<>(); + public static Map, org.bukkit.entity.EntityType> clsToTypeMap = new java.util.HashMap<>(); + // Paper end -+ - public static final MinecraftKey a = new MinecraftKey("lightning_bolt"); - private static final MinecraftKey e = new MinecraftKey("player"); - private static final Logger f = LogManager.getLogger(); -@@ -252,6 +257,8 @@ public class EntityTypes { - EntityTypes.b.a(i, minecraftkey, oclass); - EntityTypes.d.add(minecraftkey); -+ clsToKeyMap.put(oclass, minecraftkey); // Paper -+ clsToTypeMap.put(oclass, org.bukkit.entity.EntityType.fromName(s)); // Paper + @Nullable + public static MinecraftKey getName(EntityTypes entitytypes) { +@@ -278,7 +287,7 @@ public class EntityTypes { - while (EntityTypes.g.size() <= i) { - EntityTypes.g.add(null); // Paper - Decompile fix + public static class a { + +- private final Class a; ++ private final Class a; public Class getEntityClass() { return a; } // Paper - OBFHELPER + private final Function b; + private boolean c = true; + private boolean d = true; diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 76bfbaa81..82d72ea15 100644 +index cc96294f4..7f249a975 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -14,6 +14,7 @@ import org.bukkit.Location; +@@ -25,6 +25,7 @@ import org.bukkit.Location; import org.bukkit.TreeType; import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.block.CraftBlockState; @@ -88,8 +90,8 @@ index 76bfbaa81..82d72ea15 100644 import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.entity.Player; import org.bukkit.event.world.StructureGrowEvent; -@@ -583,6 +584,17 @@ public final class ItemStack { - return this.tag != null ? this.tag.getList("ench", 10) : new NBTTagList(); +@@ -547,6 +548,17 @@ public final class ItemStack { + return this.tag != null ? this.tag.getList("Enchantments", 10) : new NBTTagList(); } + // Paper start - (this is just a good no conflict location) @@ -314,19 +316,19 @@ index 000000000..a4b0901cf + } +} diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index aa1ca6d91..e15c23367 100644 +index 7fc9b5ff3..e658816c2 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java -@@ -22,7 +22,7 @@ public class NBTTagCompound extends NBTBase { +@@ -24,7 +24,7 @@ public class NBTTagCompound implements NBTBase { - private static final Logger b = LogManager.getLogger(); - private static final Pattern c = Pattern.compile("[A-Za-z0-9._+-]+"); + private static final Logger f = LogManager.getLogger(); + private static final Pattern g = Pattern.compile("[A-Za-z0-9._+-]+"); - private final Map map = Maps.newHashMap(); + public final Map map = Maps.newHashMap(); // Paper public NBTTagCompound() {} -@@ -94,11 +94,13 @@ public class NBTTagCompound extends NBTBase { +@@ -96,11 +96,13 @@ public class NBTTagCompound implements NBTBase { this.map.put(s, new NBTTagLong(i)); } @@ -340,24 +342,54 @@ index aa1ca6d91..e15c23367 100644 @Nullable public UUID a(String s) { return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least")); +@@ -492,8 +494,4 @@ public class NBTTagCompound implements NBTBase { + return chatcomponenttext; + } + } +- +- public NBTBase clone() { +- return this.clone(); +- } + } diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index e0cb6aa6e..bc6383669 100644 +index b3c944d70..e56d4836d 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java -@@ -13,7 +13,7 @@ import org.apache.logging.log4j.Logger; - public class NBTTagList extends NBTBase { +@@ -14,7 +14,7 @@ import org.apache.logging.log4j.Logger; + public class NBTTagList extends NBTList { - private static final Logger b = LogManager.getLogger(); + private static final Logger f = LogManager.getLogger(); - private List list = Lists.newArrayList(); + public List list = Lists.newArrayList(); // Paper private byte type = 0; public NBTTagList() {} +@@ -297,20 +297,4 @@ public class NBTTagList extends NBTList { + public NBTBase 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/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 8cede938a..cd2d58bfb 100644 +index 3cb868299..227bc857e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -65,9 +65,9 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -66,9 +66,9 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private final MinecraftServer minecraftServer; public EntityPlayer player; private int e; @@ -370,14 +402,6 @@ index 8cede938a..cd2d58bfb 100644 // CraftBukkit start - multithreaded fields private volatile int chatThrottle; private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); -@@ -2158,6 +2158,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - - } - -+ private long getCurrentMillis() { return d(); } // Paper - OBFHELPER - private long d() { - return System.nanoTime() / 1000000L; - } -- 2.18.0 diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch index 6c4aeee228..d737abcd0d 100644 --- a/Spigot-Server-Patches/0009-Timings-v2.patch +++ b/Spigot-Server-Patches/0009-Timings-v2.patch @@ -1,4 +1,4 @@ -From e22eabf390b42d414ad3af7a6d453ef84da87692 Mon Sep 17 00:00:00 2001 +From 169b26f073fe0a751e9e952766ae4fc3da0c4368 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Mar 2016 04:00:11 -0600 Subject: [PATCH] Timings v2 @@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2 diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java new file mode 100644 -index 000000000..1b33390de +index 000000000..4f624e39c --- /dev/null +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java @@ -0,0 +1,125 @@ @@ -124,12 +124,12 @@ index 000000000..1b33390de + } + + public static Timing getBlockTiming(Block block) { -+ return Timings.ofSafe("## Scheduled Block: " + block.getName(), scheduledBlocksTimer); ++ return Timings.ofSafe("## Scheduled Block: " + block.toString(), scheduledBlocksTimer); + } -+ ++/* + public static Timing getStructureTiming(StructureGenerator structureGenerator) { + return Timings.ofSafe("Structure Generator - " + structureGenerator.getName(), structureGenerationTimer); -+ } ++ }*/ + + public static Timing getPacketTiming(Packet packet) { + return Timings.ofSafe("## Packet - " + packet.getClass().getSimpleName(), packetProcessTimer); @@ -274,13 +274,14 @@ index 000000000..089154f62 +} 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 000000000..e0ad559b7 +index 000000000..145cb274b --- /dev/null +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -@@ -0,0 +1,99 @@ +@@ -0,0 +1,104 @@ +package co.aikar.timings; + +import net.minecraft.server.World; ++import net.minecraft.server.WorldServer; + +/** + * Set of timers per world, to track world specific timings. @@ -319,8 +320,8 @@ index 000000000..e0ad559b7 + public final Timing syncChunkLoadDataTimer; + public final Timing syncChunkLoadStructuresTimer; + public final Timing syncChunkLoadPostTimer; -+ public final Timing syncChunkLoadNBTTimer; -+ public final Timing syncChunkLoadPopulateNeighbors; ++ public final Timing syncChunkLoadPopulateTimer; ++ public final Timing chunkLoadLevelTimer; + public final Timing chunkGeneration; + public final Timing chunkIOStage1; + public final Timing chunkIOStage2; @@ -361,8 +362,8 @@ index 000000000..e0ad559b7 + syncChunkLoadDataTimer = Timings.ofSafe(name + "syncChunkLoad - Data"); + syncChunkLoadStructuresTimer = Timings.ofSafe(name + "chunkLoad - recreateStructures"); + syncChunkLoadPostTimer = Timings.ofSafe(name + "chunkLoad - Post"); -+ syncChunkLoadNBTTimer = Timings.ofSafe(name + "chunkLoad - NBT"); -+ syncChunkLoadPopulateNeighbors = Timings.ofSafe(name + "chunkLoad - Populate Neighbors"); ++ syncChunkLoadPopulateTimer = Timings.ofSafe(name + "chunkLoad - Populate"); ++ chunkLoadLevelTimer = Timings.ofSafe(name + "chunkLoad - Load Level"); + chunkGeneration = Timings.ofSafe(name + "chunkGeneration"); + chunkIOStage1 = Timings.ofSafe(name + "ChunkIO Stage 1 - DiskIO"); + chunkIOStage2 = Timings.ofSafe(name + "ChunkIO Stage 2 - Post Load"); @@ -376,6 +377,10 @@ index 000000000..e0ad559b7 + doTick = Timings.ofSafe(name + "doTick"); + tickEntities = Timings.ofSafe(name + "tickEntities"); + } ++ ++ public static Timing getTickList(WorldServer worldserver, String timingsType) { ++ return Timings.ofSafe(worldserver.getWorldData().getName() + " - Scheduled " + timingsType); ++ } +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java index 5ab2cf6ee..b5795b6d3 100644 @@ -422,14 +427,17 @@ index 5ab2cf6ee..b5795b6d3 100644 + } } diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 2dca6dbcb..352310960 100644 +index ffb91b27b..ff110c8e9 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -35,6 +35,15 @@ public class Block { - protected final BlockStateList blockStateList; +@@ -29,8 +29,17 @@ public class Block implements IMaterial { private IBlockData blockData; - private String name; -+ // Paper start + protected final boolean o; + private final boolean p; +- @Nullable +- private String name; ++ @Nullable // Paper start ++ public String name; + public co.aikar.timings.Timing timing; + public co.aikar.timings.Timing getTiming() { + if (timing == null) { @@ -438,133 +446,124 @@ index 2dca6dbcb..352310960 100644 + return timing; + } + // Paper end - - public static int getId(Block block) { - return Block.REGISTRY.a(block); // CraftBukkit - decompile error -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index f540b14a2..472b9c1c3 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -937,7 +937,7 @@ public class Chunk { - - // CraftBukkit start - public void loadNearby(IChunkProvider ichunkprovider, ChunkGenerator chunkgenerator, boolean newChunk) { -- world.timings.syncChunkLoadPostTimer.startTiming(); // Spigot -+ world.timings.syncChunkLoadPostTimer.startTiming(); // Paper - Server server = world.getServer(); - if (server != null) { - /* -@@ -963,7 +963,8 @@ public class Chunk { - } - } - // CraftBukkit end -- -+ world.timings.syncChunkLoadPostTimer.stopTiming(); // Paper -+ world.timings.syncChunkLoadPopulateNeighbors.startTiming(); // Paper - Chunk chunk = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ - 1); - Chunk chunk1 = ichunkprovider.getLoadedChunkAt(this.locX + 1, this.locZ); - Chunk chunk2 = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ + 1); -@@ -988,7 +989,7 @@ public class Chunk { - chunk4.a(chunkgenerator); - } - } -- world.timings.syncChunkLoadPostTimer.stopTiming(); // Spigot -+ world.timings.syncChunkLoadPopulateNeighbors.stopTiming(); // Paper - ++ + private static final ThreadLocal>> r = ThreadLocal.withInitial(() -> { + Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap = new Object2ByteLinkedOpenHashMap(200) { + protected void rehash(int i) {} +diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java +index 5164e5c92..0c2386f5e 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 { } -@@ -1201,6 +1202,7 @@ public class Chunk { - } + public Chunk a(long i, Chunk chunk) { ++ chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper + Chunk chunk1 = (Chunk) super.put(i, chunk); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i); - public void o() { -+ world.timings.lightChunk.startTiming(); // Paper - this.done = true; - this.lit = true; - BlockPosition blockposition = new BlockPosition(this.locX << 4, 0, this.locZ << 4); -@@ -1234,6 +1236,7 @@ public class Chunk { +@@ -55,8 +56,10 @@ public class ChunkMap extends Long2ObjectOpenHashMap { + } } } ++ chunk.world.timings.syncChunkLoadPostTimer.stopTiming(); // Paper -+ world.timings.lightChunk.stopTiming(); // Paper - } + if (chunk.newChunk) { ++ chunk.world.timings.syncChunkLoadPopulateTimer.startTiming(); // Paper + BlockSand.instaFall = true; + java.util.Random random = new java.util.Random(); + random.setSeed(chunk.world.getSeed()); +@@ -77,6 +80,7 @@ public class ChunkMap extends Long2ObjectOpenHashMap { + } + BlockSand.instaFall = false; + chunk.world.getServer().getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(chunk.bukkitChunk)); ++ chunk.world.timings.syncChunkLoadPopulateTimer.stopTiming(); // Paper + } - private void z() { + return chunk1; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 86973cb98..bd006ef74 100644 +index 0296d3ef0..badfe86b2 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -204,7 +204,7 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -221,7 +221,7 @@ public class ChunkProviderServer implements IChunkProvider { } - public void saveChunk(Chunk chunk, boolean unloaded) { // Spigot + public void saveChunk(IChunkAccess ichunkaccess, boolean unloaded) { // Spigot - try { -+ try (co.aikar.timings.Timing timed = world.timings.chunkSaveData.startTiming()) { - chunk.setLastSaved(this.world.getTime()); - this.chunkLoader.saveChunk(this.world, chunk, unloaded); // Spigot ++ try (co.aikar.timings.Timing timed = world.timings.chunkSaveData.startTiming()) { // Paper - Timings + ichunkaccess.setLastSaved(this.world.getTime()); + 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 50ec3adb8..a401dec60 100644 +index 42050f06d..e26860516 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -423,7 +423,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -1,5 +1,6 @@ + package net.minecraft.server; - public void loadEntities(Chunk chunk, NBTTagCompound nbttagcompound, World world) { - // CraftBukkit end ++import co.aikar.timings.Timings; + import com.google.common.collect.Maps; + import com.mojang.datafixers.DataFixTypes; + import com.mojang.datafixers.DataFixer; +@@ -650,7 +651,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + public void loadEntities(NBTTagCompound nbttagcompound, Chunk chunk) { + NBTTagList nbttaglist = nbttagcompound.getList("Entities", 10); + World world = chunk.getWorld(); - world.timings.syncChunkLoadEntitiesTimer.startTiming(); // Spigot -+ world.timings.syncChunkLoadNBTTimer.startTiming(); // Spigot - NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10); ++ world.timings.chunkLoadLevelTimer.startTiming(); // Spigot - for (int l = 0; l < nbttaglist1.size(); ++l) { -@@ -432,8 +432,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - a(nbttagcompound2, world, chunk); - chunk.g(true); + for (int i = 0; i < nbttaglist.size(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompound(i); +@@ -659,8 +660,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + chunk.f(true); } + - world.timings.syncChunkLoadEntitiesTimer.stopTiming(); // Spigot - world.timings.syncChunkLoadTileEntitiesTimer.startTiming(); // Spigot - NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities", 10); + NBTTagList nbttaglist1 = nbttagcompound.getList("TileEntities", 10); - for (int i1 = 0; i1 < nbttaglist2.size(); ++i1) { -@@ -444,8 +442,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - chunk.a(tileentity); + for (int j = 0; j < nbttaglist1.size(); ++j) { +@@ -677,8 +676,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } } } - world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot - world.timings.syncChunkLoadTileTicksTimer.startTiming(); // Spigot - if (nbttagcompound.hasKeyOfType("TileTicks", 9)) { - NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10); -@@ -463,7 +459,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - world.b(new BlockPosition(nbttagcompound4.getInt("x"), nbttagcompound4.getInt("y"), nbttagcompound4.getInt("z")), block, nbttagcompound4.getInt("t"), nbttagcompound4.getInt("p")); - } + if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.I() instanceof TickListServer) { + ((TickListServer) world.I()).a(nbttagcompound.getList("TileTicks", 10)); +@@ -687,7 +684,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.H() instanceof TickListServer) { + ((TickListServer) world.H()).a(nbttagcompound.getList("LiquidTicks", 10)); } - world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot -+ world.timings.syncChunkLoadNBTTimer.stopTiming(); // Spigot ++ world.timings.chunkLoadLevelTimer.stopTiming(); // Spigot - // return chunk; // CraftBukkit } + diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index e1cb96a88..8f2afcc32 100644 +index 9155aa727..a3d58b5ce 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -24,7 +24,7 @@ import java.io.PrintStream; - import org.apache.logging.log4j.Level; +@@ -29,7 +29,7 @@ import org.apache.logging.log4j.Level; + import org.bukkit.command.CommandSender; import org.bukkit.craftbukkit.LoggerOutputStream; -import org.bukkit.craftbukkit.SpigotTimings; // Spigot +import co.aikar.timings.MinecraftTimings; // Paper import org.bukkit.event.server.ServerCommandEvent; import org.bukkit.craftbukkit.util.Waitable; import org.bukkit.event.server.RemoteServerCommandEvent; -@@ -434,7 +434,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -443,7 +443,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } - public void aP() { + public void aW() { - SpigotTimings.serverCommandTimer.startTiming(); // Spigot + MinecraftTimings.serverCommandTimer.startTiming(); // Spigot while (!this.serverCommandQueue.isEmpty()) { ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); -@@ -449,7 +449,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -458,7 +458,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer // CraftBukkit end } @@ -572,8 +571,8 @@ index e1cb96a88..8f2afcc32 100644 + MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot } - public boolean aa() { -@@ -695,7 +695,20 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + public boolean S() { +@@ -708,7 +708,20 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer return remoteControlCommandListener.getMessages(); } }; @@ -596,10 +595,10 @@ index e1cb96a88..8f2afcc32 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 f140d5e28..05aad7dd0 100644 +index 7a17a4ff9..2ed362791 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -25,7 +25,8 @@ import org.bukkit.block.BlockFace; +@@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Hanging; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Vehicle; @@ -609,7 +608,7 @@ index f140d5e28..05aad7dd0 100644 import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; -@@ -147,7 +148,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -158,7 +159,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public boolean valid; public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only public boolean forceExplosionKnockback; // SPIGOT-949 @@ -618,7 +617,7 @@ index f140d5e28..05aad7dd0 100644 // Spigot start public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -531,7 +532,6 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -543,7 +544,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public void move(EnumMoveType enummovetype, double d0, double d1, double d2) { @@ -626,16 +625,16 @@ index f140d5e28..05aad7dd0 100644 if (this.noclip) { this.a(this.getBoundingBox().d(d0, d1, d2)); this.recalcPosition(); -@@ -925,7 +925,6 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -912,7 +912,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.world.methodProfiler.b(); + this.world.methodProfiler.e(); } - org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot } - public void recalcPosition() { + protected float ab() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 0026f29d5..d15cfdd76 100644 +index e630d6103..1ee54fa45 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -31,7 +31,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -647,69 +646,74 @@ index 0026f29d5..d15cfdd76 100644 public abstract class EntityLiving extends Entity { -@@ -1869,7 +1869,6 @@ public abstract class EntityLiving extends Entity { +@@ -1905,7 +1905,6 @@ public abstract class EntityLiving extends Entity { } - public void B_() { + public void tick() { - SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot - super.B_(); - this.cI(); - if (!this.world.isClientSide) { -@@ -1942,9 +1941,7 @@ public abstract class EntityLiving extends Entity { + super.tick(); + this.cU(); + this.o(); +@@ -1979,9 +1978,7 @@ public abstract class EntityLiving extends Entity { } } - SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot - this.n(); + this.k(); - SpigotTimings.timerEntityTickRest.startTiming(); // Spigot double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f = (float) (d0 * d0 + d1 * d1); -@@ -2020,8 +2017,6 @@ public abstract class EntityLiving extends Entity { +@@ -2057,8 +2054,6 @@ public abstract class EntityLiving extends Entity { } else { - this.bq = 0; + this.bv = 0; } - - SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot } - protected float g(float f, float f1) { -@@ -2086,7 +2081,6 @@ public abstract class EntityLiving extends Entity { + protected float e(float f, float f1) { +@@ -2128,7 +2123,6 @@ public abstract class EntityLiving extends Entity { } this.world.methodProfiler.a("ai"); - SpigotTimings.timerEntityAI.startTiming(); // Spigot if (this.isFrozen()) { - this.bd = false; - this.be = 0.0F; -@@ -2097,7 +2091,6 @@ public abstract class EntityLiving extends Entity { + this.bg = false; + this.bh = 0.0F; +@@ -2139,7 +2133,6 @@ public abstract class EntityLiving extends Entity { this.doTick(); - this.world.methodProfiler.b(); + this.world.methodProfiler.e(); } - SpigotTimings.timerEntityAI.stopTiming(); // Spigot - this.world.methodProfiler.b(); + this.world.methodProfiler.e(); this.world.methodProfiler.a("jump"); -@@ -2120,14 +2113,10 @@ public abstract class EntityLiving extends Entity { - this.bg *= 0.98F; - this.bh *= 0.9F; - this.r(); +@@ -2164,9 +2157,7 @@ public abstract class EntityLiving extends Entity { + this.n(); + AxisAlignedBB axisalignedbb = this.getBoundingBox(); + - SpigotTimings.timerEntityAIMove.startTiming(); // Spigot - this.a(this.be, this.bf, this.bg); + this.a(this.bh, this.bi, this.bj); - SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot - this.world.methodProfiler.b(); + this.world.methodProfiler.e(); this.world.methodProfiler.a("push"); + if (this.bw > 0) { +@@ -2174,9 +2165,7 @@ public abstract class EntityLiving extends Entity { + this.a(axisalignedbb, this.getBoundingBox()); + } + - SpigotTimings.timerEntityAICollision.startTiming(); // Spigot - this.cB(); + this.cM(); - SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot - this.world.methodProfiler.b(); + this.world.methodProfiler.e(); } diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java -index ce0124020..a60f94608 100644 +index ae31935c4..70c9b1f50 100644 --- a/src/main/java/net/minecraft/server/EntityTracker.java +++ b/src/main/java/net/minecraft/server/EntityTracker.java -@@ -175,7 +175,7 @@ public class EntityTracker { +@@ -168,7 +168,7 @@ public class EntityTracker { public void updatePlayers() { ArrayList arraylist = Lists.newArrayList(); Iterator iterator = this.c.iterator(); @@ -718,7 +722,7 @@ index ce0124020..a60f94608 100644 while (iterator.hasNext()) { EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next(); -@@ -188,7 +188,9 @@ public class EntityTracker { +@@ -181,7 +181,9 @@ public class EntityTracker { } } } @@ -728,7 +732,7 @@ index ce0124020..a60f94608 100644 for (int i = 0; i < arraylist.size(); ++i) { EntityPlayer entityplayer = (EntityPlayer) arraylist.get(i); Iterator iterator1 = this.c.iterator(); -@@ -201,6 +203,7 @@ public class EntityTracker { +@@ -194,6 +196,7 @@ public class EntityTracker { } } } @@ -737,10 +741,17 @@ index ce0124020..a60f94608 100644 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c1a8816b4..8d08b536a 100644 +index bcdd9e0fa..590eb507c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -48,8 +48,8 @@ import org.bukkit.Bukkit; +@@ -1,5 +1,6 @@ + package net.minecraft.server; + ++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 org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.Main; // CraftBukkit end @@ -748,9 +759,9 @@ index c1a8816b4..8d08b536a 100644 import org.spigotmc.SlackActivityAccountant; // Spigot +import co.aikar.timings.MinecraftTimings; // Paper - public abstract class MinecraftServer implements ICommandListener, Runnable, IAsyncTaskHandler, IMojangStatistics { + public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStatistics, ICommandListener, Runnable { -@@ -460,6 +460,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -560,6 +561,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } // CraftBukkit end MinecraftServer.LOGGER.info("Stopping server"); @@ -758,41 +769,41 @@ index c1a8816b4..8d08b536a 100644 // CraftBukkit start if (this.server != null) { this.server.disablePlugins(); -@@ -664,7 +665,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs - public void B() {} +@@ -766,7 +768,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + public void u() {} - protected void C() throws ExceptionWorldConflict { // CraftBukkit - added throws + protected void v() { - SpigotTimings.serverTickTimer.startTiming(); // Spigot + co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot - long i = System.nanoTime(); + long i = SystemUtils.c(); -@@ -692,7 +693,6 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -793,7 +795,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit - SpigotTimings.worldSaveTimer.startTiming(); // Spigot this.methodProfiler.a("save"); - this.v.savePlayers(); + this.s.savePlayers(); // Spigot Start -@@ -707,7 +707,6 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -808,7 +809,6 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // this.saveChunks(true); // Spigot End - this.methodProfiler.b(); + this.methodProfiler.e(); - SpigotTimings.worldSaveTimer.stopTiming(); // Spigot } - this.methodProfiler.a("tallying"); -@@ -730,14 +729,14 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs - + this.methodProfiler.a("snooper"); +@@ -829,14 +829,14 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + this.methodProfiler.e(); org.spigotmc.WatchdogThread.tick(); // Spigot - this.slackActivityAccountant.tickEnded(tickNanos); // Spigot + this.slackActivityAccountant.tickEnded(l); // Spigot - SpigotTimings.serverTickTimer.stopTiming(); // Spigot - org.spigotmc.CustomTimingsHandler.tick(); // Spigot + co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper } - public void D() { + public void w() { - SpigotTimings.schedulerTimer.startTiming(); // Spigot + MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Paper this.server.getScheduler().mainThreadHeartbeat(this.ticks); // CraftBukkit @@ -800,14 +811,20 @@ index c1a8816b4..8d08b536a 100644 + MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Paper + MinecraftTimings.minecraftSchedulerTimer.startTiming(); // Paper this.methodProfiler.a("jobs"); - Queue queue = this.j; -@@ -748,22 +747,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs - SystemUtils.a(entry, MinecraftServer.LOGGER); - } - // Spigot end + FutureTask futuretask; +@@ -844,26 +844,27 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + while ((futuretask = (FutureTask) this.g.poll()) != null) { + SystemUtils.a(futuretask, MinecraftServer.LOGGER); + } + MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper + this.methodProfiler.c("commandFunctions"); +- SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot ++ MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot + this.aD().X_(); +- SpigotTimings.commandFunctionsTimer.stopTiming(); // Spigot ++ MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot this.methodProfiler.c("levels"); // CraftBukkit start @@ -831,7 +848,7 @@ index c1a8816b4..8d08b536a 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) { -@@ -771,7 +771,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -871,7 +872,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 } } @@ -840,61 +857,55 @@ index c1a8816b4..8d08b536a 100644 int i; -@@ -830,9 +830,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -930,9 +931,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.methodProfiler.b(); + this.methodProfiler.e(); this.methodProfiler.a("tracker"); - worldserver.timings.tracker.startTiming(); // Spigot worldserver.getTracker().updatePlayers(); - worldserver.timings.tracker.stopTiming(); // Spigot - this.methodProfiler.b(); - this.methodProfiler.b(); - // } // CraftBukkit -@@ -841,24 +839,24 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs + this.methodProfiler.e(); + this.methodProfiler.e(); + } +@@ -941,20 +940,19 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } this.methodProfiler.c("connection"); - SpigotTimings.connectionTimer.startTiming(); // Spigot + MinecraftTimings.connectionTimer.startTiming(); // Spigot - this.an().c(); + this.getServerConnection().c(); - SpigotTimings.connectionTimer.stopTiming(); // Spigot + MinecraftTimings.connectionTimer.stopTiming(); // Spigot this.methodProfiler.c("players"); - SpigotTimings.playerListTimer.startTiming(); // Spigot + MinecraftTimings.playerListTimer.startTiming(); // Spigot - this.v.tick(); + this.s.tick(); - SpigotTimings.playerListTimer.stopTiming(); // Spigot + MinecraftTimings.playerListTimer.stopTiming(); // Spigot - this.methodProfiler.c("commandFunctions"); -- SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot -+ MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot - this.aL().e(); -- SpigotTimings.commandFunctionsTimer.stopTiming();// Spigot -+ MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot this.methodProfiler.c("tickables"); - +- - SpigotTimings.tickablesTimer.startTiming(); // Spigot + MinecraftTimings.tickablesTimer.startTiming(); // Spigot - for (i = 0; i < this.o.size(); ++i) { - ((ITickable) this.o.get(i)).e(); + for (i = 0; i < this.l.size(); ++i) { + ((ITickable) this.l.get(i)).X_(); } - SpigotTimings.tickablesTimer.stopTiming(); // Spigot + MinecraftTimings.tickablesTimer.stopTiming(); // Spigot - this.methodProfiler.b(); + this.methodProfiler.e(); } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index eeac34998..e4ed2e991 100644 +index ac6d8cc6e..d975c2ccf 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -1,5 +1,6 @@ package net.minecraft.server; +import co.aikar.timings.Timing; - import com.google.common.base.Predicate; import com.google.common.collect.AbstractIterator; import com.google.common.collect.ComparisonChain; -@@ -106,6 +107,7 @@ public class PlayerChunkMap { + import com.google.common.collect.Lists; +@@ -90,6 +91,7 @@ public class PlayerChunkMap { PlayerChunk playerchunk; if (i - this.k > 8000L) { @@ -902,7 +913,7 @@ index eeac34998..e4ed2e991 100644 this.k = i; for (j = 0; j < this.i.size(); ++j) { -@@ -113,9 +115,11 @@ public class PlayerChunkMap { +@@ -97,9 +99,11 @@ public class PlayerChunkMap { playerchunk.d(); playerchunk.c(); } @@ -914,7 +925,7 @@ index eeac34998..e4ed2e991 100644 Iterator iterator = this.f.iterator(); while (iterator.hasNext()) { -@@ -124,10 +128,12 @@ public class PlayerChunkMap { +@@ -108,25 +112,31 @@ public class PlayerChunkMap { } this.f.clear(); @@ -924,12 +935,9 @@ index eeac34998..e4ed2e991 100644 if (this.l && i % 4L == 0L) { this.l = false; + try (Timing ignored = world.timings.doChunkMapSortMissing.startTiming()) { // Paper - Collections.sort(this.h, new Comparator() { - public int a(PlayerChunk playerchunk, PlayerChunk playerchunk1) { - return ComparisonChain.start().compare(playerchunk.g(), playerchunk1.g()).result(); -@@ -137,10 +143,12 @@ public class PlayerChunkMap { - return this.a((PlayerChunk) object, (PlayerChunk) object1); - } + // CraftBukkit start + Collections.sort(this.h, (playerchunkx, playerchunk1x) -> { + return ComparisonChain.start().compare(playerchunkx.g(), playerchunk1x.g()).result(); }); + } // Paper timing } @@ -937,14 +945,11 @@ index eeac34998..e4ed2e991 100644 if (this.m && i % 4L == 2L) { this.m = false; + try (Timing ignored = world.timings.doChunkMapSortSendToPlayers.startTiming()) { // Paper - Collections.sort(this.g, new Comparator() { - public int a(PlayerChunk playerchunk, PlayerChunk playerchunk1) { - return ComparisonChain.start().compare(playerchunk.g(), playerchunk1.g()).result(); -@@ -150,9 +158,11 @@ public class PlayerChunkMap { - return this.a((PlayerChunk) object, (PlayerChunk) object1); - } + Collections.sort(this.g, (playerchunkx, playerchunk1x) -> { + return ComparisonChain.start().compare(playerchunkx.g(), playerchunk1x.g()).result(); }); + } // Paper timing + // CraftBukkit end } if (!this.h.isEmpty()) { @@ -952,7 +957,7 @@ index eeac34998..e4ed2e991 100644 // Spigot start org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; activityAccountant.startActivity(0.5); -@@ -184,10 +194,12 @@ public class PlayerChunkMap { +@@ -158,10 +168,12 @@ public class PlayerChunkMap { } activityAccountant.endActivity(); // Spigot @@ -965,7 +970,7 @@ index eeac34998..e4ed2e991 100644 Iterator iterator2 = this.g.iterator(); while (iterator2.hasNext()) { -@@ -201,14 +213,17 @@ public class PlayerChunkMap { +@@ -175,14 +187,17 @@ public class PlayerChunkMap { } } } @@ -976,7 +981,7 @@ index eeac34998..e4ed2e991 100644 + try (Timing ignored = world.timings.doChunkMapUnloadChunks.startTiming()) { // Paper WorldProvider worldprovider = this.world.worldProvider; - if (!worldprovider.e()) { + if (!worldprovider.p()) { this.world.getChunkProviderServer().b(); } + } // Paper timing @@ -984,10 +989,10 @@ index eeac34998..e4ed2e991 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ec3e08336..dacf9261a 100644 +index 227bc857e..2adb21e55 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -56,6 +56,7 @@ import org.bukkit.inventory.CraftingInventory; +@@ -57,6 +57,7 @@ import org.bukkit.inventory.CraftingInventory; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.InventoryView; import org.bukkit.util.NumberConversions; @@ -995,16 +1000,16 @@ index ec3e08336..dacf9261a 100644 // CraftBukkit end public class PlayerConnection implements PacketListenerPlayIn, ITickable { -@@ -1378,7 +1379,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1609,7 +1610,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { // CraftBukkit end private void handleCommand(String s) { - org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot + MinecraftTimings.playerCommandTimer.startTiming(); // Paper - // CraftBukkit start - whole method + // CraftBukkit start - whole method if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getName() + " issued server command: " + s); -@@ -1389,22 +1390,22 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1620,7 +1621,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { this.server.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1013,29 +1018,20 @@ index ec3e08336..dacf9261a 100644 return; } - try { - if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) { -- org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot -+ MinecraftTimings.playerCommandTimer.stopTiming(); // Paper - return; - } - } catch (org.bukkit.command.CommandException ex) { - player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command"); +@@ -1633,7 +1634,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 { - org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot + MinecraftTimings.playerCommandTimer.stopTiming(); // Paper - return; } -- org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot -+ MinecraftTimings.playerCommandTimer.stopTiming(); // Paper - // this.minecraftServer.getCommandHandler().a(this.player, s); + // this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s); // CraftBukkit end - } diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -index f74b06794..1fc632e0c 100644 +index 889b32287..69da194f5 100644 --- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java +++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -@@ -1,15 +1,21 @@ +@@ -1,11 +1,17 @@ package net.minecraft.server; +import co.aikar.timings.MinecraftTimings; // Paper @@ -1043,26 +1039,19 @@ index f74b06794..1fc632e0c 100644 + public class PlayerConnectionUtils { -- public static void ensureMainThread(final Packet packet, final T t0, IAsyncTaskHandler iasynctaskhandler) throws CancelledPacketHandleException { -+ // Paper start, fix decompile and add timings -+ public static void ensureMainThread(final Packet packet, final T listener, IAsyncTaskHandler iasynctaskhandler) throws CancelledPacketHandleException { +- public static void ensureMainThread(Packet packet, T t0, IAsyncTaskHandler iasynctaskhandler) throws CancelledPacketHandleException { ++ public static void ensureMainThread(Packet packet, T packetlistener, IAsyncTaskHandler iasynctaskhandler) throws CancelledPacketHandleException { // Paper fix name of param if (!iasynctaskhandler.isMainThread()) { -- iasynctaskhandler.postToMainThread(new Runnable() { -- public void run() { -- packet.a(packetlistener); -+ Timing timing = MinecraftTimings.getPacketTiming(packet); -+ iasynctaskhandler.postToMainThread(() -> { -+ try (Timing ignored = timing.startTiming()) { -+ packet.a(listener); - } ++ Timing timing = MinecraftTimings.getPacketTiming(packet); // Paper + iasynctaskhandler.postToMainThread(() -> { ++ try (Timing ignored = timing.startTiming()) { // Paper + packet.a(packetlistener); ++ } }); throw CancelledPacketHandleException.INSTANCE; } - } -+ // Paper end - } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index d4acbed0c..1d9f3e3dd 100644 +index 0156175fb..1e3dd22e5 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1,5 +1,6 @@ @@ -1072,7 +1061,7 @@ index d4acbed0c..1d9f3e3dd 100644 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1212,10 +1213,11 @@ public abstract class PlayerList { +@@ -1186,10 +1187,11 @@ public abstract class PlayerList { } public void savePlayers() { @@ -1084,51 +1073,63 @@ index d4acbed0c..1d9f3e3dd 100644 + MinecraftTimings.savePlayers.stopTiming(); // Paper } - public void addWhitelist(GameProfile gameprofile) { -diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index 74e3f42cd..66a80a776 100644 ---- a/src/main/java/net/minecraft/server/StructureGenerator.java -+++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -1,5 +1,7 @@ - package net.minecraft.server; + public WhiteList getWhitelist() { +diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java +index a07895935..ee5c2421b 100644 +--- a/src/main/java/net/minecraft/server/TickListServer.java ++++ b/src/main/java/net/minecraft/server/TickListServer.java +@@ -24,13 +24,19 @@ public class TickListServer implements TickList { + private final List> g = Lists.newArrayList(); + private final Consumer> h; -+import co.aikar.timings.MinecraftTimings; -+import co.aikar.timings.Timing; - import it.unimi.dsi.fastutil.longs.Long2ObjectMap; - import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; - import it.unimi.dsi.fastutil.objects.ObjectIterator; -@@ -9,11 +11,13 @@ import javax.annotation.Nullable; - - public abstract class StructureGenerator extends WorldGenBase { - -+ private final Timing timing = MinecraftTimings.getStructureTiming(this); // Paper - private PersistentStructure a; - protected Long2ObjectMap c = new Long2ObjectOpenHashMap(1024); - - public StructureGenerator() {} - -+ public String getName() { return a(); } // Paper // OBFHELPER - public abstract String a(); - - protected final synchronized void a(World world, final int i, final int j, int k, int l, ChunkSnapshot chunksnapshot) { -@@ -69,6 +73,7 @@ public abstract class StructureGenerator extends WorldGenBase { +- public TickListServer(WorldServer worldserver, Predicate predicate, Function function, Function function1, Consumer> consumer) { ++ public TickListServer(WorldServer worldserver, Predicate predicate, Function function, Function function1, Consumer> consumer, String timingsType) { // Paper + this.a = predicate; + this.b = function; + this.c = function1; + this.f = worldserver; + this.h = consumer; ++ // Paper start ++ timingCleanup = co.aikar.timings.WorldTimingsHandler.getTickList(worldserver, timingsType + " - Cleanup"); ++ timingTicking = co.aikar.timings.WorldTimingsHandler.getTickList(worldserver, timingsType + " - Ticking"); } ++ private final co.aikar.timings.Timing timingCleanup; // Paper ++ private final co.aikar.timings.Timing timingTicking; // Paper ++ // Paper end - public synchronized boolean a(World world, Random random, ChunkCoordIntPair chunkcoordintpair) { -+ timing.startTiming(); // Paper - this.a(world); - int i = (chunkcoordintpair.x << 4) + 8; - int j = (chunkcoordintpair.z << 4) + 8; -@@ -85,6 +90,7 @@ public abstract class StructureGenerator extends WorldGenBase { - this.a(structurestart.e(), structurestart.f(), structurestart); + public void a() { + int i = this.nextTickList.size(); +@@ -49,7 +55,7 @@ public class TickListServer implements TickList { } - } -+ timing.stopTiming(); // Paper - return flag; + this.f.methodProfiler.a("cleaning"); +- ++ timingCleanup.startTiming(); // Paper + NextTickListEntry nextticklistentry; // CraftBukkit - decompile error + + for (int j = 0; j < i; ++j) { +@@ -62,9 +68,11 @@ public class TickListServer implements TickList { + // this.nextTickListHash.remove(nextticklistentry); // CraftBukkit - use nextTickList + this.g.add(nextticklistentry); + } ++ timingCleanup.stopTiming(); // Paper + + this.f.methodProfiler.e(); + this.f.methodProfiler.a("ticking"); ++ timingTicking.startTiming(); // Paper + Iterator iterator = this.g.iterator(); + + while (iterator.hasNext()) { +@@ -89,6 +97,7 @@ public class TickListServer implements TickList { + + this.f.methodProfiler.e(); + this.g.clear(); ++ timingTicking.stopTiming(); // Paper + } } + diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index d7132c3c0..15f18ba1d 100644 +index b992360ac..5b7f6ca84 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; @@ -1145,26 +1146,35 @@ index d7132c3c0..15f18ba1d 100644 - public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot + public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper private static final Logger a = LogManager.getLogger(); - private static final RegistryMaterials> f = new RegistryMaterials(); + 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 843320ffb..d902e2630 100644 +index 330ea4e72..e6b916a5d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -19,11 +19,11 @@ import com.google.common.collect.Maps; +@@ -1,5 +1,6 @@ + package net.minecraft.server; + ++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 java.util.Map; import org.bukkit.Bukkit; import org.bukkit.block.BlockState; -import org.bukkit.craftbukkit.SpigotTimings; // Spigot import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; + import org.bukkit.craftbukkit.block.CraftBlockState; + 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 import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -@@ -131,7 +131,7 @@ public abstract class World implements IBlockAccess { +@@ -129,7 +130,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper @@ -1173,7 +1183,7 @@ index 843320ffb..d902e2630 100644 private boolean guardEntityList; // Spigot public static boolean haveWeSilencedAPhysicsCrash; public static String blockLocation; -@@ -201,7 +201,7 @@ public abstract class World implements IBlockAccess { +@@ -197,7 +198,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose }); this.getServer().addWorld(this.world); // CraftBukkit end @@ -1182,23 +1192,23 @@ index 843320ffb..d902e2630 100644 this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } -@@ -1384,6 +1384,7 @@ public abstract class World implements IBlockAccess { +@@ -1099,6 +1100,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } this.methodProfiler.c("remove"); + timings.entityRemoval.startTiming(); // Paper - this.entityList.removeAll(this.f); + this.entityList.removeAll(this.g); int j; -@@ -1404,6 +1405,7 @@ public abstract class World implements IBlockAccess { +@@ -1119,6 +1121,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - this.f.clear(); - this.l(); + this.g.clear(); + this.p_(); + timings.entityRemoval.stopTiming(); // Paper this.methodProfiler.c("regular"); CrashReportSystemDetails crashreportsystemdetails1; -@@ -1413,6 +1415,7 @@ public abstract class World implements IBlockAccess { +@@ -1128,6 +1131,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose timings.entityTick.startTiming(); // Spigot guardEntityList = true; // Spigot // CraftBukkit start - Use field for loop variable @@ -1206,13 +1216,13 @@ index 843320ffb..d902e2630 100644 int entitiesThisCycle = 0; if (tickPosition < 0) tickPosition = 0; for (entityLimiter.initTick(); -@@ -1434,10 +1437,11 @@ public abstract class World implements IBlockAccess { +@@ -1149,10 +1153,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose this.methodProfiler.a("tick"); if (!entity.dead && !(entity instanceof EntityPlayer)) { try { - SpigotTimings.tickEntityTimer.startTiming(); // Spigot + entity.tickTimer.startTiming(); // Paper - this.h(entity); + this.g(entity); - SpigotTimings.tickEntityTimer.stopTiming(); // Spigot + entity.tickTimer.stopTiming(); // Paper } catch (Throwable throwable1) { @@ -1220,31 +1230,31 @@ index 843320ffb..d902e2630 100644 crashreport1 = CrashReport.a(throwable1, "Ticking entity"); crashreportsystemdetails1 = crashreport1.a("Entity being ticked"); entity.appendEntityCrashDetails(crashreportsystemdetails1); -@@ -1562,6 +1566,7 @@ public abstract class World implements IBlockAccess { +@@ -1277,6 +1282,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } timings.tileEntityPending.stopTiming(); // Spigot + co.aikar.timings.TimingHistory.tileEntityTicks += this.tileEntityListTick.size(); // Paper - this.methodProfiler.b(); - this.methodProfiler.b(); + this.methodProfiler.e(); + this.methodProfiler.e(); } -@@ -1620,7 +1625,6 @@ public abstract class World implements IBlockAccess { +@@ -1335,7 +1341,6 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } // CraftBukkit end - entity.tickTimer.startTiming(); // Spigot - entity.M = entity.locX; - entity.N = entity.locY; - entity.O = entity.locZ; -@@ -1628,6 +1632,7 @@ public abstract class World implements IBlockAccess { + entity.N = entity.locX; + entity.O = entity.locY; + entity.P = entity.locZ; +@@ -1343,6 +1348,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose entity.lastPitch = entity.pitch; - if (flag && entity.aa) { + if (flag && entity.inChunk) { ++entity.ticksLived; + ++co.aikar.timings.TimingHistory.activatedEntityTicks; // Paper if (entity.isPassenger()) { - entity.aE(); + entity.aH(); } else { -@@ -1687,8 +1692,6 @@ public abstract class World implements IBlockAccess { +@@ -1402,8 +1408,6 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } } } @@ -1252,30 +1262,55 @@ index 843320ffb..d902e2630 100644 - } - public boolean b(AxisAlignedBB axisalignedbb) { + 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 c891629bd..95964c550 100644 +index 784289c0d..d7f86bf76 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -308,13 +308,13 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -1,5 +1,6 @@ + package net.minecraft.server; + ++import co.aikar.timings.Timings; + 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 + + 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) -> { + 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 + this.siegeManager = new VillageSiege(this); + this.d = new ObjectLinkedOpenHashSet(); + this.server = minecraftserver; +@@ -297,13 +298,13 @@ public class WorldServer extends World implements IAsyncTaskHandler { timings.doChunkUnload.stopTiming(); // Spigot this.methodProfiler.c("tickPending"); - timings.doTickPending.startTiming(); // Spigot + timings.scheduledBlocks.startTiming(); // Paper - this.a(false); + this.p(); - timings.doTickPending.stopTiming(); // Spigot + timings.scheduledBlocks.stopTiming(); // Paper this.methodProfiler.c("tickBlocks"); - timings.doTickTiles.startTiming(); // Spigot + timings.chunkTicks.startTiming(); // Paper - this.j(); + this.l(); - timings.doTickTiles.stopTiming(); // Spigot + timings.chunkTicks.stopTiming(); // Paper this.methodProfiler.c("chunkMap"); timings.doChunkMap.startTiming(); // Spigot this.manager.flush(); -@@ -529,7 +529,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -532,7 +533,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } } @@ -1284,76 +1319,33 @@ index c891629bd..95964c550 100644 if (i > 0) { ChunkSection[] achunksection = chunk.getSections(); int i1 = achunksection.length; -@@ -557,6 +557,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -564,6 +565,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } } } + timings.chunkTicksBlocks.stopTiming(); // Paper } - this.methodProfiler.b(); -@@ -742,6 +743,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - - this.methodProfiler.a("cleaning"); - -+ timings.scheduledBlocksCleanup.startTiming(); // Paper - NextTickListEntry nextticklistentry; - - for (int j = 0; j < i; ++j) { -@@ -755,10 +757,12 @@ public class WorldServer extends World implements IAsyncTaskHandler { - // this.nextTickListHash.remove(nextticklistentry); - this.W.add(nextticklistentry); - } -+ timings.scheduledBlocksCleanup.stopTiming(); // Paper - - this.methodProfiler.b(); - this.methodProfiler.a("ticking"); - Iterator iterator = this.W.iterator(); -+ timings.scheduledBlocksTicking.startTiming(); // Paper - - while (iterator.hasNext()) { - nextticklistentry = (NextTickListEntry) iterator.next(); -@@ -767,6 +771,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { - - if (this.areChunksLoadedBetween(nextticklistentry.a.a(0, 0, 0), nextticklistentry.a.a(0, 0, 0))) { - IBlockData iblockdata = this.getType(nextticklistentry.a); -+ co.aikar.timings.Timing timing = iblockdata.getBlock().getTiming(); // Paper -+ timing.startTiming(); // Paper - - if (iblockdata.getMaterial() != Material.AIR && Block.a(iblockdata.getBlock(), nextticklistentry.a())) { - try { -@@ -779,10 +785,12 @@ public class WorldServer extends World implements IAsyncTaskHandler { - throw new ReportedException(crashreport); - } - } -+ timing.stopTiming(); // Paper - } else { - this.a(nextticklistentry.a, nextticklistentry.a(), 0); - } - } -+ timings.scheduledBlocksTicking.stopTiming(); // Paper - - this.methodProfiler.b(); - this.W.clear(); -@@ -878,7 +886,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + 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); -+ return new ChunkProviderServer(this, ichunkloader, new co.aikar.timings.TimedChunkGenerator(this, gen)); // Paper +- 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 } -@@ -1043,6 +1051,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -869,6 +871,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (chunkproviderserver.e()) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit + timings.worldSave.startTiming(); // Paper if (iprogressupdate != null) { - iprogressupdate.a("Saving level"); + iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0])); } -@@ -1052,7 +1061,9 @@ public class WorldServer extends World implements IAsyncTaskHandler { - iprogressupdate.c("Saving chunks"); +@@ -878,7 +881,9 @@ public class WorldServer extends World implements IAsyncTaskHandler { + iprogressupdate.c(new ChatMessage("menu.savingChunks", new Object[0])); } + timings.worldSaveChunks.startTiming(); // Paper @@ -1362,7 +1354,7 @@ index c891629bd..95964c550 100644 // CraftBukkit - ArrayList -> Collection Collection arraylist = chunkproviderserver.a(); Iterator iterator = arraylist.iterator(); -@@ -1064,7 +1075,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -890,7 +895,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { chunkproviderserver.unload(chunk); } } @@ -1371,7 +1363,7 @@ index c891629bd..95964c550 100644 } } -@@ -1077,6 +1088,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -903,6 +908,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } protected void a() throws ExceptionWorldConflict { @@ -1379,8 +1371,8 @@ index c891629bd..95964c550 100644 this.checkSession(); WorldServer[] aworldserver = this.server.worldServer; int i = aworldserver.length; -@@ -1106,6 +1118,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - this.worldData.e(this.getWorldBorder().i()); +@@ -933,6 +939,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + this.worldData.c(this.server.aR().c()); this.dataManager.saveWorldData(this.worldData, this.server.getPlayerList().t()); this.worldMaps.a(); + timings.worldSaveLevel.stopTiming(); // Paper @@ -1388,10 +1380,10 @@ index c891629bd..95964c550 100644 // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 14851a3a5..9042deed6 100644 +index dad2dc959..88ea651ba 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1756,12 +1756,31 @@ public final class CraftServer implements Server { +@@ -1852,12 +1852,31 @@ public final class CraftServer implements Server { private final Spigot spigot = new Spigot() { @@ -1604,7 +1596,7 @@ index 4c8ab2bc9..000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -index 3a95b4465..b5efb9c3f 100644 +index 413dd35f0..52a8c48fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java @@ -1,6 +1,8 @@ @@ -1623,44 +1615,27 @@ index 3a95b4465..b5efb9c3f 100644 - try { + try (Timing ignored = queuedChunk.provider.world.timings.chunkIOStage1.startTimingIfSync()) { // Paper ChunkRegionLoader loader = queuedChunk.loader; - Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z); + Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z, (chunk) -> {}); -@@ -38,6 +40,7 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider Date: Tue, 1 Mar 2016 13:02:51 -0600 Subject: [PATCH] Configurable cactus and reed natural growth heights @@ -23,31 +23,31 @@ index 621bf7051..4a692ac1b 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java -index 64b7d08fa..d8fb87f7a 100644 +index 54685157f..83fb53643 100644 --- a/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java -@@ -28,7 +28,7 @@ public class BlockCactus extends Block { - ; - } - -- if (i < 3) { -+ if (i < world.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height - int j = ((Integer) iblockdata.get(BlockCactus.AGE)).intValue(); - - if (j >= (byte) range(3, ((100.0F / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot -diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java -index 57f24f55d..d19dce839 100644 ---- a/src/main/java/net/minecraft/server/BlockReed.java -+++ b/src/main/java/net/minecraft/server/BlockReed.java -@@ -28,7 +28,7 @@ public class BlockReed extends Block { +@@ -29,7 +29,7 @@ public class BlockCactus extends Block { ; } - if (i < 3) { -+ if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height - int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue(); ++ if (i < world.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height + int j = ((Integer) iblockdata.get(BlockCactus.AGE)).intValue(); - if (j >= (byte) range(3, ((100.0F / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot + if (j >= (byte) range(3, ((100.0F / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot +diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java +index 313821d52..c4e7f318d 100644 +--- a/src/main/java/net/minecraft/server/BlockReed.java ++++ b/src/main/java/net/minecraft/server/BlockReed.java +@@ -25,7 +25,7 @@ public class BlockReed extends Block { + ; + } + +- if (i < 3) { ++ if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height + int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue(); + + if (j >= (byte) range(3, ((100.0F / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot -- 2.18.0 diff --git a/Spigot-Server-Patches/0011-Configurable-baby-zombie-movement-speed.patch b/Spigot-Server-Patches/0011-Configurable-baby-zombie-movement-speed.patch index 9e7e46813a..7a61fe74f6 100644 --- a/Spigot-Server-Patches/0011-Configurable-baby-zombie-movement-speed.patch +++ b/Spigot-Server-Patches/0011-Configurable-baby-zombie-movement-speed.patch @@ -1,4 +1,4 @@ -From 7204f6dc262ca2d75ae865a2a27ea9a89cbd2b86 Mon Sep 17 00:00:00 2001 +From b9f4abe2c78d9c5499c1249747e038186fb27393 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 13:09:16 -0600 Subject: [PATCH] Configurable baby zombie movement speed @@ -20,27 +20,27 @@ index 4a692ac1b..d44cacc7e 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 11c0f24f1..277f1414a 100644 +index b24e73f2c..268e4d57b 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -16,7 +16,7 @@ public class EntityZombie extends EntityMonster { +@@ -17,7 +17,7 @@ public class EntityZombie extends EntityMonster { - protected static final IAttribute a = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance"); - private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); -- private static final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", 0.5D, 1); -+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", world.paperConfig.babyZombieMovementSpeed, 1); // Paper - Remove static - Make baby speed configurable - private static final DataWatcherObject bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h); - private static final DataWatcherObject by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b); - private static final DataWatcherObject bz = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h); -@@ -102,9 +102,9 @@ public class EntityZombie extends EntityMonster { + protected static final IAttribute c = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance"); + private static final UUID a = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); +- private static final AttributeModifier b = new AttributeModifier(EntityZombie.a, "Baby speed boost", 0.5D, 1); ++ private final AttributeModifier babyModifier = new AttributeModifier(EntityZombie.a, "Baby speed boost", world.paperConfig.babyZombieMovementSpeed, 1); // Paper - Remove static - Make baby speed configurable + private static final DataWatcherObject bC = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); + private static final DataWatcherObject bD = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b); + private static final DataWatcherObject bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); +@@ -127,9 +127,9 @@ public class EntityZombie extends EntityMonster { if (this.world != null && !this.world.isClientSide) { AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); -- attributeinstance.c(EntityZombie.c); -+ attributeinstance.c(this.c); +- attributeinstance.c(EntityZombie.b); ++ attributeinstance.c(this.babyModifier); // Paper if (flag) { -- attributeinstance.b(EntityZombie.c); -+ attributeinstance.b(this.c); +- attributeinstance.b(EntityZombie.b); ++ attributeinstance.b(this.babyModifier); // Paper } } diff --git a/Spigot-Server-Patches/0012-Configurable-fishing-time-ranges.patch b/Spigot-Server-Patches/0012-Configurable-fishing-time-ranges.patch index b7c172949b..810585bb66 100644 --- a/Spigot-Server-Patches/0012-Configurable-fishing-time-ranges.patch +++ b/Spigot-Server-Patches/0012-Configurable-fishing-time-ranges.patch @@ -1,4 +1,4 @@ -From 00a626d4786a4294acd9328c2b5c05e257f262dc Mon Sep 17 00:00:00 2001 +From 4d52eec46bc302c6dfccc2548eaa454640a703fb Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 13:14:11 -0600 Subject: [PATCH] Configurable fishing time ranges @@ -22,16 +22,16 @@ index d44cacc7e..45bddf3f4 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index b4d3bcb41..339d1f1b1 100644 +index 2512ad353..866f41980 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -381,7 +381,7 @@ public class EntityFishingHook extends Entity { - this.at = MathHelper.nextInt(this.random, 20, 80); +@@ -386,7 +386,7 @@ public class EntityFishingHook extends Entity { + this.aw = MathHelper.nextInt(this.random, 20, 80); } } else { - this.h = MathHelper.nextInt(this.random, 100, 600); + this.h = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper - this.h -= this.ax * 20 * 5; + this.h -= this.aA * 20 * 5; } } -- diff --git a/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump.patch b/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump.patch index 7bd6ce16d6..7e11177ad4 100644 --- a/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump.patch +++ b/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump.patch @@ -1,4 +1,4 @@ -From 0e0640641bbc9a2e2089ae1846e2d7899bcd9e5e Mon Sep 17 00:00:00 2001 +From 505cb60061caae705dbb6fccad730e81f9634672 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 13:24:16 -0600 Subject: [PATCH] Allow nerfed mobs to jump @@ -19,7 +19,7 @@ index 45bddf3f4..1d9dd0e0b 100644 + } } diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java -index 4f2fa59ac..8af52a61f 100644 +index 4ed5192c6..489beed26 100644 --- a/src/main/java/net/minecraft/server/ControllerJump.java +++ b/src/main/java/net/minecraft/server/ControllerJump.java @@ -13,6 +13,7 @@ public class ControllerJump { @@ -28,21 +28,21 @@ index 4f2fa59ac..8af52a61f 100644 + public void jumpIfSet() { this.b(); } // Paper - OBFHELPER public void b() { - this.b.l(this.a); + this.b.o(this.a); this.a = false; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 3c48d9463..7b02b253c 100644 +index 5de20721c..27b01d1ee 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -46,6 +46,7 @@ public abstract class EntityInsentient extends EntityLiving { - private boolean bE; - private Entity leashHolder; - private NBTTagCompound bG; +@@ -32,6 +32,7 @@ public abstract class EntityInsentient extends EntityLiving { + private final EntityAIBodyControl b; + protected NavigationAbstract navigation; + public PathfinderGoalSelector goalSelector; + @Nullable public PathfinderGoalFloat goalFloat; // Paper - - public EntityInsentient(World world) { - super(world); -@@ -651,6 +652,12 @@ public abstract class EntityInsentient extends EntityLiving { + public PathfinderGoalSelector targetSelector; + private EntityLiving goalTarget; + private final EntitySenses bC; +@@ -641,6 +642,12 @@ public abstract class EntityInsentient extends EntityLiving { // Spigot Start if ( this.fromMobSpawner ) { @@ -56,7 +56,7 @@ index 3c48d9463..7b02b253c 100644 } // Spigot End diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java -index b3b303b3b..fc6c3bf71 100644 +index 4d8876cae..2cb9d1b5a 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java @@ -6,6 +6,7 @@ public class PathfinderGoalFloat extends PathfinderGoal { @@ -73,7 +73,7 @@ index b3b303b3b..fc6c3bf71 100644 + public boolean validConditions() { return this.a(); } // Paper - OBFHELPER public boolean a() { - return this.a.isInWater() || this.a.au(); + return this.a.isInWater() || this.a.ax(); } + public void update() { this.e(); } // Paper - OBFHELPER diff --git a/Spigot-Server-Patches/0014-Add-configurable-despawn-distances-for-living-entiti.patch b/Spigot-Server-Patches/0014-Add-configurable-despawn-distances-for-living-entiti.patch index dac290424f..f3486f0292 100644 --- a/Spigot-Server-Patches/0014-Add-configurable-despawn-distances-for-living-entiti.patch +++ b/Spigot-Server-Patches/0014-Add-configurable-despawn-distances-for-living-entiti.patch @@ -1,4 +1,4 @@ -From 454d4de322b765150a71a124e972aa3853dcb2d5 Mon Sep 17 00:00:00 2001 +From 48f4ebe1a46124663d68afc009c623f0be3b87df Mon Sep 17 00:00:00 2001 From: Suddenly Date: Tue, 1 Mar 2016 13:51:54 -0600 Subject: [PATCH] Add configurable despawn distances for living entities @@ -30,10 +30,10 @@ index 1d9dd0e0b..22c1113a1 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 7b02b253c..94967e6b6 100644 +index 27b01d1ee..c8c191667 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -630,13 +630,13 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -620,13 +620,13 @@ public abstract class EntityInsentient extends EntityLiving { double d2 = entityhuman.locZ - this.locZ; double d3 = d0 * d0 + d1 * d1 + d2 * d2; 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 3646498223..94d1658dcc 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,4 +1,4 @@ -From 84cf59e1a2697bfa6e9319344d57f2363e4a6b25 Mon Sep 17 00:00:00 2001 +From 9a9d8af54bf1def19ceb5c483f07e8dbf8654f52 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 @@ -20,10 +20,10 @@ index 22c1113a1..0094d1a87 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d902e2630..759964b0f 100644 +index e6b916a5d..05d363171 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -202,6 +202,7 @@ public abstract class World implements IBlockAccess { +@@ -199,6 +199,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose 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 5b06493854..7c9ce42196 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,4 +1,4 @@ -From 3aa7c3bb231295a68bf403ab34f4b0dcc9e2696d Mon Sep 17 00:00:00 2001 +From 4f9c5ca52e2e58476694f0cacdb66b2669e552ab 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 @@ -24,11 +24,11 @@ index 0094d1a87..4da846719 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4540bf9f9..d358ab26a 100644 +index a5d0ae1de..12b86ab75 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1794,6 +1794,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper - return this.a(new ItemStack(item, i, 0), f); +@@ -1885,6 +1885,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + return this.a(itemstack, 0.0F); } + @Nullable public final EntityItem dropItem(ItemStack itemstack, float offset) { return this.a(itemstack, offset); } // Paper - OBFHELPER @@ -36,10 +36,10 @@ index 4540bf9f9..d358ab26a 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 579e51a0a..2ba5d51a5 100644 +index 850436d42..7aa12c3b4 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java -@@ -84,6 +84,17 @@ public class EntityFallingBlock extends Entity { +@@ -86,6 +86,17 @@ public class EntityFallingBlock extends Entity { } this.move(EnumMoveType.SELF, this.motX, this.motY, this.motZ); @@ -56,9 +56,9 @@ index 579e51a0a..2ba5d51a5 100644 + if (!this.world.isClientSide) { blockposition = new BlockPosition(this); - boolean flag = this.block.getBlock() == Blocks.dS; + 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 44b2d4735..0d70dd1d2 100644 +index 7edc02852..5ceb3f206 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 { diff --git a/Spigot-Server-Patches/0018-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 similarity index 75% rename from Spigot-Server-Patches/0018-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch rename to Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 90ef9445f4..013c03a550 100644 --- a/Spigot-Server-Patches/0018-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 52755667f1f619ec704fc039220647e7d105956d Mon Sep 17 00:00:00 2001 +From 7bcfdec2f367b97a5459b023661911495b573125 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 @@ -6,24 +6,29 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang diff --git a/src/main/java/net/minecraft/server/EULA.java b/src/main/java/net/minecraft/server/EULA.java -index 8361888c2..3623751bf 100644 +index 220ca7bca..eb4b08be4 100644 --- a/src/main/java/net/minecraft/server/EULA.java +++ b/src/main/java/net/minecraft/server/EULA.java -@@ -51,7 +51,8 @@ public class EULA { +@@ -52,13 +52,12 @@ public class EULA { - fileoutputstream = new FileOutputStream(this.b); - properties.setProperty("eula", "false"); -- properties.store(fileoutputstream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula)."); -+ properties.store(fileoutputstream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula)." + -+ "\nand also agreeing that tacos are tasty."); // Paper - fix lag - } catch (Exception exception) { - EULA.a.warn("Failed to save {}", this.b, exception); - } finally { + fileoutputstream = new FileOutputStream(this.b); + properties.setProperty("eula", "false"); +- properties.store(fileoutputstream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula)."); ++ properties.store(fileoutputstream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).\nYou also agree that tacos are tasty, and the best food in the world."); // Paper - fix lag); + } catch (Exception exception) { + EULA.a.warn("Failed to save {}", this.b, exception); + } finally { + IOUtils.closeQuietly(fileoutputstream); + } +- + } + } + } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8d08b536a..92d480251 100644 +index 590eb507c..4889a82a2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1049,7 +1049,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -1151,7 +1151,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } public String getServerModName() { @@ -33,24 +38,24 @@ index 8d08b536a..92d480251 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 9042deed6..33b40ffc2 100644 +index 88ea651ba..28f6cdf96 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -136,7 +136,7 @@ import org.bukkit.event.server.TabCompleteEvent; +@@ -152,7 +152,7 @@ import org.bukkit.event.server.TabCompleteEvent; import net.md_5.bungee.api.chat.BaseComponent; public final class CraftServer implements Server { - private final String serverName = "CraftBukkit"; -+ private final String serverName = "Paper"; ++ private final String serverName = "Paper"; // Paper private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 96585fb24..f95da9e26 100644 +index 5e49bca8a..d9059129d 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -192,7 +192,7 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -14); +@@ -198,7 +198,7 @@ public class Main { + deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/ ***"); diff --git a/Spigot-Server-Patches/0019-Player-affects-spawning-API.patch b/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch similarity index 68% rename from Spigot-Server-Patches/0019-Player-affects-spawning-API.patch rename to Spigot-Server-Patches/0018-Player-affects-spawning-API.patch index 7ff2908af6..5bd57f79b2 100644 --- a/Spigot-Server-Patches/0019-Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch @@ -1,26 +1,28 @@ -From 355aa45c1307053a37e07c9024e2953df1fe01b4 Mon Sep 17 00:00:00 2001 +From fd20af56dbf1982c04406fcd9a0360b54568d965 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 c374efd79..467c5bf1a 100644 +index 40efd6c60..1aa32bf11 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -64,6 +64,7 @@ public abstract class EntityHuman extends EntityLiving { - private final ItemCooldown bW; +@@ -72,6 +72,9 @@ public abstract class EntityHuman extends EntityLiving { + private final ItemCooldown ce; @Nullable public EntityFishingHook hookedFish; ++ // Paper start + public boolean affectsSpawning = true; ++ // Paper end // 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 94967e6b6..5ea9f3097 100644 +index c8c191667..d29364b01 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -624,7 +624,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -614,7 +614,7 @@ public abstract class EntityInsentient extends EntityLiving { } else { EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D); @@ -30,56 +32,64 @@ index 94967e6b6..5ea9f3097 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 50bca48bf..57552c522 100644 +index 6cb4f889c..a1ebf5c68 100644 --- a/src/main/java/net/minecraft/server/EntitySilverfish.java +++ b/src/main/java/net/minecraft/server/EntitySilverfish.java -@@ -99,8 +99,7 @@ public class EntitySilverfish extends EntityMonster { - public boolean P() { - if (super.P()) { - EntityHuman entityhuman = this.world.b(this, 5.0D); -- +@@ -96,7 +96,7 @@ public class EntitySilverfish extends EntityMonster { + if (super.a(generatoraccess)) { + EntityHuman entityhuman = generatoraccess.b(this, 5.0D); + - return entityhuman == null; + return !(entityhuman != null && !entityhuman.affectsSpawning) && entityhuman == null; // Paper - Affects Spawning API } else { return false; } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index a599a043d..1c7c187c7 100644 +index 44fb75c6f..aec9cdae5 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -52,7 +52,7 @@ public final class SpawnerCreature { +@@ -37,7 +37,7 @@ public final class SpawnerCreature { while (iterator.hasNext()) { EntityHuman entityhuman = (EntityHuman) iterator.next(); - if (!entityhuman.isSpectator()) { -+ if (!entityhuman.isSpectator() && entityhuman.affectsSpawning) { ++ if (!entityhuman.isSpectator() && entityhuman.affectsSpawning) { // Paper int l = MathHelper.floor(entityhuman.locX / 16.0D); 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 759964b0f..26d4bd690 100644 +index 05d363171..fd64b75ed 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -2727,7 +2727,7 @@ public abstract class World implements IBlockAccess { +@@ -28,6 +28,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 ++import org.bukkit.entity.Player; + import org.bukkit.event.block.BlockCanBuildEvent; + import org.bukkit.event.block.BlockPhysicsEvent; + import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +@@ -2407,7 +2408,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -- if (IEntitySelector.e.apply(entityhuman)) { -+ if (IEntitySelector.e.apply(entityhuman) && entityhuman.affectsSpawning) { // Paper - Affects Spawning API +- if (IEntitySelector.e.test(entityhuman)) { ++ if (IEntitySelector.e.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 cd99801ff..a0c86d0e0 100644 +index fad258f11..c67137a80 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1540,6 +1540,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1585,7 +1585,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { return getHandle().locale; + + } + ++ // Paper start + public void setAffectsSpawning(boolean affects) { + this.getHandle().affectsSpawning = affects; + } @@ -88,8 +98,10 @@ index cd99801ff..a0c86d0e0 100644 + public boolean getAffectsSpawning() { + return this.getHandle().affectsSpawning; } ++ // Paper end // Spigot start + private final Player.Spigot spigot = new Player.Spigot() -- 2.18.0 diff --git a/Spigot-Server-Patches/0020-Remove-invalid-mob-spawner-tile-entities.patch b/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch similarity index 75% rename from Spigot-Server-Patches/0020-Remove-invalid-mob-spawner-tile-entities.patch rename to Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch index f95cf6eea2..7f79f932f6 100644 --- a/Spigot-Server-Patches/0020-Remove-invalid-mob-spawner-tile-entities.patch +++ b/Spigot-Server-Patches/0019-Remove-invalid-mob-spawner-tile-entities.patch @@ -1,15 +1,15 @@ -From f468cbcfc4e7e05e67215e55bb021f4fb1ef1007 Mon Sep 17 00:00:00 2001 +From 7bff1557c12e7c7c67a4901f488a7ff95605603e 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 ca5a42377..50113c303 100644 +index 3b97981bc..36ea4ad47 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -759,6 +759,10 @@ public class Chunk { - tileentity.A(); +@@ -777,6 +777,10 @@ public class Chunk implements IChunkAccess { + tileentity.z(); this.tileEntities.put(blockposition, tileentity); // CraftBukkit start + // Paper start - Remove invalid mob spawner tile entities @@ -18,7 +18,7 @@ index ca5a42377..50113c303 100644 + // Paper end } else { System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ() - + " (" + org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(getBlockData(blockposition).getBlock()) + ") where there was no entity tile!"); + + " (" + getType(blockposition) + ") where there was no entity tile!"); -- 2.18.0 diff --git a/Spigot-Server-Patches/0020-Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/0020-Optimize-TileEntity-Ticking.patch new file mode 100644 index 0000000000..2d446bbee4 --- /dev/null +++ b/Spigot-Server-Patches/0020-Optimize-TileEntity-Ticking.patch @@ -0,0 +1,139 @@ +From b7e91c371fc4c629af5440e38cd70bfd2a59b293 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Tue, 1 Mar 2016 22:01:19 -0600 +Subject: [PATCH] Optimize TileEntity Ticking + + +diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java +index de06bd59a..9b54cbfdc 100644 +--- a/src/main/java/net/minecraft/server/TileEntityChest.java ++++ b/src/main/java/net/minecraft/server/TileEntityChest.java +@@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; + // CraftBukkit end + +-public class TileEntityChest extends TileEntityLootable implements ITickable { ++public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITickable + + private NonNullList items; + protected float a; +@@ -113,9 +113,15 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { + int k = this.position.getZ(); + + ++this.k; ++ // Paper start ++ } ++ private void doOpenLogic() { + float f; +- +- if (!this.world.isClientSide && this.f != 0 && (this.k + i + j + k) % 200 == 0) { ++ int i = this.position.getX(); ++ int j = this.position.getY(); ++ int k = this.position.getZ(); ++ if (!this.world.isClientSide && this.f != 0 /*&& (this.k + i + j + k) % 200 == 0*/) { // Paper - comment out tick rate limiter ++ // Paper end + this.f = 0; + f = 5.0F; + List list = this.world.a(EntityHuman.class, new AxisAlignedBB((double) ((float) i - 5.0F), (double) ((float) j - 5.0F), (double) ((float) k - 5.0F), (double) ((float) (i + 1) + 5.0F), (double) ((float) (j + 1) + 5.0F), (double) ((float) (k + 1) + 5.0F))); +@@ -134,11 +140,14 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { + } + } + +- this.e = this.a; +- f = 0.1F; + if (this.f > 0 && this.a == 0.0F) { + this.a(SoundEffects.BLOCK_CHEST_OPEN); + } ++ // Paper start ++ } ++ private void doCloseLogic() { ++ this.e = this.a; ++ // Paper end + + if (this.f == 0 && this.a > 0.0F || this.f > 0 && this.a < 1.0F) { + float f1 = this.a; +@@ -203,6 +212,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { + + ++this.f; + if (this.world == null) return; // CraftBukkit ++ doOpenLogic(); // Paper + + // CraftBukkit start - Call redstone event + if (this.getBlock() == Blocks.TRAPPED_CHEST) { +@@ -224,6 +234,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { + --this.f; + + // CraftBukkit start - Call redstone event ++ doCloseLogic(); // Paper + if (this.getBlock() == Blocks.TRAPPED_CHEST) { + int newPower = Math.max(0, Math.min(15, this.f)); + +diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java +index f275fd1c3..7d7628b04 100644 +--- a/src/main/java/net/minecraft/server/TileEntityEnderChest.java ++++ b/src/main/java/net/minecraft/server/TileEntityEnderChest.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-public class TileEntityEnderChest extends TileEntity implements ITickable { ++public class TileEntityEnderChest extends TileEntity { // Paper - Remove ITickable + + public float a; + public float e; +@@ -17,19 +17,37 @@ public class TileEntityEnderChest extends TileEntity implements ITickable { + } + + this.e = this.a; ++ // Paper start ++ /* + int i = this.position.getX(); + int j = this.position.getY(); + int k = this.position.getZ(); + float f = 0.1F; + double d0; +- ++ */ ++ // Paper start ++ } ++ private void doOpenLogic() { ++ int i = this.position.getX(); ++ int j = this.position.getY(); ++ int k = this.position.getZ(); ++ double d0; ++ // Paper end + if (this.f > 0 && this.a == 0.0F) { + double d1 = (double) i + 0.5D; + + d0 = (double) k + 0.5D; + this.world.a((EntityHuman) null, d1, (double) j + 0.5D, d0, SoundEffects.BLOCK_ENDER_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); + } +- ++ // Paper start ++ } ++ private void doCloseLogic() { ++ int i = this.position.getX(); ++ int j = this.position.getY(); ++ int k = this.position.getZ(); ++ this.e = this.a; ++ double d0; ++ // Paper end + if (this.f == 0 && this.a > 0.0F || this.f > 0 && this.a < 1.0F) { + float f1 = this.a; + +@@ -76,11 +94,13 @@ public class TileEntityEnderChest extends TileEntity implements ITickable { + public void c() { + ++this.f; + this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.f); ++ doOpenLogic(); // Paper + } + + public void d() { + --this.f; + this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.f); ++ doCloseLogic(); // Paper + } + + public boolean a(EntityHuman entityhuman) { +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0022-Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch similarity index 94% rename from Spigot-Server-Patches/0022-Further-improve-server-tick-loop.patch rename to Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch index 1877fc02f9..f927ce4360 100644 --- a/Spigot-Server-Patches/0022-Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch @@ -1,4 +1,4 @@ -From 1e6e7ab651008e3a1077dd86e7ff04563ce9cc97 Mon Sep 17 00:00:00 2001 +From 3d481b7c47b3781e9ee6bd3badaf44de6eae33df 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 92d480251..47fe9262a 100644 +index 4889a82a2..2e691b9f6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -114,16 +114,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -141,17 +141,13 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati public org.bukkit.command.ConsoleCommandSender console; public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; public ConsoleReader reader; @@ -24,6 +24,7 @@ index 92d480251..47fe9262a 100644 public final Thread primaryThread; public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; + public File bukkitDataPackFolder; // CraftBukkit end // Spigot start - public static final int TPS = 20; @@ -33,7 +34,7 @@ index 92d480251..47fe9262a 100644 public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant(); // Spigot end -@@ -534,12 +530,54 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -637,12 +633,54 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati this.isRunning = false; } @@ -93,7 +94,7 @@ index 92d480251..47fe9262a 100644 public void run() { try { -@@ -553,24 +591,41 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -654,24 +692,41 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // Spigot start Arrays.fill( recentTps, 20 ); @@ -147,10 +148,10 @@ index 92d480251..47fe9262a 100644 } lastTick = curTime; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 33b40ffc2..bfddd1685 100644 +index 28f6cdf96..2055bf7de 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1753,6 +1753,17 @@ public final class CraftServer implements Server { +@@ -1849,6 +1849,17 @@ public final class CraftServer implements Server { return CraftMagicNumbers.INSTANCE; } diff --git a/Spigot-Server-Patches/0021-Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/0021-Optimize-TileEntity-Ticking.patch deleted file mode 100644 index 9e1a026f44..0000000000 --- a/Spigot-Server-Patches/0021-Optimize-TileEntity-Ticking.patch +++ /dev/null @@ -1,190 +0,0 @@ -From 38c9fb6874ea9a6a93dcb74babdf31dccacb9fde Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Tue, 1 Mar 2016 22:01:19 -0600 -Subject: [PATCH] Optimize TileEntity Ticking - - -diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java -index 3b5af473d..631304122 100644 ---- a/src/main/java/net/minecraft/server/TileEntityChest.java -+++ b/src/main/java/net/minecraft/server/TileEntityChest.java -@@ -8,17 +8,17 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity; - import org.bukkit.entity.HumanEntity; - // CraftBukkit end - --public class TileEntityChest extends TileEntityLootable implements ITickable { -+public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITickable - - private NonNullList items; - public boolean a; -- public TileEntityChest f; -- public TileEntityChest g; -- public TileEntityChest h; -- public TileEntityChest i; -- public float j; -+ public TileEntityChest f; // Paper - Adjacent Chest Z Neg -+ public TileEntityChest g; // Paper - Adjacent Chest X Pos -+ public TileEntityChest h; // Paper - Adjacent Chest X Neg -+ public TileEntityChest i; // Paper - Adjacent Chest Z Pos -+ public float j; // Paper - lid angle - public float k; -- public int l; -+ public int l; // Paper - Number of viewers - private int q; - private BlockChest.Type r; - -@@ -190,6 +190,8 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { - } - - public void e() { -+ // Paper - Disable all of this, just in case this does get ticked -+ /* - this.o(); - int i = this.position.getX(); - int j = this.position.getY(); -@@ -270,7 +272,8 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { - this.j = 0.0F; - } - } -- -+ */ -+ // Paper end - } - - public boolean c(int i, int j) { -@@ -290,6 +293,28 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { - int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added - - ++this.l; -+ -+ // Paper start - Move chest open sound out of the tick loop -+ this.o(); -+ -+ if (this.l > 0 && this.j == 0.0F && this.f == null && this.h == null) { -+ this.j = 0.7F; -+ -+ double d0 = (double) this.position.getZ() + 0.5D; -+ double d1 = (double) this.position.getX() + 0.5D; -+ -+ if (this.i != null) { -+ d0 += 0.5D; -+ } -+ -+ if (this.g != null) { -+ d1 += 0.5D; -+ } -+ -+ this.world.a((EntityHuman) null, d1, (double) this.position.getY() + 0.5D, d0, SoundEffects.ac, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); -+ } -+ // Paper end -+ - if (this.world == null) return; // CraftBukkit - this.world.playBlockAction(this.position, this.getBlock(), 1, this.l); - -@@ -314,6 +339,34 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { - if (!entityhuman.isSpectator() && this.getBlock() instanceof BlockChest) { - int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added - --this.l; -+ -+ // Paper start - Move chest close sound out of the tick loop -+ if (this.l == 0 && this.j > 0.0F || this.l > 0 && this.j < 1.0F) { -+ float f = 0.1F; -+ -+ if (this.l > 0) { -+ this.j += f; -+ } else { -+ this.j -= f; -+ } -+ -+ double d0 = (double) this.getPosition().getX() + 0.5D; -+ double d2 = (double) this.getPosition().getZ() + 0.5D; -+ int yLoc = this.position.getY(); -+ -+ if (this.i != null) { -+ d2 += 0.5D; -+ } -+ -+ if (this.g != null) { -+ d0 += 0.5D; -+ } -+ -+ this.world.a((EntityHuman) null, d0, (double) yLoc + 0.5D, d2, SoundEffects.aa, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); -+ this.j = 0.0F; -+ } -+ // Paper end -+ - this.world.playBlockAction(this.position, this.getBlock(), 1, this.l); - this.world.applyPhysics(this.position, this.getBlock(), false); - -diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java -index 31585757b..1c1741c56 100644 ---- a/src/main/java/net/minecraft/server/TileEntityEnderChest.java -+++ b/src/main/java/net/minecraft/server/TileEntityEnderChest.java -@@ -1,15 +1,17 @@ - package net.minecraft.server; - --public class TileEntityEnderChest extends TileEntity implements ITickable { -+public class TileEntityEnderChest extends TileEntity { // Paper - Remove ITickable - -- public float a; -+ public float a; // Paper - lid angle - public float f; -- public int g; -+ public int g; // Paper - Number of viewers - private int h; - - public TileEntityEnderChest() {} - - public void e() { -+ // Paper start - Disable all of this, just in case this does get ticked -+ /* - if (++this.h % 20 * 4 == 0) { - this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.g); - } -@@ -54,6 +56,8 @@ public class TileEntityEnderChest extends TileEntity implements ITickable { - this.a = 0.0F; - } - } -+ */ -+ // Paper end - - } - -@@ -73,11 +77,34 @@ public class TileEntityEnderChest extends TileEntity implements ITickable { - - public void a() { - ++this.g; -+ -+ // Paper start - Move enderchest open sounds out of the tick loop -+ if (this.g > 0 && this.a == 0.0F) { -+ this.a = 0.7F; -+ -+ double d1 = (double) this.getPosition().getX() + 0.5D; -+ double d0 = (double) this.getPosition().getZ() + 0.5D; -+ -+ this.world.a((EntityHuman) null, d1, (double) this.getPosition().getY() + 0.5D, d0, SoundEffects.aT, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); -+ } -+ // Paper end -+ - this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.g); - } - - public void f() { - --this.g; -+ -+ // Paper start - Move enderchest close sounds out of the tick loop -+ if (this.g == 0 && this.a > 0.0F || this.g > 0 && this.a < 1.0F) { -+ double d0 = (double) this.getPosition().getX() + 0.5D; -+ double d2 = (double) this.getPosition().getZ() + 0.5D; -+ -+ this.world.a((EntityHuman) null, d0, (double) this.getPosition().getY() + 0.5D, d2, SoundEffects.aS, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); -+ this.a = 0.0F; -+ } -+ // Paper end -+ - this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.g); - } - --- -2.18.0 - diff --git a/Spigot-Server-Patches/0023-Only-refresh-abilities-if-needed.patch b/Spigot-Server-Patches/0022-Only-refresh-abilities-if-needed.patch similarity index 86% rename from Spigot-Server-Patches/0023-Only-refresh-abilities-if-needed.patch rename to Spigot-Server-Patches/0022-Only-refresh-abilities-if-needed.patch index a1e4ceff36..f78e14ee49 100644 --- a/Spigot-Server-Patches/0023-Only-refresh-abilities-if-needed.patch +++ b/Spigot-Server-Patches/0022-Only-refresh-abilities-if-needed.patch @@ -1,14 +1,14 @@ -From ab130b09cf07883b904852ed5d8cc5b791e13772 Mon Sep 17 00:00:00 2001 +From 87f57e185916a66a14dec3bb7ec0c33f24a45bc9 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 23:12:03 -0600 Subject: [PATCH] Only refresh abilities if needed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a0c86d0e0..e3ad45aa8 100644 +index c67137a80..79223dfa6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1240,12 +1240,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1285,12 +1285,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setFlying(boolean value) { diff --git a/Spigot-Server-Patches/0024-Add-async-chunk-load-API.patch b/Spigot-Server-Patches/0023-Add-async-chunk-load-API.patch similarity index 89% rename from Spigot-Server-Patches/0024-Add-async-chunk-load-API.patch rename to Spigot-Server-Patches/0023-Add-async-chunk-load-API.patch index 678569df1e..5992a89ad0 100644 --- a/Spigot-Server-Patches/0024-Add-async-chunk-load-API.patch +++ b/Spigot-Server-Patches/0023-Add-async-chunk-load-API.patch @@ -1,14 +1,14 @@ -From c3014cb73ff60881596d4127dfbc32e58a3e07a2 Mon Sep 17 00:00:00 2001 +From cfeda276a4e161703f02b62d97e39a1ddd65193f Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 23:19:01 -0600 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 ef8165da4..01fc193db 100644 +index 0b2a9d09d..4df849eef 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -134,6 +134,26 @@ public class CraftWorld implements World { +@@ -133,6 +133,26 @@ public class CraftWorld implements World { } } diff --git a/Spigot-Server-Patches/0025-Entity-Origin-API.patch b/Spigot-Server-Patches/0024-Entity-Origin-API.patch similarity index 83% rename from Spigot-Server-Patches/0025-Entity-Origin-API.patch rename to Spigot-Server-Patches/0024-Entity-Origin-API.patch index dd85943cf6..fbde3fe916 100644 --- a/Spigot-Server-Patches/0025-Entity-Origin-API.patch +++ b/Spigot-Server-Patches/0024-Entity-Origin-API.patch @@ -1,14 +1,14 @@ -From eb34ce2535e4e16447bb108f92ca70742ff00a66 Mon Sep 17 00:00:00 2001 +From d97bed2c5c938d245595b74e0cdda94a68a6bc27 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 d358ab26a..011cf59c0 100644 +index 12b86ab75..2288df268 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -149,6 +149,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -160,6 +160,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only public boolean forceExplosionKnockback; // SPIGOT-949 public Timing tickTimer = MinecraftTimings.getEntityTimings(this); // Paper @@ -16,7 +16,7 @@ index d358ab26a..011cf59c0 100644 // Spigot start public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -1545,6 +1546,11 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -1629,6 +1630,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } } @@ -28,7 +28,7 @@ index d358ab26a..011cf59c0 100644 return nbttagcompound; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT"); -@@ -1688,6 +1694,13 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -1771,6 +1777,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end @@ -42,7 +42,7 @@ index d358ab26a..011cf59c0 100644 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded"); -@@ -1756,6 +1769,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -1842,6 +1855,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke protected abstract void b(NBTTagCompound nbttagcompound); @@ -51,10 +51,10 @@ index d358ab26a..011cf59c0 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 2ba5d51a5..abdc2dea9 100644 +index 7aa12c3b4..1d4a7b64d 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java -@@ -267,6 +267,14 @@ public class EntityFallingBlock extends Entity { +@@ -249,6 +249,14 @@ public class EntityFallingBlock extends Entity { this.block = Blocks.SAND.getBlockData(); } @@ -70,7 +70,7 @@ index 2ba5d51a5..abdc2dea9 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 0d70dd1d2..bb0904f86 100644 +index 5ceb3f206..87f3205f8 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,22 +89,22 @@ index 0d70dd1d2..bb0904f86 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index bc6383669..ca9eb2f3b 100644 +index e56d4836d..0bf8d15d7 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java -@@ -153,6 +153,7 @@ public class NBTTagList extends NBTBase { +@@ -182,6 +182,7 @@ public class NBTTagList extends NBTList { return new int[0]; } -+ public final double getDoubleAt(int i) { return this.f(i); } // Paper - OBFHELPER - public double f(int i) { ++ public final double getDoubleAt(int i) { return this.k(i); } // Paper - OBFHELPER + public double k(int i) { 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 26d4bd690..31b765dea 100644 +index fd64b75ed..3f0b6ac26 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1071,6 +1071,12 @@ public abstract class World implements IBlockAccess { +@@ -940,6 +940,12 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose int j = MathHelper.floor(entity.locZ / 16.0D); boolean flag = entity.attachedToPlayer; @@ -118,10 +118,10 @@ index 26d4bd690..31b765dea 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 833e3111d..6c23e88a5 100644 +index 1e3675e4f..0daa15f1b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -761,4 +761,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -781,4 +781,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return spigot; } // Spigot end diff --git a/Spigot-Server-Patches/0026-Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/0025-Prevent-tile-entity-and-entity-crashes.patch similarity index 76% rename from Spigot-Server-Patches/0026-Prevent-tile-entity-and-entity-crashes.patch rename to Spigot-Server-Patches/0025-Prevent-tile-entity-and-entity-crashes.patch index 54a2dc9ad8..f93fc6ca8a 100644 --- a/Spigot-Server-Patches/0026-Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/0025-Prevent-tile-entity-and-entity-crashes.patch @@ -1,32 +1,32 @@ -From a949306e1efe3b5ba7ae41b9ea584778b59a5265 Mon Sep 17 00:00:00 2001 +From c25380700dff93018c14a133e3b1ab252516d495 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 15f18ba1d..33e245e4c 100644 +index 5b7f6ca84..8cab71c0e 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java -@@ -196,7 +196,12 @@ public abstract class TileEntity implements KeyedObject { - } +@@ -175,7 +175,12 @@ public abstract class TileEntity implements KeyedObject { + return TileEntityTypes.a.b(this.C()) + " // " + this.getClass().getCanonicalName(); }); if (this.world != null) { -- CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock(), this.v()); +- CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock()); + // Paper start - Prevent TileEntity and Entity crashes -+ Block block = this.getBlock(); ++ IBlockData block = this.getBlock(); + if (block != null) { -+ CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock(), this.v()); ++ CrashReportSystemDetails.a(crashreportsystemdetails, this.position, block); + } + // Paper end - crashreportsystemdetails.a("Actual block type", new CrashReportCallable() { - public String a() throws Exception { - int i = Block.getId(TileEntity.this.world.getType(TileEntity.this.position).getBlock()); + CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.world.getType(this.position)); + } + } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 31b765dea..fd5f8102a 100644 +index 3f0b6ac26..c605d7e52 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1449,10 +1449,12 @@ public abstract class World implements IBlockAccess { +@@ -1166,10 +1166,12 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose entity.tickTimer.stopTiming(); // Paper } catch (Throwable throwable1) { entity.tickTimer.stopTiming(); @@ -43,9 +43,9 @@ index 31b765dea..fd5f8102a 100644 } } -@@ -1515,10 +1517,13 @@ public abstract class World implements IBlockAccess { - ((ITickable) tileentity).e(); - this.methodProfiler.b(); +@@ -1232,10 +1234,13 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + ((ITickable) tileentity).X_(); + this.methodProfiler.e(); } catch (Throwable throwable2) { - crashreport1 = CrashReport.a(throwable2, "Ticking block entity"); - crashreportsystemdetails1 = crashreport1.a("Block entity being ticked"); diff --git a/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/0026-Configurable-top-of-nether-void-damage.patch similarity index 63% rename from Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch rename to Spigot-Server-Patches/0026-Configurable-top-of-nether-void-damage.patch index 8d9962cc80..2294976bd1 100644 --- a/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch +++ b/Spigot-Server-Patches/0026-Configurable-top-of-nether-void-damage.patch @@ -1,16 +1,16 @@ -From 76648e3954c2467150ff499f71a67f70f8e6f5a4 Mon Sep 17 00:00:00 2001 +From 288de182d84b0380c328c4c4590c5d0a83d74a8e 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 d3484489b..bf7af475c 100644 +index 4da846719..a340866f3 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -129,4 +129,10 @@ public class PaperWorldConfig { - waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5); - log("Water over lava flow speed: " + waterOverLavaFlowSpeed); +@@ -123,4 +123,10 @@ public class PaperWorldConfig { + if (fallingBlockHeightNerf != 0) log("Falling Block Height Limit set to Y: " + fallingBlockHeightNerf); + if (entityTNTHeightNerf != 0) log("TNT Entity Height Limit set to Y: " + entityTNTHeightNerf); } + + public boolean netherVoidTopDamage; @@ -20,10 +20,10 @@ index d3484489b..bf7af475c 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 43b802855..aadc426fd 100644 +index 2288df268..111eeeecc 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -450,9 +450,15 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -464,9 +464,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.fallDistance *= 0.5F; } @@ -31,7 +31,7 @@ index 43b802855..aadc426fd 100644 + // Extracted to own function + /* if (this.locY < -64.0D) { - this.ac(); + this.aa(); } + */ + this.checkAndDoHeightDamage(); @@ -39,38 +39,34 @@ index 43b802855..aadc426fd 100644 if (!this.world.isClientSide) { this.setFlag(0, this.fireTicks > 0); -@@ -462,6 +468,18 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper - this.world.methodProfiler.b(); +@@ -476,6 +482,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + this.world.methodProfiler.e(); } -+ // Paper start - Configurable top of nether void damage -+ private boolean paperNetherCheck() { -+ return this.world.paperConfig.netherVoidTopDamage && this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this.locY >= 128.0D; -+ } -+ ++ // Paper start + protected void checkAndDoHeightDamage() { -+ if (this.locY < -64.0D || paperNetherCheck()) { ++ if (this.locY < -64.0D || (this.world.paperConfig.netherVoidTopDamage && this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this.locY >= 128.0D)) { + this.kill(); + } + } + // Paper end + - protected void I() { + protected void E() { if (this.portalCooldown > 0) { --this.portalCooldown; -@@ -518,6 +536,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -532,6 +546,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.fireTicks = 0; } -+ protected final void kill() { this.ac(); } // Paper - OBFHELPER - protected void ac() { ++ protected final void kill() { this.aa(); } // Paper - OBFHELPER + protected void aa() { this.die(); } diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index a9412d4e0..1f4025486 100644 +index 2f4e1a280..3598998b5 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -@@ -204,9 +204,15 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT +@@ -201,9 +201,15 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT this.setDamage(this.getDamage() - 1.0F); } @@ -78,7 +74,7 @@ index a9412d4e0..1f4025486 100644 + // Extracted to own function + /* if (this.locY < -64.0D) { - this.ac(); + this.aa(); } + */ + this.checkAndDoHeightDamage(); diff --git a/Spigot-Server-Patches/0028-Check-online-mode-before-converting-and-renaming-pla.patch b/Spigot-Server-Patches/0027-Check-online-mode-before-converting-and-renaming-pla.patch similarity index 80% rename from Spigot-Server-Patches/0028-Check-online-mode-before-converting-and-renaming-pla.patch rename to Spigot-Server-Patches/0027-Check-online-mode-before-converting-and-renaming-pla.patch index 9db8fdafef..471354d135 100644 --- a/Spigot-Server-Patches/0028-Check-online-mode-before-converting-and-renaming-pla.patch +++ b/Spigot-Server-Patches/0027-Check-online-mode-before-converting-and-renaming-pla.patch @@ -1,15 +1,15 @@ -From a44f81bb9c9cc3fe4d1f2b995c6da771b273ee0a Mon Sep 17 00:00:00 2001 +From e22a475ba3127f333d314118e9a1bb956334ac8d 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 b69c6cf97..eba1228fd 100644 +index a5157269c..a562e1e46 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -167,7 +167,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { - File file = new File(this.playerDir, entityhuman.bn() + ".dat"); +@@ -169,7 +169,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { + File file = new File(this.playerDir, entityhuman.bu() + ".dat"); // Spigot Start boolean usingWrongFile = false; - if ( !file.exists() ) diff --git a/Spigot-Server-Patches/0029-Always-tick-falling-blocks.patch b/Spigot-Server-Patches/0028-Always-tick-falling-blocks.patch similarity index 80% rename from Spigot-Server-Patches/0029-Always-tick-falling-blocks.patch rename to Spigot-Server-Patches/0028-Always-tick-falling-blocks.patch index 391e6b1c5c..e2c3eca105 100644 --- a/Spigot-Server-Patches/0029-Always-tick-falling-blocks.patch +++ b/Spigot-Server-Patches/0028-Always-tick-falling-blocks.patch @@ -1,11 +1,11 @@ -From 44f7b670a109010c9d1e76a06aa48d717bb14b1e Mon Sep 17 00:00:00 2001 +From 0ded699fa2af784c8866b92e86dca3d5cd3b321b Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 2 Mar 2016 00:32:25 -0600 Subject: [PATCH] Always tick falling blocks diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 38be7ed71..3265a6c25 100644 +index f68e42c4d..1aade75f3 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -13,6 +13,7 @@ import net.minecraft.server.EntityCreature; @@ -16,14 +16,14 @@ index 38be7ed71..3265a6c25 100644 import net.minecraft.server.EntityFireball; import net.minecraft.server.EntityFireworks; import net.minecraft.server.EntityHuman; -@@ -80,6 +81,7 @@ public class ActivationRange +@@ -81,6 +82,7 @@ public class ActivationRange || entity instanceof EntityFireball || entity instanceof EntityWeather || entity instanceof EntityTNTPrimed + || entity instanceof EntityFallingBlock // Paper - Always tick falling blocks || entity instanceof EntityEnderCrystal - || entity instanceof EntityFireworks ) - { + || entity instanceof EntityFireworks + || entity instanceof EntityThrownTrident ) -- 2.18.0 diff --git a/Spigot-Server-Patches/0030-Lighting-Queue.patch b/Spigot-Server-Patches/0029-Lighting-Queue.patch similarity index 78% rename from Spigot-Server-Patches/0030-Lighting-Queue.patch rename to Spigot-Server-Patches/0029-Lighting-Queue.patch index 3bfe7d0ea5..b77b6db454 100644 --- a/Spigot-Server-Patches/0030-Lighting-Queue.patch +++ b/Spigot-Server-Patches/0029-Lighting-Queue.patch @@ -1,4 +1,4 @@ -From eff7f534ce1d3c0f5c1e12bfae87996f1a22dbcc Mon Sep 17 00:00:00 2001 +From a3a7edec34bd96d3265f4af61927aeab46f195c9 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 2 Mar 2016 00:52:31 -0600 Subject: [PATCH] Lighting Queue @@ -6,10 +6,10 @@ Subject: [PATCH] Lighting Queue This provides option to queue lighting updates to ensure they do not cause the server lag diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -index e0ad559b7..4eebd9fae 100644 +index 145cb274b..eff9dcf54 100644 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -@@ -49,6 +49,8 @@ public class WorldTimingsHandler { +@@ -50,6 +50,8 @@ public class WorldTimingsHandler { public final Timing worldSaveLevel; public final Timing chunkSaveData; @@ -18,19 +18,20 @@ index e0ad559b7..4eebd9fae 100644 public WorldTimingsHandler(World server) { String name = server.worldData.getName() +" - "; -@@ -95,5 +97,7 @@ public class WorldTimingsHandler { +@@ -96,6 +98,8 @@ public class WorldTimingsHandler { tracker2 = Timings.ofSafe(name + "tracker stage 2"); doTick = Timings.ofSafe(name + "doTick"); tickEntities = Timings.ofSafe(name + "tickEntities"); + + lightingQueueTimer = Timings.ofSafe(name + "Lighting Queue"); } - } + + 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 bf7af475c..94a173045 100644 +index a340866f3..1e3405cc1 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -135,4 +135,10 @@ public class PaperWorldConfig { +@@ -129,4 +129,10 @@ public class PaperWorldConfig { netherVoidTopDamage = getBoolean( "nether-ceiling-void-damage", false ); log("Top of the nether void damage: " + netherVoidTopDamage); } @@ -42,19 +43,19 @@ index bf7af475c..94a173045 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 50113c303..aaf253c89 100644 +index 36ea4ad47..e5567701e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -61,6 +61,7 @@ public class Chunk { +@@ -91,6 +91,7 @@ public class Chunk implements IChunkAccess { return removed; } } + final PaperLightingQueue.LightingQueue lightingQueue = new PaperLightingQueue.LightingQueue(this); // Paper end - private boolean done; - private boolean lit; -@@ -258,6 +259,13 @@ public class Chunk { - private void h(boolean flag) { + public boolean areNeighborsLoaded(final int radius) { + switch (radius) { +@@ -281,6 +282,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)) { + this.runOrQueueLightUpdate(() -> recheckGaps(flag)); // Paper - Queue light update @@ -66,25 +67,25 @@ index 50113c303..aaf253c89 100644 + // Paper end for (int i = 0; i < 16; ++i) { for (int j = 0; j < 16; ++j) { - if (this.i[i + j * 16]) { -@@ -511,6 +519,7 @@ public class Chunk { - if (flag) { + if (this.h[i + j * 16]) { +@@ -524,6 +532,7 @@ public class Chunk implements IChunkAccess { + if (flag1) { this.initLighting(); } else { + this.runOrQueueLightUpdate(() -> { // Paper - Queue light update - int j1 = iblockdata.c(); - int k1 = iblockdata1.c(); + int i1 = iblockdata.b(this.world, blockposition); + int j1 = iblockdata1.b(this.world, blockposition); -@@ -525,6 +534,7 @@ public class Chunk { - if (j1 != k1 && (j1 < k1 || this.getBrightness(EnumSkyBlock.SKY, blockposition) > 0 || this.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 0)) { - this.d(i, k); +@@ -531,6 +540,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); } + }); // Paper } TileEntity tileentity; -@@ -1377,6 +1387,16 @@ public class Chunk { - this.w = i; +@@ -1290,6 +1300,16 @@ public class Chunk implements IChunkAccess { + return this.E == 8; } + // Paper start @@ -101,10 +102,10 @@ index 50113c303..aaf253c89 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 bd006ef74..2b320cbd1 100644 +index badfe86b2..51bc23daf 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -295,6 +295,7 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -323,6 +323,7 @@ public class ChunkProviderServer implements IChunkProvider { return false; } save = event.isSaveChunk(); @@ -113,24 +114,24 @@ index bd006ef74..2b320cbd1 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 47fe9262a..d63a243f3 100644 +index 2e691b9f6..4473c3b51 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -722,7 +722,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs - protected void C() throws ExceptionWorldConflict { // CraftBukkit - added throws +@@ -825,7 +825,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + protected void v() { co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot -- long i = System.nanoTime(); -+ long i = System.nanoTime(); long startTime = i; // Paper +- long i = SystemUtils.c(); ++ long i = SystemUtils.c(); long startTime = i; // Paper ++this.ticks; - if (this.T) { -@@ -783,6 +783,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs - this.methodProfiler.b(); - + if (this.S) { +@@ -883,6 +883,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + this.methodProfiler.e(); + this.methodProfiler.e(); org.spigotmc.WatchdogThread.tick(); // Spigot + PaperLightingQueue.processQueue(startTime); // Paper - this.slackActivityAccountant.tickEnded(tickNanos); // Spigot + this.slackActivityAccountant.tickEnded(l); // Spigot co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper } diff --git a/src/main/java/net/minecraft/server/PaperLightingQueue.java b/src/main/java/net/minecraft/server/PaperLightingQueue.java @@ -232,16 +233,16 @@ index 000000000..345cd5824 + } +} diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index fd5f8102a..77ed2d249 100644 +index c605d7e52..f57bd081b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -391,7 +391,7 @@ public abstract class World implements IBlockAccess { - } else { - if (iblockdata.c() != iblockdata1.c() || iblockdata.d() != iblockdata1.d()) { +@@ -325,7 +325,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + + if (iblockdata2.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata2.e() != iblockdata1.e()) { this.methodProfiler.a("checkLight"); -- this.w(blockposition); -+ chunk.runOrQueueLightUpdate(() -> this.w(blockposition)); // Paper - Queue light update - this.methodProfiler.b(); +- this.r(blockposition); ++ chunk.runOrQueueLightUpdate(() -> this.r(blockposition)); // Paper - Queue light update + this.methodProfiler.e(); } -- diff --git a/Spigot-Server-Patches/0031-Configurable-end-credits.patch b/Spigot-Server-Patches/0030-Configurable-end-credits.patch similarity index 67% rename from Spigot-Server-Patches/0031-Configurable-end-credits.patch rename to Spigot-Server-Patches/0030-Configurable-end-credits.patch index 8345019eda..3a5a425ff3 100644 --- a/Spigot-Server-Patches/0031-Configurable-end-credits.patch +++ b/Spigot-Server-Patches/0030-Configurable-end-credits.patch @@ -1,14 +1,14 @@ -From 2a957c68f83983541fb26d90e11944e9f97ec7fa Mon Sep 17 00:00:00 2001 +From 5b727c50fb330b282c3b6b23576ca0f5e552e2a5 Mon Sep 17 00:00:00 2001 From: DoctorDark Date: Wed, 16 Mar 2016 02:21:39 -0500 Subject: [PATCH] Configurable end credits diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 94a173045..db09711e4 100644 +index 1e3405cc1..dccccbf5b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -141,4 +141,10 @@ public class PaperWorldConfig { +@@ -135,4 +135,10 @@ public class PaperWorldConfig { queueLightUpdates = getBoolean("queue-light-updates", false); log("Lighting Queue enabled: " + queueLightUpdates); } @@ -20,25 +20,25 @@ index 94a173045..db09711e4 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 730acd971..dfaab774d 100644 +index e035025f0..cb44bf3a7 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -56,7 +56,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - private long cn = System.currentTimeMillis(); - private Entity co; +@@ -62,7 +62,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + private long cv = SystemUtils.b(); + private Entity cw; public boolean worldChangeInvuln; -- private boolean cq; -+ private boolean cq; private void setHasSeenCredits(boolean has) { this.cq = has; } // Paper - OBFHELPER - private final RecipeBookServer cr = new RecipeBookServer(); - private Vec3D cs; - private int ct; -@@ -612,6 +612,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +- 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; +@@ -621,6 +621,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.cq ? 0.0F : 1.0F)); - this.cq = true; + this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cy ? 0.0F : 1.0F)); + this.cy = true; } -- 2.18.0 diff --git a/Spigot-Server-Patches/0032-Fix-lag-from-explosions-processing-dead-entities.patch b/Spigot-Server-Patches/0031-Fix-lag-from-explosions-processing-dead-entities.patch similarity index 90% rename from Spigot-Server-Patches/0032-Fix-lag-from-explosions-processing-dead-entities.patch rename to Spigot-Server-Patches/0031-Fix-lag-from-explosions-processing-dead-entities.patch index dbe9bc64e9..0dde6c3f06 100644 --- a/Spigot-Server-Patches/0032-Fix-lag-from-explosions-processing-dead-entities.patch +++ b/Spigot-Server-Patches/0031-Fix-lag-from-explosions-processing-dead-entities.patch @@ -1,14 +1,14 @@ -From 178c570553fa6504bac1ad6233eed59af89f1360 Mon Sep 17 00:00:00 2001 +From ca823da1187da71d1c8e6d179dfdb81166043332 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 98c2bdcf7..a1ebcf858 100644 +index 37e6e5922..e30219258 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -104,7 +104,14 @@ public class Explosion { +@@ -110,7 +110,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/0034-Optimize-explosions.patch b/Spigot-Server-Patches/0032-Optimize-explosions.patch similarity index 86% rename from Spigot-Server-Patches/0034-Optimize-explosions.patch rename to Spigot-Server-Patches/0032-Optimize-explosions.patch index 6965d149bf..513210ae6d 100644 --- a/Spigot-Server-Patches/0034-Optimize-explosions.patch +++ b/Spigot-Server-Patches/0032-Optimize-explosions.patch @@ -1,4 +1,4 @@ -From 7c6a6c8a4f1efcf9c0319a79cfcc36fc6b700591 Mon Sep 17 00:00:00 2001 +From 51fa8a93b0548bb469018d71ee6adcf7123f6ccc Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 2 Mar 2016 11:59:48 -0600 Subject: [PATCH] Optimize explosions @@ -10,12 +10,12 @@ 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 7e5cd8042..15675efbf 100644 +index dccccbf5b..3626aa717 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -177,4 +177,10 @@ public class PaperWorldConfig { - disableExtremeHillsMonsterEggs = getBoolean("generator-settings.disable-extreme-hills-monster-eggs", false); - disableMesaAdditionalGold = getBoolean("generator-settings.disable-mesa-additional-gold", false); +@@ -141,4 +141,10 @@ public class PaperWorldConfig { + disableEndCredits = getBoolean("game-mechanics.disable-end-credits", false); + log("End credits disabled: " + disableEndCredits); } + + public boolean optimizeExplosions; @@ -25,10 +25,10 @@ index 7e5cd8042..15675efbf 100644 + } } diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index a1ebcf858..e7f0e84d4 100644 +index e30219258..ddbf667c4 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -130,7 +130,7 @@ public class Explosion { +@@ -136,7 +136,7 @@ public class Explosion { d8 /= d11; d9 /= d11; d10 /= d11; @@ -37,7 +37,7 @@ index a1ebcf858..e7f0e84d4 100644 double d13 = (1.0D - d7) * d12; // CraftBukkit start -@@ -298,4 +298,85 @@ public class Explosion { +@@ -312,4 +312,85 @@ public class Explosion { public List getBlocks() { return this.blocks; } @@ -124,22 +124,22 @@ index a1ebcf858..e7f0e84d4 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d63a243f3..4e8ce79ff 100644 +index 4473c3b51..1027b0588 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -889,6 +889,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs +@@ -990,6 +990,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati worldserver.getTracker().updatePlayers(); - this.methodProfiler.b(); - this.methodProfiler.b(); + this.methodProfiler.e(); + this.methodProfiler.e(); + worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions - // } // CraftBukkit + } - // this.i[i][this.ticks % 100] = System.nanoTime() - j; // CraftBukkit + // 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 77ed2d249..fc7315f7d 100644 +index f57bd081b..04493a1f9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -16,6 +16,7 @@ import javax.annotation.Nullable; +@@ -18,6 +18,7 @@ import org.apache.logging.log4j.Logger; // CraftBukkit start import com.google.common.collect.Maps; @@ -147,7 +147,7 @@ index 77ed2d249..fc7315f7d 100644 import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.block.BlockState; -@@ -138,6 +139,7 @@ public abstract class World implements IBlockAccess { +@@ -138,6 +139,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; private int tileTickPosition; diff --git a/Spigot-Server-Patches/0038-Add-player-view-distance-API.patch b/Spigot-Server-Patches/0033-Add-player-view-distance-API.patch similarity index 92% rename from Spigot-Server-Patches/0038-Add-player-view-distance-API.patch rename to Spigot-Server-Patches/0033-Add-player-view-distance-API.patch index 6403c58f48..a4be69b6bc 100644 --- a/Spigot-Server-Patches/0038-Add-player-view-distance-API.patch +++ b/Spigot-Server-Patches/0033-Add-player-view-distance-API.patch @@ -1,14 +1,14 @@ -From 0ecf170f67207941568d9e933f1648f12a858ec4 Mon Sep 17 00:00:00 2001 +From 9ef5da712e0601ac690b564f05fc90837caff795 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 dfaab774d..3058dfef0 100644 +index cb44bf3a7..0531812fb 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -66,6 +66,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -72,6 +72,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public boolean f; public int ping; public boolean viewingCredits; @@ -25,10 +25,10 @@ index dfaab774d..3058dfef0 100644 // CraftBukkit start public String displayName; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index e4ed2e991..9627a9be0 100644 +index d975c2ccf..6ece565c5 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -47,7 +47,7 @@ public class PlayerChunkMap { +@@ -35,7 +35,7 @@ public class PlayerChunkMap { private final List g = Lists.newLinkedList(); private final List h = Lists.newLinkedList(); private final List i = Lists.newArrayList(); @@ -37,7 +37,7 @@ index e4ed2e991..9627a9be0 100644 private long k; private boolean l = true; private boolean m = true; -@@ -291,8 +291,11 @@ public class PlayerChunkMap { +@@ -265,8 +265,11 @@ public class PlayerChunkMap { // CraftBukkit start - Load nearby chunks first List chunkList = new LinkedList(); @@ -51,7 +51,7 @@ index e4ed2e991..9627a9be0 100644 chunkList.add(new ChunkCoordIntPair(k, l)); } } -@@ -311,8 +314,11 @@ public class PlayerChunkMap { +@@ -285,8 +288,11 @@ public class PlayerChunkMap { int i = (int) entityplayer.d >> 4; int j = (int) entityplayer.e >> 4; @@ -65,7 +65,7 @@ index e4ed2e991..9627a9be0 100644 PlayerChunk playerchunk = this.getChunk(k, l); if (playerchunk != null) { -@@ -342,7 +348,9 @@ public class PlayerChunkMap { +@@ -316,7 +322,9 @@ public class PlayerChunkMap { if (d2 >= 64.0D) { int k = (int) entityplayer.d >> 4; int l = (int) entityplayer.e >> 4; @@ -76,7 +76,7 @@ index e4ed2e991..9627a9be0 100644 int j1 = i - k; int k1 = j - l; -@@ -351,7 +359,7 @@ public class PlayerChunkMap { +@@ -325,7 +333,7 @@ public class PlayerChunkMap { if (j1 != 0 || k1 != 0) { for (int l1 = i - i1; l1 <= i + i1; ++l1) { for (int i2 = j - i1; i2 <= j + i1; ++i2) { @@ -85,7 +85,7 @@ index e4ed2e991..9627a9be0 100644 // this.c(l1, i2).a(entityplayer); chunksToLoad.add(new ChunkCoordIntPair(l1, i2)); // CraftBukkit } -@@ -386,6 +394,8 @@ public class PlayerChunkMap { +@@ -360,6 +368,8 @@ public class PlayerChunkMap { return playerchunk != null && playerchunk.d(entityplayer) && playerchunk.e(); } @@ -94,7 +94,7 @@ index e4ed2e991..9627a9be0 100644 public void a(int i) { i = MathHelper.clamp(i, 3, 32); if (i != this.j) { -@@ -395,36 +405,55 @@ public class PlayerChunkMap { +@@ -369,36 +379,55 @@ public class PlayerChunkMap { while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer) iterator.next(); @@ -172,7 +172,7 @@ index e4ed2e991..9627a9be0 100644 private void e() { this.l = true; -@@ -503,4 +532,29 @@ public class PlayerChunkMap { +@@ -477,4 +506,29 @@ public class PlayerChunkMap { } } // CraftBukkit end @@ -203,12 +203,12 @@ index e4ed2e991..9627a9be0 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 e3ad45aa8..e6ff3fc97 100644 +index 79223dfa6..bb3a48e57 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1553,6 +1553,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - return this.getHandle().affectsSpawning; +@@ -1600,6 +1600,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } + // Paper end + @Override + public int getViewDistance() { diff --git a/Spigot-Server-Patches/0039-Disable-explosion-knockback.patch b/Spigot-Server-Patches/0034-Disable-explosion-knockback.patch similarity index 76% rename from Spigot-Server-Patches/0039-Disable-explosion-knockback.patch rename to Spigot-Server-Patches/0034-Disable-explosion-knockback.patch index b14cae1341..e50d24f287 100644 --- a/Spigot-Server-Patches/0039-Disable-explosion-knockback.patch +++ b/Spigot-Server-Patches/0034-Disable-explosion-knockback.patch @@ -1,16 +1,16 @@ -From 8c80dd00564a7e849b0e698664bc59afc86be7f9 Mon Sep 17 00:00:00 2001 +From 708fa230efe63dcc4d1ab4f42f956002e27443c6 Mon Sep 17 00:00:00 2001 From: Sudzzy Date: Wed, 2 Mar 2016 14:48:03 -0600 Subject: [PATCH] Disable explosion knockback diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b0b3033e7..afc13e851 100644 +index 3626aa717..be92c1af6 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -197,4 +197,9 @@ public class PaperWorldConfig { - lavaFlowSpeedNormal = getInt("lava-flow-speed.normal", 30); - lavaFlowSpeedNether = getInt("lava-flow-speed.nether", 10); +@@ -147,4 +147,9 @@ public class PaperWorldConfig { + optimizeExplosions = getBoolean("optimize-explosions", false); + log("Optimize explosions: " + optimizeExplosions); } + + public boolean disableExplosionKnockback; @@ -19,10 +19,10 @@ index b0b3033e7..afc13e851 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index d15cfdd76..2aaeac324 100644 +index 1ee54fa45..43715902e 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -906,6 +906,7 @@ public abstract class EntityLiving extends Entity { +@@ -927,6 +927,7 @@ public abstract class EntityLiving extends Entity { } } @@ -30,7 +30,7 @@ index d15cfdd76..2aaeac324 100644 if (flag1) { if (flag) { this.world.broadcastEntityEffect(this, (byte) 29); -@@ -922,6 +923,7 @@ public abstract class EntityLiving extends Entity { +@@ -943,6 +944,7 @@ public abstract class EntityLiving extends Entity { b0 = 2; } @@ -38,7 +38,7 @@ index d15cfdd76..2aaeac324 100644 this.world.broadcastEntityEffect(this, b0); } -@@ -945,6 +947,8 @@ public abstract class EntityLiving extends Entity { +@@ -966,6 +968,8 @@ public abstract class EntityLiving extends Entity { } } @@ -46,12 +46,12 @@ index d15cfdd76..2aaeac324 100644 + if (this.getHealth() <= 0.0F) { if (!this.e(damagesource)) { - SoundEffect soundeffect = this.cf(); + SoundEffect soundeffect = this.cr(); diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index e7f0e84d4..e148901e5 100644 +index ddbf667c4..2652b1575 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -146,7 +146,7 @@ public class Explosion { +@@ -152,7 +152,7 @@ public class Explosion { double d14 = d13; if (entity instanceof EntityLiving) { @@ -60,13 +60,13 @@ index e7f0e84d4..e148901e5 100644 } entity.motX += d8 * d14; -@@ -155,7 +155,7 @@ public class Explosion { +@@ -161,7 +161,7 @@ public class Explosion { if (entity instanceof EntityHuman) { EntityHuman entityhuman = (EntityHuman) entity; -- if (!entityhuman.isSpectator() && (!entityhuman.z() || !entityhuman.abilities.isFlying)) { -+ if (!entityhuman.isSpectator() && (!entityhuman.z() && !world.paperConfig.disableExplosionKnockback || !entityhuman.abilities.isFlying)) { // Paper - Disable explosion knockback - this.k.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13)); +- if (!entityhuman.isSpectator() && (!entityhuman.u() || !entityhuman.abilities.isFlying)) { ++ if (!entityhuman.isSpectator() && (!entityhuman.u() && !world.paperConfig.disableExplosionKnockback || !entityhuman.abilities.isFlying)) { // Paper - Disable explosion knockback + this.l.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13)); } } -- diff --git a/Spigot-Server-Patches/0040-Disable-thunder.patch b/Spigot-Server-Patches/0035-Disable-thunder.patch similarity index 74% rename from Spigot-Server-Patches/0040-Disable-thunder.patch rename to Spigot-Server-Patches/0035-Disable-thunder.patch index 51a514758c..747ad2beca 100644 --- a/Spigot-Server-Patches/0040-Disable-thunder.patch +++ b/Spigot-Server-Patches/0035-Disable-thunder.patch @@ -1,14 +1,14 @@ -From d2fc9addb5a311bf9f318eadbec8856814f9f2e3 Mon Sep 17 00:00:00 2001 +From fa2fd885d88a3298213da1a7fb2e5375ac473f7b Mon Sep 17 00:00:00 2001 From: Sudzzy Date: Wed, 2 Mar 2016 14:52:43 -0600 Subject: [PATCH] Disable thunder diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index afc13e851..4ae2f9af1 100644 +index be92c1af6..efacd5ea0 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -202,4 +202,9 @@ public class PaperWorldConfig { +@@ -152,4 +152,9 @@ public class PaperWorldConfig { private void disableExplosionKnockback(){ disableExplosionKnockback = getBoolean("disable-explosion-knockback", false); } @@ -19,18 +19,17 @@ index afc13e851..4ae2f9af1 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 95964c550..b12c58732 100644 +index 420cbee6a..7a9cd1398 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -488,7 +488,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -491,7 +491,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { int l; BlockPosition blockposition; - if (flag && flag1 && this.random.nextInt(100000) == 0) { -+ // Paper - Disable thunder -+ if (!this.paperConfig.disableThunder && flag && flag1 && this.random.nextInt(100000) == 0) { - this.l = this.l * 3 + 1013904223; - l = this.l >> 2; ++ if (!this.paperConfig.disableThunder && flag && flag1 && this.random.nextInt(100000) == 0) { // Paper - Disable thunder + this.m = this.m * 3 + 1013904223; + l = this.m >> 2; blockposition = this.a(new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15))); -- 2.18.0 diff --git a/Spigot-Server-Patches/0041-Disable-ice-and-snow.patch b/Spigot-Server-Patches/0036-Disable-ice-and-snow.patch similarity index 70% rename from Spigot-Server-Patches/0041-Disable-ice-and-snow.patch rename to Spigot-Server-Patches/0036-Disable-ice-and-snow.patch index 92c0735caa..269b8917e1 100644 --- a/Spigot-Server-Patches/0041-Disable-ice-and-snow.patch +++ b/Spigot-Server-Patches/0036-Disable-ice-and-snow.patch @@ -1,14 +1,14 @@ -From f87ff63cc88a82e74518b65870af236bbfbec5bb Mon Sep 17 00:00:00 2001 +From e10462c97a334a255b9f38c8d95997a700004b05 Mon Sep 17 00:00:00 2001 From: Sudzzy Date: Wed, 2 Mar 2016 14:57:24 -0600 Subject: [PATCH] Disable ice and snow diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 4ae2f9af1..70b02f020 100644 +index efacd5ea0..0130e5860 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -207,4 +207,9 @@ public class PaperWorldConfig { +@@ -157,4 +157,9 @@ public class PaperWorldConfig { private void disableThunder() { disableThunder = getBoolean("disable-thunder", false); } @@ -19,18 +19,18 @@ index 4ae2f9af1..70b02f020 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b12c58732..d0ff0adf5 100644 +index 7a9cd1398..21b8a1dd9 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -511,7 +511,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -513,7 +513,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } this.methodProfiler.c("iceandsnow"); - if (this.random.nextInt(16) == 0) { + if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow - this.l = this.l * 3 + 1013904223; - l = this.l >> 2; - blockposition = this.p(new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15))); + this.m = this.m * 3 + 1013904223; + l = this.m >> 2; + blockposition = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15))); -- 2.18.0 diff --git a/Spigot-Server-Patches/0042-Configurable-mob-spawner-tick-rate.patch b/Spigot-Server-Patches/0037-Configurable-mob-spawner-tick-rate.patch similarity index 67% rename from Spigot-Server-Patches/0042-Configurable-mob-spawner-tick-rate.patch rename to Spigot-Server-Patches/0037-Configurable-mob-spawner-tick-rate.patch index 34b1c6ac17..d8d276be71 100644 --- a/Spigot-Server-Patches/0042-Configurable-mob-spawner-tick-rate.patch +++ b/Spigot-Server-Patches/0037-Configurable-mob-spawner-tick-rate.patch @@ -1,14 +1,14 @@ -From 7687ee0d8185f0476427df0ce90d6a1f347bd385 Mon Sep 17 00:00:00 2001 +From a44894177052ab64b102687ed47812440f2289b7 Mon Sep 17 00:00:00 2001 From: Sudzzy Date: Wed, 2 Mar 2016 15:03:53 -0600 Subject: [PATCH] Configurable mob spawner tick rate diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 70b02f020..f431000d1 100644 +index 0130e5860..47f391243 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 { +@@ -162,4 +162,9 @@ public class PaperWorldConfig { private void disableIceAndSnow(){ disableIceAndSnow = getBoolean("disable-ice-and-snow", false); } @@ -19,18 +19,18 @@ index 70b02f020..f431000d1 100644 + } } diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 0149726ea..a5261d70b 100644 +index e9650d962..61472a0eb 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -19,6 +19,7 @@ public abstract class MobSpawnerAbstract { - public int maxNearbyEntities = 6; // CraftBukkit private -> public - public int requiredPlayerRange = 16; // CraftBukkit private -> public - public int spawnRange = 4; // CraftBukkit private -> public +@@ -22,6 +22,7 @@ public abstract class MobSpawnerAbstract { + public int maxNearbyEntities = 6; + public int requiredPlayerRange = 16; + public int spawnRange = 4; + private int tickDelay = 0; // Paper public MobSpawnerAbstract() {} -@@ -44,6 +45,10 @@ public abstract class MobSpawnerAbstract { +@@ -51,6 +52,10 @@ public abstract class MobSpawnerAbstract { } public void c() { @@ -39,18 +39,18 @@ index 0149726ea..a5261d70b 100644 + tickDelay = this.a().paperConfig.mobSpawnerTickRate; + // Paper end if (!this.h()) { - this.e = this.d; + this.f = this.e; } else { -@@ -57,18 +62,18 @@ public abstract class MobSpawnerAbstract { - this.a().addParticle(EnumParticle.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); - this.a().addParticle(EnumParticle.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); +@@ -64,18 +69,18 @@ public abstract class MobSpawnerAbstract { + this.a().addParticle(Particles.M, d0, d1, d2, 0.0D, 0.0D, 0.0D); + this.a().addParticle(Particles.y, d0, d1, d2, 0.0D, 0.0D, 0.0D); if (this.spawnDelay > 0) { - --this.spawnDelay; + this.spawnDelay -= tickDelay; // Paper } - this.e = this.d; - this.d = (this.d + (double) (1000.0F / ((float) this.spawnDelay + 200.0F))) % 360.0D; + this.f = this.e; + this.e = (this.e + (double) (1000.0F / ((float) this.spawnDelay + 200.0F))) % 360.0D; } else { - if (this.spawnDelay == -1) { + if (this.spawnDelay < -tickDelay) { // Paper diff --git a/Spigot-Server-Patches/0043-Send-absolute-position-the-first-time-an-entity-is-s.patch b/Spigot-Server-Patches/0038-Send-absolute-position-the-first-time-an-entity-is-s.patch similarity index 97% rename from Spigot-Server-Patches/0043-Send-absolute-position-the-first-time-an-entity-is-s.patch rename to Spigot-Server-Patches/0038-Send-absolute-position-the-first-time-an-entity-is-s.patch index 43bb77bcf0..b54460f1b8 100644 --- a/Spigot-Server-Patches/0043-Send-absolute-position-the-first-time-an-entity-is-s.patch +++ b/Spigot-Server-Patches/0038-Send-absolute-position-the-first-time-an-entity-is-s.patch @@ -1,11 +1,11 @@ -From dd5f739fe833b8a215e3f8822c57eecfd89cd661 Mon Sep 17 00:00:00 2001 +From 6fd7638017aa2ac3c12fd9499df14b0f3cd6b9cf Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Wed, 2 Mar 2016 23:13:07 -0600 Subject: [PATCH] Send absolute position the first time an entity is seen diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index d864c7745..4c6eb6ed1 100644 +index 0410f9cf3..6ae576a2e 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -41,7 +41,12 @@ public class EntityTrackerEntry { diff --git a/Spigot-Server-Patches/0044-Add-BeaconEffectEvent.patch b/Spigot-Server-Patches/0039-Add-BeaconEffectEvent.patch similarity index 85% rename from Spigot-Server-Patches/0044-Add-BeaconEffectEvent.patch rename to Spigot-Server-Patches/0039-Add-BeaconEffectEvent.patch index 163092974d..f3c490d614 100644 --- a/Spigot-Server-Patches/0044-Add-BeaconEffectEvent.patch +++ b/Spigot-Server-Patches/0039-Add-BeaconEffectEvent.patch @@ -1,29 +1,27 @@ -From e77bc538984bbbf0e7f687632a51243419f2e808 Mon Sep 17 00:00:00 2001 +From 39777e20f300912b4d94472e7b627c0c33bca485 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 2 Mar 2016 23:30:53 -0600 Subject: [PATCH] Add BeaconEffectEvent diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java -index b84a2ce55..a57b17171 100644 +index c0db08f61..32b53bcae 100644 --- a/src/main/java/net/minecraft/server/TileEntityBeacon.java +++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java -@@ -16,6 +16,14 @@ import org.bukkit.entity.HumanEntity; +@@ -16,6 +16,12 @@ import org.bukkit.entity.HumanEntity; import org.bukkit.potion.PotionEffect; // CraftBukkit end +// Paper start +import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.entity.Player; -+import org.bukkit.potion.PotionData; -+import org.bukkit.potion.PotionEffect; +import com.destroystokyo.paper.event.block.BeaconEffectEvent; +// Paper end + - public class TileEntityBeacon extends TileEntityContainer implements ITickable, IWorldInventory { + public class TileEntityBeacon extends TileEntityContainer implements IWorldInventory, ITickable { public static final MobEffectList[][] a = new MobEffectList[][] { { MobEffects.FASTER_MOVEMENT, MobEffects.FASTER_DIG}, { MobEffects.RESISTANCE, MobEffects.JUMP}, { MobEffects.INCREASE_DAMAGE}, { MobEffects.REGENERATION}}; -@@ -116,14 +124,30 @@ public class TileEntityBeacon extends TileEntityContainer implements ITickable, +@@ -130,14 +136,30 @@ public class TileEntityBeacon extends TileEntityContainer implements IWorldInven } private void applyEffect(List list, MobEffectList effects, int i, int b0) { @@ -55,7 +53,7 @@ index b84a2ce55..a57b17171 100644 } } } -@@ -145,10 +169,10 @@ public class TileEntityBeacon extends TileEntityContainer implements ITickable, +@@ -159,10 +181,10 @@ public class TileEntityBeacon extends TileEntityContainer implements IWorldInven int i = getLevel(); List list = getHumansInRange(); diff --git a/Spigot-Server-Patches/0045-Configurable-container-update-tick-rate.patch b/Spigot-Server-Patches/0040-Configurable-container-update-tick-rate.patch similarity index 84% rename from Spigot-Server-Patches/0045-Configurable-container-update-tick-rate.patch rename to Spigot-Server-Patches/0040-Configurable-container-update-tick-rate.patch index a28ba14bbd..b0266f8654 100644 --- a/Spigot-Server-Patches/0045-Configurable-container-update-tick-rate.patch +++ b/Spigot-Server-Patches/0040-Configurable-container-update-tick-rate.patch @@ -1,14 +1,14 @@ -From de658229f19d33a91965d3552a3d3e2df61fdef6 Mon Sep 17 00:00:00 2001 +From b0906baff3e381342e84d50728bbeebb32c4bf30 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 diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index f431000d1..abcfb9216 100644 +index 47f391243..26d8dbb60 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 { +@@ -167,4 +167,9 @@ public class PaperWorldConfig { private void mobSpawnerTickRate() { mobSpawnerTickRate = getInt("mob-spawner-tick-rate", 1); } @@ -19,10 +19,10 @@ index f431000d1..abcfb9216 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3058dfef0..ed3546ccc 100644 +index 0531812fb..5ca0dec1f 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -75,6 +75,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -81,6 +81,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.viewDistance = viewDistance; } // Paper end @@ -30,7 +30,7 @@ index 3058dfef0..ed3546ccc 100644 // CraftBukkit start public String displayName; -@@ -275,7 +276,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -331,7 +332,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { --this.noDamageTicks; } diff --git a/Spigot-Server-Patches/0046-Use-UserCache-for-player-heads.patch b/Spigot-Server-Patches/0041-Use-UserCache-for-player-heads.patch similarity index 89% rename from Spigot-Server-Patches/0046-Use-UserCache-for-player-heads.patch rename to Spigot-Server-Patches/0041-Use-UserCache-for-player-heads.patch index b3cc29e17f..5e50bac730 100644 --- a/Spigot-Server-Patches/0046-Use-UserCache-for-player-heads.patch +++ b/Spigot-Server-Patches/0041-Use-UserCache-for-player-heads.patch @@ -1,11 +1,11 @@ -From 42a3ad24ded6b1cb5d7be1be315fe6cf89f7c0e1 Mon Sep 17 00:00:00 2001 +From ba521991598460ec18a75a28a25efc76404927af Mon Sep 17 00:00:00 2001 From: Techcable Date: Wed, 2 Mar 2016 23:42:37 -0600 Subject: [PATCH] Use UserCache for player heads diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index b6b34627a..862b30286 100644 +index 4cfc70aa7..52de1439e 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -6,6 +6,7 @@ import net.minecraft.server.GameProfileSerializer; @@ -16,7 +16,7 @@ index b6b34627a..862b30286 100644 import org.bukkit.Bukkit; import org.bukkit.Material; -@@ -141,7 +142,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { +@@ -153,7 +154,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { if (name == null) { profile = null; } else { diff --git a/Spigot-Server-Patches/0047-Disable-spigot-tick-limiters.patch b/Spigot-Server-Patches/0042-Disable-spigot-tick-limiters.patch similarity index 86% rename from Spigot-Server-Patches/0047-Disable-spigot-tick-limiters.patch rename to Spigot-Server-Patches/0042-Disable-spigot-tick-limiters.patch index 232834b852..33efdd1869 100644 --- a/Spigot-Server-Patches/0047-Disable-spigot-tick-limiters.patch +++ b/Spigot-Server-Patches/0042-Disable-spigot-tick-limiters.patch @@ -1,14 +1,14 @@ -From a38a03bec72f44ef894d94609741021909ce1d11 Mon Sep 17 00:00:00 2001 +From bae9f32e5b3c4025e471f44ffb7a431ea750826d 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 fc7315f7d..e85ed2e33 100644 +index 04493a1f9..d988fd007 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1426,10 +1426,10 @@ public abstract class World implements IBlockAccess { +@@ -1143,10 +1143,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose // CraftBukkit start - Use field for loop variable co.aikar.timings.TimingHistory.entityTicks += this.entityList.size(); // Paper int entitiesThisCycle = 0; @@ -23,7 +23,7 @@ index fc7315f7d..e85ed2e33 100644 tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0; entity = (Entity) this.entityList.get(this.tickPosition); // CraftBukkit end -@@ -1493,9 +1493,7 @@ public abstract class World implements IBlockAccess { +@@ -1210,9 +1210,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose // Spigot start // Iterator iterator = this.tileEntityListTick.iterator(); int tilesThisCycle = 0; diff --git a/Spigot-Server-Patches/0048-Configurable-Chunk-IO-Thread-Base-Count.patch b/Spigot-Server-Patches/0043-Configurable-Chunk-IO-Thread-Base-Count.patch similarity index 96% rename from Spigot-Server-Patches/0048-Configurable-Chunk-IO-Thread-Base-Count.patch rename to Spigot-Server-Patches/0043-Configurable-Chunk-IO-Thread-Base-Count.patch index 7a2f1d96ed..9c7b5a436d 100644 --- a/Spigot-Server-Patches/0048-Configurable-Chunk-IO-Thread-Base-Count.patch +++ b/Spigot-Server-Patches/0043-Configurable-Chunk-IO-Thread-Base-Count.patch @@ -1,4 +1,4 @@ -From 128af90387c06be0da343f45b342a235228b37ea Mon Sep 17 00:00:00 2001 +From 8902eebead1a655e38adf0a099873f77f4d76374 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 2 Mar 2016 23:46:57 -0600 Subject: [PATCH] Configurable Chunk IO Thread Base Count diff --git a/Spigot-Server-Patches/0049-Add-PlayerInitialSpawnEvent.patch b/Spigot-Server-Patches/0044-Add-PlayerInitialSpawnEvent.patch similarity index 94% rename from Spigot-Server-Patches/0049-Add-PlayerInitialSpawnEvent.patch rename to Spigot-Server-Patches/0044-Add-PlayerInitialSpawnEvent.patch index c992024641..0f8adfee53 100644 --- a/Spigot-Server-Patches/0049-Add-PlayerInitialSpawnEvent.patch +++ b/Spigot-Server-Patches/0044-Add-PlayerInitialSpawnEvent.patch @@ -1,4 +1,4 @@ -From a696a1afb907dcc000b57e966c3ab11c5aa53138 Mon Sep 17 00:00:00 2001 +From 53913c2c055fcc06fd10b3a19756ba50b7db68f9 Mon Sep 17 00:00:00 2001 From: Steve Anton Date: Thu, 3 Mar 2016 00:09:38 -0600 Subject: [PATCH] Add PlayerInitialSpawnEvent @@ -6,7 +6,7 @@ Subject: [PATCH] Add PlayerInitialSpawnEvent For modifying a player's initial spawn location as they join the server diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 1d9f3e3dd..536534d2e 100644 +index 1e3dd22e5..23562388a 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -110,6 +110,21 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0050-Disable-chest-cat-detection.patch b/Spigot-Server-Patches/0045-Disable-chest-cat-detection.patch similarity index 60% rename from Spigot-Server-Patches/0050-Disable-chest-cat-detection.patch rename to Spigot-Server-Patches/0045-Disable-chest-cat-detection.patch index 513aa782ad..9e8c51bd4f 100644 --- a/Spigot-Server-Patches/0050-Disable-chest-cat-detection.patch +++ b/Spigot-Server-Patches/0045-Disable-chest-cat-detection.patch @@ -1,14 +1,14 @@ -From e86c5102d5b832a152202db0b357323fc3755fce Mon Sep 17 00:00:00 2001 +From e5ba54d156defe2e5ef5376a394ed5901136db0e Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Mar 2016 01:13:45 -0600 Subject: [PATCH] Disable chest cat detection diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index abcfb9216..4c57b9cbf 100644 +index 26d8dbb60..43aa73e1d 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 { +@@ -172,4 +172,9 @@ public class PaperWorldConfig { private void containerUpdateTickRate() { containerUpdateTickRate = getInt("container-update-tick-rate", 1); } @@ -19,21 +19,21 @@ index abcfb9216..4c57b9cbf 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index da2cfe206..bc398ec52 100644 +index d55122c66..f8be07258 100644 --- a/src/main/java/net/minecraft/server/BlockChest.java +++ b/src/main/java/net/minecraft/server/BlockChest.java -@@ -399,6 +399,11 @@ public class BlockChest extends BlockTileEntity { +@@ -235,6 +235,11 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC } - private boolean j(World world, BlockPosition blockposition) { -+ // Paper start - Option ti dsiable chest cat detection + private boolean b(World world, BlockPosition blockposition) { ++ // Paper start - Option to disable chest cat detection + if (world.paperConfig.disableChestCatDetection) { + return false; + } + // Paper end - Iterator iterator = world.a(EntityOcelot.class, new AxisAlignedBB((double) blockposition.getX(), (double) (blockposition.getY() + 1), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 2), (double) (blockposition.getZ() + 1))).iterator(); + List list = world.a(EntityOcelot.class, new AxisAlignedBB((double) blockposition.getX(), (double) (blockposition.getY() + 1), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 2), (double) (blockposition.getZ() + 1))); - EntityOcelot entityocelot; + if (!list.isEmpty()) { -- 2.18.0 diff --git a/Spigot-Server-Patches/0051-Ensure-commands-are-not-ran-async.patch b/Spigot-Server-Patches/0046-Ensure-commands-are-not-ran-async.patch similarity index 95% rename from Spigot-Server-Patches/0051-Ensure-commands-are-not-ran-async.patch rename to Spigot-Server-Patches/0046-Ensure-commands-are-not-ran-async.patch index 5fcda5b7a7..eddd74a39f 100644 --- a/Spigot-Server-Patches/0051-Ensure-commands-are-not-ran-async.patch +++ b/Spigot-Server-Patches/0046-Ensure-commands-are-not-ran-async.patch @@ -1,4 +1,4 @@ -From c7b0d45e95bb420f3051f4bde3d28fc8d584a03a Mon Sep 17 00:00:00 2001 +From 76230fe4dce6a66d080d18d066a83fffd1291354 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 da25a8bea..48379f414 100644 +index 2adb21e55..27c255c8d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1311,6 +1311,29 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1542,6 +1542,29 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } if (!async && s.startsWith("/")) { @@ -48,10 +48,10 @@ index da25a8bea..48379f414 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 bfddd1685..462ad1024 100644 +index 2055bf7de..29344593a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -645,6 +645,29 @@ public final class CraftServer implements Server { +@@ -688,6 +688,29 @@ public final class CraftServer implements Server { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(commandLine, "CommandLine cannot be null"); diff --git a/Spigot-Server-Patches/0052-All-chunks-are-slime-spawn-chunks-toggle.patch b/Spigot-Server-Patches/0047-All-chunks-are-slime-spawn-chunks-toggle.patch similarity index 50% rename from Spigot-Server-Patches/0052-All-chunks-are-slime-spawn-chunks-toggle.patch rename to Spigot-Server-Patches/0047-All-chunks-are-slime-spawn-chunks-toggle.patch index 4aa44b9e50..634769d6c9 100644 --- a/Spigot-Server-Patches/0052-All-chunks-are-slime-spawn-chunks-toggle.patch +++ b/Spigot-Server-Patches/0047-All-chunks-are-slime-spawn-chunks-toggle.patch @@ -1,14 +1,14 @@ -From 0b776c2a991e7b2afc49d7dd72d8d44a55574465 Mon Sep 17 00:00:00 2001 +From 130efdb434d880b1a4bdcb43579e72273f59c5ef 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 4c57b9cbf..a289ba019 100644 +index 43aa73e1d..0743db5ac 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -227,4 +227,9 @@ public class PaperWorldConfig { +@@ -177,4 +177,9 @@ public class PaperWorldConfig { private void disableChestCatDetection() { disableChestCatDetection = getBoolean("game-mechanics.disable-chest-cat-detection", false); } @@ -19,20 +19,18 @@ index 4c57b9cbf..a289ba019 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index 272b22652..3d3a9ca04 100644 +index 3167c3f5f..3b13b697a 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java -@@ -251,8 +251,8 @@ public class EntitySlime extends EntityInsentient implements IMonster { - if (biomebase == Biomes.h && this.locY > 50.0D && this.locY < 70.0D && this.random.nextFloat() < 0.5F && this.random.nextFloat() < this.world.G() && this.world.getLightLevel(new BlockPosition(this)) <= this.random.nextInt(8)) { - return super.P(); +@@ -252,7 +252,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { } -- -- if (this.random.nextInt(10) == 0 && chunk.a(world.spigotConfig.slimeSeed).nextInt(10) == 0 && this.locY < 40.0D) { // Spigot -+ boolean isSlimeChunk = world.paperConfig.allChunksAreSlimeChunks || chunk.a(world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper -+ if (this.random.nextInt(10) == 0 && isSlimeChunk && this.locY < 40.0D) { // Paper - return super.P(); - } - } + + 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 + + if (this.random.nextInt(10) == 0 && flag && this.locY < 40.0D) { + return super.a(generatoraccess); -- 2.18.0 diff --git a/Spigot-Server-Patches/0053-Optimize-Pathfinding.patch b/Spigot-Server-Patches/0048-Optimize-Pathfinding.patch similarity index 85% rename from Spigot-Server-Patches/0053-Optimize-Pathfinding.patch rename to Spigot-Server-Patches/0048-Optimize-Pathfinding.patch index 9795a605af..c9496b2a78 100644 --- a/Spigot-Server-Patches/0053-Optimize-Pathfinding.patch +++ b/Spigot-Server-Patches/0048-Optimize-Pathfinding.patch @@ -1,4 +1,4 @@ -From a1991aa9db5af320aa989bf9cfc44ddda11f8001 Mon Sep 17 00:00:00 2001 +From add330cbad4d620b15e610e7df6f692ce69560df Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Mar 2016 02:02:07 -0600 Subject: [PATCH] Optimize Pathfinding @@ -7,10 +7,10 @@ Prevents pathfinding from spamming failures for things such as arrow attacks. diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index bfc5769f7..cc44d30b5 100644 +index 9337b9397..1964684ac 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -118,10 +118,26 @@ public abstract class NavigationAbstract { +@@ -122,10 +122,26 @@ public abstract class NavigationAbstract { } public boolean a(Entity entity, double d0) { @@ -38,10 +38,10 @@ index bfc5769f7..cc44d30b5 100644 public boolean a(@Nullable PathEntity pathentity, double d0) { if (pathentity == null) { -@@ -256,6 +272,7 @@ public abstract class NavigationAbstract { +@@ -258,6 +274,7 @@ public abstract class NavigationAbstract { } - public void p() { + public void r() { + this.pathfindFailures = 0; this.lastFailure = 0; // Paper - Pathfinding optimizations this.c = null; } diff --git a/Spigot-Server-Patches/0054-Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/0049-Avoid-hopper-searches-if-there-are-no-items.patch similarity index 71% rename from Spigot-Server-Patches/0054-Avoid-hopper-searches-if-there-are-no-items.patch rename to Spigot-Server-Patches/0049-Avoid-hopper-searches-if-there-are-no-items.patch index 4e79988fa1..b872e9be42 100644 --- a/Spigot-Server-Patches/0054-Avoid-hopper-searches-if-there-are-no-items.patch +++ b/Spigot-Server-Patches/0049-Avoid-hopper-searches-if-there-are-no-items.patch @@ -1,4 +1,4 @@ -From 04eb0a217ec431985499b59ceb505a2047a3173c Mon Sep 17 00:00:00 2001 +From 0316b4817e772abdbef722b4a3f85619fa16cbdc 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,52 +14,45 @@ 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 aaf253c89..a5db14343 100644 +index e5567701e..32f467b37 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -76,6 +76,13 @@ public class Chunk { - public boolean d; - protected gnu.trove.map.hash.TObjectIntHashMap entityCount = new gnu.trove.map.hash.TObjectIntHashMap(); // Spigot - -+ // Paper start +@@ -92,6 +92,10 @@ public class Chunk implements IChunkAccess { + } + } + final PaperLightingQueue.LightingQueue lightingQueue = new PaperLightingQueue.LightingQueue(this); + // Track the number of minecarts and items + // Keep this synced with entitySlices.add() and entitySlices.remove() + private final int[] itemCounts = new int[16]; + private final int[] inventoryEntityCounts = new int[16]; -+ // Paper end -+ - // CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking - private int neighbors = 0x1 << 12; - public long chunkKey; -@@ -648,6 +655,13 @@ public class Chunk { - entity.ac = k; - entity.ad = this.locZ; + // Paper end + public boolean areNeighborsLoaded(final int radius) { + switch (radius) { +@@ -685,6 +689,11 @@ public class Chunk implements IChunkAccess { + entity.ag = this.locZ; this.entitySlices[k].add(entity); -+ // Paper start - update count + // Paper start + if (entity instanceof EntityItem) { + itemCounts[k]++; + } else if (entity instanceof IInventory) { + inventoryEntityCounts[k]++; + } -+ // Paper end - // Spigot start - increment creature type count - // Keep this synced up with World.a(Class) - if (entity instanceof EntityInsentient) { -@@ -684,6 +698,13 @@ public class Chunk { + entity.setCurrentChunk(this); + entityCounts.increment(entity.entityKeyString); + // Paper end +@@ -710,6 +719,11 @@ public class Chunk implements IChunkAccess { + if (!this.entitySlices[i].remove(entity)) { + return; } - - this.entitySlices[i].remove(entity); -+ // Paper start - update counts + if (entity instanceof EntityItem) { + itemCounts[i]--; + } else if (entity instanceof IInventory) { + inventoryEntityCounts[i]--; + } -+ // Paper end - // Spigot start - decrement creature type count - // Keep this synced up with World.a(Class) - if (entity instanceof EntityInsentient) { -@@ -879,6 +900,15 @@ public class Chunk { + entity.setCurrentChunk(null); + entityCounts.decrement(entity.entityKeyString); + // Paper end +@@ -901,6 +915,15 @@ public class Chunk implements IChunkAccess { if (!this.entitySlices[k].isEmpty()) { Iterator iterator = this.entitySlices[k].iterator(); @@ -75,7 +68,7 @@ index aaf253c89..a5db14343 100644 while (iterator.hasNext()) { Entity entity1 = (Entity) iterator.next(); -@@ -915,7 +945,18 @@ public class Chunk { +@@ -937,7 +960,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/0055-Expose-server-CommandMap.patch b/Spigot-Server-Patches/0050-Expose-server-CommandMap.patch similarity index 76% rename from Spigot-Server-Patches/0055-Expose-server-CommandMap.patch rename to Spigot-Server-Patches/0050-Expose-server-CommandMap.patch index 714416a72b..712f1c3de0 100644 --- a/Spigot-Server-Patches/0055-Expose-server-CommandMap.patch +++ b/Spigot-Server-Patches/0050-Expose-server-CommandMap.patch @@ -1,14 +1,14 @@ -From 185ae1f1fd5dda3d640dc46dd02cda578dac0f10 Mon Sep 17 00:00:00 2001 +From 96c952ead9d29b9e4ce25edabbb6dbd967ffcf07 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 462ad1024..1386bed52 100644 +index 29344593a..32a05ca18 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1564,6 +1564,7 @@ public final class CraftServer implements Server { +@@ -1603,6 +1603,7 @@ public final class CraftServer implements Server { return helpMap; } diff --git a/Spigot-Server-Patches/0056-Be-a-bit-more-informative-in-maxHealth-exception.patch b/Spigot-Server-Patches/0051-Be-a-bit-more-informative-in-maxHealth-exception.patch similarity index 87% rename from Spigot-Server-Patches/0056-Be-a-bit-more-informative-in-maxHealth-exception.patch rename to Spigot-Server-Patches/0051-Be-a-bit-more-informative-in-maxHealth-exception.patch index 57fd0ce95a..f0064f13aa 100644 --- a/Spigot-Server-Patches/0056-Be-a-bit-more-informative-in-maxHealth-exception.patch +++ b/Spigot-Server-Patches/0051-Be-a-bit-more-informative-in-maxHealth-exception.patch @@ -1,14 +1,14 @@ -From 5a0ca0019bba86347b69d398a66bf641dfcda650 Mon Sep 17 00:00:00 2001 +From 6cff21d27c465708ea0e5689d00205a776f3b73a Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 3 Mar 2016 02:18:39 -0600 Subject: [PATCH] Be a bit more informative in maxHealth exception diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index bf4428e1c..34f1ef176 100644 +index 0b12ed819..83e6276b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -94,7 +94,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -96,7 +96,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void setHealth(double health) { health = (float) health; if ((health < 0) || (health > getMaxHealth())) { diff --git a/Spigot-Server-Patches/0057-Player-Tab-List-and-Title-APIs.patch b/Spigot-Server-Patches/0052-Player-Tab-List-and-Title-APIs.patch similarity index 95% rename from Spigot-Server-Patches/0057-Player-Tab-List-and-Title-APIs.patch rename to Spigot-Server-Patches/0052-Player-Tab-List-and-Title-APIs.patch index 2112620fe3..c41927f1de 100644 --- a/Spigot-Server-Patches/0057-Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-Server-Patches/0052-Player-Tab-List-and-Title-APIs.patch @@ -1,4 +1,4 @@ -From abeaa2a2bfcde56cb470cdbcc36d5eaac6e02320 Mon Sep 17 00:00:00 2001 +From 64863607d2317dded8dcdd1cc126638b42564c53 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 @@ -40,10 +40,10 @@ index 0663b07ca..f5ef1ba31 100644 public void a(PacketListenerPlayOut packetlistenerplayout) { diff --git a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java -index 7bcafa8bb..4f6c1c2e7 100644 +index 7b18c1640..900bd8357 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java -@@ -12,6 +12,18 @@ public class PacketPlayOutTitle implements Packet { +@@ -11,6 +11,18 @@ public class PacketPlayOutTitle implements Packet { private int d; private int e; @@ -62,7 +62,7 @@ index 7bcafa8bb..4f6c1c2e7 100644 public PacketPlayOutTitle() {} public PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction packetplayouttitle_enumtitleaction, IChatBaseComponent ichatbasecomponent) { -@@ -47,7 +59,13 @@ public class PacketPlayOutTitle implements Packet { +@@ -46,7 +58,13 @@ public class PacketPlayOutTitle implements Packet { public void b(PacketDataSerializer packetdataserializer) throws IOException { packetdataserializer.a((Enum) this.a); if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE || this.a == PacketPlayOutTitle.EnumTitleAction.ACTIONBAR) { @@ -78,7 +78,7 @@ index 7bcafa8bb..4f6c1c2e7 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 b2b707305..c14100ac6 100644 +index bb3a48e57..18f68b925 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 @@ @@ -88,7 +88,7 @@ index b2b707305..c14100ac6 100644 import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.io.BaseEncoding; -@@ -163,6 +164,85 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -201,6 +202,85 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } diff --git a/Spigot-Server-Patches/0058-Ensure-inv-drag-is-in-bounds.patch b/Spigot-Server-Patches/0053-Ensure-inv-drag-is-in-bounds.patch similarity index 87% rename from Spigot-Server-Patches/0058-Ensure-inv-drag-is-in-bounds.patch rename to Spigot-Server-Patches/0053-Ensure-inv-drag-is-in-bounds.patch index a98c520b7b..e1bf41c72a 100644 --- a/Spigot-Server-Patches/0058-Ensure-inv-drag-is-in-bounds.patch +++ b/Spigot-Server-Patches/0053-Ensure-inv-drag-is-in-bounds.patch @@ -1,15 +1,15 @@ -From c366a9167ac26fc0eb4230e64b012b3dfbbcc2de Mon Sep 17 00:00:00 2001 +From c3b31381ddd19fbbb3fa8e456c819c03e01ce91a Mon Sep 17 00:00:00 2001 From: Joseph Hirschfeld Date: Thu, 3 Mar 2016 02:33:53 -0600 Subject: [PATCH] Ensure inv drag is in bounds diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java -index 7d80b68b2..3a488ce20 100644 +index e86ffb4dc..0bf14b671 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -141,7 +141,7 @@ public abstract class Container { - this.d(); + this.c(); } } else if (this.g == 1) { - Slot slot = (Slot) this.slots.get(i); diff --git a/Spigot-Server-Patches/0054-Change-implementation-of-tile-entity-removal-list.patch b/Spigot-Server-Patches/0054-Change-implementation-of-tile-entity-removal-list.patch new file mode 100644 index 0000000000..bb3395d0ab --- /dev/null +++ b/Spigot-Server-Patches/0054-Change-implementation-of-tile-entity-removal-list.patch @@ -0,0 +1,69 @@ +From 6188ea1fe10d05fd67558cb270221a06e981b1f2 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 d988fd007..26b2a1fd4 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 + } + }; + // Spigot end +- protected final List g = Lists.newArrayList(); ++ protected final Set g = 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 + public final List players = Lists.newArrayList(); + public final List k = Lists.newArrayList(); + protected final IntHashMap entitiesById = new IntHashMap(); +@@ -1114,20 +1117,20 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + this.entityList.removeAll(this.g); + + int j; ++ // Paper start - Set based removal lists ++ for (Entity e : this.g) { ++ j = e.getChunkZ(); ++ int k = e.getChunkX(); + +- for (i = 0; i < this.g.size(); ++i) { +- entity = (Entity) this.g.get(i); +- int k = entity.ae; +- +- j = entity.ag; +- if (entity.inChunk && this.isChunkLoaded(k, j, true)) { +- this.getChunkAt(k, j).b(entity); ++ if (e.inChunk && this.isChunkLoaded(k, j, true)) { ++ this.getChunkAt(k, j).b(e); + } + } + +- for (i = 0; i < this.g.size(); ++i) { +- this.c((Entity) this.g.get(i)); ++ for (Entity e : this.g) { ++ this.c(e); + } ++ // Paper end + + this.g.clear(); + this.p_(); +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0060-Add-configurable-portal-search-radius.patch b/Spigot-Server-Patches/0055-Add-configurable-portal-search-radius.patch similarity index 81% rename from Spigot-Server-Patches/0060-Add-configurable-portal-search-radius.patch rename to Spigot-Server-Patches/0055-Add-configurable-portal-search-radius.patch index 724c835c8a..d09c864b8e 100644 --- a/Spigot-Server-Patches/0060-Add-configurable-portal-search-radius.patch +++ b/Spigot-Server-Patches/0055-Add-configurable-portal-search-radius.patch @@ -1,14 +1,14 @@ -From 0b318cc00f265124445ca5f9f0f833525e066ca9 Mon Sep 17 00:00:00 2001 +From c82e590f3e79ebef289b3af8bcfdd1fa6505c1a7 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 a289ba019..38ccabc0d 100644 +index 0743db5ac..1ba09df9c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -232,4 +232,9 @@ public class PaperWorldConfig { +@@ -182,4 +182,9 @@ public class PaperWorldConfig { private void allChunksAreSlimeChunks() { allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); } @@ -19,19 +19,19 @@ index a289ba019..38ccabc0d 100644 + } } diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index d1c67e396..f49729796 100644 +index 0cb1eeb68..402d8d7d6 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java -@@ -12,7 +12,7 @@ import org.bukkit.util.Vector; - +@@ -13,7 +13,7 @@ import org.bukkit.util.Vector; public class PortalTravelAgent { + private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL; - private final WorldServer world; -+ protected final WorldServer world; // Paper - private -> protected - private final Random b; - private final Long2ObjectMap c = new Long2ObjectOpenHashMap(4096); ++ public final WorldServer world; // Paper - private -> public + private final Random c; + private final Long2ObjectMap d = new Long2ObjectOpenHashMap(4096); -@@ -92,7 +92,7 @@ public class PortalTravelAgent { +@@ -93,7 +93,7 @@ public class PortalTravelAgent { public boolean b(Entity entity, float f) { // CraftBukkit start - Modularize portal search process and entity teleportation diff --git a/Spigot-Server-Patches/0061-Add-velocity-warnings.patch b/Spigot-Server-Patches/0056-Add-velocity-warnings.patch similarity index 93% rename from Spigot-Server-Patches/0061-Add-velocity-warnings.patch rename to Spigot-Server-Patches/0056-Add-velocity-warnings.patch index ad09668fbe..11298758f0 100644 --- a/Spigot-Server-Patches/0061-Add-velocity-warnings.patch +++ b/Spigot-Server-Patches/0056-Add-velocity-warnings.patch @@ -1,15 +1,15 @@ -From fb23b7590e446635c8435469d8a3f8aaa49234c0 Mon Sep 17 00:00:00 2001 +From 65aee21930eec551b399471716a9252863124d57 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 1386bed52..d56966109 100644 +index 32a05ca18..eaac1430e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -173,6 +173,7 @@ public final class CraftServer implements Server { - private boolean unrestrictedAdvancements; +@@ -189,6 +189,7 @@ public final class CraftServer implements Server { + public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; + public static Exception excessiveVelEx; // Paper - Velocity warnings @@ -17,10 +17,10 @@ index 1386bed52..d56966109 100644 private final class BooleanWrapper { private boolean value = true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 6c23e88a5..3b25b8b73 100644 +index 0daa15f1b..2b9c571ca 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -247,12 +247,44 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -262,12 +262,44 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public void setVelocity(Vector velocity) { Preconditions.checkArgument(velocity != null, "velocity"); velocity.checkFinite(); diff --git a/Spigot-Server-Patches/0062-Configurable-inter-world-teleportation-safety.patch b/Spigot-Server-Patches/0057-Configurable-inter-world-teleportation-safety.patch similarity index 90% rename from Spigot-Server-Patches/0062-Configurable-inter-world-teleportation-safety.patch rename to Spigot-Server-Patches/0057-Configurable-inter-world-teleportation-safety.patch index c43aa23555..c8b3e9eba2 100644 --- a/Spigot-Server-Patches/0062-Configurable-inter-world-teleportation-safety.patch +++ b/Spigot-Server-Patches/0057-Configurable-inter-world-teleportation-safety.patch @@ -1,4 +1,4 @@ -From 3b584419d099289f1f5092871bddccad0cfe8d36 Mon Sep 17 00:00:00 2001 +From a83d01f64fcfef076c79ea5da00a7663fd2b2c32 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,10 +16,10 @@ 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 38ccabc0d..b241c0380 100644 +index 1ba09df9c..6fc3b7621 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -237,4 +237,9 @@ public class PaperWorldConfig { +@@ -187,4 +187,9 @@ public class PaperWorldConfig { private void portalSearchRadius() { portalSearchRadius = getInt("portal-search-radius", 128); } @@ -30,10 +30,10 @@ index 38ccabc0d..b241c0380 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 536534d2e..bf7aaebd6 100644 +index 23562388a..23cab725d 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -799,7 +799,7 @@ public abstract class PlayerList { +@@ -798,7 +798,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 536534d2e..bf7aaebd6 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 9b9e02ae1..18a481f2f 100644 +index 18f68b925..aacf8ea7f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -618,7 +618,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -660,7 +660,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (fromWorld == toWorld) { entity.playerConnection.teleport(to); } else { diff --git a/Spigot-Server-Patches/0063-Add-exception-reporting-event.patch b/Spigot-Server-Patches/0058-Add-exception-reporting-event.patch similarity index 78% rename from Spigot-Server-Patches/0063-Add-exception-reporting-event.patch rename to Spigot-Server-Patches/0058-Add-exception-reporting-event.patch index d82dfd5392..26edf5de2a 100644 --- a/Spigot-Server-Patches/0063-Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/0058-Add-exception-reporting-event.patch @@ -1,4 +1,4 @@ -From fa5787eee0ee62491653acc9fd911e0e3f9134c0 Mon Sep 17 00:00:00 2001 +From 7ec9bf1e72944794b4ede33f140c763b46317740 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 @@ -50,30 +50,39 @@ 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 a5db14343..0788f7712 100644 +index 32f467b37..fa500e93f 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -1,5 +1,6 @@ package net.minecraft.server; +import com.destroystokyo.paper.exception.ServerInternalException; - import com.google.common.base.Predicate; import com.google.common.collect.Maps; import com.google.common.collect.Queues; -@@ -16,6 +17,7 @@ import org.apache.logging.log4j.Logger; + 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.Server; // CraftBukkit +import org.bukkit.craftbukkit.util.CraftMagicNumbers; // Paper - public class Chunk { + public class Chunk implements IChunkAccess { -@@ -795,10 +797,15 @@ public class Chunk { +@@ -427,6 +430,7 @@ 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) { + return this.getBlockData(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + } +@@ -806,10 +810,15 @@ public class Chunk implements IChunkAccess { this.tileEntities.remove(blockposition); // Paper end } else { - System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ() -- + " (" + org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(getBlockData(blockposition).getBlock()) + ") where there was no entity tile!"); +- + " (" + getType(blockposition) + ") where there was no entity tile!"); - System.out.println("Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); - new Exception().printStackTrace(); + // Paper start @@ -89,33 +98,20 @@ index a5db14343..0788f7712 100644 } } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 2b320cbd1..4e7e8e5fd 100644 +index 51bc23daf..bb96a7392 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -12,6 +12,7 @@ import java.util.Iterator; - import java.util.List; - import java.util.Set; +@@ -17,6 +17,7 @@ import java.util.concurrent.ExecutionException; + import java.util.function.Consumer; + import java.util.function.Function; import javax.annotation.Nullable; +import com.destroystokyo.paper.exception.ServerInternalException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -189,7 +190,11 @@ public class ChunkProviderServer implements IChunkProvider { - - return chunk; - } catch (Exception exception) { -- ChunkProviderServer.a.error("Couldn\'t load chunk", exception); -+ // Paper start -+ String msg = "Couldn\'t load chunk"; -+ ChunkProviderServer.a.error(msg, exception); -+ ServerInternalException.reportInternalException(exception); -+ // Paper end - return null; - } - } -@@ -198,7 +203,11 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -215,7 +216,11 @@ public class ChunkProviderServer implements IChunkProvider { try { - // this.chunkLoader.b(this.world, chunk); // Spigot + // this.chunkLoader.a(this.world, chunk); // Spigot } catch (Exception exception) { - ChunkProviderServer.a.error("Couldn\'t save entities", exception); + // Paper start @@ -126,9 +122,9 @@ index 2b320cbd1..4e7e8e5fd 100644 } } -@@ -208,9 +217,14 @@ public class ChunkProviderServer implements IChunkProvider { - chunk.setLastSaved(this.world.getTime()); - this.chunkLoader.saveChunk(this.world, chunk, unloaded); // Spigot +@@ -225,9 +230,14 @@ public class ChunkProviderServer implements IChunkProvider { + ichunkaccess.setLastSaved(this.world.getTime()); + this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot } catch (IOException ioexception) { - ChunkProviderServer.a.error("Couldn\'t save chunk", ioexception); + // Paper start @@ -144,18 +140,17 @@ index 2b320cbd1..4e7e8e5fd 100644 } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index 83322b85b..b943a9b20 100644 +index 33e5aaf2c..f13534917 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -@@ -1,5 +1,7 @@ +@@ -1,5 +1,6 @@ package net.minecraft.server; +import com.destroystokyo.paper.exception.ServerInternalException; -+import com.google.common.base.Charsets; - import com.google.common.base.Predicate; - import com.google.common.collect.Iterators; import com.google.common.collect.Lists; -@@ -361,6 +363,7 @@ public class NameReferencingFileConverter { + import com.google.common.collect.Maps; + import com.google.common.io.Files; +@@ -356,6 +357,7 @@ public class NameReferencingFileConverter { root = NBTCompressedStreamTools.a(new java.io.FileInputStream(file1)); } catch (Exception exception) { exception.printStackTrace(); @@ -163,7 +158,7 @@ index 83322b85b..b943a9b20 100644 } if (root != null) { -@@ -374,6 +377,7 @@ public class NameReferencingFileConverter { +@@ -369,6 +371,7 @@ public class NameReferencingFileConverter { NBTCompressedStreamTools.a(root, new java.io.FileOutputStream(file2)); } catch (Exception exception) { exception.printStackTrace(); @@ -172,7 +167,7 @@ index 83322b85b..b943a9b20 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java -index 936d6c640..50056f49a 100644 +index 0ffca4301..86d8fd0d9 100644 --- a/src/main/java/net/minecraft/server/PersistentCollection.java +++ b/src/main/java/net/minecraft/server/PersistentCollection.java @@ -1,5 +1,6 @@ @@ -181,16 +176,16 @@ index 936d6c640..50056f49a 100644 +import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.collect.Lists; import com.google.common.collect.Maps; - import java.io.DataInputStream; -@@ -53,6 +54,7 @@ public class PersistentCollection { - } - } catch (Exception exception1) { - exception1.printStackTrace(); -+ ServerInternalException.reportInternalException(exception1); // Paper - } - } - -@@ -102,6 +104,7 @@ public class PersistentCollection { + 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(); @@ -199,7 +194,7 @@ index 936d6c640..50056f49a 100644 } diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 1ba26de5c..6a92b5af8 100644 +index 94364baae..c80d724f0 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -1,5 +1,6 @@ @@ -218,7 +213,7 @@ index 1ba26de5c..6a92b5af8 100644 } @@ -209,6 +211,7 @@ public class RegionFile { - this.b(i, j, (int) (MinecraftServer.aw() / 1000L)); + this.b(i, j, (int) (SystemUtils.d() / 1000L)); } catch (IOException ioexception) { ioexception.printStackTrace(); + ServerInternalException.reportInternalException(ioexception); // Paper @@ -226,7 +221,7 @@ index 1ba26de5c..6a92b5af8 100644 } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index c15a0d1f8..5f9e9ddef 100644 +index d394645a5..384628ccc 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -1,5 +1,6 @@ @@ -236,7 +231,7 @@ index c15a0d1f8..5f9e9ddef 100644 import com.google.common.collect.Maps; import java.io.DataInputStream; import java.io.DataOutputStream; -@@ -68,6 +69,7 @@ public class RegionFileCache { +@@ -69,6 +70,7 @@ public class RegionFileCache { } } catch (IOException ioexception) { ioexception.printStackTrace(); @@ -245,35 +240,35 @@ index c15a0d1f8..5f9e9ddef 100644 } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 1c7c187c7..68a045323 100644 +index aec9cdae5..6d842df62 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -7,6 +7,7 @@ import java.util.Random; - import java.util.Set; +@@ -10,6 +10,7 @@ import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; // CraftBukkit start +import com.destroystokyo.paper.exception.ServerInternalException; import org.bukkit.craftbukkit.util.LongHash; import org.bukkit.craftbukkit.util.LongHashSet; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -@@ -177,6 +178,7 @@ public final class SpawnerCreature { - entityinsentient = (EntityInsentient) biomebase_biomemeta.b.getConstructor(new Class[] { World.class}).newInstance(new Object[] { worldserver}); - } catch (Exception exception) { - exception.printStackTrace(); -+ ServerInternalException.reportInternalException(exception); // Paper - return j1; - } +@@ -167,6 +168,7 @@ public final class SpawnerCreature { + entityinsentient = (EntityInsentient) biomebase_biomemeta.b.a((World) worldserver); + } catch (Exception exception) { + SpawnerCreature.a.warn("Failed to create mob", exception); ++ ServerInternalException.reportInternalException(exception); // Paper + return j1; + } -@@ -288,6 +290,7 @@ public final class SpawnerCreature { - entityinsentient = (EntityInsentient) biomebase_biomemeta.b.getConstructor(new Class[] { World.class}).newInstance(new Object[] { world}); +@@ -287,6 +289,7 @@ public final class SpawnerCreature { + entityinsentient = (EntityInsentient) biomebase_biomemeta.b.a(generatoraccess.getMinecraftWorld()); } catch (Exception exception) { - exception.printStackTrace(); + SpawnerCreature.a.warn("Failed to create mob", exception); + ServerInternalException.reportInternalException(exception); // Paper continue; } diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java -index 9ff4f23ab..6fce3015f 100644 +index 4ff243dab..67b2e41c7 100644 --- a/src/main/java/net/minecraft/server/VillageSiege.java +++ b/src/main/java/net/minecraft/server/VillageSiege.java @@ -1,5 +1,7 @@ @@ -285,7 +280,7 @@ index 9ff4f23ab..6fce3015f 100644 import java.util.List; import javax.annotation.Nullable; @@ -136,6 +138,7 @@ public class VillageSiege { - entityzombie.prepare(this.a.D(new BlockPosition(entityzombie)), (GroupDataEntity) null); + entityzombie.prepare(this.a.getDamageScaler(new BlockPosition(entityzombie)), (GroupDataEntity) null, (NBTTagCompound) null); } catch (Exception exception) { exception.printStackTrace(); + ServerInternalException.reportInternalException(exception); // Paper @@ -293,18 +288,19 @@ index 9ff4f23ab..6fce3015f 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 89197281e..6be9c1815 100644 +index 26b2a1fd4..d51ed0f80 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1,5 +1,7 @@ +@@ -1,6 +1,8 @@ package net.minecraft.server; + import co.aikar.timings.Timings; +import com.destroystokyo.paper.event.server.ServerExceptionEvent; +import com.destroystokyo.paper.exception.ServerInternalException; - import com.google.common.base.Function; import com.google.common.base.MoreObjects; - import com.google.common.base.Predicate; -@@ -1457,8 +1459,10 @@ public abstract class World implements IBlockAccess { + import com.google.common.collect.Lists; + import java.util.ArrayList; +@@ -1172,8 +1174,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } catch (Throwable throwable1) { entity.tickTimer.stopTiming(); // Paper start - Prevent tile entity and entity crashes @@ -316,8 +312,8 @@ index 89197281e..6be9c1815 100644 entity.dead = true; continue; // Paper end -@@ -1523,8 +1527,10 @@ public abstract class World implements IBlockAccess { - this.methodProfiler.b(); +@@ -1238,8 +1242,10 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + this.methodProfiler.e(); } catch (Throwable throwable2) { // Paper start - Prevent tile entity and entity crashes - System.err.println("TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()); diff --git a/Spigot-Server-Patches/0059-Change-implementation-of-tile-entity-removal-list.patch b/Spigot-Server-Patches/0059-Change-implementation-of-tile-entity-removal-list.patch deleted file mode 100644 index a6ecfb3a4c..0000000000 --- a/Spigot-Server-Patches/0059-Change-implementation-of-tile-entity-removal-list.patch +++ /dev/null @@ -1,82 +0,0 @@ -From bc94a21d1941e2d5d173d0be455acef7c1b02ce8 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/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index aadc426fd..584501787 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -122,7 +122,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper - private static final DataWatcherObject aC = DataWatcher.a(Entity.class, DataWatcherRegistry.h); - private static final DataWatcherObject aD = DataWatcher.a(Entity.class, DataWatcherRegistry.h); - private static final DataWatcherObject aE = DataWatcher.a(Entity.class, DataWatcherRegistry.h); -- public boolean aa; -+ public boolean aa; public boolean isAddedToChunk() { return aa; } // Paper - OBFHELPER - public int ab; public int getChunkX() { return ab; } // Paper - OBFHELPER - public int ac; public int getChunkY() { return ac; } // Paper - OBFHELPER - public int ad; public int getChunkZ() { return ad; } // Paper - OBFHELPER -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e85ed2e33..89197281e 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -31,6 +31,11 @@ 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 IBlockAccess { - - private int a = 63; -@@ -61,11 +66,11 @@ public abstract class World implements IBlockAccess { - } - }; - // Spigot end -- protected final List f = Lists.newArrayList(); -+ protected final Set f = Sets.newHashSet(); // Paper - public final List tileEntityList = Lists.newArrayList(); - public final List tileEntityListTick = Lists.newArrayList(); - private final List b = Lists.newArrayList(); -- private final List tileEntityListUnload = Lists.newArrayList(); -+ private final Set tileEntityListUnload = Sets.newHashSet(); // Paper - public final List players = Lists.newArrayList(); - public final List j = Lists.newArrayList(); - protected final IntHashMap entitiesById = new IntHashMap(); -@@ -1397,20 +1402,20 @@ public abstract class World implements IBlockAccess { - this.entityList.removeAll(this.f); - - int j; -+ // Paper start - Set based removal lists -+ for (Entity e : this.f) { -+ j = e.getChunkZ(); -+ int k = e.getChunkX(); - -- for (i = 0; i < this.f.size(); ++i) { -- entity = (Entity) this.f.get(i); -- int k = entity.ab; -- -- j = entity.ad; -- if (entity.aa && this.isChunkLoaded(k, j, true)) { -- this.getChunkAt(k, j).b(entity); -+ if (e.isAddedToChunk() && this.isChunkLoaded(k, j, true)) { -+ this.getChunkAt(k, j).b(e); - } - } - -- for (i = 0; i < this.f.size(); ++i) { -- this.c((Entity) this.f.get(i)); -+ for (Entity e : this.f) { -+ this.c(e); - } -+ // Paper end - - this.f.clear(); - this.l(); --- -2.18.0 - diff --git a/Spigot-Server-Patches/0064-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/Spigot-Server-Patches/0059-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch similarity index 93% rename from Spigot-Server-Patches/0064-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch rename to Spigot-Server-Patches/0059-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch index 738b588392..2db386c7ab 100644 --- a/Spigot-Server-Patches/0064-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch +++ b/Spigot-Server-Patches/0059-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch @@ -1,4 +1,4 @@ -From 19fe04ed766ce08de277106c28f66e864ac03f29 Mon Sep 17 00:00:00 2001 +From 480711c6cb6bc009d27b889b36c6f3cfd7567fe6 Mon Sep 17 00:00:00 2001 From: kashike Date: Tue, 8 Mar 2016 18:28:43 -0800 Subject: [PATCH] Don't nest if we don't need to when cerealising text @@ -6,7 +6,7 @@ Subject: [PATCH] Don't nest if we don't need to when cerealising text diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java -index 67666d35b..5d1a49623 100644 +index 28a262835..eba6aadad 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java @@ -27,7 +27,14 @@ public class PacketPlayOutChat implements Packet { diff --git a/Spigot-Server-Patches/0065-Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/0060-Disable-Scoreboards-for-non-players-by-default.patch similarity index 54% rename from Spigot-Server-Patches/0065-Disable-Scoreboards-for-non-players-by-default.patch rename to Spigot-Server-Patches/0060-Disable-Scoreboards-for-non-players-by-default.patch index 971480f81f..4405a74e7e 100644 --- a/Spigot-Server-Patches/0065-Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/0060-Disable-Scoreboards-for-non-players-by-default.patch @@ -1,4 +1,4 @@ -From eb01ced7635cb5ef37aef6669d54e7b4e6a4cf72 Mon Sep 17 00:00:00 2001 +From 404f2ace454d6e15c3b60664b9a2d62a96a73d7e Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 8 Mar 2016 23:25:45 -0500 Subject: [PATCH] Disable Scoreboards for non players by default @@ -11,10 +11,10 @@ So avoid looking up scoreboards and short circuit to the "not on a team" logic which is most likely to be true. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b241c0380..a4c94845b 100644 +index 6fc3b7621..93486b4b8 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -242,4 +242,9 @@ public class PaperWorldConfig { +@@ -192,4 +192,9 @@ public class PaperWorldConfig { private void disableTeleportationSuffocationCheck() { disableTeleportationSuffocationCheck = getBoolean("disable-teleportation-suffocation-check", false); } @@ -24,30 +24,30 @@ index b241c0380..a4c94845b 100644 + nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false); + } } -diff --git a/src/main/java/net/minecraft/server/CommandScoreboard.java b/src/main/java/net/minecraft/server/CommandScoreboard.java -index ec9a87239..b08274d93 100644 ---- a/src/main/java/net/minecraft/server/CommandScoreboard.java -+++ b/src/main/java/net/minecraft/server/CommandScoreboard.java -@@ -492,6 +492,7 @@ public class CommandScoreboard extends CommandAbstract { - - while (iterator.hasNext()) { - Entity entity = (Entity) iterator.next(); -+ if (!entity.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(entity instanceof EntityHuman)) { continue; } // Paper - String s2 = f(minecraftserver, icommandlistener, entity.bn()); - - if (scoreboard.addPlayerToTeam(s2, s)) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 804104818..f547dbfd0 100644 +index d378f1a9d..e16579116 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2123,6 +2123,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -2252,6 +2252,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @Nullable - public ScoreboardTeamBase aY() { + public ScoreboardTeamBase be() { + if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper - return this.world.getScoreboard().getPlayerTeam(this.bn()); + return this.world.getScoreboard().getPlayerTeam(this.getName()); } +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index 43715902e..f57e0136c 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -536,6 +536,7 @@ public abstract class EntityLiving extends Entity { + if (nbttagcompound.hasKeyOfType("Team", 8)) { + String s = nbttagcompound.getString("Team"); + ScoreboardTeam scoreboardteam = this.world.getScoreboard().getTeam(s); ++ if (!world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { scoreboardteam = null; } // Paper + boolean flag = scoreboardteam != null && this.world.getScoreboard().addPlayerToTeam(this.bu(), scoreboardteam); + + if (!flag) { -- 2.18.0 diff --git a/Spigot-Server-Patches/0066-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/Spigot-Server-Patches/0061-Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 83% rename from Spigot-Server-Patches/0066-Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to Spigot-Server-Patches/0061-Add-methods-for-working-with-arrows-stuck-in-living-.patch index c7ed817cd5..6e1513e91d 100644 --- a/Spigot-Server-Patches/0066-Add-methods-for-working-with-arrows-stuck-in-living-.patch +++ b/Spigot-Server-Patches/0061-Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -1,14 +1,14 @@ -From 076a022c505a512a8d517c8b7234686dccc4577b Mon Sep 17 00:00:00 2001 +From d622a5fb50a1cf10a6334eaae7e2036bbe929728 Mon Sep 17 00:00:00 2001 From: mrapple Date: Sun, 25 Nov 2012 13:43:39 -0600 Subject: [PATCH] Add methods for working with arrows stuck in living entities diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 34f1ef176..d4d51688c 100644 +index 2ef1433a7..7e3a9eeb2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -494,4 +494,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -508,4 +508,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public boolean isCollidable() { return getHandle().collides; } diff --git a/Spigot-Server-Patches/0067-Complete-resource-pack-API.patch b/Spigot-Server-Patches/0062-Complete-resource-pack-API.patch similarity index 68% rename from Spigot-Server-Patches/0067-Complete-resource-pack-API.patch rename to Spigot-Server-Patches/0062-Complete-resource-pack-API.patch index 18f34858e0..d60fc65924 100644 --- a/Spigot-Server-Patches/0067-Complete-resource-pack-API.patch +++ b/Spigot-Server-Patches/0062-Complete-resource-pack-API.patch @@ -1,32 +1,41 @@ -From 6d5516f22451507fd10a9d2c8d2717f9f6a560f0 Mon Sep 17 00:00:00 2001 +From e8d1d0159c1cba0d04340218e701786a9adf8d66 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/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 060301da6..d23fe82db 100644 +index 27c255c8d..2cc277e4f 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1067,7 +1067,12 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - // CraftBukkit start - public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) { - PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.x()); -- this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()])); -+ // Paper start -+ //this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()])); +@@ -1308,7 +1308,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + + } + +- public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {} ++ public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) { ++ // Paper start; + final PlayerResourcePackStatusEvent.Status status = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()]; + this.getPlayer().setResourcePackStatus(status); + this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), status)); + // Paper end - } - // CraftBukkit end ++ } + public void a(PacketPlayInBoatMove packetplayinboatmove) { + PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.getWorldServer()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 18a481f2f..ff4512060 100644 +index aacf8ea7f..f6a7f08f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -88,6 +88,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -54,6 +54,7 @@ import net.minecraft.server.PacketPlayOutCustomSoundEffect; + import net.minecraft.server.PacketPlayOutMap; + import net.minecraft.server.PacketPlayOutNamedSoundEffect; + import net.minecraft.server.PacketPlayOutPlayerInfo; ++import net.minecraft.server.PacketPlayOutPlayerListHeaderFooter; + import net.minecraft.server.PacketPlayOutSpawnPosition; + import net.minecraft.server.PacketPlayOutStopSound; + import net.minecraft.server.PacketPlayOutTitle; +@@ -126,6 +127,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private double health = 20; private boolean scaledHealth = false; private double healthScale = 20; @@ -37,7 +46,7 @@ index 18a481f2f..ff4512060 100644 public CraftPlayer(CraftServer server, EntityPlayer entity) { super(server, entity); -@@ -1644,6 +1648,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1691,6 +1696,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { ((WorldServer) getHandle().world).getPlayerChunkMap().updateViewDistance(getHandle(), viewDistance); } diff --git a/Spigot-Server-Patches/0068-Chunk-save-queue-improvements.patch b/Spigot-Server-Patches/0063-Chunk-save-queue-improvements.patch similarity index 58% rename from Spigot-Server-Patches/0068-Chunk-save-queue-improvements.patch rename to Spigot-Server-Patches/0063-Chunk-save-queue-improvements.patch index 8db9845612..9c820fab1a 100644 --- a/Spigot-Server-Patches/0068-Chunk-save-queue-improvements.patch +++ b/Spigot-Server-Patches/0063-Chunk-save-queue-improvements.patch @@ -1,4 +1,4 @@ -From c137628da7ca3cdca8ef577cdb3594bff5460657 Mon Sep 17 00:00:00 2001 +From dcb8cb2a5d04086bb7e7b7870c8db52fddecc418 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 4 Mar 2016 18:18:37 -0600 Subject: [PATCH] Chunk save queue improvements @@ -41,44 +41,85 @@ index 36689db74..3898ad8fa 100644 + } } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index a401dec60..4c3faa201 100644 +index e26860516..17996af9c 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -12,6 +12,7 @@ import java.util.List; - import java.util.Map; - import java.util.Set; +@@ -25,6 +25,7 @@ import java.util.function.Consumer; + import java.util.function.Function; + import java.util.function.Predicate; import javax.annotation.Nullable; +import java.util.concurrent.ConcurrentLinkedQueue; // Paper import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; // Spigot start -@@ -21,6 +22,8 @@ import org.spigotmc.SupplierUtils; +@@ -34,8 +35,21 @@ import org.spigotmc.SupplierUtils; public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { -+ private ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); // Paper - Chunk queue improvements -+ private final Object lock = new Object(); // Paper - Chunk queue improvements ++ // Paper start - Chunk queue improvements ++ private static class QueuedChunk { ++ public ChunkCoordIntPair coords; ++ public Supplier compoundSupplier; ++ ++ public QueuedChunk(ChunkCoordIntPair coords, Supplier compoundSupplier) { ++ this.coords = coords; ++ this.compoundSupplier = compoundSupplier; ++ } ++ } ++ private ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); ++ // Paper end ++ private static final Logger a = LogManager.getLogger(); - private final Map> b = Maps.newConcurrentMap(); // Spigot - // CraftBukkit -@@ -155,9 +158,10 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - protected void a(ChunkCoordIntPair chunkcoordintpair, Supplier nbttagcompound) { // Spigot - // CraftBukkit - // if (!this.c.contains(chunkcoordintpair)) -- { -+ synchronized (lock) { // Paper - Chunk queue improvements - this.b.put(chunkcoordintpair, nbttagcompound); - } -+ queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements +- private final Object2ObjectMap> b = Object2ObjectMaps.synchronize(new Object2ObjectLinkedOpenHashMap()); // Spigot ++ private final Object2ObjectMap> b = new Object2ObjectLinkedOpenHashMap(); // Spigot // Paper - remove synchronized + private final File c; + private final DataFixer d; + private PersistentStructureLegacy e; +@@ -247,7 +261,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } + }; + } else { +- if (this.b.containsKey(chunkcoordintpair) && this.a(this.b.get(chunkcoordintpair).get()) == ChunkStatus.Type.LEVELCHUNK || this.a(this.b(world, chunkcoordintpair.x, chunkcoordintpair.z)) == ChunkStatus.Type.LEVELCHUNK) { ++ // Paper start ++ Supplier existingSave; ++ synchronized (this) { ++ existingSave = this.b.get(chunkcoordintpair); ++ } ++ if (existingSave != null && this.a(existingSave.get()) == ChunkStatus.Type.LEVELCHUNK || this.a(this.b(world, chunkcoordintpair.x, chunkcoordintpair.z)) == ChunkStatus.Type.LEVELCHUNK) { // Paper - extract existingSave to synchronized lookup ++ // Paper end + return; + } +@@ -258,8 +278,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } + }; + } +- +- this.a(chunkcoordintpair, SupplierUtils.createUnivaluedSupplier(completion, unloaded && this.b.size() < SAVE_QUEUE_TARGET_SIZE)); ++ this.a(chunkcoordintpair, SupplierUtils.createUnivaluedSupplier(completion, unloaded)); // Paper - Remove save queue target size ++ // Paper end + // Spigot end + } catch (Exception exception) { + ChunkRegionLoader.a.error("Failed to save chunk", exception); +@@ -268,18 +288,22 @@ 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); FileIOThread.a().a(this); } -@@ -168,8 +172,11 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + +- public synchronized boolean a() { ++ public boolean a() { // Paper - remove synchronized + // CraftBukkit start + return this.processSaveQueueEntry(false); } - private synchronized boolean processSaveQueueEntry(boolean logCompletion) { +- 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 + // Paper start - Chunk queue improvements + QueuedChunk chunk = queue.poll(); @@ -86,8 +127,8 @@ index a401dec60..4c3faa201 100644 + // Paper - end if (logCompletion) { // CraftBukkit end - ChunkRegionLoader.a.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.d.getName()); -@@ -177,17 +184,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + ChunkRegionLoader.a.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.c.getName()); +@@ -287,17 +311,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { return false; } else { @@ -101,66 +142,47 @@ index a401dec60..4c3faa201 100644 boolean flag; try { - // this.c.add(chunkcoordintpair); + // NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.get(chunkcoordintpair); // CraftBukkit - NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(value); // Spigot + NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(chunk.compoundSupplier); // Spigot // Paper - // CraftBukkit if (nbttagcompound != null) { -@@ -197,10 +200,11 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - ChunkRegionLoader.a.error("Failed to save chunk", exception); - } - } -+ synchronized (lock) { if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { this.b.remove(chunkcoordintpair); } }// Paper - This will not equal if a newer version is still pending + try { +@@ -309,7 +329,14 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { flag = true; } finally { - this.b.remove(chunkcoordintpair, value); // CraftBukkit // Spigot -+ //this.b.remove(chunkcoordintpair, value); // CraftBukkit // Spigot // Paper ++ // 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 } return flag; -@@ -574,4 +578,16 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - return entity; - } - } -+ -+ // Paper start - Chunk queue improvements -+ private static class QueuedChunk { -+ public ChunkCoordIntPair coords; -+ public Supplier compoundSupplier; -+ -+ public QueuedChunk(ChunkCoordIntPair coords, Supplier compoundSupplier) { -+ this.coords = coords; -+ this.compoundSupplier = compoundSupplier; -+ } -+ } -+ // Paper end - } diff --git a/src/main/java/net/minecraft/server/FileIOThread.java b/src/main/java/net/minecraft/server/FileIOThread.java -index 1d6b1874c..9ee4115be 100644 +index 34312667a..549fab9a5 100644 --- a/src/main/java/net/minecraft/server/FileIOThread.java +++ b/src/main/java/net/minecraft/server/FileIOThread.java -@@ -39,11 +39,15 @@ public class FileIOThread implements Runnable { - ++this.d; +@@ -43,11 +43,12 @@ public class FileIOThread implements Runnable { + ++this.e; } -- try { -- Thread.sleep(this.e ? 0L : 10L); -- } catch (InterruptedException interruptedexception) { -- interruptedexception.printStackTrace(); -+ // Paper start - Add toggle -+ if (com.destroystokyo.paper.PaperConfig.enableFileIOThreadSleep) { -+ try { -+ Thread.sleep(this.e ? 0L : 2L); -+ } catch (InterruptedException interruptedexception) { -+ interruptedexception.printStackTrace(); -+ } - } -+ // Paper end ++ if (com.destroystokyo.paper.PaperConfig.enableFileIOThreadSleep) { // Paper + try { +- Thread.sleep(this.f ? 0L : 10L); ++ Thread.sleep(this.f ? 0L : 1L); // Paper + } catch (InterruptedException interruptedexception) { + interruptedexception.printStackTrace(); +- } ++ }} // Paper } - if (this.b.isEmpty()) { + if (this.c.isEmpty()) { -- 2.18.0 diff --git a/Spigot-Server-Patches/0069-Chunk-Save-Reattempt.patch b/Spigot-Server-Patches/0064-Chunk-Save-Reattempt.patch similarity index 80% rename from Spigot-Server-Patches/0069-Chunk-Save-Reattempt.patch rename to Spigot-Server-Patches/0064-Chunk-Save-Reattempt.patch index e024da8af3..d876b89fd7 100644 --- a/Spigot-Server-Patches/0069-Chunk-Save-Reattempt.patch +++ b/Spigot-Server-Patches/0064-Chunk-Save-Reattempt.patch @@ -1,4 +1,4 @@ -From bc3a702f71fbd98ac83d02992c8df88a9207e765 Mon Sep 17 00:00:00 2001 +From 5cdbcf814615e02e10b10126bcad50a7d29fa787 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 4 Mar 2013 23:46:10 -0500 Subject: [PATCH] Chunk Save Reattempt @@ -6,11 +6,11 @@ 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 4c3faa201..12bd558a7 100644 +index 17996af9c..faaa1b36b 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -194,11 +194,16 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - // CraftBukkit +@@ -320,11 +320,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 @@ -25,15 +25,15 @@ index 4c3faa201..12bd558a7 100644 + 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 } - synchronized (lock) { if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { this.b.remove(chunkcoordintpair); } }// Paper - This will not equal if a newer version is still pending + flag = true; diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 6a92b5af8..5bcbd718f 100644 +index c80d724f0..3f9aa5923 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -210,8 +210,7 @@ public class RegionFile { - this.b(i, j, (int) (MinecraftServer.aw() / 1000L)); + this.b(i, j, (int) (SystemUtils.d() / 1000L)); } catch (IOException ioexception) { - ioexception.printStackTrace(); - ServerInternalException.reportInternalException(ioexception); // Paper diff --git a/Spigot-Server-Patches/0070-Default-loading-permissions.yml-before-plugins.patch b/Spigot-Server-Patches/0065-Default-loading-permissions.yml-before-plugins.patch similarity index 91% rename from Spigot-Server-Patches/0070-Default-loading-permissions.yml-before-plugins.patch rename to Spigot-Server-Patches/0065-Default-loading-permissions.yml-before-plugins.patch index f78e17e835..fd44844540 100644 --- a/Spigot-Server-Patches/0070-Default-loading-permissions.yml-before-plugins.patch +++ b/Spigot-Server-Patches/0065-Default-loading-permissions.yml-before-plugins.patch @@ -1,4 +1,4 @@ -From 2003df4e8bd6827060840d6c24d45b9cca953384 Mon Sep 17 00:00:00 2001 +From 8dd09a05d4ebb0fa6a8ab1d267baf9f0a07ef836 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 3898ad8fa..2f6e169f5 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d56966109..d482589b3 100644 +index eaac1430e..6dae117ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -322,6 +322,7 @@ public final class CraftServer implements Server { +@@ -330,6 +330,7 @@ public final class CraftServer implements Server { if (type == PluginLoadOrder.STARTUP) { helpMap.clear(); helpMap.initializeGeneralTopics(); @@ -41,7 +41,7 @@ index d56966109..d482589b3 100644 } Plugin[] plugins = pluginManager.getPlugins(); -@@ -339,7 +340,7 @@ public final class CraftServer implements Server { +@@ -347,7 +348,7 @@ public final class CraftServer implements Server { setVanillaCommands(false); // Spigot end commandMap.registerServerAliases(); diff --git a/Spigot-Server-Patches/0071-Allow-Reloading-of-Custom-Permissions.patch b/Spigot-Server-Patches/0066-Allow-Reloading-of-Custom-Permissions.patch similarity index 87% rename from Spigot-Server-Patches/0071-Allow-Reloading-of-Custom-Permissions.patch rename to Spigot-Server-Patches/0066-Allow-Reloading-of-Custom-Permissions.patch index 760bdd39f6..307ecc0923 100644 --- a/Spigot-Server-Patches/0071-Allow-Reloading-of-Custom-Permissions.patch +++ b/Spigot-Server-Patches/0066-Allow-Reloading-of-Custom-Permissions.patch @@ -1,4 +1,4 @@ -From 80b97310030500c8eae0b1d7b8c4ba337b5fa17b Mon Sep 17 00:00:00 2001 +From 71f4d4247cb4ab0e25b12805cdcb6aa50a9c30a0 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 d482589b3..e53f8c58f 100644 +index 6dae117ac..5ffb335f5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1863,5 +1863,20 @@ public final class CraftServer implements Server { +@@ -1959,5 +1959,20 @@ public final class CraftServer implements Server { return false; } } diff --git a/Spigot-Server-Patches/0072-Remove-Metadata-on-reload.patch b/Spigot-Server-Patches/0067-Remove-Metadata-on-reload.patch similarity index 87% rename from Spigot-Server-Patches/0072-Remove-Metadata-on-reload.patch rename to Spigot-Server-Patches/0067-Remove-Metadata-on-reload.patch index 5cb0d34025..0d2c25ea6c 100644 --- a/Spigot-Server-Patches/0072-Remove-Metadata-on-reload.patch +++ b/Spigot-Server-Patches/0067-Remove-Metadata-on-reload.patch @@ -1,4 +1,4 @@ -From 3481b79ff64f24f29029cafe3367f2bcfee00e3c Mon Sep 17 00:00:00 2001 +From 9fdf883e7c73906f9c5219c1a45475e09fd738c6 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 e53f8c58f..d3e949707 100644 +index 5ffb335f5..f98f355dd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -743,8 +743,18 @@ public final class CraftServer implements Server { +@@ -786,8 +786,18 @@ public final class CraftServer implements Server { world.paperConfig.init(); // Paper } diff --git a/Spigot-Server-Patches/0073-Undead-horse-leashing.patch b/Spigot-Server-Patches/0068-Undead-horse-leashing.patch similarity index 83% rename from Spigot-Server-Patches/0073-Undead-horse-leashing.patch rename to Spigot-Server-Patches/0068-Undead-horse-leashing.patch index 337940ae05..7b39be99c5 100644 --- a/Spigot-Server-Patches/0073-Undead-horse-leashing.patch +++ b/Spigot-Server-Patches/0068-Undead-horse-leashing.patch @@ -1,4 +1,4 @@ -From fc16de493fda64fc50353d88616f97947e2f4053 Mon Sep 17 00:00:00 2001 +From 87c9b3d8b44cb3769bdff1d66b9990a164a3671d Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Mar 2016 14:19:19 -0400 Subject: [PATCH] Undead horse leashing @@ -6,10 +6,10 @@ Subject: [PATCH] Undead horse leashing default false to match vanilla, but option to allow undead horse types to be leashed. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a4c94845b..faacd86ba 100644 +index 93486b4b8..cd20572eb 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -247,4 +247,9 @@ public class PaperWorldConfig { +@@ -197,4 +197,9 @@ public class PaperWorldConfig { private void nonPlayerEntitiesOnScoreboards() { nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false); } @@ -20,10 +20,10 @@ index a4c94845b..faacd86ba 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -index 46d1ea217..dcc39236f 100644 +index fbf6aa40d..0fe269bc8 100644 --- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java +++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -@@ -115,7 +115,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven +@@ -113,7 +113,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven } public boolean a(EntityHuman entityhuman) { @@ -31,7 +31,7 @@ index 46d1ea217..dcc39236f 100644 + return world.paperConfig.allowLeashingUndeadHorse ? super.a(entityhuman) : super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD; // Paper } - protected void q(float f) { + protected void u(float f) { -- 2.18.0 diff --git a/Spigot-Server-Patches/0074-Fix-Furnace-cook-time-bug.patch b/Spigot-Server-Patches/0069-Fix-Furnace-cook-time-bug.patch similarity index 70% rename from Spigot-Server-Patches/0074-Fix-Furnace-cook-time-bug.patch rename to Spigot-Server-Patches/0069-Fix-Furnace-cook-time-bug.patch index 5283a07cab..7364f57652 100644 --- a/Spigot-Server-Patches/0074-Fix-Furnace-cook-time-bug.patch +++ b/Spigot-Server-Patches/0069-Fix-Furnace-cook-time-bug.patch @@ -1,4 +1,4 @@ -From cbd0700140ece892d3de977dc69b4b2e5c585291 Mon Sep 17 00:00:00 2001 +From 6c0ee073774c89e031563dcbb9bc01837b02aaef Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Mar 2016 14:24:53 -0400 Subject: [PATCH] Fix Furnace cook time bug @@ -9,17 +9,17 @@ cook in the expected amount of time as the cook time was not decremented correct This patch ensures that furnaces cook to the correct wall time expectation. diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index 886a73e93..7a1428105 100644 +index 8f9a59693..3a587a766 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java -@@ -165,7 +165,7 @@ public class TileEntityFurnace extends TileEntityContainer implements ITickable, - if (this.isBurning() && this.canBurn()) { +@@ -272,7 +272,7 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInve + if (this.isBurning() && this.canBurn(irecipe)) { this.cookTime += elapsedTicks; if (this.cookTime >= this.cookTimeTotal) { - this.cookTime = 0; + this.cookTime -= this.cookTimeTotal; // Paper - this.cookTimeTotal = this.a((ItemStack) this.items.get(0)); - this.burn(); + this.cookTimeTotal = this.s(); + this.burn(irecipe); flag1 = true; -- 2.18.0 diff --git a/Spigot-Server-Patches/0075-Handle-Item-Meta-Inconsistencies.patch b/Spigot-Server-Patches/0070-Handle-Item-Meta-Inconsistencies.patch similarity index 74% rename from Spigot-Server-Patches/0075-Handle-Item-Meta-Inconsistencies.patch rename to Spigot-Server-Patches/0070-Handle-Item-Meta-Inconsistencies.patch index 9586173a37..03729376a9 100644 --- a/Spigot-Server-Patches/0075-Handle-Item-Meta-Inconsistencies.patch +++ b/Spigot-Server-Patches/0070-Handle-Item-Meta-Inconsistencies.patch @@ -1,4 +1,4 @@ -From 841254f7471189b0be7020ad4f65eea1c697d2c1 Mon Sep 17 00:00:00 2001 +From 2f906444609e41acee8780cf662686805c586cd0 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,75 +18,67 @@ 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 82d72ea15..5047a57e9 100644 +index 7f249a975..70f2dcc9e 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -57,6 +57,22 @@ public final class ItemStack { +@@ -7,6 +7,8 @@ import com.mojang.brigadier.StringReader; + import com.mojang.brigadier.exceptions.CommandSyntaxException; + import java.text.DecimalFormat; + import java.text.DecimalFormatSymbols; ++import java.util.Collections; ++import java.util.Comparator; + import java.util.Locale; + import java.util.Objects; + import java.util.Random; +@@ -54,6 +56,22 @@ public final class ItemStack { + decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT)); + return decimalformat; } - - // CraftBukkit start + // Paper start -+ private static final java.util.Comparator enchantSorter = java.util.Comparator.comparingInt(o -> o.getShort("id")); ++ private static final java.util.Comparator enchantSorter = java.util.Comparator.comparing(o -> o.getString("id")); + private void processEnchantOrder(NBTTagCompound tag) { -+ if (tag == null || !tag.hasKeyOfType("ench", 9)) { ++ if (tag == null || !tag.hasKeyOfType("Enchantments", 9)) { + return; + } -+ NBTTagList list = tag.getList("ench", 10); ++ NBTTagList list = tag.getList("Enchantments", 10); + if (list.size() < 2) { + return; + } + try { -+ list.sort(enchantSorter); // Paper ++ //noinspection unchecked ++ list.sort((Comparator) enchantSorter); // Paper + } catch (Exception ignored) {} + } + // Paper end -+ - public ItemStack(Item item, int i, int j) { - this(item, i, j, true); - } -@@ -114,6 +130,7 @@ public final class ItemStack { + + public ItemStack(IMaterial imaterial) { + this(imaterial, 1); +@@ -90,6 +108,7 @@ public final class ItemStack { if (nbttagcompound.hasKeyOfType("tag", 10)) { // CraftBukkit start - make defensive copy as this data may be coming from the save thread this.tag = (NBTTagCompound) nbttagcompound.getCompound("tag").clone(); + processEnchantOrder(this.tag); // Paper - if (this.item != null) { - this.item.a(this.tag); - // CraftBukkit end -@@ -597,6 +614,7 @@ public final class ItemStack { + this.getItem().a(this.tag); + // CraftBukkit end + } +@@ -561,6 +580,7 @@ public final class ItemStack { // Paper end public void setTag(@Nullable NBTTagCompound nbttagcompound) { this.tag = nbttagcompound; + processEnchantOrder(this.tag); // Paper } - public String getName() { -@@ -670,6 +688,7 @@ public final class ItemStack { - nbttagcompound.setShort("id", (short) Enchantment.getId(enchantment)); + public IChatBaseComponent getName() { +@@ -637,6 +657,7 @@ public final class ItemStack { + nbttagcompound.setString("id", String.valueOf(Enchantment.enchantments.b(enchantment))); nbttagcompound.setShort("lvl", (short) ((byte) i)); - nbttaglist.add(nbttagcompound); + nbttaglist.add((NBTBase) nbttagcompound); + processEnchantOrder(nbttagcompound); // Paper } public boolean hasEnchantments() { -diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index ca9eb2f3b..576c3b714 100644 ---- a/src/main/java/net/minecraft/server/NBTTagList.java -+++ b/src/main/java/net/minecraft/server/NBTTagList.java -@@ -14,6 +14,12 @@ public class NBTTagList extends NBTBase { - - private static final Logger b = LogManager.getLogger(); - public List list = Lists.newArrayList(); // Paper -+ // Paper start -+ public void sort(java.util.Comparator comparator) { -+ //noinspection unchecked -+ java.util.Collections.sort(list, (java.util.Comparator) comparator); -+ } -+ // Paper end - private byte type = 0; - - public NBTTagList() {} diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index fb1dc542d..cdf16e15a 100644 +index 4c4f04557..cb3b952e2 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; @@ -97,7 +89,7 @@ index fb1dc542d..cdf16e15a 100644 import java.util.Map; import net.minecraft.server.EnchantmentManager; -@@ -183,28 +184,11 @@ public final class CraftItemStack extends ItemStack { +@@ -185,28 +186,11 @@ public final class CraftItemStack extends ItemStack { public void addUnsafeEnchantment(Enchantment ench, int level) { Validate.notNull(ench, "Cannot add null enchantment"); @@ -113,14 +105,14 @@ index fb1dc542d..cdf16e15a 100644 - - for (int i = 0; i < size; i++) { - NBTTagCompound tag = (NBTTagCompound) list.get(i); -- short id = tag.getShort(ENCHANTMENTS_ID.NBT); -- if (id == ench.getId()) { +- String id = tag.getString(ENCHANTMENTS_ID.NBT); +- if (id.equals(ench.getKey().toString())) { - tag.setShort(ENCHANTMENTS_LVL.NBT, (short) level); - return; - } - } - NBTTagCompound tag = new NBTTagCompound(); -- tag.setShort(ENCHANTMENTS_ID.NBT, (short) ench.getId()); +- tag.setString(ENCHANTMENTS_ID.NBT, ench.getKey().toString()); - tag.setShort(ENCHANTMENTS_LVL.NBT, (short) level); - list.add(tag); + // Paper start - Replace whole method @@ -131,7 +123,7 @@ index fb1dc542d..cdf16e15a 100644 } static boolean makeTag(net.minecraft.server.ItemStack item) { -@@ -221,66 +205,34 @@ public final class CraftItemStack extends ItemStack { +@@ -223,66 +207,35 @@ public final class CraftItemStack extends ItemStack { @Override public boolean containsEnchantment(Enchantment ench) { @@ -146,13 +138,13 @@ index fb1dc542d..cdf16e15a 100644 - return 0; - } - return EnchantmentManager.getEnchantmentLevel(CraftEnchantment.getRaw(ench), handle); -+ return hasItemMeta() ? getItemMeta().getEnchantLevel(ench) : 0; // Pape - replace entire method with meta ++ return hasItemMeta() ? getItemMeta().getEnchantLevel(ench) : 0; // Paper - replace entire method with meta } @Override public int removeEnchantment(Enchantment ench) { Validate.notNull(ench, "Cannot remove null enchantment"); -- + - NBTTagList list = getEnchantmentList(handle), listCopy; - if (list == null) { - return 0; @@ -163,8 +155,8 @@ index fb1dc542d..cdf16e15a 100644 - - for (int i = 0; i < size; i++) { - NBTTagCompound enchantment = (NBTTagCompound) list.get(i); -- int id = 0xffff & enchantment.getShort(ENCHANTMENTS_ID.NBT); -- if (id == ench.getId()) { +- String id = enchantment.getString(ENCHANTMENTS_ID.NBT); +- if (id.equals(ench.getKey().toString())) { - index = i; - level = 0xffff & enchantment.getShort(ENCHANTMENTS_LVL.NBT); - break; @@ -212,53 +204,42 @@ index fb1dc542d..cdf16e15a 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 c743ae066..0cdc8007a 100644 +index 3b73e52fa..e43a24989 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -6,13 +6,8 @@ import java.lang.annotation.RetentionPolicy; - import java.lang.annotation.Target; - import java.lang.reflect.Constructor; +@@ -8,12 +8,14 @@ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; --import java.util.ArrayList; --import java.util.Collection; --import java.util.HashMap; --import java.util.List; --import java.util.Map; --import java.util.NoSuchElementException; + import java.util.ArrayList; + import java.util.Collection; ++import java.util.Comparator; + import java.util.HashMap; + import java.util.List; + import java.util.Map; + import java.util.NoSuchElementException; + import net.minecraft.server.IChatBaseComponent; +import com.google.common.collect.ImmutableSortedMap; import net.minecraft.server.NBTBase; import net.minecraft.server.NBTTagCompound; import net.minecraft.server.NBTTagList; -@@ -38,10 +33,18 @@ import com.google.common.collect.Sets; - import java.io.ByteArrayInputStream; - import java.io.ByteArrayOutputStream; - import java.io.IOException; -+import java.util.ArrayList; - import java.util.Arrays; -+import java.util.Collection; -+import java.util.Comparator; +@@ -46,6 +48,7 @@ import java.util.Arrays; import java.util.EnumSet; -+import java.util.HashMap; import java.util.HashSet; -+import java.util.List; -+import java.util.Map; -+import java.util.NoSuchElementException; import java.util.Set; +import java.util.TreeMap; import java.util.logging.Level; import java.util.logging.Logger; import net.minecraft.server.NBTCompressedStreamTools; -@@ -226,7 +229,7 @@ class CraftMetaItem implements ItemMeta, Repairable { - private String displayName; - private String locName; +@@ -233,7 +236,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { + private IChatBaseComponent displayName; + private IChatBaseComponent locName; private List lore; - private Map enchantments; + private EnchantmentMap enchantments; // Paper private int repairCost; private int hideFlag; private boolean unbreakable; -@@ -234,7 +237,7 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -242,7 +245,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { private static final Set HANDLED_TAGS = Sets.newHashSet(); private NBTTagCompound internalTag; @@ -267,7 +248,7 @@ index c743ae066..0cdc8007a 100644 CraftMetaItem(CraftMetaItem meta) { if (meta == null) { -@@ -249,7 +252,7 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -257,7 +260,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { } if (meta.enchantments != null) { // Spigot @@ -276,7 +257,7 @@ index c743ae066..0cdc8007a 100644 } this.repairCost = meta.repairCost; -@@ -470,13 +473,13 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -482,13 +485,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { } } @@ -291,8 +272,8 @@ index c743ae066..0cdc8007a 100644 + EnchantmentMap enchantments = new EnchantmentMap(); // Paper for (int i = 0; i < ench.size(); i++) { - int id = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_ID.NBT); -@@ -546,13 +549,13 @@ class CraftMetaItem implements ItemMeta, Repairable { + String id = ((NBTTagCompound) ench.get(i)).getString(ENCHANTMENTS_ID.NBT); +@@ -563,13 +566,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { void deserializeInternal(NBTTagCompound tag) { } @@ -308,7 +289,7 @@ index c743ae066..0cdc8007a 100644 for (Map.Entry entry : ench.entrySet()) { // Doctor older enchants String enchantKey = entry.getKey().toString(); -@@ -703,13 +706,13 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -724,13 +727,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { } public Map getEnchants() { @@ -324,7 +305,7 @@ index c743ae066..0cdc8007a 100644 } if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) { -@@ -880,7 +883,7 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -918,7 +921,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { clone.lore = new ArrayList(this.lore); } if (this.enchantments != null) { @@ -333,7 +314,7 @@ index c743ae066..0cdc8007a 100644 } clone.hideFlag = this.hideFlag; clone.unbreakable = this.unbreakable; -@@ -1038,6 +1041,23 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -1087,6 +1090,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { } } @@ -345,7 +326,7 @@ index c743ae066..0cdc8007a 100644 + } + + private EnchantmentMap() { -+ super((o1, o2) -> ((Integer) o1.getId()).compareTo(o2.getId())); ++ super(Comparator.comparing(o -> o.getKey().toString())); + } + + public EnchantmentMap clone() { diff --git a/Spigot-Server-Patches/0076-Configurable-Non-Player-Arrow-Despawn-Rate.patch b/Spigot-Server-Patches/0071-Configurable-Non-Player-Arrow-Despawn-Rate.patch similarity index 64% rename from Spigot-Server-Patches/0076-Configurable-Non-Player-Arrow-Despawn-Rate.patch rename to Spigot-Server-Patches/0071-Configurable-Non-Player-Arrow-Despawn-Rate.patch index 12621c91d8..ba937169d7 100644 --- a/Spigot-Server-Patches/0076-Configurable-Non-Player-Arrow-Despawn-Rate.patch +++ b/Spigot-Server-Patches/0071-Configurable-Non-Player-Arrow-Despawn-Rate.patch @@ -1,4 +1,4 @@ -From 5086a12a999a530288262ae057cd49229bce127c Mon Sep 17 00:00:00 2001 +From 0aa551410860a14b627f6e8cba52b2b2c64f83f9 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 @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Non Player Arrow Despawn Rate Can set a much shorter despawn rate for arrows that players can not pick up. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index faacd86ba..f71580393 100644 +index cd20572eb..b9dc0be2c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -252,4 +252,13 @@ public class PaperWorldConfig { +@@ -202,4 +202,13 @@ public class PaperWorldConfig { private void allowLeashingUndeadHorse() { allowLeashingUndeadHorse = getBoolean("allow-leashing-undead-horse", false); } @@ -24,18 +24,18 @@ index faacd86ba..f71580393 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 584782adb..86836a5d0 100644 +index e16c8e8d9..75445b00d 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -157,7 +157,7 @@ public abstract class EntityArrow extends Entity implements IProjectile { - this.ay = 0; - } else { - ++this.ax; -- if (this.ax >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter -+ if (this.ax >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot - First int after shooter // Paper - this.die(); - } - } +@@ -258,7 +258,7 @@ public abstract class EntityArrow extends Entity implements IProjectile { + + protected void f() { + ++this.despawnCounter; +- if (this.despawnCounter >= world.spigotConfig.arrowDespawnRate) { // Spigot ++ if (this.despawnCounter >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot // Paper + this.die(); + } + -- 2.18.0 diff --git a/Spigot-Server-Patches/0072-Add-World-Util-Methods.patch b/Spigot-Server-Patches/0072-Add-World-Util-Methods.patch new file mode 100644 index 0000000000..05a0e79055 --- /dev/null +++ b/Spigot-Server-Patches/0072-Add-World-Util-Methods.patch @@ -0,0 +1,99 @@ +From 33b09d0b5df953307a34e27ebeeffe4953f37484 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Fri, 18 Mar 2016 20:16:03 -0400 +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 fa500e93f..f376b3a34 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 { + } + } + ++ public final int getLightSubtracted(BlockPosition blockposition, int i) { return this.a(blockposition, i); } // Paper - OBFHELPER + public int a(BlockPosition blockposition, int i) { + 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 d51ed0f80..1c939e523 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 + public final List k = Lists.newArrayList(); + protected final IntHashMap entitiesById = new IntHashMap(); + private final long G = 16777215L; +- private int H; ++ private int H; private int getSkylightSubtracted() { return this.H; } // 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 + return this.getType(blockposition).isAir(); + } + ++ // Paper start ++ public Chunk getChunkIfLoaded(BlockPosition blockposition) { ++ return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); ++ } ++ // test if meets light level, return faster ++ // logic copied from below ++ public boolean isLightLevel(BlockPosition blockposition, int level) { ++ if (isValidLocation(blockposition)) { ++ if (this.getType(blockposition).c(this, blockposition)) { ++ int sky = getSkylightSubtracted(); ++ if (this.getLightLevel(blockposition.up(), sky) >= level) { ++ return true; ++ } ++ if (this.getLightLevel(blockposition.east(), sky) >= level) { ++ return true; ++ } ++ if (this.getLightLevel(blockposition.west(), sky) >= level) { ++ return true; ++ } ++ if (this.getLightLevel(blockposition.south(), sky) >= level) { ++ return true; ++ } ++ if (this.getLightLevel(blockposition.north(), sky) >= level) { ++ return true; ++ } ++ return false; ++ } else { ++ if (blockposition.getY() >= 256) { ++ blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); ++ } ++ ++ Chunk chunk = this.getChunkAtWorldCoords(blockposition); ++ return chunk.getLightSubtracted(blockposition, this.getSkylightSubtracted()) >= level; ++ } ++ } else { ++ return true; ++ } ++ } ++ // reduces need to do isLoaded before getType ++ public IBlockData getTypeIfLoaded(BlockPosition blockposition) { ++ // CraftBukkit start - tree generation ++ if (captureTreeGeneration) { ++ for (CraftBlockState previous : capturedBlockStates) { ++ if (previous.getX() == blockposition.getX() && previous.getY() == blockposition.getY() && previous.getZ() == blockposition.getZ()) { ++ return previous.getHandle(); ++ } ++ } ++ } ++ // CraftBukkit end ++ Chunk chunk = this.getChunkIfLoaded(blockposition); ++ if (chunk != null) { ++ return isValidLocation(blockposition) ? chunk.getBlockData(blockposition) : Blocks.AIR.getBlockData(); ++ } ++ return null; ++ } ++ // Paper end ++ + public Chunk getChunkAtWorldCoords(BlockPosition blockposition) { + return this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4); + } +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0073-Optimized-Light-Level-Comparisons.patch b/Spigot-Server-Patches/0073-Optimized-Light-Level-Comparisons.patch new file mode 100644 index 0000000000..e4ed371af8 --- /dev/null +++ b/Spigot-Server-Patches/0073-Optimized-Light-Level-Comparisons.patch @@ -0,0 +1,90 @@ +From 8c2726ab77974922d93dfec069139e06d3b4853b Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Fri, 18 Mar 2016 21:22:56 -0400 +Subject: [PATCH] Optimized Light Level Comparisons + +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 e64b6dbda..8acfe9e66 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 + + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) { + super.a(iblockdata, world, blockposition, random); +- if (world.getLightLevel(blockposition.up(), 0) >= 9) { ++ if (world.isLightLevel(blockposition.up(), 9)) { // Paper + int i = this.j(iblockdata); + + if (i < this.d()) { +diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java +index 723e5c9b4..e24fb1736 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 + + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) { + super.a(iblockdata, world, blockposition, random); +- if (world.getLightLevel(blockposition.up()) >= 9 && random.nextInt(Math.max(2, (int) (((100.0F / world.spigotConfig.saplingModifier) * 7) + 0.5F))) == 0) { // Spigot ++ if (world.isLightLevel(blockposition.up(), 9) && random.nextInt(Math.max(2, (int) (((100.0F / world.spigotConfig.saplingModifier) * 7) + 0.5F))) == 0) { // Spigot // Paper + // CraftBukkit start + 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 3959e0700..c4aff522b 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 { + + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) { + super.a(iblockdata, world, blockposition, random); +- if (world.getLightLevel(blockposition.up(), 0) >= 9) { ++ if (world.isLightLevel(blockposition.up(), 9)) { // Paper + float f = BlockCrops.a((Block) this, (IBlockAccess) world, blockposition); + + 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 bef146aa9..9c387365b 100644 +--- a/src/main/java/net/minecraft/server/EntityMonster.java ++++ b/src/main/java/net/minecraft/server/EntityMonster.java +@@ -64,9 +64,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); +- +- return i <= this.random.nextInt(8); ++ // Paper start - optimized light check, returns faster ++ boolean passes; ++ if (this.world.X()) { ++ int orig = world.getSkylightSubtracted(); ++ world.setSkylightSubtracted(10); ++ passes = !this.world.isLightLevel(blockposition, this.random.nextInt(8)); ++ world.setSkylightSubtracted(orig); ++ } else { ++ passes = !this.world.isLightLevel(blockposition, this.random.nextInt(8)); ++ } ++ return passes; ++ // Paper end + } + } + +diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java +index 268e4d57b..24224efc6 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 { + 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())) { + this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0079-Pass-world-to-Village-creation.patch b/Spigot-Server-Patches/0074-Pass-world-to-Village-creation.patch similarity index 81% rename from Spigot-Server-Patches/0079-Pass-world-to-Village-creation.patch rename to Spigot-Server-Patches/0074-Pass-world-to-Village-creation.patch index d50015b9b8..bbadb93522 100644 --- a/Spigot-Server-Patches/0079-Pass-world-to-Village-creation.patch +++ b/Spigot-Server-Patches/0074-Pass-world-to-Village-creation.patch @@ -1,4 +1,4 @@ -From dd7c164ead24c4f2b19d7d110e07ab96c037e83d Mon Sep 17 00:00:00 2001 +From c83f024c86f2b96c27f4892fdab2cdafed02e9de 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,20 +6,20 @@ 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 a5b79ecad..01f7cee38 100644 +index c09326636..3219ccca4 100644 --- a/src/main/java/net/minecraft/server/PersistentVillage.java +++ b/src/main/java/net/minecraft/server/PersistentVillage.java -@@ -238,7 +238,7 @@ public class PersistentVillage extends PersistentBase { +@@ -234,7 +234,7 @@ public class PersistentVillage extends PersistentBase { for (int i = 0; i < nbttaglist.size(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.get(i); + NBTTagCompound nbttagcompound1 = nbttaglist.getCompound(i); - Village village = new Village(); + Village village = new Village(world); // Paper 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 fb52785b9..2eb33a986 100644 +index e742cbe12..dfcabb83a 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/0075-Custom-replacement-for-eaten-items.patch b/Spigot-Server-Patches/0075-Custom-replacement-for-eaten-items.patch new file mode 100644 index 0000000000..cc18538521 --- /dev/null +++ b/Spigot-Server-Patches/0075-Custom-replacement-for-eaten-items.patch @@ -0,0 +1,48 @@ +From da54731dadf31eda89e05a97c378e2ca37c217d5 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 f57e0136c..a0af21301 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -2484,12 +2484,13 @@ public abstract class EntityLiving extends Entity { + + protected void q() { + if (!this.activeItem.isEmpty() && this.isHandRaised()) { ++ PlayerItemConsumeEvent event = null; // Paper + this.b(this.activeItem, 16); + // CraftBukkit start - fire PlayerItemConsumeEvent + ItemStack itemstack; + if (this instanceof EntityPlayer) { + org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.activeItem); +- PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); ++ event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); // Paper + world.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { +@@ -2504,9 +2505,19 @@ public abstract class EntityLiving extends Entity { + itemstack = this.activeItem.a(this.world, this); + } + ++ // Paper start - save the default replacement item and change it if necessary ++ final ItemStack defaultReplacement = itemstack; ++ if (event != null && event.getReplacement() != null) { ++ itemstack = CraftItemStack.asNMSCopy(event.getReplacement()); ++ } ++ // Paper end + this.a(this.cT(), itemstack); + // CraftBukkit end + this.cZ(); ++ // Paper start - if the replacement is anything but the default, update the client inventory ++ if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) { ++ ((EntityPlayer) this).getBukkitEntity().updateInventory(); ++ } + } + + } +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0081-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/Spigot-Server-Patches/0076-handle-NaN-health-absorb-values-and-repair-bad-data.patch similarity index 84% rename from Spigot-Server-Patches/0081-handle-NaN-health-absorb-values-and-repair-bad-data.patch rename to Spigot-Server-Patches/0076-handle-NaN-health-absorb-values-and-repair-bad-data.patch index 2fc8e0a085..f6203af49e 100644 --- a/Spigot-Server-Patches/0081-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/Spigot-Server-Patches/0076-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -1,14 +1,14 @@ -From ef17ef72c8d9428c33f84c84fc3178dc9974f670 Mon Sep 17 00:00:00 2001 +From 5871d2878dd1896e28e792f64e8be8345b9aca4f 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 7e2cc66d7..a92b89d7c 100644 +index a0af21301..acf0e0281 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -488,7 +488,13 @@ public abstract class EntityLiving extends Entity { +@@ -497,7 +497,13 @@ public abstract class EntityLiving extends Entity { } public void a(NBTTagCompound nbttagcompound) { @@ -23,7 +23,7 @@ index 7e2cc66d7..a92b89d7c 100644 if (nbttagcompound.hasKeyOfType("Attributes", 9) && this.world != null && !this.world.isClientSide) { GenericAttributes.a(this.getAttributeMap(), nbttagcompound.getList("Attributes", 10)); } -@@ -791,6 +797,10 @@ public abstract class EntityLiving extends Entity { +@@ -813,6 +819,10 @@ public abstract class EntityLiving extends Entity { } public void setHealth(float f) { @@ -34,7 +34,7 @@ index 7e2cc66d7..a92b89d7c 100644 // CraftBukkit start - Handle scaled health if (this instanceof EntityPlayer) { org.bukkit.craftbukkit.entity.CraftPlayer player = ((EntityPlayer) this).getBukkitEntity(); -@@ -2265,7 +2275,7 @@ public abstract class EntityLiving extends Entity { +@@ -2349,7 +2359,7 @@ public abstract class EntityLiving extends Entity { } public void setAbsorptionHearts(float f) { @@ -44,10 +44,10 @@ index 7e2cc66d7..a92b89d7c 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ff4512060..e1d34d46d 100644 +index f6a7f08f9..e71fc971d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1464,6 +1464,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1510,6 +1510,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/Spigot-Server-Patches/0077-Add-World-Util-Methods.patch b/Spigot-Server-Patches/0077-Add-World-Util-Methods.patch deleted file mode 100644 index d56acb9ef8..0000000000 --- a/Spigot-Server-Patches/0077-Add-World-Util-Methods.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 9f9ec804809dd8bf00e6cbb2c633594403f24a29 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Fri, 18 Mar 2016 20:16:03 -0400 -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 0788f7712..57b23a018 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -610,6 +610,7 @@ public class Chunk { - - } - -+ public final int getLightSubtracted(BlockPosition blockposition, int i) { return this.a(blockposition, i); } // Paper - OBFHELPER - public int a(BlockPosition blockposition, int i) { - int j = blockposition.getX() & 15; - int k = blockposition.getY(); -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6be9c1815..b8ae41704 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -77,7 +77,7 @@ public abstract class World implements IBlockAccess { - public final List j = Lists.newArrayList(); - protected final IntHashMap entitiesById = new IntHashMap(); - private final long K = 16777215L; -- private int L; -+ private int L; private int getSkylightSubtracted() { return this.L; } // Paper - OBFHELPER - protected int l = (new Random()).nextInt(); - protected final int m = 1013904223; - protected float n; -@@ -156,6 +156,12 @@ public abstract class World implements IBlockAccess { - return (CraftServer) Bukkit.getServer(); - } - -+ // Paper start -+ public Chunk getChunkIfLoaded(BlockPosition blockposition) { -+ return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); -+ } -+ // Paper end -+ - public Chunk getChunkIfLoaded(int x, int z) { - return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(x, z); - } -@@ -686,10 +692,46 @@ public abstract class World implements IBlockAccess { - } - } - -+ // Paper start - test if meets light level, return faster -+ // logic copied from below -+ public boolean isLightLevel(BlockPosition blockposition, int level) { -+ if (isValidLocation(blockposition)) { -+ if (this.getType(blockposition).f()) { -+ if (this.c(blockposition.up(), false) >= level) { -+ return true; -+ } -+ if (this.c(blockposition.east(), false) >= level) { -+ return true; -+ } -+ if (this.c(blockposition.west(), false) >= level) { -+ return true; -+ } -+ if (this.c(blockposition.south(), false) >= level) { -+ return true; -+ } -+ if (this.c(blockposition.north(), false) >= level) { -+ return true; -+ } -+ return false; -+ } else { -+ if (blockposition.getY() >= 256) { -+ blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); -+ } -+ -+ Chunk chunk = this.getChunkAtWorldCoords(blockposition); -+ return chunk.getLightSubtracted(blockposition, this.getSkylightSubtracted()) >= level; -+ } -+ } else { -+ return true; -+ } -+ } -+ // Paper end -+ - public int getLightLevel(BlockPosition blockposition) { - return this.c(blockposition, true); - } - -+ public final int getLight(BlockPosition blockposition, boolean checkNeighbors) { return this.c(blockposition, checkNeighbors); } // Paper - OBFHELPER - public int c(BlockPosition blockposition, boolean flag) { - if (blockposition.getX() >= -30000000 && blockposition.getZ() >= -30000000 && blockposition.getX() < 30000000 && blockposition.getZ() < 30000000) { - if (flag && this.getType(blockposition).f()) { -@@ -805,6 +847,27 @@ public abstract class World implements IBlockAccess { - return this.worldProvider.o()[this.getLightLevel(blockposition)]; - } - -+ // Paper start - reduces need to do isLoaded before getType -+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) { -+ // CraftBukkit start - tree generation -+ if (captureTreeGeneration) { -+ Iterator it = capturedBlockStates.iterator(); -+ while (it.hasNext()) { -+ BlockState previous = it.next(); -+ if (previous.getX() == blockposition.getX() && previous.getY() == blockposition.getY() && previous.getZ() == blockposition.getZ()) { -+ return CraftMagicNumbers.getBlock(previous.getTypeId()).fromLegacyData(previous.getRawData()); -+ } -+ } -+ } -+ // CraftBukkit end -+ Chunk chunk = this.getChunkIfLoaded(blockposition); -+ if (chunk != null) { -+ return this.isValidLocation(blockposition) ? chunk.getBlockData(blockposition) : Blocks.AIR.getBlockData(); -+ } -+ return null; -+ } -+ // Paper end -+ - public IBlockData getType(BlockPosition blockposition) { - // CraftBukkit start - tree generation - if (captureTreeGeneration) { --- -2.18.0 - diff --git a/Spigot-Server-Patches/0082-Catch-Async-PlayerChunkMap-operations.patch b/Spigot-Server-Patches/0077-Catch-Async-PlayerChunkMap-operations.patch similarity index 84% rename from Spigot-Server-Patches/0082-Catch-Async-PlayerChunkMap-operations.patch rename to Spigot-Server-Patches/0077-Catch-Async-PlayerChunkMap-operations.patch index fce59c9c82..fbd7e228b7 100644 --- a/Spigot-Server-Patches/0082-Catch-Async-PlayerChunkMap-operations.patch +++ b/Spigot-Server-Patches/0077-Catch-Async-PlayerChunkMap-operations.patch @@ -1,14 +1,14 @@ -From c5c1acfc51996231112a7702df7839efa938e2fe Mon Sep 17 00:00:00 2001 +From 944a34bbc6cbfe42ca5f51d0a7751af51b7b2bfa Mon Sep 17 00:00:00 2001 From: Daniel Ennis Date: Sun, 20 Mar 2016 15:22:42 -0400 Subject: [PATCH] Catch Async PlayerChunkMap operations diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 9627a9be0..ad1d90b56 100644 +index 6ece565c5..4d888d6d4 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -469,10 +469,12 @@ public class PlayerChunkMap { +@@ -443,10 +443,12 @@ public class PlayerChunkMap { } public void a(PlayerChunk playerchunk) { diff --git a/Spigot-Server-Patches/0078-Optimized-Light-Level-Comparisons.patch b/Spigot-Server-Patches/0078-Optimized-Light-Level-Comparisons.patch deleted file mode 100644 index 435178437e..0000000000 --- a/Spigot-Server-Patches/0078-Optimized-Light-Level-Comparisons.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 48a4571e79ab35c95bf6266573c1edcb1a07dfa0 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Fri, 18 Mar 2016 21:22:56 -0400 -Subject: [PATCH] Optimized Light Level Comparisons - -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 c0b88580c..55ed0c956 100644 ---- a/src/main/java/net/minecraft/server/BlockCrops.java -+++ b/src/main/java/net/minecraft/server/BlockCrops.java -@@ -48,7 +48,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement - - public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { - super.b(world, blockposition, iblockdata, random); -- if (world.getLightLevel(blockposition.up()) >= 9) { -+ if (world.isLightLevel(blockposition.up(), 9)) { // Paper - int i = this.y(iblockdata); - - if (i < this.g()) { -diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java -index fe55848be..8fc736d6a 100644 ---- a/src/main/java/net/minecraft/server/BlockGrass.java -+++ b/src/main/java/net/minecraft/server/BlockGrass.java -@@ -29,7 +29,8 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement { - - public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { - if (!world.isClientSide) { -- if (world.getLightLevel(blockposition.up()) < 4 && world.getType(blockposition.up()).c() > 2) { -+ int lightLevel = -1; // Paper -+ if (world.getType(blockposition.up()).c() > 2 && (lightLevel = world.getLightLevel(blockposition.up())) < 4) { // Paper - move light check to end to avoid unneeded light lookups - // CraftBukkit start - // world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData()); - org.bukkit.World bworld = world.getWorld(); -@@ -44,18 +45,25 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement { - } - // CraftBukkit end - } else { -- if (world.getLightLevel(blockposition.up()) >= 9) { -+ // Paper start -+ // If light was calculated above, reuse it, else grab it -+ if (lightLevel == -1) { -+ lightLevel = world.getLightLevel(blockposition.up()); -+ } -+ if (lightLevel >= 9) { -+ // Paper end - for (int i = 0; i < 4; ++i) { - BlockPosition blockposition1 = blockposition.a(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); - -- if (blockposition1.getY() >= 0 && blockposition1.getY() < 256 && !world.isLoaded(blockposition1)) { -+ IBlockData iblockdata2 = world.getTypeIfLoaded(blockposition1); // Paper - moved up -+ if (iblockdata2 == null) { // Paper - return; - } - - IBlockData iblockdata1 = world.getType(blockposition1.up()); -- IBlockData iblockdata2 = world.getType(blockposition1); -+ //IBlockData iblockdata2 = world.getTypeIfLoaded(blockposition1); // Paper - moved up - -- if (iblockdata2.getBlock() == Blocks.DIRT && iblockdata2.get(BlockDirt.VARIANT) == BlockDirt.EnumDirtVariant.DIRT && world.getLightLevel(blockposition1.up()) >= 4 && iblockdata1.c() <= 2) { -+ if (iblockdata2.getBlock() == Blocks.DIRT && iblockdata2.get(BlockDirt.VARIANT) == BlockDirt.EnumDirtVariant.DIRT && iblockdata1.c() <= 2 && world.isLightLevel(blockposition1.up(), 4)) { // Paper - move last check before isLightLevel to avoid unneeded light checks - // CraftBukkit start - // world.setTypeUpdate(blockposition1, Blocks.GRASS.getBlockData()); - org.bukkit.World bworld = world.getWorld(); -diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java -index 6d0f4c156..3bbb123bc 100644 ---- a/src/main/java/net/minecraft/server/BlockSapling.java -+++ b/src/main/java/net/minecraft/server/BlockSapling.java -@@ -34,7 +34,7 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen - public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { - if (!world.isClientSide) { - super.b(world, blockposition, iblockdata, random); -- if (world.getLightLevel(blockposition.up()) >= 9 && random.nextInt(Math.max(2, (int) (((100.0F / world.spigotConfig.saplingModifier) * 7) + 0.5F))) == 0) { // Spigot -+ if (world.isLightLevel(blockposition.up(), 9) && random.nextInt(Math.max(2, (int) (((100.0F / world.spigotConfig.saplingModifier) * 7) + 0.5F))) == 0) { // Spigot // Paper - // CraftBukkit start - 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 f12987c84..5ae7bd9df 100644 ---- a/src/main/java/net/minecraft/server/BlockStem.java -+++ b/src/main/java/net/minecraft/server/BlockStem.java -@@ -48,7 +48,7 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { - - public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { - super.b(world, blockposition, iblockdata, random); -- if (world.getLightLevel(blockposition.up()) >= 9) { -+ if (world.isLightLevel(blockposition.up(), 9)) { // Paper - float f = BlockCrops.a((Block) this, world, blockposition); - - 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 0f55cf515..8782bce56 100644 ---- a/src/main/java/net/minecraft/server/EntityMonster.java -+++ b/src/main/java/net/minecraft/server/EntityMonster.java -@@ -118,17 +118,17 @@ 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.getLightLevel(blockposition); -- -+ //int i = this.world.getLightLevel(blockposition); // Paper -+ boolean passes; // Paper - if (this.world.X()) { - int j = this.world.ah(); - - this.world.c(10); -- i = this.world.getLightLevel(blockposition); -+ passes = !world.isLightLevel(blockposition, this.random.nextInt(9)); // Paper - this.world.c(j); -- } -+ } else { passes = !world.isLightLevel(blockposition, this.random.nextInt(9)); } // Paper - -- return i <= this.random.nextInt(8); -+ return passes; // Paper - } - } - -diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 277f1414a..6111ca0b2 100644 ---- a/src/main/java/net/minecraft/server/EntityZombie.java -+++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -178,7 +178,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.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) { - this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit --- -2.18.0 - diff --git a/Spigot-Server-Patches/0084-Waving-banner-workaround.patch b/Spigot-Server-Patches/0078-Waving-banner-workaround.patch similarity index 95% rename from Spigot-Server-Patches/0084-Waving-banner-workaround.patch rename to Spigot-Server-Patches/0078-Waving-banner-workaround.patch index d43f7b840c..7a780aebd8 100644 --- a/Spigot-Server-Patches/0084-Waving-banner-workaround.patch +++ b/Spigot-Server-Patches/0078-Waving-banner-workaround.patch @@ -1,4 +1,4 @@ -From b0ea83e0b72ee47162d2950eb74ac94b5faede08 Mon Sep 17 00:00:00 2001 +From a6cfcd582092205a3cc16876f512319aa6e3659b Mon Sep 17 00:00:00 2001 From: Gabscap Date: Sat, 19 Mar 2016 22:25:11 +0100 Subject: [PATCH] Waving banner workaround diff --git a/Spigot-Server-Patches/0085-Use-a-Shared-Random-for-Entities.patch b/Spigot-Server-Patches/0079-Use-a-Shared-Random-for-Entities.patch similarity index 74% rename from Spigot-Server-Patches/0085-Use-a-Shared-Random-for-Entities.patch rename to Spigot-Server-Patches/0079-Use-a-Shared-Random-for-Entities.patch index 3979ac1497..0280e0d2a2 100644 --- a/Spigot-Server-Patches/0085-Use-a-Shared-Random-for-Entities.patch +++ b/Spigot-Server-Patches/0079-Use-a-Shared-Random-for-Entities.patch @@ -1,4 +1,4 @@ -From 95dfc2d6b2593ea2603bc30932824b855b8bb672 Mon Sep 17 00:00:00 2001 +From e8130f30b3ccaa96576a1a9f8ab34ec9e01ff0eb Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 22 Mar 2016 00:33:47 -0400 Subject: [PATCH] Use a Shared Random for Entities @@ -6,10 +6,10 @@ Subject: [PATCH] Use a Shared Random for Entities Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b4ad611fc..4a08db5ba 100644 +index e16579116..c0367df20 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -46,6 +46,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -50,6 +50,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke // CraftBukkit start private static final int CURRENT_LEVEL = 2; @@ -17,10 +17,10 @@ index b4ad611fc..4a08db5ba 100644 static boolean isLevelAtLeast(NBTTagCompound tag, int level) { return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; } -@@ -171,7 +172,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -182,7 +183,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.length = 1.8F; - this.ax = 1; - this.ay = 1.0F; + this.aA = 1.0F; + this.aB = 1.0F; - this.random = new Random(); + this.random = SHARED_RANDOM; // Paper this.fireTicks = -this.getMaxFireTicks(); diff --git a/Spigot-Server-Patches/0086-Don-t-teleport-dead-entities.patch b/Spigot-Server-Patches/0080-Don-t-teleport-dead-entities.patch similarity index 80% rename from Spigot-Server-Patches/0086-Don-t-teleport-dead-entities.patch rename to Spigot-Server-Patches/0080-Don-t-teleport-dead-entities.patch index 473a755069..009ff59ff6 100644 --- a/Spigot-Server-Patches/0086-Don-t-teleport-dead-entities.patch +++ b/Spigot-Server-Patches/0080-Don-t-teleport-dead-entities.patch @@ -1,4 +1,4 @@ -From d24cf71aec74d0f22ad259e435ccbce611139fed Mon Sep 17 00:00:00 2001 +From fe002b9182ad3501cf49a62a7628886ca334eb42 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 eb07d4233..e2202ed0c 100644 +index c0367df20..c37c46e71 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2399,7 +2399,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper +@@ -2556,7 +2556,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public Entity teleportTo(Location exit, boolean portal) { diff --git a/Spigot-Server-Patches/0081-Optimize-Chunk-Access.patch b/Spigot-Server-Patches/0081-Optimize-Chunk-Access.patch new file mode 100644 index 0000000000..898131b21a --- /dev/null +++ b/Spigot-Server-Patches/0081-Optimize-Chunk-Access.patch @@ -0,0 +1,40 @@ +From cdb7534af1e2b9eccff805ba33c17dbe7173b8bf Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Thu, 27 Aug 2015 01:15:02 -0400 +Subject: [PATCH] Optimize Chunk Access + +getting a loaded chunk is one of the most hottest pieces of code in the game. +getChunkAt is called for the same chunk multiple times in a row, often from getType(); + +Optimize this look up by using a Last Access cache. + +diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java +index 0c2386f5e..5757aa80f 100644 +--- a/src/main/java/net/minecraft/server/ChunkMap.java ++++ b/src/main/java/net/minecraft/server/ChunkMap.java +@@ -106,8 +106,22 @@ public class ChunkMap extends Long2ObjectOpenHashMap { + } + } + ++ // Paper start ++ if (lastChunkByPos != null && i == lastChunkByPos.chunkKey) { ++ lastChunkByPos = null; ++ } + return chunk; + } ++ private Chunk lastChunkByPos = null; // Paper ++ ++ @Override ++ public Chunk get(long l) { ++ if (lastChunkByPos != null && l == lastChunkByPos.chunkKey) { ++ return lastChunkByPos; ++ } ++ return super.get(l); ++ } ++ // Paper end + + public Chunk a(Object object) { + return this.a(((Long) object).longValue()); +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0088-Configurable-spawn-chances-for-skeleton-horses.patch b/Spigot-Server-Patches/0082-Configurable-spawn-chances-for-skeleton-horses.patch similarity index 81% rename from Spigot-Server-Patches/0088-Configurable-spawn-chances-for-skeleton-horses.patch rename to Spigot-Server-Patches/0082-Configurable-spawn-chances-for-skeleton-horses.patch index 8488c57343..77889de4f5 100644 --- a/Spigot-Server-Patches/0088-Configurable-spawn-chances-for-skeleton-horses.patch +++ b/Spigot-Server-Patches/0082-Configurable-spawn-chances-for-skeleton-horses.patch @@ -1,14 +1,14 @@ -From 058e5610e2eb40aa6c0e06b8dabe6cb5b8d99d4c Mon Sep 17 00:00:00 2001 +From 80270bef8a4e821f22b5da1aeee36822fde9150b 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 f71580393..38d664e00 100644 +index b9dc0be2c..9f586774d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -261,4 +261,9 @@ public class PaperWorldConfig { +@@ -211,4 +211,9 @@ public class PaperWorldConfig { } log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate); } @@ -19,18 +19,18 @@ index f71580393..38d664e00 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d0ff0adf5..96792300c 100644 +index 9bd11a5fd..88868b4c4 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -496,7 +496,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -498,7 +498,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (this.isRainingAt(blockposition)) { - DifficultyDamageScaler difficultydamagescaler = this.D(blockposition); + DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); - 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) { EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this); - entityhorseskeleton.p(true); + entityhorseskeleton.s(true); -- 2.18.0 diff --git a/Spigot-Server-Patches/0083-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/0083-Optimize-isValidLocation-getType-and-getBlockData-fo.patch new file mode 100644 index 0000000000..309e976283 --- /dev/null +++ b/Spigot-Server-Patches/0083-Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -0,0 +1,204 @@ +From 67514f1f5435a6fecdeaa029189972d8d9cc6419 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 + +Hot methods, so reduce # of instructions for the method. + +Move is valid location test to the BlockPosition class so that it can access local variables. + +Replace all calls to the new place to the unnecessary forward. + +Optimize getType and getBlockData to manually inline and optimize the calls + +diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java +index c3e990bdf..d190144a1 100644 +--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java ++++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java +@@ -10,6 +10,14 @@ public class BaseBlockPosition implements Comparable { + private final int a; + private final int b; + private final int c; ++ // Paper start ++ public boolean isValidLocation() { ++ return a >= -30000000 && c >= -30000000 && a < 30000000 && c < 30000000 && b >= 0 && b < 256; ++ } ++ public boolean isInvalidYLocation() { ++ return b < 0 || b >= 256; ++ } ++ // Paper end + + 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 002da2a19..0fddd916b 100644 +--- a/src/main/java/net/minecraft/server/BlockPosition.java ++++ b/src/main/java/net/minecraft/server/BlockPosition.java +@@ -338,6 +338,16 @@ public class BlockPosition extends BaseBlockPosition { + protected int b; + protected int c; + protected int d; ++ // Paper start ++ @Override ++ public boolean isValidLocation() { ++ return b >= -30000000 && d >= -30000000 && b < 30000000 && d < 30000000 && c >= 0 && c < 256; ++ } ++ @Override ++ public boolean isInvalidYLocation() { ++ return c < 0 || c >= 256; ++ } ++ // Paper end + + 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 f376b3a34..75fcc693d 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 { + return this.getBlockData(i, j, k).b(this.world, new BlockPosition(i, j, k)); + } + +- public IBlockData getBlockData(BlockPosition blockposition) { return getType(blockposition); } // Paper ++ // 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) { + return this.getBlockData(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + } + +- public IBlockData getBlockData(int i, int j, int k) { ++ public final IBlockData getBlockData(final int x, final int y, final int z) { ++ // Method body / logic copied from below ++ final int i = y >> 4; ++ if (y >= 0 && i < this.sections.length && this.sections[i] != null) { ++ // Inlined ChunkSection.getType() and DataPaletteBlock.a(int,int,int) ++ return this.sections[i].blockIds.a((y & 15) << 8 | (z & 15) << 4 | x & 15); ++ } ++ return Blocks.AIR.getBlockData(); ++ } ++ ++ public IBlockData getBlockData_unused(int i, int j, int k) { ++ // Paper end + if (this.world.R() == 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 +index 7c6308dbe..880058a9e 100644 +--- a/src/main/java/net/minecraft/server/ChunkSection.java ++++ b/src/main/java/net/minecraft/server/ChunkSection.java +@@ -9,7 +9,7 @@ public class ChunkSection { + private int nonEmptyBlockCount; + private int tickingBlockCount; + private int e; +- private final DataPaletteBlock blockIds; ++ final DataPaletteBlock blockIds; // Paper - package + private NibbleArray emittedLight; + private NibbleArray skyLight; + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index 1c939e523..9e56b046f 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 + } + + public static boolean isValidLocation(BlockPosition blockposition) { +- return !k(blockposition) && blockposition.getX() >= -30000000 && blockposition.getZ() >= -30000000 && blockposition.getX() < 30000000 && blockposition.getZ() < 30000000; ++ return blockposition.isValidLocation(); // Paper + } + + public static boolean k(BlockPosition blockposition) { +- return blockposition.getY() < 0 || blockposition.getY() >= 256; ++ return blockposition.isInvalidYLocation(); // Paper + } + + public boolean isEmpty(BlockPosition blockposition) { +@@ -280,7 +280,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + // test if meets light level, return faster + // logic copied from below + public boolean isLightLevel(BlockPosition blockposition, int level) { +- if (isValidLocation(blockposition)) { ++ if (blockposition.isValidLocation()) { + 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 + // CraftBukkit end + Chunk chunk = this.getChunkIfLoaded(blockposition); + if (chunk != null) { +- return isValidLocation(blockposition) ? chunk.getBlockData(blockposition) : Blocks.AIR.getBlockData(); ++ return blockposition.isValidLocation() ? chunk.getBlockData(blockposition) : Blocks.AIR.getBlockData(); // Paper + } + return null; + } +@@ -359,7 +359,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + return true; + } + // CraftBukkit end +- if (k(blockposition)) { ++ if (blockposition.isInvalidYLocation()) { // Paper + return false; + } else if (!this.isClientSide && this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) { + return false; +@@ -669,11 +669,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + blockposition = new BlockPosition(blockposition.getX(), 0, blockposition.getZ()); + } + +- return !isValidLocation(blockposition) ? enumskyblock.c : (!this.isLoaded(blockposition) ? enumskyblock.c : this.getChunkAtWorldCoords(blockposition).getBrightness(enumskyblock, blockposition)); ++ return !blockposition.isValidLocation() ? enumskyblock.c : (!this.isLoaded(blockposition) ? enumskyblock.c : this.getChunkAtWorldCoords(blockposition).getBrightness(enumskyblock, blockposition)); // Paper + } + + public void a(EnumSkyBlock enumskyblock, BlockPosition blockposition, int i) { +- if (isValidLocation(blockposition)) { ++ if (blockposition.isValidLocation()) { // Paper + if (this.isLoaded(blockposition)) { + this.getChunkAtWorldCoords(blockposition).a(enumskyblock, blockposition, i); + this.m(blockposition); +@@ -700,7 +700,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + } + } + // CraftBukkit end +- if (k(blockposition)) { ++ if (blockposition.isInvalidYLocation()) { // Paper + return Blocks.VOID_AIR.getBlockData(); + } else { + Chunk chunk = this.getChunkAtWorldCoords(blockposition); +@@ -710,7 +710,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + } + + public Fluid b(BlockPosition blockposition) { +- if (k(blockposition)) { ++ if (blockposition.isInvalidYLocation()) { // Paper + return FluidTypes.a.i(); + } else { + Chunk chunk = this.getChunkAtWorldCoords(blockposition); +@@ -1764,7 +1764,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + public Map capturedTileEntities = Maps.newHashMap(); + @Nullable + public TileEntity getTileEntity(BlockPosition blockposition) { +- if (k(blockposition)) { ++ if (blockposition.isInvalidYLocation()) { // Paper + return null; + } else { + // CraftBukkit start +@@ -1805,7 +1805,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + } + + public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { +- if (!k(blockposition)) { ++ if (!blockposition.isInvalidYLocation()) { // Paper + if (tileentity != null && !tileentity.x()) { + // CraftBukkit start + if (captureBlockStates) { +@@ -1866,7 +1866,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + } + + public boolean p(BlockPosition blockposition) { +- if (k(blockposition)) { ++ if (blockposition.isInvalidYLocation()) { // Paper + return false; + } else { + Chunk chunk = this.chunkProvider.getLoadedChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4); +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0083-Support-offline-mode-in-whitelist-command-as-well.patch b/Spigot-Server-Patches/0083-Support-offline-mode-in-whitelist-command-as-well.patch deleted file mode 100644 index e388517ee7..0000000000 --- a/Spigot-Server-Patches/0083-Support-offline-mode-in-whitelist-command-as-well.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 0e1114be5240770f53eb77187b73f603f8f168cb Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Mon, 21 Mar 2016 00:19:18 -0500 -Subject: [PATCH] Support offline mode in whitelist command as well - - -diff --git a/src/main/java/net/minecraft/server/CommandWhitelist.java b/src/main/java/net/minecraft/server/CommandWhitelist.java -index c74d1d2be..0f4237db1 100644 ---- a/src/main/java/net/minecraft/server/CommandWhitelist.java -+++ b/src/main/java/net/minecraft/server/CommandWhitelist.java -@@ -44,24 +44,35 @@ public class CommandWhitelist extends CommandAbstract { - throw new ExceptionUsage("commands.whitelist.add.usage", new Object[0]); - } - -+ // Paper start - Handle offline mode as well -+ /* - gameprofile = minecraftserver.getUserCache().getProfile(astring[1]); - if (gameprofile == null) { - throw new CommandException("commands.whitelist.add.failed", new Object[] { astring[1]}); - } - - minecraftserver.getPlayerList().addWhitelist(gameprofile); -+ */ -+ this.whitelist(minecraftserver, astring[1], true); -+ // Paper end - a(icommandlistener, (ICommand) this, "commands.whitelist.add.success", new Object[] { astring[1]}); - } else if ("remove".equals(astring[0])) { - if (astring.length < 2) { - throw new ExceptionUsage("commands.whitelist.remove.usage", new Object[0]); - } - -+ // Paper start - Handle offline mode as well -+ /* - gameprofile = minecraftserver.getPlayerList().getWhitelist().a(astring[1]); - if (gameprofile == null) { - throw new CommandException("commands.whitelist.remove.failed", new Object[] { astring[1]}); - } - - minecraftserver.getPlayerList().removeWhitelist(gameprofile); -+ -+ */ -+ this.whitelist(minecraftserver, astring[1], false); -+ // Paper end - a(icommandlistener, (ICommand) this, "commands.whitelist.remove.success", new Object[] { astring[1]}); - } else if ("reload".equals(astring[0])) { - minecraftserver.getPlayerList().reloadWhitelist(); -@@ -89,4 +100,43 @@ public class CommandWhitelist extends CommandAbstract { - return Collections.emptyList(); - } - } -+ -+ // Paper start -+ /** -+ * Adds or removes a player from the game whitelist -+ * -+ * @param mcserver running instance of MinecraftServer -+ * @param playerName the player we're going to be whitelisting -+ * @param add whether we're adding or removing from the whitelist -+ */ -+ private void whitelist(MinecraftServer mcserver, String playerName, boolean add) throws CommandException { -+ if (mcserver.getOnlineMode()) { -+ // The reason we essentially copy/pasta NMS code here is because the NMS online-only version -+ // is capable of providing feedback to the person running the command based on whether or -+ // not the player is a real online-mode account -+ GameProfile gameprofile = mcserver.getUserCache().getProfile(playerName); -+ if (gameprofile == null) { -+ if (add) { -+ throw new CommandException("commands.whitelist.add.failed", new Object[] { playerName}); -+ } else { -+ throw new CommandException("commands.whitelist.remove.failed", new Object[] { playerName}); -+ } -+ } -+ -+ if (add) { -+ mcserver.getPlayerList().addWhitelist(gameprofile); -+ } else { -+ mcserver.getPlayerList().removeWhitelist(gameprofile); -+ } -+ } else { -+ // versus our offline version, which will always report success all of the time -+ org.bukkit.OfflinePlayer offlinePlayer = org.bukkit.Bukkit.getOfflinePlayer(playerName); -+ if (add) { -+ offlinePlayer.setWhitelisted(true); -+ } else { -+ offlinePlayer.setWhitelisted(false); -+ } -+ } -+ } -+ // Paper end - } --- -2.18.0 - diff --git a/Spigot-Server-Patches/0091-Access-items-by-EquipmentSlot.patch b/Spigot-Server-Patches/0084-Access-items-by-EquipmentSlot.patch similarity index 93% rename from Spigot-Server-Patches/0091-Access-items-by-EquipmentSlot.patch rename to Spigot-Server-Patches/0084-Access-items-by-EquipmentSlot.patch index 438f367a01..28775abcf9 100644 --- a/Spigot-Server-Patches/0091-Access-items-by-EquipmentSlot.patch +++ b/Spigot-Server-Patches/0084-Access-items-by-EquipmentSlot.patch @@ -1,14 +1,14 @@ -From b0fe7f64b1dfc8d800070d347cda11ea6f146773 Mon Sep 17 00:00:00 2001 +From ff5e0a9bbb04c9d508bdeb1a01746c12f08701d7 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sun, 20 Mar 2016 06:45:01 -0400 Subject: [PATCH] Access items by EquipmentSlot diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java -index 67c54899d..3f58c34e0 100644 +index 6cbe06956..7b62f26d7 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java -@@ -267,4 +267,54 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i +@@ -250,4 +250,54 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i public void setBootsDropChance(float chance) { throw new UnsupportedOperationException(); } diff --git a/Spigot-Server-Patches/0093-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch b/Spigot-Server-Patches/0085-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch similarity index 58% rename from Spigot-Server-Patches/0093-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch rename to Spigot-Server-Patches/0085-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch index 22e3b1ce4e..9dcaddb902 100644 --- a/Spigot-Server-Patches/0093-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch +++ b/Spigot-Server-Patches/0085-Option-to-disable-BlockPhysicsEvent-for-Redstone.patch @@ -1,4 +1,4 @@ -From d03b75f5e4ea7e6ff34ebc7651c9a86e2550c6ef Mon Sep 17 00:00:00 2001 +From bb5082dc3d9b53d91ff31abd7ce59e2fd9f85c7f 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,10 +11,10 @@ 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 38d664e00..e634c3afd 100644 +index 9f586774d..1c2209270 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -266,4 +266,9 @@ public class PaperWorldConfig { +@@ -216,4 +216,9 @@ public class PaperWorldConfig { private void skeleHorseSpawnChance() { skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state } @@ -25,23 +25,23 @@ index 38d664e00..e634c3afd 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8f0a306cc..74ae80646 100644 +index 9e56b046f..c9d0c22d5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -582,7 +582,7 @@ public abstract class World implements IBlockAccess { +@@ -582,7 +582,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose try { // CraftBukkit start CraftWorld world = ((WorldServer) this).getWorld(); - if (world != null) { + if (world != null && !((WorldServer)this).stopPhysicsEvent) { // Paper - BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftMagicNumbers.getId(block)); + BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); 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 96792300c..ebe397116 100644 +index 88868b4c4..e3d62fc9c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -35,6 +35,7 @@ import org.bukkit.event.weather.LightningStrikeEvent; +@@ -36,6 +36,7 @@ import org.bukkit.event.weather.LightningStrikeEvent; public class WorldServer extends World implements IAsyncTaskHandler { private static final Logger a = LogManager.getLogger(); @@ -49,23 +49,14 @@ index 96792300c..ebe397116 100644 private final MinecraftServer server; public EntityTracker tracker; private final PlayerChunkMap manager; -@@ -777,6 +778,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -676,6 +677,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + IBlockData iblockdata = this.getType(nextticklistentry.a); - if (iblockdata.getMaterial() != Material.AIR && Block.a(iblockdata.getBlock(), nextticklistentry.a())) { - try { -+ stopPhysicsEvent = !paperConfig.firePhysicsEventForRedstone && (iblockdata.getBlock() instanceof BlockDiodeAbstract || iblockdata.getBlock() instanceof BlockRedstoneTorch); // Paper - iblockdata.getBlock().b((World) this, nextticklistentry.a, iblockdata, this.random); - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.a(throwable, "Exception while ticking a block"); -@@ -784,7 +786,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + if (iblockdata.getBlock() == nextticklistentry.a()) { ++ stopPhysicsEvent = !paperConfig.firePhysicsEventForRedstone && (iblockdata.getBlock() instanceof BlockDiodeAbstract || iblockdata.getBlock() instanceof BlockRedstoneTorch); // Paper + iblockdata.a((World) this, nextticklistentry.a, this.random); + } - CrashReportSystemDetails.a(crashreportsystemdetails, nextticklistentry.a, iblockdata); - throw new ReportedException(crashreport); -- } -+ } finally { stopPhysicsEvent = false; } // Paper - } - timing.stopTiming(); // Paper - } else { -- 2.18.0 diff --git a/Spigot-Server-Patches/0094-Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-Server-Patches/0086-Entity-AddTo-RemoveFrom-World-Events.patch similarity index 69% rename from Spigot-Server-Patches/0094-Entity-AddTo-RemoveFrom-World-Events.patch rename to Spigot-Server-Patches/0086-Entity-AddTo-RemoveFrom-World-Events.patch index 8345860f35..f8af43d627 100644 --- a/Spigot-Server-Patches/0094-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-Server-Patches/0086-Entity-AddTo-RemoveFrom-World-Events.patch @@ -1,14 +1,14 @@ -From 3ed61703830d84e115bc1a5b009e756735ce2ee7 Mon Sep 17 00:00:00 2001 +From 3eb77c1663b1d445903206370ceec40558d6ca71 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 74ae80646..119cd0636 100644 +index c9d0c22d5..e88baae1d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1185,6 +1185,7 @@ public abstract class World implements IBlockAccess { +@@ -1037,6 +1037,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose } entity.valid = true; // CraftBukkit @@ -16,8 +16,8 @@ index 74ae80646..119cd0636 100644 } protected void c(Entity entity) { -@@ -1192,6 +1193,7 @@ public abstract class World implements IBlockAccess { - ((IWorldAccess) this.u.get(i)).b(entity); +@@ -1044,6 +1045,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + ((IWorldAccess) this.v.get(i)).b(entity); } + new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid diff --git a/Spigot-Server-Patches/0095-Configurable-Chunk-Inhabited-Timer.patch b/Spigot-Server-Patches/0087-Configurable-Chunk-Inhabited-Timer.patch similarity index 61% rename from Spigot-Server-Patches/0095-Configurable-Chunk-Inhabited-Timer.patch rename to Spigot-Server-Patches/0087-Configurable-Chunk-Inhabited-Timer.patch index dc2f83a0f6..169e3c92a1 100644 --- a/Spigot-Server-Patches/0095-Configurable-Chunk-Inhabited-Timer.patch +++ b/Spigot-Server-Patches/0087-Configurable-Chunk-Inhabited-Timer.patch @@ -1,4 +1,4 @@ -From e2eb0375f3b5fa6b9d074ee6d8551732eb8e37a7 Mon Sep 17 00:00:00 2001 +From 79c231e9a63f78d87f1042415362779abee394af 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 e634c3afd..54f23ea75 100644 +index 1c2209270..17fb883f6 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -271,4 +271,9 @@ public class PaperWorldConfig { +@@ -221,4 +221,9 @@ public class PaperWorldConfig { private void firePhysicsEventForRedstone() { firePhysicsEventForRedstone = getBoolean("fire-physics-event-for-redstone", firePhysicsEventForRedstone); } @@ -23,18 +23,27 @@ index e634c3afd..54f23ea75 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index bf3b64e37..6b13e1d7d 100644 +index 75fcc693d..aaa65582b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -1445,7 +1445,7 @@ public class Chunk { +@@ -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; +@@ -1231,7 +1231,7 @@ public class Chunk implements IChunkAccess { } - public long x() { -- return this.w; -+ return world.paperConfig.useInhabitedTime ? this.w : 0; // Paper + public long m() { +- return this.A; ++ return world.paperConfig.useInhabitedTime ? getInhabitedTime() : 0; // Paper } - public void c(long i) { + public void b(long i) { -- 2.18.0 diff --git a/Spigot-Server-Patches/0087-Optimize-Chunk-Access.patch b/Spigot-Server-Patches/0087-Optimize-Chunk-Access.patch deleted file mode 100644 index d5d48744b2..0000000000 --- a/Spigot-Server-Patches/0087-Optimize-Chunk-Access.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 4f5d96217a3ec5d72b3f19f874b53fd13d506b97 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Thu, 27 Aug 2015 01:15:02 -0400 -Subject: [PATCH] Optimize Chunk Access - -getting a loaded chunk is one of the most hottest pieces of code in the game. -getChunkAt is called for the same chunk multiple times in a row, often from getType(); - -Optimize this look up by using a Last Access cache. - -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 4e7e8e5fd..1771a1794 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -27,7 +27,27 @@ public class ChunkProviderServer implements IChunkProvider { - public final Set unloadQueue = Sets.newHashSet(); - public final ChunkGenerator chunkGenerator; - private final IChunkLoader chunkLoader; -- public final Long2ObjectMap chunks = new Long2ObjectOpenHashMap(8192); -+ // Paper start -+ protected Chunk lastChunkByPos = null; -+ public Long2ObjectOpenHashMap chunks = new Long2ObjectOpenHashMap(8192) { -+ -+ @Override -+ public Chunk get(long key) { -+ if (lastChunkByPos != null && key == lastChunkByPos.chunkKey) { -+ return lastChunkByPos; -+ } -+ return lastChunkByPos = super.get(key); -+ } -+ -+ @Override -+ public Chunk remove(long key) { -+ if (lastChunkByPos != null && key == lastChunkByPos.chunkKey) { -+ lastChunkByPos = null; -+ } -+ return super.remove(key); -+ } -+ }; // CraftBukkit -+ // Paper end - public final WorldServer world; - - public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, ChunkGenerator chunkgenerator) { --- -2.18.0 - diff --git a/Spigot-Server-Patches/0088-EntityPathfindEvent.patch b/Spigot-Server-Patches/0088-EntityPathfindEvent.patch new file mode 100644 index 0000000000..117da38482 --- /dev/null +++ b/Spigot-Server-Patches/0088-EntityPathfindEvent.patch @@ -0,0 +1,39 @@ +From 31f50d7cd6e30d27b06ff85e3e3b16a1c294951e Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Mon, 28 Mar 2016 21:22:26 -0400 +Subject: [PATCH] EntityPathfindEvent + +Fires when an Entity decides to start moving to a location. + +diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java +index 1964684ac..0c5215657 100644 +--- a/src/main/java/net/minecraft/server/NavigationAbstract.java ++++ b/src/main/java/net/minecraft/server/NavigationAbstract.java +@@ -4,7 +4,7 @@ import javax.annotation.Nullable; + + public abstract class NavigationAbstract { + +- protected EntityInsentient a; ++ protected EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER + protected World b; + @Nullable + protected PathEntity c; +@@ -78,6 +78,7 @@ public abstract class NavigationAbstract { + } else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { + return this.c; + } else { ++ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper + this.q = blockposition; + float f = this.k(); + +@@ -102,6 +103,7 @@ public abstract class NavigationAbstract { + if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { + return this.c; + } else { ++ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper + this.q = blockposition; + float f = this.k(); + +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0089-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/0089-Optimize-isValidLocation-getType-and-getBlockData-fo.patch deleted file mode 100644 index 262a4fce2f..0000000000 --- a/Spigot-Server-Patches/0089-Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ /dev/null @@ -1,260 +0,0 @@ -From 72e8da5083dce12fb49c57cebbab6ea0b7230f45 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 - -Hot methods, so reduce # of instructions for the method. - -Move is valid location test to the BlockPosition class so that it can access local variables. - -Replace all calls to the new place to the unnecessary forward. - -Optimize getType and getBlockData to manually inline and optimize the calls - -diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index d55e180d7..679d5504e 100644 ---- a/src/main/java/net/minecraft/server/BaseBlockPosition.java -+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java -@@ -10,6 +10,14 @@ public class BaseBlockPosition implements Comparable { - private final int a; - private final int b; - private final int c; -+ // Paper start -+ public boolean isValidLocation() { -+ return a >= -30000000 && c >= -30000000 && a < 30000000 && c < 30000000 && b >= 0 && b < 256; -+ } -+ public boolean isInvalidYLocation() { -+ return b < 0 || b >= 256; -+ } -+ // Paper end - - 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 67b476b22..008ed206d 100644 ---- a/src/main/java/net/minecraft/server/BlockPosition.java -+++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -339,6 +339,16 @@ public class BlockPosition extends BaseBlockPosition { - protected int b; - protected int c; - protected int d; -+ // Paper start -+ @Override -+ public boolean isValidLocation() { -+ return b >= -30000000 && d >= -30000000 && b < 30000000 && d < 30000000 && c >= 0 && c < 256; -+ } -+ @Override -+ public boolean isInvalidYLocation() { -+ return c < 0 || c >= 256; -+ } -+ // Paper end - - 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 57b23a018..bf3b64e37 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -435,11 +435,27 @@ public class Chunk { - return this.a(i, j, k).c(); - } - -- public IBlockData getBlockData(BlockPosition blockposition) { -- return this.a(blockposition.getX(), blockposition.getY(), blockposition.getZ()); -+ // Paper start - Optimize getBlockData to reduce instructions -+ public final IBlockData getBlockData(final BlockPosition pos) { -+ return getBlockData(pos.getX(), pos.getY(), pos.getZ()); -+ } -+ -+ public final IBlockData getBlockData(final int x, final int y, final int z) { -+ // Method body / logic copied from below -+ final int i = y >> 4; -+ if (y >= 0 && i < this.sections.length && this.sections[i] != null) { -+ // Inlined ChunkSection.getType() and DataPaletteBlock.a(int,int,int) -+ return this.sections[i].blockIds.a((y & 15) << 8 | (z & 15) << 4 | x & 15); -+ } -+ return Blocks.AIR.getBlockData(); - } - - public IBlockData a(final int i, final int j, final int k) { -+ return getBlockData(i, j, k); -+ } -+ -+ public IBlockData unused(final int i, final int j, final int k) { -+ // Paper end - if (this.world.N() == 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 -index 3d784d0dc..afdc4a779 100644 ---- a/src/main/java/net/minecraft/server/ChunkSection.java -+++ b/src/main/java/net/minecraft/server/ChunkSection.java -@@ -5,7 +5,7 @@ public class ChunkSection { - private final int yPos; - private int nonEmptyBlockCount; - private int tickingBlockCount; -- private final DataPaletteBlock blockIds; -+ final DataPaletteBlock blockIds; // Paper - package - private NibbleArray emittedLight; - private NibbleArray skyLight; - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b8ae41704..8f0a306cc 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -277,12 +277,12 @@ public abstract class World implements IBlockAccess { - return this.getType(blockposition1); - } - -- private boolean isValidLocation(BlockPosition blockposition) { -- return !this.E(blockposition) && blockposition.getX() >= -30000000 && blockposition.getZ() >= -30000000 && blockposition.getX() < 30000000 && blockposition.getZ() < 30000000; -+ private static boolean isValidLocation(BlockPosition blockposition) { // Paper - unused but incase reflection / future uses -+ return blockposition.isValidLocation(); // Paper - } - -- private boolean E(BlockPosition blockposition) { -- return blockposition.getY() < 0 || blockposition.getY() >= 256; -+ private static boolean E(BlockPosition blockposition) { // Paper - unused but incase reflection / future uses -+ return blockposition.isInvalidYLocation(); // Paper - } - - public boolean isEmpty(BlockPosition blockposition) { -@@ -378,7 +378,7 @@ public abstract class World implements IBlockAccess { - return true; - } - // CraftBukkit end -- if (this.E(blockposition)) { -+ if (blockposition.isInvalidYLocation()) { // Paper - return false; - } else if (!this.isClientSide && this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) { - return false; -@@ -695,7 +695,7 @@ public abstract class World implements IBlockAccess { - // Paper start - test if meets light level, return faster - // logic copied from below - public boolean isLightLevel(BlockPosition blockposition, int level) { -- if (isValidLocation(blockposition)) { -+ if (blockposition.isValidLocation()) { - if (this.getType(blockposition).f()) { - if (this.c(blockposition.up(), false) >= level) { - return true; -@@ -814,7 +814,7 @@ public abstract class World implements IBlockAccess { - blockposition = new BlockPosition(blockposition.getX(), 0, blockposition.getZ()); - } - -- if (!this.isValidLocation(blockposition)) { -+ if (!blockposition.isValidLocation()) { // Paper - return enumskyblock.c; - } else if (!this.isLoaded(blockposition)) { - return enumskyblock.c; -@@ -826,7 +826,7 @@ public abstract class World implements IBlockAccess { - } - - public void a(EnumSkyBlock enumskyblock, BlockPosition blockposition, int i) { -- if (this.isValidLocation(blockposition)) { -+ if (blockposition.isValidLocation()) { // Paper - if (this.isLoaded(blockposition)) { - Chunk chunk = this.getChunkAtWorldCoords(blockposition); - -@@ -850,19 +850,19 @@ public abstract class World implements IBlockAccess { - // Paper start - reduces need to do isLoaded before getType - public IBlockData getTypeIfLoaded(BlockPosition blockposition) { - // CraftBukkit start - tree generation -+ final int x = blockposition.getX(); -+ final int y = blockposition.getY(); -+ final int z = blockposition.getZ(); - if (captureTreeGeneration) { -- Iterator it = capturedBlockStates.iterator(); -- while (it.hasNext()) { -- BlockState previous = it.next(); -- if (previous.getX() == blockposition.getX() && previous.getY() == blockposition.getY() && previous.getZ() == blockposition.getZ()) { -- return CraftMagicNumbers.getBlock(previous.getTypeId()).fromLegacyData(previous.getRawData()); -- } -+ final IBlockData previous = getCapturedBlockType(x, y, z); -+ if (previous != null) { -+ return previous; - } - } - // CraftBukkit end -- Chunk chunk = this.getChunkIfLoaded(blockposition); -+ Chunk chunk = ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(x >> 4, z >> 4); - if (chunk != null) { -- return this.isValidLocation(blockposition) ? chunk.getBlockData(blockposition) : Blocks.AIR.getBlockData(); -+ return chunk.getBlockData(x, y, z); - } - return null; - } -@@ -870,24 +870,33 @@ public abstract class World implements IBlockAccess { - - public IBlockData getType(BlockPosition blockposition) { - // CraftBukkit start - tree generation -+ // Paper start - optimize getType lookup to reduce instructions - getBlockData already enforces valid Y, move tree out -+ final int x = blockposition.getX(); -+ final int y = blockposition.getY(); -+ final int z = blockposition.getZ(); - if (captureTreeGeneration) { -- Iterator it = capturedBlockStates.iterator(); -- while (it.hasNext()) { -- BlockState previous = it.next(); -- if (previous.getX() == blockposition.getX() && previous.getY() == blockposition.getY() && previous.getZ() == blockposition.getZ()) { -- return CraftMagicNumbers.getBlock(previous.getTypeId()).fromLegacyData(previous.getRawData()); -- } -+ final IBlockData previous = getCapturedBlockType(x, y, z); -+ if (previous != null) { -+ return previous; - } - } - // CraftBukkit end -- if (this.E(blockposition)) { -- return Blocks.AIR.getBlockData(); -- } else { -- Chunk chunk = this.getChunkAtWorldCoords(blockposition); -+ return this.chunkProvider.getChunkAt(x >> 4, z >> 4).getBlockData(x, y, z); -+ // Paper end -+ } - -- return chunk.getBlockData(blockposition); -+ // Paper start -+ private IBlockData getCapturedBlockType(int x, int y, int z) { -+ Iterator it = capturedBlockStates.iterator(); -+ while (it.hasNext()) { -+ BlockState previous = it.next(); -+ if (previous.getX() == x && previous.getY() == y && previous.getZ() == z) { -+ return CraftMagicNumbers.getBlock(previous.getTypeId()).fromLegacyData(previous.getRawData()); -+ } - } -+ return null; - } -+ // Paper end - - public boolean D() { - return this.L < 4; -@@ -2017,7 +2026,7 @@ public abstract class World implements IBlockAccess { - public Map capturedTileEntities = Maps.newHashMap(); - @Nullable - public TileEntity getTileEntity(BlockPosition blockposition) { -- if (this.E(blockposition)) { -+ if (blockposition.isInvalidYLocation()) { // Paper - return null; - } else { - // CraftBukkit start -@@ -2058,7 +2067,7 @@ public abstract class World implements IBlockAccess { - } - - public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { -- if (!this.E(blockposition)) { -+ if (!blockposition.isInvalidYLocation()) { - if (tileentity != null && !tileentity.y()) { - // CraftBukkit start - if (captureBlockStates) { -@@ -2121,7 +2130,7 @@ public abstract class World implements IBlockAccess { - } - - public boolean d(BlockPosition blockposition, boolean flag) { -- if (this.E(blockposition)) { -+ if (blockposition.isInvalidYLocation()) { // Paper - return false; - } else { - Chunk chunk = this.chunkProvider.getLoadedChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4); --- -2.18.0 - diff --git a/Spigot-Server-Patches/0089-Reduce-IO-ops-opening-a-new-region-file.patch b/Spigot-Server-Patches/0089-Reduce-IO-ops-opening-a-new-region-file.patch new file mode 100644 index 0000000000..c82e50f232 --- /dev/null +++ b/Spigot-Server-Patches/0089-Reduce-IO-ops-opening-a-new-region-file.patch @@ -0,0 +1,53 @@ +From 2d8c5299e664122b08b135fa309307b150d551ee Mon Sep 17 00:00:00 2001 +From: Antony Riley +Date: Tue, 29 Mar 2016 06:56:23 +0300 +Subject: [PATCH] Reduce IO ops opening a new region file. + + +diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java +index 3f9aa5923..4acb6df5d 100644 +--- a/src/main/java/net/minecraft/server/RegionFile.java ++++ b/src/main/java/net/minecraft/server/RegionFile.java +@@ -8,9 +8,12 @@ import java.io.ByteArrayInputStream; + import java.io.ByteArrayOutputStream; + import java.io.DataInputStream; + import java.io.DataOutputStream; ++import java.io.EOFException; + import java.io.File; + import java.io.IOException; + import java.io.RandomAccessFile; ++import java.nio.ByteBuffer; ++import java.nio.IntBuffer; + import java.util.List; + import java.util.zip.DeflaterOutputStream; + import java.util.zip.GZIPInputStream; +@@ -67,8 +70,16 @@ public class RegionFile { + + int k; + ++ // Paper Start ++ ByteBuffer header = ByteBuffer.allocate(8192); ++ while (header.hasRemaining()) { ++ if (this.c.getChannel().read(header) == -1) throw new EOFException(); ++ } ++ header.clear(); ++ IntBuffer headerAsInts = header.asIntBuffer(); ++ // Paper End + for (j = 0; j < 1024; ++j) { +- k = this.c.readInt(); ++ k = headerAsInts.get(); // Paper + this.d[j] = k; + if (k != 0 && (k >> 8) + (k & 255) <= this.f.size()) { + for (int l = 0; l < (k & 255); ++l) { +@@ -78,7 +89,7 @@ public class RegionFile { + } + + for (j = 0; j < 1024; ++j) { +- k = this.c.readInt(); ++ k = headerAsInts.get(); // Paper + this.e[j] = k; + } + } catch (IOException ioexception) { +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0090-Fix-cooked-fish-legacy-import.patch b/Spigot-Server-Patches/0090-Fix-cooked-fish-legacy-import.patch deleted file mode 100644 index 966c2c4861..0000000000 --- a/Spigot-Server-Patches/0090-Fix-cooked-fish-legacy-import.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 884edba128e9ff9052944693982a7fab7f95df65 Mon Sep 17 00:00:00 2001 -From: Jedediah Smith -Date: Tue, 1 Mar 2016 04:32:08 -0500 -Subject: [PATCH] Fix cooked fish legacy import - - -diff --git a/src/main/java/net/minecraft/server/DataConverterMaterialId.java b/src/main/java/net/minecraft/server/DataConverterMaterialId.java -index 87b82eb35..a7c71f406 100644 ---- a/src/main/java/net/minecraft/server/DataConverterMaterialId.java -+++ b/src/main/java/net/minecraft/server/DataConverterMaterialId.java -@@ -261,7 +261,7 @@ public class DataConverterMaterialId implements IDataConverter { - DataConverterMaterialId.a[347] = "minecraft:clock"; - DataConverterMaterialId.a[348] = "minecraft:glowstone_dust"; - DataConverterMaterialId.a[349] = "minecraft:fish"; -- DataConverterMaterialId.a[350] = "minecraft:cooked_fished"; -+ DataConverterMaterialId.a[350] = "minecraft:cooked_fish"; // Paper - cooked_fished -> cooked_fish - DataConverterMaterialId.a[351] = "minecraft:dye"; - DataConverterMaterialId.a[352] = "minecraft:bone"; - DataConverterMaterialId.a[353] = "minecraft:sugar"; --- -2.18.0 - diff --git a/Spigot-Server-Patches/0090-Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/0090-Sanitise-RegionFileCache-and-make-configurable.patch new file mode 100644 index 0000000000..728b5128b2 --- /dev/null +++ b/Spigot-Server-Patches/0090-Sanitise-RegionFileCache-and-make-configurable.patch @@ -0,0 +1,81 @@ +From eb06649c441f9bae0b3db6b27584f2ef490297f5 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. + +RegionFileCache prior to this patch would close every single open region +file upon reaching a size of 256. +This patch modifies that behaviour so it closes the the least recently +used RegionFile. +The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap). +The maximum size of the RegionFileCache is also made configurable. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index 2f6e169f5..ec4643384 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -215,4 +215,9 @@ public class PaperConfig { + private static void loadPermsBeforePlugins() { + loadPermsBeforePlugins = getBoolean("settings.load-permissions-yml-before-plugins", true); + } ++ ++ public static int regionFileCacheSize = 256; ++ private static void regionFileCacheSize() { ++ regionFileCacheSize = getInt("settings.region-file-cache-size", 256); ++ } + } +diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java +index 384628ccc..b335016fd 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; + import java.util.Iterator; + import java.util.Map; + import javax.annotation.Nullable; ++import com.destroystokyo.paper.PaperConfig; // Paper ++import java.util.LinkedHashMap; // Paper + + public class RegionFileCache { + +- public static final Map a = Maps.newHashMap(); // Spigot - private -> public ++ public static final Map a = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Spigot - private -> public, Paper - HashMap -> LinkedHashMap + + public static synchronized RegionFile a(File file, int i, int j) { + File file1 = new File(file, "region"); +@@ -26,8 +28,8 @@ public class RegionFileCache { + file1.mkdirs(); + } + +- if (RegionFileCache.a.size() >= 256) { +- a(); ++ if (RegionFileCache.a.size() >= PaperConfig.regionFileCacheSize) { // Paper ++ trimCache(); // Paper + } + + RegionFile regionfile1 = new RegionFile(file2); +@@ -58,6 +60,22 @@ public class RegionFileCache { + } + } + ++ // Paper Start ++ private static synchronized void trimCache() { ++ Iterator> itr = RegionFileCache.a.entrySet().iterator(); ++ int count = RegionFileCache.a.size() - PaperConfig.regionFileCacheSize; ++ while (count-- >= 0 && itr.hasNext()) { ++ try { ++ itr.next().getValue().c(); ++ } catch (IOException ioexception) { ++ ioexception.printStackTrace(); ++ ServerInternalException.reportInternalException(ioexception); ++ } ++ itr.remove(); ++ } ++ } ++ // Paper End ++ + public static synchronized void a() { + Iterator iterator = RegionFileCache.a.values().iterator(); + +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0091-Use-Optimized-Collections.patch b/Spigot-Server-Patches/0091-Use-Optimized-Collections.patch new file mode 100644 index 0000000000..462a346dcc --- /dev/null +++ b/Spigot-Server-Patches/0091-Use-Optimized-Collections.patch @@ -0,0 +1,38 @@ +From a298bd1caa168fd3ede25b2419e0888c4007ebb9 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 30 Mar 2016 02:13:24 -0400 +Subject: [PATCH] Use Optimized Collections + +Swap out CraftBukkit LongObjectHashMap with Long2ObjectOpenHashMap +Swap out Integer key HashMap for a Int2ObjectOpenHashMap For ChunkProviderServer + +Amaranth, the creator of LongObjectHashMap, tested it vs fastutil and determined fastutil to be 3x faster +and could not create anything faster than fastutil. + +These collections are super fast as seen +http://java-performance.info/hashmap-overview-jdk-fastutil-goldman-sachs-hppc-koloboke-trove-january-2015/ + +diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java +index 2b27ae797..7191185ba 100644 +--- a/src/main/java/net/minecraft/server/DataWatcher.java ++++ b/src/main/java/net/minecraft/server/DataWatcher.java +@@ -12,6 +12,7 @@ import java.util.Map; + import java.util.concurrent.locks.ReadWriteLock; + import java.util.concurrent.locks.ReentrantReadWriteLock; + import javax.annotation.Nullable; ++import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; // Paper + import org.apache.commons.lang3.ObjectUtils; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +@@ -21,7 +22,7 @@ public class DataWatcher { + private static final Logger a = LogManager.getLogger(); + private static final Map, Integer> b = Maps.newHashMap(); + private final Entity c; +- private final Map> d = Maps.newHashMap(); ++ private final Map> d = new Int2ObjectOpenHashMap<>(); // Paper + private final ReadWriteLock e = new ReentrantReadWriteLock(); + private boolean f = true; + private boolean g; +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0092-Check-async-remove-unused-vars-GH-159.patch b/Spigot-Server-Patches/0092-Check-async-remove-unused-vars-GH-159.patch deleted file mode 100644 index 436610b122..0000000000 --- a/Spigot-Server-Patches/0092-Check-async-remove-unused-vars-GH-159.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 29ffb89527cbf4bc5312c099877f79a4808b54dc Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Sun, 27 Mar 2016 20:24:05 -0500 -Subject: [PATCH] Check async, remove unused vars, GH-159 - - -diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 68a045323..45a83ae99 100644 ---- a/src/main/java/net/minecraft/server/SpawnerCreature.java -+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -40,6 +40,7 @@ public final class SpawnerCreature { - // Spigot end - - public int a(WorldServer worldserver, boolean flag, boolean flag1, boolean flag2) { -+ org.spigotmc.AsyncCatcher.catchOp("check for eligible spawn chunks"); // Paper - At least until we figure out what is calling this async - if (!flag && !flag1) { - return 0; - } else { -@@ -120,8 +121,10 @@ public final class SpawnerCreature { - // CraftBukkit end - - if ((!enumcreaturetype.d() || flag1) && (enumcreaturetype.d() || flag) && (!enumcreaturetype.e() || flag2)) { -+ /* Paper start - As far as I can tell neither of these are even used - k = worldserver.a(enumcreaturetype.a()); - int l1 = limit * i / a; // CraftBukkit - use per-world limits -+ */ // Paper end - - if ((mobcnt = getEntityCount(worldserver, enumcreaturetype.a())) <= limit * i / 256) { - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); --- -2.18.0 - diff --git a/Spigot-Server-Patches/0092-Do-not-load-chunks-for-light-checks.patch b/Spigot-Server-Patches/0092-Do-not-load-chunks-for-light-checks.patch new file mode 100644 index 0000000000..7c19d5c08c --- /dev/null +++ b/Spigot-Server-Patches/0092-Do-not-load-chunks-for-light-checks.patch @@ -0,0 +1,23 @@ +From 7e7897a420565c84d951cc87d921a71b00d32f13 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 + +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 e88baae1d..e42a334bc 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -625,6 +625,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + if (blockposition.getY() >= 256) { + blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); + } ++ if (!this.isLoaded(blockposition)) return 0; // Paper + + return this.getChunkAtWorldCoords(blockposition).a(blockposition, i); + } +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0093-Add-PlayerUseUnknownEntityEvent.patch b/Spigot-Server-Patches/0093-Add-PlayerUseUnknownEntityEvent.patch new file mode 100644 index 0000000000..312ea229c9 --- /dev/null +++ b/Spigot-Server-Patches/0093-Add-PlayerUseUnknownEntityEvent.patch @@ -0,0 +1,43 @@ +From f2aa3681729af76cbf7d48b050d2b022dc103701 Mon Sep 17 00:00:00 2001 +From: Jedediah Smith +Date: Sat, 2 Apr 2016 05:09:16 -0400 +Subject: [PATCH] Add PlayerUseUnknownEntityEvent + + +diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +index 77440ac81..8711462e1 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java ++++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +@@ -5,7 +5,7 @@ import javax.annotation.Nullable; + + public class PacketPlayInUseEntity implements Packet { + +- private int a; ++ private int a; public int getEntityId() { return this.a; } // Paper - add accessor + private PacketPlayInUseEntity.EnumEntityUseAction action; + 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 2cc277e4f..553011d88 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -1888,6 +1888,16 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + } + } + } ++ // Paper start - fire event ++ else { ++ this.server.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerUseUnknownEntityEvent( ++ this.getPlayer(), ++ packetplayinuseentity.getEntityId(), ++ packetplayinuseentity.a() == PacketPlayInUseEntity.EnumEntityUseAction.ATTACK, ++ packetplayinuseentity.b() == EnumHand.MAIN_HAND ? EquipmentSlot.HAND : EquipmentSlot.OFF_HAND ++ )); ++ } ++ // Paper end + + } + +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0094-Fix-reducedDebugInfo-not-initialized-on-client.patch b/Spigot-Server-Patches/0094-Fix-reducedDebugInfo-not-initialized-on-client.patch new file mode 100644 index 0000000000..dcd74c9c43 --- /dev/null +++ b/Spigot-Server-Patches/0094-Fix-reducedDebugInfo-not-initialized-on-client.patch @@ -0,0 +1,21 @@ +From 52309a5ebc1db4b00122113b4a5323ecc1a2d51a Mon Sep 17 00:00:00 2001 +From: Jedediah Smith +Date: Sat, 2 Apr 2016 20:37:03 -0400 +Subject: [PATCH] Fix reducedDebugInfo not initialized on client + + +diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java +index 23cab725d..8e1edde31 100644 +--- a/src/main/java/net/minecraft/server/PlayerList.java ++++ b/src/main/java/net/minecraft/server/PlayerList.java +@@ -162,6 +162,7 @@ public abstract class PlayerList { + playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); + playerconnection.sendPacket(new PacketPlayOutRecipeUpdate(this.server.getCraftingManager().b())); + playerconnection.sendPacket(new PacketPlayOutTags(this.server.getTagRegistry())); ++ playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean("reducedDebugInfo") ? 22 : 23))); // Paper - fix this rule not being initialized on the client + this.f(entityplayer); + entityplayer.getStatisticManager().c(); + entityplayer.B().a(entityplayer); +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0095-Configurable-Grass-Spread-Tick-Rate.patch b/Spigot-Server-Patches/0095-Configurable-Grass-Spread-Tick-Rate.patch new file mode 100644 index 0000000000..7587147136 --- /dev/null +++ b/Spigot-Server-Patches/0095-Configurable-Grass-Spread-Tick-Rate.patch @@ -0,0 +1,36 @@ +From f7491b43e43d1a84ac5ba371a65c3e7d6d3fb3aa 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 17fb883f6..eb09be512 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -226,4 +226,10 @@ public class PaperWorldConfig { + private void useInhabitedTime() { + useInhabitedTime = getBoolean("use-chunk-inhabited-timer", true); + } ++ ++ public int grassUpdateRate = 1; ++ private void grassUpdateRate() { ++ grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate)); ++ log("Grass Spread Tick Rate: " + grassUpdateRate); ++ } + } +diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +index 6343fb1e0..903e8241b 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 { + } + + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) { ++ if (this instanceof BlockGrass && world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper + if (!world.isClientSide) { + if (!a((IWorldReader) world, blockposition)) { + // CraftBukkit start +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0096-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/0096-Configurable-Keep-Spawn-Loaded-range-per-world.patch new file mode 100644 index 0000000000..029d31dbb6 --- /dev/null +++ b/Spigot-Server-Patches/0096-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -0,0 +1,87 @@ +From c0013f59652a0a64e836a922863092944b8ef36f 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 + +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 eb09be512..6ac58e5ec 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -232,4 +232,10 @@ public class PaperWorldConfig { + grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate)); + log("Grass Spread Tick Rate: " + grassUpdateRate); + } ++ ++ public short keepLoadedRange; ++ private void keepLoadedRange() { ++ keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 8)) * 16); ++ log( "Keep Spawn Loaded Range: " + (keepLoadedRange/16)); ++ } + } +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 1027b0588..b7aa9e869 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -446,8 +446,11 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + ArrayList arraylist = Lists.newArrayList(); + Set set = Sets.newConcurrentHashSet(); + +- for (int i = -192; i <= 192 && this.isRunning(); i += 16) { +- for (int j = -192; j <= 192 && this.isRunning(); j += 16) { ++ // Paper start ++ short radius = worldserver.paperConfig.keepLoadedRange; ++ for (int i = -radius; i <= radius && this.isRunning(); i += 16) { ++ for (int j = -radius; j <= radius && this.isRunning(); j += 16) { ++ // Paper end + arraylist.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4)); + } + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index e42a334bc..d15afd595 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -2821,8 +2821,9 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + int k = i * 16 + 8 - blockposition.getX(); + int l = j * 16 + 8 - blockposition.getZ(); + boolean flag = true; ++ short keepLoadedRange = paperConfig.keepLoadedRange; // Paper + +- return k >= -128 && k <= 128 && l >= -128 && l <= 128 && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory' ++ 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) { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index f98f355dd..2bcd1c3ca 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -1007,7 +1007,7 @@ public final class CraftServer implements Server { + System.out.println("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")"); + + if (internal.getWorld().getKeepSpawnInMemory()) { +- short short1 = 196; ++ short short1 = internal.paperConfig.keepLoadedRange; // Paper + long i = System.currentTimeMillis(); + 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 4df849eef..9d88b9ddb 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -1305,8 +1305,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. +- for (int x = -12; x <= 12; x++) { +- for (int z = -12; z <= 12; z++) { ++ int radius = world.paperConfig.keepLoadedRange / 16; // Paper ++ for (int x = -radius; x <= radius; x++) { // Paper ++ for (int z = -radius; z <= radius; z++) { // Paper + if (keepLoaded) { + loadChunk(chunkCoordX + x, chunkCoordZ + z); + } else { +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0097-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/0097-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch new file mode 100644 index 0000000000..067a822224 --- /dev/null +++ b/Spigot-Server-Patches/0097-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -0,0 +1,21 @@ +From 3e8cb3c6253665e96ccc32e6c082951c56395c77 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 d15afd595..9fdedc2d7 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -540,6 +540,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + } + + public void applyPhysics(BlockPosition blockposition, Block block) { ++ if (captureBlockStates) { return; } // Paper - Cancel all physics during placement + this.a(blockposition.west(), block, blockposition); + this.a(blockposition.east(), block, blockposition); + this.a(blockposition.down(), block, blockposition); +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0098-Don-t-spam-reload-spawn-chunks-in-nether-end.patch b/Spigot-Server-Patches/0098-Don-t-spam-reload-spawn-chunks-in-nether-end.patch new file mode 100644 index 0000000000..bbe1311641 --- /dev/null +++ b/Spigot-Server-Patches/0098-Don-t-spam-reload-spawn-chunks-in-nether-end.patch @@ -0,0 +1,34 @@ +From 25f92cc47e0b7f71bd08f03787a8c1fcb353d536 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 9fdedc2d7..3bf2cb8d0 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -2817,6 +2817,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + return this.K; + } + ++ public boolean shouldStayLoaded(int i, int j) { return g(i, j); } // Paper - OBFHELPER + public boolean g(int i, int j) { + BlockPosition blockposition = this.getSpawn(); + int k = i * 16 + 8 - blockposition.getX(); +diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java +index 6b62235e5..26ef3a41f 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 + } + + protected abstract void m(); +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0099-Remove-Debug-checks-from-DataBits.patch b/Spigot-Server-Patches/0099-Remove-Debug-checks-from-DataBits.patch new file mode 100644 index 0000000000..e7f467a0bc --- /dev/null +++ b/Spigot-Server-Patches/0099-Remove-Debug-checks-from-DataBits.patch @@ -0,0 +1,46 @@ +From 774b04c0fba71b85a554183e04cc07cf47b0cfa1 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Tue, 5 Apr 2016 21:38:58 -0400 +Subject: [PATCH] Remove Debug checks from DataBits + +These are super hot and causing noticeable hits + +Before: http://i.imgur.com/nQsMzAE.png +After: http://i.imgur.com/nJ46crB.png + +diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java +index d24ec3d53..0fb3162e6 100644 +--- a/src/main/java/net/minecraft/server/DataBits.java ++++ b/src/main/java/net/minecraft/server/DataBits.java +@@ -14,7 +14,7 @@ public class DataBits { + } + + public DataBits(int i, int j, long[] along) { +- Validate.inclusiveBetween(1L, 32L, (long) i); ++ //Validate.inclusiveBetween(1L, 32L, (long) i); // Paper + this.d = j; + this.b = i; + this.a = along; +@@ -27,8 +27,8 @@ public class DataBits { + } + + public void a(int i, int j) { +- Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); +- Validate.inclusiveBetween(0L, this.c, (long) j); ++ //Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); // Paper ++ //Validate.inclusiveBetween(0L, this.c, (long) j); // Paper + int k = i * this.b; + int l = k / 64; + int i1 = ((i + 1) * this.b - 1) / 64; +@@ -45,7 +45,7 @@ public class DataBits { + } + + public int a(int i) { +- Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); ++ //Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); // Paper + int j = i * this.b; + int k = j / 64; + int l = ((i + 1) * this.b - 1) / 64; +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0100-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/Spigot-Server-Patches/0100-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch new file mode 100644 index 0000000000..b749354650 --- /dev/null +++ b/Spigot-Server-Patches/0100-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -0,0 +1,55 @@ +From d8dc035a4c4013dbfc42842f5233022488a2649c 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 6ac58e5ec..ff9929a05 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -238,4 +238,9 @@ public class PaperWorldConfig { + keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 8)) * 16); + log( "Keep Spawn Loaded Range: " + (keepLoadedRange/16)); + } ++ ++ public boolean useVanillaScoreboardColoring; ++ private void useVanillaScoreboardColoring() { ++ useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false); ++ } + } +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index c37c46e71..fecf29710 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -2251,6 +2251,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + return this.getFlag(5); + } + ++ @Nullable public ScoreboardTeamBase getTeam() { return this.aY(); } // Paper - OBFHELPER + @Nullable + public ScoreboardTeamBase be() { + if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 553011d88..d61ce6461 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -1622,7 +1622,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + return; + } + +- s = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage()); ++ // Paper Start - (Meh) Support for vanilla world scoreboard name coloring ++ String displayName = event.getPlayer().getDisplayName(); ++ if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) { ++ displayName = ScoreboardTeam.getPlayerDisplayName(this.player.getTeam(), player.getDisplayName()); ++ } ++ ++ s = String.format(event.getFormat(), displayName, event.getMessage()); ++ // Paper end + minecraftServer.console.sendMessage(s); + if (((LazyPlayerSet) event.getRecipients()).isLazy()) { + for (Object recipient : minecraftServer.getPlayerList().players) { +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0101-Workaround-for-setting-passengers-on-players.patch b/Spigot-Server-Patches/0101-Workaround-for-setting-passengers-on-players.patch new file mode 100644 index 0000000000..f43a4601fb --- /dev/null +++ b/Spigot-Server-Patches/0101-Workaround-for-setting-passengers-on-players.patch @@ -0,0 +1,32 @@ +From eec3163a764f422f16126cfdfe4118005448d36b 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 + +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 e71fc971d..3871f3100 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -671,6 +671,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + return true; + } + ++ // Paper start - Ugly workaround for SPIGOT-1915 & GH-114 ++ @Override ++ public boolean setPassenger(org.bukkit.entity.Entity passenger) { ++ boolean wasSet = super.setPassenger(passenger); ++ if (wasSet) { ++ this.getHandle().playerConnection.sendPacket(new net.minecraft.server.PacketPlayOutMount(this.getHandle())); ++ } ++ return wasSet; ++ } ++ // Paper end ++ + @Override + public void setSneaking(boolean sneak) { + getHandle().setSneaking(sneak); +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0102-Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/0102-Remove-unused-World-Tile-Entity-List.patch new file mode 100644 index 0000000000..f51f08b416 --- /dev/null +++ b/Spigot-Server-Patches/0102-Remove-unused-World-Tile-Entity-List.patch @@ -0,0 +1,71 @@ +From 3e338b0485e7e2979327199b68dfa566eb12a64b 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 + +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 3bf2cb8d0..3b3cc69de 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 + }; + // Spigot end + protected final Set g = 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 +@@ -1270,7 +1270,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + timings.tileEntityTick.startTiming(); // Spigot + if (!this.tileEntityListUnload.isEmpty()) { + this.tileEntityListTick.removeAll(this.tileEntityListUnload); +- this.tileEntityList.removeAll(this.tileEntityListUnload); ++ //this.tileEntityList.removeAll(this.tileEntityListUnload); // Paper - remove unused list + this.tileEntityListUnload.clear(); + } + +@@ -1323,7 +1323,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + if (tileentity.x()) { + tilesThisCycle--; + this.tileEntityListTick.remove(tileTickPosition--); +- this.tileEntityList.remove(tileentity); ++ //this.tileEntityList.remove(tileentity); // Paper - remove unused list + if (this.isLoaded(tileentity.getPosition())) { + this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition()); + } +@@ -1353,7 +1353,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); + // CraftBukkit start + // From above, don't screw this up - SPIGOT-1746 +- if (!this.tileEntityList.contains(tileentity1)) { ++ if (true) { // Paper - remove unused list + this.a(tileentity1); + } + // CraftBukkit end +@@ -1373,9 +1373,9 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + protected void p_() {} + + public boolean a(TileEntity tileentity) { +- boolean flag = this.tileEntityList.add(tileentity); ++ boolean flag = true; // Paper - remove unused list + +- if (flag && tileentity instanceof ITickable) { ++ if (flag && tileentity instanceof ITickable && !this.tileEntityListTick.contains(tileentity)) { // Paper + this.tileEntityListTick.add(tileentity); + } + +@@ -1852,7 +1852,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + } else { + if (tileentity != null) { + this.c.remove(tileentity); +- this.tileEntityList.remove(tileentity); ++ //this.tileEntityList.remove(tileentity); // Paper - remove unused list + this.tileEntityListTick.remove(tileentity); + } + +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0103-Don-t-tick-Skulls-unused-code.patch b/Spigot-Server-Patches/0103-Don-t-tick-Skulls-unused-code.patch new file mode 100644 index 0000000000..e61c3c7c31 --- /dev/null +++ b/Spigot-Server-Patches/0103-Don-t-tick-Skulls-unused-code.patch @@ -0,0 +1,22 @@ +From 2656f524d7bc6d8a806dce43790024bceba5d288 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 13 Apr 2016 00:30:10 -0400 +Subject: [PATCH] Don't tick Skulls - unused code + + +diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java +index db4967f24..804236547 100644 +--- a/src/main/java/net/minecraft/server/TileEntitySkull.java ++++ b/src/main/java/net/minecraft/server/TileEntitySkull.java +@@ -24,7 +24,7 @@ import com.mojang.authlib.ProfileLookupCallback; + import java.util.concurrent.Callable; + // Spigot end + +-public class TileEntitySkull extends TileEntity implements ITickable { ++public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Paper - remove tickable + + private GameProfile a; + private int e; +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0104-Configurable-Player-Collision.patch b/Spigot-Server-Patches/0104-Configurable-Player-Collision.patch new file mode 100644 index 0000000000..e09396ebb8 --- /dev/null +++ b/Spigot-Server-Patches/0104-Configurable-Player-Collision.patch @@ -0,0 +1,118 @@ +From f5f4102b6341f818aef3ccb79a0edc839174a2b8 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 13 Apr 2016 02:10:49 -0400 +Subject: [PATCH] Configurable Player Collision + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index ec4643384..430b5d0cd 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -220,4 +220,9 @@ public class PaperConfig { + private static void regionFileCacheSize() { + regionFileCacheSize = getInt("settings.region-file-cache-size", 256); + } ++ ++ public static boolean enablePlayerCollisions = true; ++ private static void enablePlayerCollisions() { ++ enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true); ++ } + } +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index b7aa9e869..c5670fe8d 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -379,6 +379,20 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + + 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()); ++ for (String teamName : toRemove) { ++ scoreboard.removeTeam(scoreboard.getTeam(teamName)); // Clean up after ourselves ++ } ++ ++ if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) { ++ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + worlds.get(0).random.nextInt(), 16); ++ ScoreboardTeam collideTeam = scoreboard.createTeam(this.getPlayerList().collideRuleTeamName); ++ collideTeam.setCanSeeFriendlyInvisibles(false); // Because we want to mimic them not being on a team at all ++ } ++ // Paper end + } + + protected void a(File file, WorldData worlddata) { +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +index 5f54e7b9c..759288b97 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +@@ -94,7 +94,7 @@ public class PacketPlayOutScoreboardTeam implements Packet playersByName = new org.spigotmc.CaseInsensitiveMap(); ++ @Nullable String collideRuleTeamName; // Paper - Team name used for collideRule + + public PlayerList(MinecraftServer minecraftserver) { + this.cserver = minecraftserver.server = new CraftServer(minecraftserver, this); +@@ -231,6 +232,12 @@ public abstract class PlayerList { + } + + entityplayer.syncInventory(); ++ // Paper start - Add to collideRule team if needed ++ final Scoreboard scoreboard = this.getServer().getWorld().getScoreboard(); ++ if (this.collideRuleTeamName != null && scoreboard.getTeam(collideRuleTeamName) != null && entityplayer.getTeam() == null) { ++ scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeamName); ++ } ++ // Paper end + // CraftBukkit - Moved from above, added world + PlayerList.f.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", entityplayer.getDisplayName().getString(), s1, Integer.valueOf(entityplayer.getId()), entityplayer.world.worldData.getName(), Double.valueOf(entityplayer.locX), Double.valueOf(entityplayer.locY), Double.valueOf(entityplayer.locZ)); + } +@@ -423,6 +430,16 @@ public abstract class PlayerList { + entityplayer.playerTick();// SPIGOT-924 + // CraftBukkit end + ++ // Paper start - Remove from collideRule team if needed ++ if (this.collideRuleTeamName != null) { ++ final Scoreboard scoreBoard = this.server.getWorld().getScoreboard(); ++ final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName); ++ if (entityplayer.getTeam() == team && team != null) { ++ scoreBoard.removePlayerFromTeam(entityplayer.getName(), team); ++ } ++ } ++ // Paper end ++ + this.savePlayerFile(entityplayer); + if (entityplayer.isPassenger()) { + Entity entity = entityplayer.getRootVehicle(); +@@ -1318,7 +1335,13 @@ public abstract class PlayerList { + player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message + } + // CraftBukkit end +- ++ // Paper start - Remove collideRule team if it exists ++ if (this.collideRuleTeamName != null) { ++ final Scoreboard scoreboard = this.getServer().getWorld().getScoreboard(); ++ final ScoreboardTeam team = scoreboard.getTeam(this.collideRuleTeamName); ++ if (team != null) scoreboard.removeTeam(team); ++ } ++ // Paper end + } + + // CraftBukkit start +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0105-Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-Server-Patches/0105-Add-handshake-event-to-allow-plugins-to-handle-clien.patch new file mode 100644 index 0000000000..1feddd68ff --- /dev/null +++ b/Spigot-Server-Patches/0105-Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -0,0 +1,49 @@ +From 0f9759f4dd921364dd71b1a71c813e2d22176add Mon Sep 17 00:00:00 2001 +From: kashike +Date: Wed, 13 Apr 2016 20:21:38 -0700 +Subject: [PATCH] Add handshake event to allow plugins to handle client + handshaking logic themselves + + +diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java +index 7c75433f5..088ec198e 100644 +--- a/src/main/java/net/minecraft/server/HandshakeListener.java ++++ b/src/main/java/net/minecraft/server/HandshakeListener.java +@@ -72,8 +72,33 @@ public class HandshakeListener implements PacketHandshakingInListener { + this.b.close(chatmessage); + } else { + this.b.setPacketListener(new LoginListener(this.a, this.b)); ++ // Paper start - handshake event ++ boolean proxyLogicEnabled = org.spigotmc.SpigotConfig.bungee; ++ boolean handledByEvent = false; ++ // Try and handle the handshake through the event ++ if (com.destroystokyo.paper.event.player.PlayerHandshakeEvent.getHandlerList().getRegisteredListeners().length != 0) { // Hello? Can you hear me? ++ com.destroystokyo.paper.event.player.PlayerHandshakeEvent event = new com.destroystokyo.paper.event.player.PlayerHandshakeEvent(packethandshakinginsetprotocol.hostname, !proxyLogicEnabled); ++ if (event.callEvent()) { ++ // If we've failed somehow, let the client know so and go no further. ++ if (event.isFailed()) { ++ chatmessage = new ChatMessage(event.getFailMessage()); ++ this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage)); ++ this.b.close(chatmessage); ++ return; ++ } ++ ++ packethandshakinginsetprotocol.hostname = event.getServerHostname(); ++ this.b.l = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort()); ++ this.b.spoofedUUID = event.getUniqueId(); ++ this.b.spoofedProfile = gson.fromJson(event.getPropertiesJson(), com.mojang.authlib.properties.Property[].class); ++ handledByEvent = true; // Hooray, we did it! ++ } ++ } ++ // Don't try and handle default logic if it's been handled by the event. ++ if (!handledByEvent && proxyLogicEnabled) { ++ // Paper end + // Spigot Start +- if (org.spigotmc.SpigotConfig.bungee) { ++ //if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! + String[] split = packethandshakinginsetprotocol.hostname.split("\00"); + if ( split.length == 3 || split.length == 4 ) { + packethandshakinginsetprotocol.hostname = split[0]; +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0106-Configurable-RCON-IP-address.patch b/Spigot-Server-Patches/0106-Configurable-RCON-IP-address.patch new file mode 100644 index 0000000000..75f4f37661 --- /dev/null +++ b/Spigot-Server-Patches/0106-Configurable-RCON-IP-address.patch @@ -0,0 +1,23 @@ +From 8f40f7624b7a906dc0d09295b88bada5f0f97aa4 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sat, 16 Apr 2016 00:39:33 -0400 +Subject: [PATCH] Configurable RCON IP address + +For servers with multiple IP's, ability to bind to a specific interface. + +diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java +index 6f0176f6f..1e5caa13a 100644 +--- a/src/main/java/net/minecraft/server/RemoteControlListener.java ++++ b/src/main/java/net/minecraft/server/RemoteControlListener.java +@@ -24,7 +24,7 @@ public class RemoteControlListener extends RemoteConnectionThread { + super(iminecraftserver, "RCON Listener"); + this.h = iminecraftserver.a("rcon.port", 0); + this.l = iminecraftserver.a("rcon.password", ""); +- this.j = iminecraftserver.e(); ++ this.j = iminecraftserver.a("rcon.ip", iminecraftserver.d_()); // Paper + this.i = iminecraftserver.f(); + if (0 == this.h) { + this.h = this.i + 10; +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0107-Prevent-Fire-from-loading-chunks.patch b/Spigot-Server-Patches/0107-Prevent-Fire-from-loading-chunks.patch new file mode 100644 index 0000000000..918b6ec702 --- /dev/null +++ b/Spigot-Server-Patches/0107-Prevent-Fire-from-loading-chunks.patch @@ -0,0 +1,53 @@ +From 0b5b0ef90ca93ca68ab9de1e93ece64799f32d4e Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 17 Apr 2016 17:27:09 -0400 +Subject: [PATCH] Prevent Fire from loading chunks + +This causes the nether to spam unload/reload chunks, plus overall +bad behavior. + +diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java +index b6caf4c8a..f3a278c0b 100644 +--- a/src/main/java/net/minecraft/server/BlockFire.java ++++ b/src/main/java/net/minecraft/server/BlockFire.java +@@ -162,6 +162,7 @@ public class BlockFire extends Block { + } + + blockposition_mutableblockposition.g(blockposition).d(l, j1, i1); ++ if (!world.isLoaded(blockposition_mutableblockposition)) continue; // Paper + int l1 = this.a((IWorldReader) world, (BlockPosition) blockposition_mutableblockposition); + + if (l1 > 0) { +@@ -207,10 +208,14 @@ public class BlockFire extends Block { + } + + private void a(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition +- int k = this.f(world.getType(blockposition).getBlock()); ++ // Paper start ++ final IBlockData iblockdata = world.getTypeIfLoaded(blockposition); ++ if (iblockdata == null) return; ++ int k = this.f(iblockdata.getBlock()); ++ // Paper end + + if (random.nextInt(i) < k) { +- IBlockData iblockdata = world.getType(blockposition); ++ //IBlockData iblockdata = world.getType(blockposition); // Paper + + // CraftBukkit start + org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); +@@ -267,7 +272,11 @@ public class BlockFire extends Block { + for (int k = 0; k < j; ++k) { + EnumDirection enumdirection = aenumdirection[k]; + +- i = Math.max(this.g(iworldreader.getType(blockposition.shift(enumdirection)).getBlock()), i); ++ // Paper start ++ final IBlockData type = ((World)iworldreader).getTypeIfLoaded(blockposition.shift(enumdirection)); ++ if (type == null) continue; ++ i = Math.max(this.g(type.getBlock()), i); ++ // Paper end + } + + return i; +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0108-Implement-PlayerLocaleChangeEvent.patch b/Spigot-Server-Patches/0108-Implement-PlayerLocaleChangeEvent.patch new file mode 100644 index 0000000000..78e0a46d83 --- /dev/null +++ b/Spigot-Server-Patches/0108-Implement-PlayerLocaleChangeEvent.patch @@ -0,0 +1,69 @@ +From 7c0d5e351e70cae45275be880bb19b15859894fe 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 5ca0dec1f..8b5cfc78a 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 { + + 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; +@@ -1228,12 +1228,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.a())) { ++ if (this.locale == null || !this.locale.equals(packetplayinsettings.b())) { // Paper - fix bug and check for null + PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(getBukkitEntity(), packetplayinsettings.b()); + this.server.server.getPluginManager().callEvent(event); + } + // CraftBukkit end ++ // Paper start - add PlayerLocaleChangeEvent ++ // Since the field is initialized to null, this event should always fire the first time the packet is received ++ String oldLocale = this.locale; + this.locale = packetplayinsettings.b(); ++ if (!this.locale.equals(oldLocale)) { ++ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent(); ++ } ++ // Paper end + this.ct = packetplayinsettings.d(); + this.cu = 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 3871f3100..7d4355439 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -1683,8 +1683,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + @Override + public String getLocale() { +- return getHandle().locale; +- ++ // Paper start - Locale change event ++ final String locale = getHandle().locale; ++ return locale != null ? locale : "en_us"; ++ // Paper end + } + + // Paper start +@@ -1766,7 +1768,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + @Override + public String getLocale() + { +- return getHandle().locale; ++ return CraftPlayer.this.getLocale(); // Paper + } + + @Override +-- +2.18.0 + diff --git a/Spigot-Server-Patches/0109-EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-Server-Patches/0109-EntityRegainHealthEvent-isFastRegen-API.patch new file mode 100644 index 0000000000..2483b052db --- /dev/null +++ b/Spigot-Server-Patches/0109-EntityRegainHealthEvent-isFastRegen-API.patch @@ -0,0 +1,45 @@ +From 618b1abbe1fcbc0eb1277dcaae3fe013f7934b3d Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Fri, 22 Apr 2016 01:43:11 -0500 +Subject: [PATCH] EntityRegainHealthEvent isFastRegen API + +Don't even get me started + +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index acf0e0281..b12c9e461 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -795,10 +795,16 @@ public abstract class EntityLiving extends Entity { + } + + public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) { ++ // Paper start - Forward ++ heal(f, regainReason, false); ++ } ++ ++ public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason, boolean isFastRegen) { ++ // Paper end + float f1 = this.getHealth(); + + if (f1 > 0.0F) { +- EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason); ++ EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason, isFastRegen); // Paper - Add isFastRegen + this.world.getServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { +diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java +index bbcc488bd..d886e476b 100644 +--- a/src/main/java/net/minecraft/server/FoodMetaData.java ++++ b/src/main/java/net/minecraft/server/FoodMetaData.java +@@ -65,7 +65,7 @@ public class FoodMetaData { + if (this.foodTickTimer >= 10) { + float f = Math.min(this.saturationLevel, 6.0F); + +- entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason ++ entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen + this.a(f); + this.foodTickTimer = 0; + } +-- +2.18.0 + diff --git a/pre/Bukkit-Patches/0001-POM-Changes.patch b/pre/Bukkit-Patches/0001-POM-Changes.patch deleted file mode 100644 index 6dbce87e7f..0000000000 --- a/pre/Bukkit-Patches/0001-POM-Changes.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f87ae06596749c3e2e83df6d20b0e84a422e361f Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sun, 2 Jun 2013 10:36:24 +1000 -Subject: [PATCH] POM Changes - - -diff --git a/pom.xml b/pom.xml -index 2ed1e4de..88b109e0 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -3,14 +3,14 @@ - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 4.0.0 - -- org.bukkit -- bukkit -+ org.spigotmc -+ spigot-api - 1.13-pre5-R0.1-SNAPSHOT - jar - -- Bukkit -+ Spigot-API - https://www.spigotmc.org/ -- A plugin API for Minecraft servers. -+ An enhanced plugin API for Minecraft servers. - - - 1.8 --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0002-Skeleton-API-Implementations.patch b/pre/Bukkit-Patches/0002-Skeleton-API-Implementations.patch deleted file mode 100644 index 3102a4fcae..0000000000 --- a/pre/Bukkit-Patches/0002-Skeleton-API-Implementations.patch +++ /dev/null @@ -1,189 +0,0 @@ -From 4f1fccef7b07f362222a90594bfeb59a4ab77232 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Mon, 15 May 2017 15:16:15 +1000 -Subject: [PATCH] Skeleton API Implementations - - -diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index a3eafe70..3ffce71b 100644 ---- a/src/main/java/org/bukkit/Bukkit.java -+++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1235,4 +1235,9 @@ public final class Bukkit { - public static UnsafeValues getUnsafe() { - return server.getUnsafe(); - } -+ -+ public static Server.Spigot spigot() -+ { -+ return server.spigot(); -+ } - } -diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index dc2e1018..61d8077a 100644 ---- a/src/main/java/org/bukkit/Server.java -+++ b/src/main/java/org/bukkit/Server.java -@@ -1013,4 +1013,13 @@ public interface Server extends PluginMessageRecipient { - */ - @Deprecated - UnsafeValues getUnsafe(); -+ -+ // Spigot start -+ public class Spigot -+ { -+ -+ } -+ -+ Spigot spigot(); -+ // Spigot end - } -diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 4883d182..ab6b1e3a 100644 ---- a/src/main/java/org/bukkit/World.java -+++ b/src/main/java/org/bukkit/World.java -@@ -1428,6 +1428,14 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); - -+ // Spigot start -+ public class Spigot -+ { -+ -+ } -+ -+ Spigot spigot(); -+ // Spigot end - - /** - * Represents various map environment types that a world may be -diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java -index 148756b9..5dcd2218 100644 ---- a/src/main/java/org/bukkit/command/CommandSender.java -+++ b/src/main/java/org/bukkit/command/CommandSender.java -@@ -32,4 +32,13 @@ public interface CommandSender extends Permissible { - * @return Name of the sender - */ - public String getName(); -+ -+ // Spigot start -+ public class Spigot -+ { -+ -+ } -+ -+ Spigot spigot(); -+ // Spigot end - } -diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java -index 752eeb5e..c77f3a4f 100644 ---- a/src/main/java/org/bukkit/entity/Arrow.java -+++ b/src/main/java/org/bukkit/entity/Arrow.java -@@ -89,4 +89,14 @@ public interface Arrow extends Projectile { - */ - CREATIVE_ONLY - } -+ -+ // Spigot start -+ public class Spigot extends Entity.Spigot -+ { -+ -+ } -+ -+ @Override -+ Spigot spigot(); -+ // Spigot end - } -diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 9d96976d..294eb7f7 100644 ---- a/src/main/java/org/bukkit/entity/Entity.java -+++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -478,4 +478,14 @@ public interface Entity extends Metadatable, CommandSender, Nameable { - * @return reaction - */ - PistonMoveReaction getPistonMoveReaction(); -+ -+ // Spigot start -+ public class Spigot extends CommandSender.Spigot -+ { -+ -+ } -+ -+ @Override -+ Spigot spigot(); -+ // Spigot end - } -diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java -index c8b5154e..ee2218c1 100644 ---- a/src/main/java/org/bukkit/entity/LightningStrike.java -+++ b/src/main/java/org/bukkit/entity/LightningStrike.java -@@ -12,4 +12,13 @@ public interface LightningStrike extends Weather { - */ - public boolean isEffect(); - -+ // Spigot start -+ public class Spigot extends Entity.Spigot -+ { -+ -+ } -+ -+ @Override -+ Spigot spigot(); -+ // Spigot end - } -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index b862d7b6..92825490 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1437,4 +1437,14 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline - * @return the player's locale - */ - public String getLocale(); -+ -+ // Spigot start -+ public class Spigot extends Entity.Spigot -+ { -+ -+ } -+ -+ @Override -+ Spigot spigot(); -+ // Spigot end - } -diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java -index d66e3f59..3b6bf419 100644 ---- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java -+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java -@@ -173,4 +173,13 @@ public interface BookMeta extends ItemMeta { - int getPageCount(); - - BookMeta clone(); -+ -+ // Spigot start -+ public class Spigot extends ItemMeta.Spigot { -+ -+ } -+ -+ @Override -+ Spigot spigot(); -+ // Spigot end - } -diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index 76d43266..e48616d2 100644 ---- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -@@ -196,4 +196,13 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { - - @SuppressWarnings("javadoc") - ItemMeta clone(); -+ -+ // Spigot start -+ public class Spigot -+ { -+ -+ } -+ -+ Spigot spigot(); -+ // Spigot end - } --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0003-Spigot-Timings.patch b/pre/Bukkit-Patches/0003-Spigot-Timings.patch deleted file mode 100644 index 49e20bd4a8..0000000000 --- a/pre/Bukkit-Patches/0003-Spigot-Timings.patch +++ /dev/null @@ -1,485 +0,0 @@ -From 0047a4cf6d2c557a6e2624bf082a4c5010b6eaf0 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sun, 2 Jun 2013 10:42:57 +1000 -Subject: [PATCH] Spigot Timings - -Adds performance tracking timings all around the Minecraft Server, and improves the usability of the /timings command - -Plugins can track their own timings with CustomTimingsHandler - -diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 3ffce71b..27c69e96 100644 ---- a/src/main/java/org/bukkit/Bukkit.java -+++ b/src/main/java/org/bukkit/Bukkit.java -@@ -534,6 +534,7 @@ public final class Bukkit { - */ - public static void reload() { - server.reload(); -+ org.spigotmc.CustomTimingsHandler.reload(); // Spigot - } - - /** -diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 61d8077a..c9ef86e4 100644 ---- a/src/main/java/org/bukkit/Server.java -+++ b/src/main/java/org/bukkit/Server.java -@@ -1018,6 +1018,10 @@ public interface Server extends PluginMessageRecipient { - public class Spigot - { - -+ public org.bukkit.configuration.file.YamlConfiguration getConfig() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - Spigot spigot(); -diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java -index d00bad28..7ca5be84 100644 ---- a/src/main/java/org/bukkit/command/Command.java -+++ b/src/main/java/org/bukkit/command/Command.java -@@ -32,6 +32,7 @@ public abstract class Command { - protected String usageMessage; - private String permission; - private String permissionMessage; -+ public org.spigotmc.CustomTimingsHandler timings; // Spigot - - protected Command(String name) { - this(name, "", "/" + name, new ArrayList()); -@@ -45,6 +46,7 @@ public abstract class Command { - this.usageMessage = usageMessage; - this.aliases = aliases; - this.activeAliases = new ArrayList(aliases); -+ this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot - } - - /** -@@ -233,6 +235,7 @@ public abstract class Command { - public boolean setLabel(String name) { - this.nextLabel = name; - if (!isRegistered()) { -+ this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot - this.label = name; - return true; - } -diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index f81ae85d..1b5b37bf 100644 ---- a/src/main/java/org/bukkit/command/SimpleCommandMap.java -+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java -@@ -136,11 +136,15 @@ public class SimpleCommandMap implements CommandMap { - } - - try { -+ target.timings.startTiming(); // Spigot - // Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false) - target.execute(sender, sentCommandLabel, Arrays.copyOfRange(args, 1, args.length)); -+ target.timings.stopTiming(); // Spigot - } catch (CommandException ex) { -+ target.timings.stopTiming(); // Spigot - throw ex; - } catch (Throwable ex) { -+ target.timings.stopTiming(); // Spigot - throw new CommandException("Unhandled exception executing '" + commandLine + "' in " + target, ex); - } - -diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java -index 66ea6345..bba914d7 100644 ---- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java -+++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java -@@ -19,23 +19,101 @@ import org.bukkit.util.StringUtil; - - import com.google.common.collect.ImmutableList; - -+// Spigot start -+import java.io.ByteArrayOutputStream; -+import java.io.OutputStream; -+import java.net.HttpURLConnection; -+import java.net.URL; -+import java.net.URLEncoder; -+import java.util.logging.Level; -+ -+import org.bukkit.command.RemoteConsoleCommandSender; -+import org.bukkit.plugin.SimplePluginManager; -+import org.spigotmc.CustomTimingsHandler; -+// Spigot end -+ - public class TimingsCommand extends BukkitCommand { -- private static final List TIMINGS_SUBCOMMANDS = ImmutableList.of("merged", "reset", "separate"); -+ private static final List TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste"); // Spigot -+ public static long timingStart = 0; // Spigot - - public TimingsCommand(String name) { - super(name); -- this.description = "Records timings for all plugin events"; -- this.usageMessage = "/timings "; -+ this.description = "Manages Spigot Timings data to see performance of the server."; // Spigot -+ this.usageMessage = "/timings "; // Spigot - this.setPermission("bukkit.command.timings"); - } - -+ // Spigot start - redesigned Timings Command -+ public void executeSpigotTimings(CommandSender sender, String[] args) { -+ if ( "on".equals( args[0] ) ) -+ { -+ ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( true ); -+ CustomTimingsHandler.reload(); -+ sender.sendMessage( "Enabled Timings & Reset" ); -+ return; -+ } else if ( "off".equals( args[0] ) ) -+ { -+ ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( false ); -+ sender.sendMessage( "Disabled Timings" ); -+ return; -+ } -+ -+ if ( !Bukkit.getPluginManager().useTimings() ) -+ { -+ sender.sendMessage( "Please enable timings by typing /timings on" ); -+ return; -+ } -+ -+ boolean paste = "paste".equals( args[0] ); -+ if ("reset".equals(args[0])) { -+ CustomTimingsHandler.reload(); -+ sender.sendMessage("Timings reset"); -+ } else if ("merged".equals(args[0]) || "report".equals(args[0]) || paste) { -+ long sampleTime = System.nanoTime() - timingStart; -+ int index = 0; -+ File timingFolder = new File("timings"); -+ timingFolder.mkdirs(); -+ File timings = new File(timingFolder, "timings.txt"); -+ ByteArrayOutputStream bout = ( paste ) ? new ByteArrayOutputStream() : null; -+ while (timings.exists()) timings = new File(timingFolder, "timings" + (++index) + ".txt"); -+ PrintStream fileTimings = null; -+ try { -+ fileTimings = ( paste ) ? new PrintStream( bout ) : new PrintStream( timings ); -+ -+ CustomTimingsHandler.printTimings(fileTimings); -+ fileTimings.println( "Sample time " + sampleTime + " (" + sampleTime / 1E9 + "s)" ); -+ -+ fileTimings.println( "" ); -+ fileTimings.println( Bukkit.spigot().getConfig().saveToString() ); -+ fileTimings.println( "" ); -+ -+ if ( paste ) -+ { -+ new PasteThread( sender, bout ).start(); -+ return; -+ } -+ -+ sender.sendMessage("Timings written to " + timings.getPath()); -+ sender.sendMessage( "Paste contents of file into form at http://www.spigotmc.org/go/timings to read results." ); -+ -+ } catch (IOException e) { -+ } finally { -+ if (fileTimings != null) { -+ fileTimings.close(); -+ } -+ } -+ } -+ } -+ // Spigot end -+ - @Override - public boolean execute(CommandSender sender, String currentAlias, String[] args) { - if (!testPermission(sender)) return true; -- if (args.length != 1) { -+ if (args.length < 1) { // Spigot - sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); - return false; - } -+ if (true) { executeSpigotTimings(sender, args); return true; } // Spigot - if (!sender.getServer().getPluginManager().useTimings()) { - sender.sendMessage("Please enable timings by setting \"settings.plugin-profiling\" to true in bukkit.yml"); - return true; -@@ -121,4 +199,55 @@ public class TimingsCommand extends BukkitCommand { - } - return ImmutableList.of(); - } -+ -+ // Spigot start -+ private static class PasteThread extends Thread -+ { -+ -+ private final CommandSender sender; -+ private final ByteArrayOutputStream bout; -+ -+ public PasteThread(CommandSender sender, ByteArrayOutputStream bout) -+ { -+ super( "Timings paste thread" ); -+ this.sender = sender; -+ this.bout = bout; -+ } -+ -+ @Override -+ public synchronized void start() { -+ if (sender instanceof RemoteConsoleCommandSender) { -+ run(); -+ } else { -+ super.start(); -+ } -+ } -+ -+ @Override -+ public void run() -+ { -+ try -+ { -+ HttpURLConnection con = (HttpURLConnection) new URL( "https://timings.spigotmc.org/paste" ).openConnection(); -+ con.setDoOutput( true ); -+ con.setRequestMethod( "POST" ); -+ con.setInstanceFollowRedirects( false ); -+ -+ OutputStream out = con.getOutputStream(); -+ out.write( bout.toByteArray() ); -+ out.close(); -+ -+ com.google.gson.JsonObject location = new com.google.gson.Gson().fromJson(new java.io.InputStreamReader(con.getInputStream()), com.google.gson.JsonObject.class); -+ con.getInputStream().close(); -+ -+ String pasteID = location.get( "key" ).getAsString(); -+ sender.sendMessage( ChatColor.GREEN + "Timings results can be viewed at https://www.spigotmc.org/go/timings?url=" + pasteID ); -+ } catch ( IOException ex ) -+ { -+ sender.sendMessage( ChatColor.RED + "Error pasting timings, check your console for more information" ); -+ Bukkit.getServer().getLogger().log( Level.WARNING, "Could not paste timings", ex ); -+ } -+ } -+ } -+ // Spigot end - } -diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 60b23995..8b130abb 100644 ---- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java -+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -@@ -293,6 +293,7 @@ public final class SimplePluginManager implements PluginManager { - } - } - -+ org.bukkit.command.defaults.TimingsCommand.timingStart = System.nanoTime(); // Spigot - return result.toArray(new Plugin[result.size()]); - } - -diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index df613b0c..73372534 100644 ---- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -40,6 +40,7 @@ import org.bukkit.plugin.PluginLoader; - import org.bukkit.plugin.RegisteredListener; - import org.bukkit.plugin.TimedRegisteredListener; - import org.bukkit.plugin.UnknownDependencyException; -+import org.spigotmc.CustomTimingsHandler; // Spigot - import org.yaml.snakeyaml.error.YAMLException; - - /** -@@ -50,6 +51,7 @@ public final class JavaPluginLoader implements PluginLoader { - private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), }; - private final Map> classes = new HashMap>(); - private final List loaders = new CopyOnWriteArrayList(); -+ public static final CustomTimingsHandler pluginParentTimer = new CustomTimingsHandler("** Plugins"); // Spigot - - /** - * This class was not meant to be constructed explicitly -@@ -287,13 +289,19 @@ public final class JavaPluginLoader implements PluginLoader { - } - } - -+ final CustomTimingsHandler timings = new CustomTimingsHandler("Plugin: " + plugin.getDescription().getFullName() + " Event: " + listener.getClass().getName() + "::" + method.getName()+"("+eventClass.getSimpleName()+")", pluginParentTimer); // Spigot - EventExecutor executor = new EventExecutor() { - public void execute(Listener listener, Event event) throws EventException { - try { - if (!eventClass.isAssignableFrom(event.getClass())) { - return; - } -+ // Spigot start -+ boolean isAsync = event.isAsynchronous(); -+ if (!isAsync) timings.startTiming(); - method.invoke(listener, event); -+ if (!isAsync) timings.stopTiming(); -+ // Spigot end - } catch (InvocationTargetException ex) { - throw new EventException(ex.getCause()); - } catch (Throwable t) { -@@ -301,7 +309,7 @@ public final class JavaPluginLoader implements PluginLoader { - } - } - }; -- if (useTimings) { -+ if (false) { // Spigot - RL handles useTimings check now - eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); - } else { - eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); -diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java -new file mode 100644 -index 00000000..8d982974 ---- /dev/null -+++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java -@@ -0,0 +1,165 @@ -+package org.spigotmc; -+ -+import org.bukkit.command.defaults.TimingsCommand; -+import org.bukkit.event.HandlerList; -+import org.bukkit.plugin.Plugin; -+import org.bukkit.plugin.RegisteredListener; -+import org.bukkit.plugin.TimedRegisteredListener; -+import java.io.PrintStream; -+import java.util.Collection; -+import java.util.HashSet; -+import java.util.List; -+import java.util.Queue; -+import java.util.concurrent.ConcurrentLinkedQueue; -+ -+import org.bukkit.Bukkit; -+import org.bukkit.World; -+ -+/** -+ * Provides custom timing sections for /timings merged. -+ */ -+public class CustomTimingsHandler -+{ -+ -+ private static Queue HANDLERS = new ConcurrentLinkedQueue(); -+ /*========================================================================*/ -+ private final String name; -+ private final CustomTimingsHandler parent; -+ private long count = 0; -+ private long start = 0; -+ private long timingDepth = 0; -+ private long totalTime = 0; -+ private long curTickTotal = 0; -+ private long violations = 0; -+ -+ public CustomTimingsHandler(String name) -+ { -+ this( name, null ); -+ } -+ -+ public CustomTimingsHandler(String name, CustomTimingsHandler parent) -+ { -+ this.name = name; -+ this.parent = parent; -+ HANDLERS.add( this ); -+ } -+ -+ /** -+ * Prints the timings and extra data to the given stream. -+ * -+ * @param printStream -+ */ -+ public static void printTimings(PrintStream printStream) -+ { -+ printStream.println( "Minecraft" ); -+ for ( CustomTimingsHandler timings : HANDLERS ) -+ { -+ long time = timings.totalTime; -+ long count = timings.count; -+ if ( count == 0 ) -+ { -+ continue; -+ } -+ long avg = time / count; -+ -+ printStream.println( " " + timings.name + " Time: " + time + " Count: " + count + " Avg: " + avg + " Violations: " + timings.violations ); -+ } -+ printStream.println( "# Version " + Bukkit.getVersion() ); -+ int entities = 0; -+ int livingEntities = 0; -+ for ( World world : Bukkit.getWorlds() ) -+ { -+ entities += world.getEntities().size(); -+ livingEntities += world.getLivingEntities().size(); -+ } -+ printStream.println( "# Entities " + entities ); -+ printStream.println( "# LivingEntities " + livingEntities ); -+ } -+ -+ /** -+ * Resets all timings. -+ */ -+ public static void reload() -+ { -+ if ( Bukkit.getPluginManager().useTimings() ) -+ { -+ for ( CustomTimingsHandler timings : HANDLERS ) -+ { -+ timings.reset(); -+ } -+ } -+ TimingsCommand.timingStart = System.nanoTime(); -+ } -+ -+ /** -+ * Ticked every tick by CraftBukkit to count the number of times a timer -+ * caused TPS loss. -+ */ -+ public static void tick() -+ { -+ if ( Bukkit.getPluginManager().useTimings() ) -+ { -+ for ( CustomTimingsHandler timings : HANDLERS ) -+ { -+ if ( timings.curTickTotal > 50000000 ) -+ { -+ timings.violations += Math.ceil( timings.curTickTotal / 50000000 ); -+ } -+ timings.curTickTotal = 0; -+ timings.timingDepth = 0; // incase reset messes this up -+ } -+ } -+ } -+ -+ /** -+ * Starts timing to track a section of code. -+ */ -+ public void startTiming() -+ { -+ // If second condtion fails we are already timing -+ if ( Bukkit.getPluginManager().useTimings() && ++timingDepth == 1 ) -+ { -+ start = System.nanoTime(); -+ if ( parent != null && ++parent.timingDepth == 1 ) -+ { -+ parent.start = start; -+ } -+ } -+ } -+ -+ /** -+ * Stops timing a section of code. -+ */ -+ public void stopTiming() -+ { -+ if ( Bukkit.getPluginManager().useTimings() ) -+ { -+ if ( --timingDepth != 0 || start == 0 ) -+ { -+ return; -+ } -+ long diff = System.nanoTime() - start; -+ totalTime += diff; -+ curTickTotal += diff; -+ count++; -+ start = 0; -+ if ( parent != null ) -+ { -+ parent.stopTiming(); -+ } -+ } -+ } -+ -+ /** -+ * Reset this timer, setting all values to zero. -+ */ -+ public void reset() -+ { -+ count = 0; -+ violations = 0; -+ curTickTotal = 0; -+ totalTime = 0; -+ start = 0; -+ timingDepth = 0; -+ } -+} --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0004-Add-PlayerItemDamageEvent.patch b/pre/Bukkit-Patches/0004-Add-PlayerItemDamageEvent.patch deleted file mode 100644 index 5af945da2c..0000000000 --- a/pre/Bukkit-Patches/0004-Add-PlayerItemDamageEvent.patch +++ /dev/null @@ -1,69 +0,0 @@ -From e5a52668a8bdea96c7850a7d5b30900e89486db7 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Mon, 4 Mar 2013 18:31:20 +1100 -Subject: [PATCH] Add PlayerItemDamageEvent - - -diff --git a/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java -new file mode 100644 -index 00000000..38a72ab8 ---- /dev/null -+++ b/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java -@@ -0,0 +1,54 @@ -+package org.bukkit.event.player; -+ -+import org.bukkit.entity.Player; -+import org.bukkit.event.Cancellable; -+import org.bukkit.event.HandlerList; -+import org.bukkit.inventory.ItemStack; -+ -+public class PlayerItemDamageEvent extends PlayerEvent implements Cancellable { -+ -+ private static final HandlerList handlers = new HandlerList(); -+ private final ItemStack item; -+ private int damage; -+ private boolean cancelled = false; -+ -+ public PlayerItemDamageEvent(Player player, ItemStack what, int damage) { -+ super(player); -+ this.item = what; -+ this.damage = damage; -+ } -+ -+ public ItemStack getItem() { -+ return item; -+ } -+ -+ /** -+ * Gets the amount of durability damage this item will be taking. -+ * -+ * @return durability change -+ */ -+ public int getDamage() { -+ return damage; -+ } -+ -+ public void setDamage(int damage) { -+ this.damage = damage; -+ } -+ -+ public boolean isCancelled() { -+ return cancelled; -+ } -+ -+ public void setCancelled(boolean cancel) { -+ this.cancelled = cancel; -+ } -+ -+ @Override -+ public HandlerList getHandlers() { -+ return handlers; -+ } -+ -+ public static HandlerList getHandlerList() { -+ return handlers; -+ } -+} --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0005-BungeeCord-Support.patch b/pre/Bukkit-Patches/0005-BungeeCord-Support.patch deleted file mode 100644 index f9f9b28cbc..0000000000 --- a/pre/Bukkit-Patches/0005-BungeeCord-Support.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 74788e62f3c700c8b0e5e4a2f08fa9cd923e79cd Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sun, 2 Jun 2013 15:20:49 +1000 -Subject: [PATCH] BungeeCord Support - - -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 92825490..0215e0d0 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1442,6 +1442,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline - public class Spigot extends Entity.Spigot - { - -+ /** -+ * Gets the connection address of this player, regardless of whether it -+ * has been spoofed or not. -+ * -+ * @return the player's connection address -+ */ -+ public InetSocketAddress getRawAddress() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - @Override -diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java -index 8b012ea9..de4fb37f 100644 ---- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java -+++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java -@@ -14,6 +14,7 @@ public class PlayerLoginEvent extends PlayerEvent { - private final String hostname; - private Result result = Result.ALLOWED; - private String message = ""; -+ private final InetAddress realAddress; // Spigot - - /** - * This constructor defaults message to an empty string, and result to -@@ -24,10 +25,17 @@ public class PlayerLoginEvent extends PlayerEvent { - * @param address The address the player used to connect, provided for - * timing issues - */ -- public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address) { -+ public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address, final InetAddress realAddress) { // Spigot - super(player); - this.hostname = hostname; - this.address = address; -+ // Spigot start -+ this.realAddress = realAddress; -+ } -+ -+ public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address) { -+ this(player, hostname, address, address); -+ // Spigot end - } - - /** -@@ -40,12 +48,23 @@ public class PlayerLoginEvent extends PlayerEvent { - * @param result The result status for this event - * @param message The message to be displayed if result denies login - */ -- public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message) { -- this(player, hostname, address); -+ public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message, final InetAddress realAddress) { // Spigot -+ this(player, hostname, address, realAddress); // Spigot - this.result = result; - this.message = message; - } - -+ // Spigot start -+ /** -+ * Gets the connection address of this player, regardless of whether it has been spoofed or not. -+ * -+ * @return the player's connection address -+ */ -+ public InetAddress getRealAddress() { -+ return realAddress; -+ } -+ // Spigot end -+ - /** - * Gets the current result of the login, as an enum - * --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0006-Add-Arrow-API.patch b/pre/Bukkit-Patches/0006-Add-Arrow-API.patch deleted file mode 100644 index e4d40e3013..0000000000 --- a/pre/Bukkit-Patches/0006-Add-Arrow-API.patch +++ /dev/null @@ -1,29 +0,0 @@ -From fd503f43019eb782cc176f776b7b9ca8487e7551 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sun, 2 Jun 2013 15:08:24 +1000 -Subject: [PATCH] Add Arrow API - - -diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java -index c77f3a4f..99814eee 100644 ---- a/src/main/java/org/bukkit/entity/Arrow.java -+++ b/src/main/java/org/bukkit/entity/Arrow.java -@@ -94,6 +94,15 @@ public interface Arrow extends Projectile { - public class Spigot extends Entity.Spigot - { - -+ public double getDamage() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } -+ -+ public void setDamage(double damage) -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - @Override --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0007-Add-Particle-API.patch b/pre/Bukkit-Patches/0007-Add-Particle-API.patch deleted file mode 100644 index 9068be706f..0000000000 --- a/pre/Bukkit-Patches/0007-Add-Particle-API.patch +++ /dev/null @@ -1,438 +0,0 @@ -From fed8bd962751a695c15c495ff39326d6b387a5b2 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sun, 2 Jun 2013 15:57:09 +1000 -Subject: [PATCH] Add Particle API - - -diff --git a/src/main/java/org/bukkit/Effect.java b/src/main/java/org/bukkit/Effect.java -index 21f7db58..eeb25812 100644 ---- a/src/main/java/org/bukkit/Effect.java -+++ b/src/main/java/org/bukkit/Effect.java -@@ -5,6 +5,7 @@ import java.util.Map; - import com.google.common.collect.Maps; - - import org.bukkit.block.BlockFace; -+import org.bukkit.material.MaterialData; - import org.bukkit.potion.Potion; - - /** -@@ -196,27 +197,258 @@ public enum Effect { - * The sound of an enderdragon growling - */ - ENDERDRAGON_GROWL(3001, Type.SOUND), -+ /** -+ * The spark that comes off a fireworks -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ FIREWORKS_SPARK("fireworksSpark", Type.PARTICLE), -+ /** -+ * Critical hit particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ CRIT("crit", Type.PARTICLE), -+ /** -+ * Blue critical hit particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ MAGIC_CRIT("magicCrit", Type.PARTICLE), -+ /** -+ * Multicolored potion effect particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ POTION_SWIRL("mobSpell", Type.PARTICLE), -+ /** -+ * Multicolored potion effect particles that are slightly transparent -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ POTION_SWIRL_TRANSPARENT("mobSpellAmbient", Type.PARTICLE), -+ /** -+ * A puff of white potion swirls -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ SPELL("spell", Type.PARTICLE), -+ /** -+ * A puff of white stars -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ INSTANT_SPELL("instantSpell", Type.PARTICLE), -+ /** -+ * A puff of purple particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ WITCH_MAGIC("witchMagic", Type.PARTICLE), -+ /** -+ * The note that appears above note blocks -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ NOTE("note", Type.PARTICLE), -+ /** -+ * The particles shown at nether portals -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ PORTAL("portal", Type.PARTICLE), -+ /** -+ * The symbols that fly towards the enchantment table -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ FLYING_GLYPH("enchantmenttable", Type.PARTICLE), -+ /** -+ * Fire particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ FLAME("flame", Type.PARTICLE), -+ /** -+ * The particles that pop out of lava -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ LAVA_POP("lava", Type.PARTICLE), -+ /** -+ * A small gray square -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ FOOTSTEP("footstep", Type.PARTICLE), -+ /** -+ * Water particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ SPLASH("splash", Type.PARTICLE), -+ /** -+ * Smoke particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ PARTICLE_SMOKE("smoke", Type.PARTICLE), -+ /** -+ * The biggest explosion particle effect -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ EXPLOSION_HUGE("hugeexplosion", Type.PARTICLE), -+ /** -+ * A larger version of the explode particle -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ EXPLOSION_LARGE("largeexplode", Type.PARTICLE), -+ /** -+ * Explosion particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ EXPLOSION("explode", Type.PARTICLE), -+ /** -+ * Small gray particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ VOID_FOG("depthsuspend", Type.PARTICLE), -+ /** -+ * Small gray particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ SMALL_SMOKE("townaura", Type.PARTICLE), -+ /** -+ * A puff of white smoke -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ CLOUD("cloud", Type.PARTICLE), -+ /** -+ * Multicolored dust particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ COLOURED_DUST("reddust", Type.PARTICLE), -+ /** -+ * Snowball breaking -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ SNOWBALL_BREAK("snowballpoof", Type.PARTICLE), -+ /** -+ * The water drip particle that appears on blocks under water -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ WATERDRIP("dripWater", Type.PARTICLE), -+ /** -+ * The lava drip particle that appears on blocks under lava -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ LAVADRIP("dripLava", Type.PARTICLE), -+ /** -+ * White particles -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ SNOW_SHOVEL("snowshovel", Type.PARTICLE), -+ /** -+ * The particle shown when a slime jumps -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ SLIME("slime", Type.PARTICLE), -+ /** -+ * The particle that appears when breading animals -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ HEART("heart", Type.PARTICLE), -+ /** -+ * The particle that appears when hitting a villager -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ VILLAGER_THUNDERCLOUD("angryVillager", Type.PARTICLE), -+ /** -+ * The particle that appears when trading with a villager -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ HAPPY_VILLAGER("happyVillager", Type.PARTICLE), -+ /** -+ * The smoke particles that appears on blazes, minecarts -+ * with furnaces and fire -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ LARGE_SMOKE("largesmoke", Type.PARTICLE), -+ /** -+ * The particles generated when a tool breaks. -+ * This particle requires a Material so that the client can select the correct texture. -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ ITEM_BREAK("iconcrack", Type.PARTICLE, Material.class), -+ /** -+ * The particles generated while breaking a block. -+ * This particle requires a Material and data value so that the client can select the correct texture. -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ TILE_BREAK("blockcrack", Type.PARTICLE, MaterialData.class), -+ /** -+ * The particles generated while sprinting a block -+ * This particle requires a Material and data value so that the client can select the correct texture. -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ TILE_DUST("blockdust", Type.PARTICLE, MaterialData.class) - ; - - private final int id; - private final Type type; - private final Class data; - private static final Map BY_ID = Maps.newHashMap(); -+ private static final Map BY_NAME = Maps.newHashMap(); -+ private final String particleName; - -- Effect(int id, Type type) { -+ private Effect(int id, Type type) { - this(id, type, null); - } - -- Effect(int id, Type type, Class data) { -+ private Effect(int id, Type type, Class data) { - this.id = id; - this.type = type; - this.data = data; -+ particleName = null; -+ } -+ -+ private Effect(String particleName, Type type, Class data) { -+ this.particleName = particleName; -+ this.type = type; -+ id = 0; -+ this.data = data; -+ } -+ -+ private Effect(String particleName, Type type) { -+ this.particleName = particleName; -+ this.type = type; -+ id = 0; -+ this.data = null; - } - - /** - * Gets the ID for this effect. - * -- * @return ID of this effect -+ * @return if this Effect isn't of type PARTICLE it returns ID of this effect - * @deprecated Magic value - */ - @Deprecated -@@ -224,6 +456,17 @@ public enum Effect { - return this.id; - } - -+ /** -+ * Returns the effect's name. This returns null if the effect is not a particle -+ * -+ * @return The effect's name -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ public String getName() { -+ return particleName; -+ } -+ - /** - * @return The type of the effect. - */ -@@ -232,8 +475,7 @@ public enum Effect { - } - - /** -- * @return The class which represents data for this effect, or null if -- * none -+ * @return if this Effect isn't of type PARTICLE it returns the class which represents data for this effect, or null if none - */ - public Class getData() { - return this.data; -@@ -253,12 +495,34 @@ public enum Effect { - - static { - for (Effect effect : values()) { -- BY_ID.put(effect.id, effect); -+ if (effect.type != Type.PARTICLE) { -+ BY_ID.put(effect.id, effect); -+ } -+ } -+ } -+ -+ /** -+ * Gets the Effect associated with the given name. -+ * -+ * @param name name of the Effect to return -+ * @return Effect with the given name -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ public static Effect getByName(String name) { -+ return BY_NAME.get(name); -+ } -+ -+ static { -+ for (Effect effect : values()) { -+ if (effect.type == Type.PARTICLE) { -+ BY_NAME.put(effect.particleName, effect); -+ } - } - } - - /** - * Represents the type of an effect. - */ -- public enum Type {SOUND, VISUAL} -+ public enum Type {SOUND, VISUAL, PARTICLE} - } -diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index ab6b1e3a..89db7303 100644 ---- a/src/main/java/org/bukkit/World.java -+++ b/src/main/java/org/bukkit/World.java -@@ -1432,6 +1432,51 @@ public interface World extends PluginMessageRecipient, Metadatable { - public class Spigot - { - -+ /** -+ * Plays an effect to all players within a default radius around a given -+ * location. -+ * -+ * @param location the {@link Location} around which players must be to -+ * see the effect -+ * @param effect the {@link Effect} -+ * @throws IllegalArgumentException if the location or effect is null. -+ * It also throws when the effect requires a material or a material data -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ public void playEffect(Location location, Effect effect) -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } -+ -+ /** -+ * Plays an effect to all players within a default radius around a given -+ * location. The effect will use the provided material (and material -+ * data if required). The particle's position on the client will be the -+ * given location, adjusted on each axis by a normal distribution with -+ * mean 0 and standard deviation given in the offset parameters, each -+ * particle has independently calculated offsets. The effect will have -+ * the given speed and particle count if the effect is a particle. Some -+ * effect will create multiple particles. -+ * -+ * @param location the {@link Location} around which players must be to -+ * see the effect -+ * @param effect effect the {@link Effect} -+ * @param id the item/block/data id for the effect -+ * @param data the data value of the block/item for the effect -+ * @param offsetX the amount to be randomly offset by in the X axis -+ * @param offsetY the amount to be randomly offset by in the Y axis -+ * @param offsetZ the amount to be randomly offset by in the Z axis -+ * @param speed the speed of the particles -+ * @param particleCount the number of particles -+ * @param radius the radius around the location -+ * @deprecated Spigot specific API, use {@link Particle}. -+ */ -+ @Deprecated -+ public void playEffect(Location location, Effect effect, int id, int data, float offsetX, float offsetY, float offsetZ, float speed, int particleCount, int radius) -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - Spigot spigot(); -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 0215e0d0..7e6b5963 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1452,6 +1452,12 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline - { - throw new UnsupportedOperationException( "Not supported yet." ); - } -+ -+ @Deprecated -+ public void playEffect(Location location, Effect effect, int id, int data, float offsetX, float offsetY, float offsetZ, float speed, int particleCount, int radius) -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - @Override -diff --git a/src/test/java/org/bukkit/EffectTest.java b/src/test/java/org/bukkit/EffectTest.java -index 08aa71d3..5217aecb 100644 ---- a/src/test/java/org/bukkit/EffectTest.java -+++ b/src/test/java/org/bukkit/EffectTest.java -@@ -9,7 +9,11 @@ public class EffectTest { - @Test - public void getById() { - for (Effect effect : Effect.values()) { -- assertThat(Effect.getById(effect.getId()), is(effect)); -+ if (effect.getType() != Effect.Type.PARTICLE) { -+ assertThat(Effect.getById(effect.getId()), is(effect)); -+ } else { -+ assertThat(Effect.getByName(effect.getName()), is(effect)); -+ } - } - } - } --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0008-Define-EntitySpawnEvent-and-SpawnerSpawnEvent.patch b/pre/Bukkit-Patches/0008-Define-EntitySpawnEvent-and-SpawnerSpawnEvent.patch deleted file mode 100644 index ec205427b3..0000000000 --- a/pre/Bukkit-Patches/0008-Define-EntitySpawnEvent-and-SpawnerSpawnEvent.patch +++ /dev/null @@ -1,219 +0,0 @@ -From cf02bc5cea506a51b858066b8baec21020d43030 Mon Sep 17 00:00:00 2001 -From: Andy Shulman -Date: Mon, 15 Apr 2013 20:06:01 -0500 -Subject: [PATCH] Define EntitySpawnEvent and SpawnerSpawnEvent - -Defines EntitySpawnEvent and SpawnerSpawnEvent. Adds BUKKIT-267 and BUKKIT-1559 - -diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java -index 4a8f2e18..70212ea5 100644 ---- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java -+++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java -@@ -3,17 +3,13 @@ package org.bukkit.event.entity; - import org.bukkit.Location; - import org.bukkit.entity.Entity; - import org.bukkit.entity.LivingEntity; --import org.bukkit.event.Cancellable; --import org.bukkit.event.HandlerList; - - /** - * Called when a creature is spawned into a world. - *

- * If a Creature Spawn event is cancelled, the creature will not spawn. - */ --public class CreatureSpawnEvent extends EntityEvent implements Cancellable { -- private static final HandlerList handlers = new HandlerList(); -- private boolean canceled; -+public class CreatureSpawnEvent extends EntitySpawnEvent { - private final SpawnReason spawnReason; - - public CreatureSpawnEvent(final LivingEntity spawnee, final SpawnReason spawnReason) { -@@ -21,28 +17,11 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { - this.spawnReason = spawnReason; - } - -- public boolean isCancelled() { -- return canceled; -- } -- -- public void setCancelled(boolean cancel) { -- canceled = cancel; -- } -- - @Override - public LivingEntity getEntity() { - return (LivingEntity) entity; - } - -- /** -- * Gets the location at which the creature is spawning. -- * -- * @return The location at which the creature is spawning -- */ -- public Location getLocation() { -- return getEntity().getLocation(); -- } -- - /** - * Gets the reason for why the creature is being spawned. - * -@@ -53,15 +32,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { - return spawnReason; - } - -- @Override -- public HandlerList getHandlers() { -- return handlers; -- } -- -- public static HandlerList getHandlerList() { -- return handlers; -- } -- - /** - * An enum to specify the type of spawning - */ -diff --git a/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java b/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java -new file mode 100644 -index 00000000..5dcf98f3 ---- /dev/null -+++ b/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java -@@ -0,0 +1,45 @@ -+package org.bukkit.event.entity; -+ -+import org.bukkit.Location; -+import org.bukkit.entity.Entity; -+import org.bukkit.event.HandlerList; -+ -+/** -+ * Called when an entity is spawned into a world. -+ *

-+ * If an Entity Spawn event is cancelled, the entity will not spawn. -+ */ -+public class EntitySpawnEvent extends EntityEvent implements org.bukkit.event.Cancellable { -+ private static final HandlerList handlers = new HandlerList(); -+ private boolean canceled; -+ -+ public EntitySpawnEvent(final Entity spawnee) { -+ super(spawnee); -+ } -+ -+ public boolean isCancelled() { -+ return canceled; -+ } -+ -+ public void setCancelled(boolean cancel) { -+ canceled = cancel; -+ } -+ -+ /** -+ * Gets the location at which the entity is spawning. -+ * -+ * @return The location at which the entity is spawning -+ */ -+ public Location getLocation() { -+ return getEntity().getLocation(); -+ } -+ -+ @Override -+ public HandlerList getHandlers() { -+ return handlers; -+ } -+ -+ public static HandlerList getHandlerList() { -+ return handlers; -+ } -+} -diff --git a/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java b/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java -index bafd934a..776f8e72 100644 ---- a/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java -+++ b/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java -@@ -1,51 +1,23 @@ - package org.bukkit.event.entity; - --import org.bukkit.entity.Item; - import org.bukkit.Location; --import org.bukkit.event.Cancellable; --import org.bukkit.event.HandlerList; -+import org.bukkit.entity.Item; - - /** - * Called when an item is spawned into a world - */ --public class ItemSpawnEvent extends EntityEvent implements Cancellable { -- private static final HandlerList handlers = new HandlerList(); -- private final Location location; -- private boolean canceled; -- -- public ItemSpawnEvent(final Item spawnee, final Location loc) { -+public class ItemSpawnEvent extends EntitySpawnEvent { -+ public ItemSpawnEvent(final Item spawnee) { - super(spawnee); -- this.location = loc; - } - -- public boolean isCancelled() { -- return canceled; -- } -- -- public void setCancelled(boolean cancel) { -- canceled = cancel; -+ @Deprecated -+ public ItemSpawnEvent(final Item spawnee, final Location loc) { -+ this(spawnee); - } - - @Override - public Item getEntity() { - return (Item) entity; - } -- -- /** -- * Gets the location at which the item is spawning. -- * -- * @return The location at which the item is spawning -- */ -- public Location getLocation() { -- return location; -- } -- -- @Override -- public HandlerList getHandlers() { -- return handlers; -- } -- -- public static HandlerList getHandlerList() { -- return handlers; -- } - } -diff --git a/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java b/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java -new file mode 100644 -index 00000000..1acb3c40 ---- /dev/null -+++ b/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java -@@ -0,0 +1,22 @@ -+package org.bukkit.event.entity; -+ -+import org.bukkit.block.CreatureSpawner; -+import org.bukkit.entity.Entity; -+ -+/** -+ * Called when an entity is spawned into a world by a spawner. -+ *

-+ * If a Spawner Spawn event is cancelled, the entity will not spawn. -+ */ -+public class SpawnerSpawnEvent extends EntitySpawnEvent { -+ private final CreatureSpawner spawner; -+ -+ public SpawnerSpawnEvent(final Entity spawnee, final CreatureSpawner spawner) { -+ super(spawnee); -+ this.spawner = spawner; -+ } -+ -+ public CreatureSpawner getSpawner() { -+ return spawner; -+ } -+} --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0009-Entity-Mount-and-Dismount-Events.patch b/pre/Bukkit-Patches/0009-Entity-Mount-and-Dismount-Events.patch deleted file mode 100644 index 18fad9c83d..0000000000 --- a/pre/Bukkit-Patches/0009-Entity-Mount-and-Dismount-Events.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 41cbe1d5fc27d3c28018b955e5b88878760cde12 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Tue, 2 Jul 2013 20:32:53 +1000 -Subject: [PATCH] Entity Mount and Dismount Events - - -diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -new file mode 100644 -index 00000000..24d4942a ---- /dev/null -+++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -@@ -0,0 +1,39 @@ -+package org.spigotmc.event.entity; -+ -+import org.bukkit.entity.Entity; -+import org.bukkit.event.HandlerList; -+import org.bukkit.event.entity.EntityEvent; -+ -+/** -+ * Called when an entity stops riding another entity. -+ * -+ */ -+public class EntityDismountEvent extends EntityEvent -+{ -+ -+ private static final HandlerList handlers = new HandlerList(); -+ private boolean cancelled; -+ private final Entity dismounted; -+ -+ public EntityDismountEvent(Entity what, Entity dismounted) -+ { -+ super( what ); -+ this.dismounted = dismounted; -+ } -+ -+ public Entity getDismounted() -+ { -+ return dismounted; -+ } -+ -+ @Override -+ public HandlerList getHandlers() -+ { -+ return handlers; -+ } -+ -+ public static HandlerList getHandlerList() -+ { -+ return handlers; -+ } -+} -diff --git a/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java -new file mode 100644 -index 00000000..16aa2a7e ---- /dev/null -+++ b/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java -@@ -0,0 +1,52 @@ -+package org.spigotmc.event.entity; -+ -+import org.bukkit.entity.Entity; -+import org.bukkit.event.Cancellable; -+import org.bukkit.event.HandlerList; -+import org.bukkit.event.entity.EntityEvent; -+ -+/** -+ * Called when an entity attempts to ride another entity. -+ * -+ */ -+public class EntityMountEvent extends EntityEvent implements Cancellable -+{ -+ -+ private static final HandlerList handlers = new HandlerList(); -+ private boolean cancelled; -+ private final Entity mount; -+ -+ public EntityMountEvent(Entity what, Entity mount) -+ { -+ super( what ); -+ this.mount = mount; -+ } -+ -+ public Entity getMount() -+ { -+ return mount; -+ } -+ -+ @Override -+ public boolean isCancelled() -+ { -+ return cancelled; -+ } -+ -+ @Override -+ public void setCancelled(boolean cancel) -+ { -+ this.cancelled = cancel; -+ } -+ -+ @Override -+ public HandlerList getHandlers() -+ { -+ return handlers; -+ } -+ -+ public static HandlerList getHandlerList() -+ { -+ return handlers; -+ } -+} --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0010-InventoryClickEvent-getClickedInventory.patch b/pre/Bukkit-Patches/0010-InventoryClickEvent-getClickedInventory.patch deleted file mode 100644 index 2bba9cf60b..0000000000 --- a/pre/Bukkit-Patches/0010-InventoryClickEvent-getClickedInventory.patch +++ /dev/null @@ -1,54 +0,0 @@ -From b3545a19c3480cccaece21d8a8215d1ef00ca1bf Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sun, 7 Jul 2013 10:32:05 -0400 -Subject: [PATCH] InventoryClickEvent getClickedInventory - -Add InventoryClickEvent.getClickedInventory. Adds BUKKIT-4495 -Plugins currently have to do the logic themselves on the raw slot ID -in order to determine the inventory clicked. This provides the logic for plugins to -readily identify which inventory was clicked. - -diff --git a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java -index 55527652..60feaf3b 100644 ---- a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java -+++ b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java -@@ -47,6 +47,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { - private static final HandlerList handlers = new HandlerList(); - private final ClickType click; - private final InventoryAction action; -+ private final Inventory clickedInventory; - private SlotType slot_type; - private int whichSlot; - private int rawSlot; -@@ -57,6 +58,13 @@ public class InventoryClickEvent extends InventoryInteractEvent { - super(view); - this.slot_type = type; - this.rawSlot = slot; -+ if (slot < 0) { -+ this.clickedInventory = null; -+ } else if (view.getTopInventory() != null && slot < view.getTopInventory().getSize()) { -+ this.clickedInventory = view.getTopInventory(); -+ } else { -+ this.clickedInventory = view.getBottomInventory(); -+ } - this.whichSlot = view.convertSlot(slot); - this.click = click; - this.action = action; -@@ -67,6 +75,14 @@ public class InventoryClickEvent extends InventoryInteractEvent { - this.hotbarKey = key; - } - -+ /** -+ * Gets the inventory that was clicked, or null if outside of window -+ * @return The clicked inventory -+ */ -+ public Inventory getClickedInventory() { -+ return clickedInventory; -+ } -+ - /** - * Gets the type of slot that was clicked. - * --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0011-Added-getAllSessionData-to-the-Conversation-API.patch b/pre/Bukkit-Patches/0011-Added-getAllSessionData-to-the-Conversation-API.patch deleted file mode 100644 index 57449990f3..0000000000 --- a/pre/Bukkit-Patches/0011-Added-getAllSessionData-to-the-Conversation-API.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 107814e9730ec89ba793e42d6e79c820abb6d39d Mon Sep 17 00:00:00 2001 -From: Alex Bennett -Date: Thu, 11 Jul 2013 15:31:32 -0500 -Subject: [PATCH] Added getAllSessionData() to the Conversation API. - - -diff --git a/src/main/java/org/bukkit/conversations/ConversationContext.java b/src/main/java/org/bukkit/conversations/ConversationContext.java -index 4f33ff46..7390a771 100644 ---- a/src/main/java/org/bukkit/conversations/ConversationContext.java -+++ b/src/main/java/org/bukkit/conversations/ConversationContext.java -@@ -45,6 +45,14 @@ public class ConversationContext { - return forWhom; - } - -+ /** -+ * Gets the entire sessionData map. -+ * @return The full sessionData map. -+ */ -+ public Map getAllSessionData() { -+ return sessionData; -+ } -+ - /** - * Gets session data shared between all {@link Prompt} invocations. Use - * this as a way to pass data through each Prompt as the conversation --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0012-Player-Collision-API.patch b/pre/Bukkit-Patches/0012-Player-Collision-API.patch deleted file mode 100644 index 1b6d534dcb..0000000000 --- a/pre/Bukkit-Patches/0012-Player-Collision-API.patch +++ /dev/null @@ -1,45 +0,0 @@ -From a02150204b952113adc1c1e7225d6873a3984263 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sat, 3 Aug 2013 19:20:50 +1000 -Subject: [PATCH] Player Collision API - - -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 7e6b5963..2bb9dffa 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1458,6 +1458,31 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline - { - throw new UnsupportedOperationException( "Not supported yet." ); - } -+ -+ /** -+ * Gets whether the player collides with entities -+ * -+ * @return the player's collision toggle state -+ * @deprecated see {@link LivingEntity#isCollidable()} -+ */ -+ @Deprecated -+ public boolean getCollidesWithEntities() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } -+ -+ /** -+ * Sets whether the player collides with entities -+ * -+ * @param collides whether the player should collide with entities or -+ * not. -+ * @deprecated {@link LivingEntity#setCollidable(boolean)} -+ */ -+ @Deprecated -+ public void setCollidesWithEntities(boolean collides) -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - @Override --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0013-Expand-Boolean-Prompt-Values.patch b/pre/Bukkit-Patches/0013-Expand-Boolean-Prompt-Values.patch deleted file mode 100644 index 2fc5f04bbb..0000000000 --- a/pre/Bukkit-Patches/0013-Expand-Boolean-Prompt-Values.patch +++ /dev/null @@ -1,28 +0,0 @@ -From edc49490b0e21e0e889273d4b84981964f6ba96e Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sat, 3 Aug 2013 19:42:16 +1000 -Subject: [PATCH] Expand Boolean Prompt Values - - -diff --git a/src/main/java/org/bukkit/conversations/BooleanPrompt.java b/src/main/java/org/bukkit/conversations/BooleanPrompt.java -index c37d1596..6701c175 100644 ---- a/src/main/java/org/bukkit/conversations/BooleanPrompt.java -+++ b/src/main/java/org/bukkit/conversations/BooleanPrompt.java -@@ -15,12 +15,13 @@ public abstract class BooleanPrompt extends ValidatingPrompt { - - @Override - protected boolean isInputValid(ConversationContext context, String input) { -- String[] accepted = {"true", "false", "on", "off", "yes", "no"}; -+ String[] accepted = {"true", "false", "on", "off", "yes", "no" /* Spigot: */, "y", "n", "1", "0", "right", "wrong", "correct", "incorrect", "valid", "invalid"}; // Spigot - return ArrayUtils.contains(accepted, input.toLowerCase()); - } - - @Override - protected Prompt acceptValidatedInput(ConversationContext context, String input) { -+ if (input.equalsIgnoreCase("y") || input.equals("1") || input.equalsIgnoreCase("right") || input.equalsIgnoreCase("correct") || input.equalsIgnoreCase("valid")) input = "true"; // Spigot - return acceptValidatedInput(context, BooleanUtils.toBoolean(input)); - } - --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0014-Add-Getter-for-Entity-Invulnerability.patch b/pre/Bukkit-Patches/0014-Add-Getter-for-Entity-Invulnerability.patch deleted file mode 100644 index a24620576d..0000000000 --- a/pre/Bukkit-Patches/0014-Add-Getter-for-Entity-Invulnerability.patch +++ /dev/null @@ -1,29 +0,0 @@ -From d77f65145e2456e05305eddcf78a9e15d6a094b5 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sat, 3 Aug 2013 19:49:36 +1000 -Subject: [PATCH] Add Getter for Entity Invulnerability - - -diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 294eb7f7..28b169d2 100644 ---- a/src/main/java/org/bukkit/entity/Entity.java -+++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -483,6 +483,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable { - public class Spigot extends CommandSender.Spigot - { - -+ /** -+ * Returns whether this entity is invulnerable. -+ * -+ * @return True if the entity is invulnerable. -+ */ -+ public boolean isInvulnerable() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - @Override --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0015-Add-respawn-API.patch b/pre/Bukkit-Patches/0015-Add-respawn-API.patch deleted file mode 100644 index a1c64ef6a5..0000000000 --- a/pre/Bukkit-Patches/0015-Add-respawn-API.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 5ab257dd399e0d5adc51df4e6fbf878d38f4c1a4 Mon Sep 17 00:00:00 2001 -From: ninja- -Date: Tue, 8 Oct 2013 14:35:58 +0200 -Subject: [PATCH] Add respawn API. - - -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 2bb9dffa..226aa6b6 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1483,6 +1483,14 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline - { - throw new UnsupportedOperationException( "Not supported yet." ); - } -+ -+ /** -+ * Respawns the player if dead. -+ */ -+ public void respawn() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - @Override --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0016-Implement-Locale-Getter-for-Players.patch b/pre/Bukkit-Patches/0016-Implement-Locale-Getter-for-Players.patch deleted file mode 100644 index b130b76380..0000000000 --- a/pre/Bukkit-Patches/0016-Implement-Locale-Getter-for-Players.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a9f4c0424e5d7f77a2959ffbad58bfd313cb8287 Mon Sep 17 00:00:00 2001 -From: Smove -Date: Sat, 1 Feb 2014 18:10:49 +1100 -Subject: [PATCH] Implement Locale Getter for Players - - -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 226aa6b6..e021495e 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1491,6 +1491,18 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline - { - throw new UnsupportedOperationException( "Not supported yet." ); - } -+ -+ /** -+ * Gets player locale language. -+ * -+ * @return the player's client language settings -+ * @deprecated Use {@link Player#getLocale()} -+ */ -+ @Deprecated -+ public String getLocale() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - @Override --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0017-Add-support-for-fetching-hidden-players.patch b/pre/Bukkit-Patches/0017-Add-support-for-fetching-hidden-players.patch deleted file mode 100644 index 4118978167..0000000000 --- a/pre/Bukkit-Patches/0017-Add-support-for-fetching-hidden-players.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 8323466f3f99a166b69049f86b022c181be32d9a Mon Sep 17 00:00:00 2001 -From: Tux -Date: Sun, 9 Feb 2014 14:02:11 -0500 -Subject: [PATCH] Add support for fetching hidden players - - -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index e021495e..5c55c2e2 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1503,6 +1503,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline - { - throw new UnsupportedOperationException( "Not supported yet." ); - } -+ -+ /** -+ * Gets all players hidden with {@link #hidePlayer(org.bukkit.entity.Player)}. -+ * -+ * @return a Set with all hidden players -+ */ -+ public java.util.Set getHiddenPlayers() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - @Override --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0018-Silenceable-Lightning-API.patch b/pre/Bukkit-Patches/0018-Silenceable-Lightning-API.patch deleted file mode 100644 index a3744f06d0..0000000000 --- a/pre/Bukkit-Patches/0018-Silenceable-Lightning-API.patch +++ /dev/null @@ -1,64 +0,0 @@ -From d0594aceab7ec85ddfbc2222fbb95e9a2fab80ab Mon Sep 17 00:00:00 2001 -From: drXor -Date: Sun, 23 Feb 2014 16:16:29 -0400 -Subject: [PATCH] Silenceable Lightning API - - -diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 89db7303..33b14a07 100644 ---- a/src/main/java/org/bukkit/World.java -+++ b/src/main/java/org/bukkit/World.java -@@ -1477,6 +1477,30 @@ public interface World extends PluginMessageRecipient, Metadatable { - { - throw new UnsupportedOperationException( "Not supported yet." ); - } -+ -+ /** -+ * Strikes lightning at the given {@link Location} and possibly without sound -+ * -+ * @param loc The location to strike lightning -+ * @param isSilent Whether this strike makes no sound -+ * @return The lightning entity. -+ */ -+ public LightningStrike strikeLightning(Location loc, boolean isSilent) -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } -+ -+ /** -+ * Strikes lightning at the given {@link Location} without doing damage and possibly without sound -+ * -+ * @param loc The location to strike lightning -+ * @param isSilent Whether this strike makes no sound -+ * @return The lightning entity. -+ */ -+ public LightningStrike strikeLightningEffect(Location loc, boolean isSilent) -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - Spigot spigot(); -diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java -index ee2218c1..aa809392 100644 ---- a/src/main/java/org/bukkit/entity/LightningStrike.java -+++ b/src/main/java/org/bukkit/entity/LightningStrike.java -@@ -16,6 +16,15 @@ public interface LightningStrike extends Weather { - public class Spigot extends Entity.Spigot - { - -+ /* -+ * Returns whether the strike is silent. -+ * -+ * @return whether the strike is silent. -+ */ -+ public boolean isSilent() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - @Override --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0019-Remove-deprecation-on-some-player-lookup-methods.patch b/pre/Bukkit-Patches/0019-Remove-deprecation-on-some-player-lookup-methods.patch deleted file mode 100644 index 6608216c23..0000000000 --- a/pre/Bukkit-Patches/0019-Remove-deprecation-on-some-player-lookup-methods.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 34f489fe204450f1487f812efd07d10717dc7cf7 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sun, 30 Mar 2014 15:58:22 +1100 -Subject: [PATCH] Remove deprecation on some player lookup methods - -Most of these methods still have plenty of use given that only one player with each name can exist at a time. Deprecating these methods renders even basic functionality such as /msg impossible without causing compiler warnings. We will maintain this API and it should be considered safe and appropriate for most use cases. - -diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 27c69e96..0f42a66a 100644 ---- a/src/main/java/org/bukkit/Bukkit.java -+++ b/src/main/java/org/bukkit/Bukkit.java -@@ -365,12 +365,9 @@ public final class Bukkit { - *

- * This method may not return objects for offline players. - * -- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer -- * guaranteed to be unique - * @param name the name to look up - * @return a player if one was found, null otherwise - */ -- @Deprecated - public static Player getPlayer(String name) { - return server.getPlayer(name); - } -@@ -378,12 +375,9 @@ public final class Bukkit { - /** - * Gets the player with the exact given name, case insensitive. - * -- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer -- * guaranteed to be unique - * @param name Exact name of the player to retrieve - * @return a player object if one was found, null otherwise - */ -- @Deprecated - public static Player getPlayerExact(String name) { - return server.getPlayerExact(name); - } -@@ -395,12 +389,9 @@ public final class Bukkit { - * This list is not sorted in any particular order. If an exact match is - * found, the returned list will only contain a single result. - * -- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer -- * guaranteed to be unique - * @param name the (partial) name to match - * @return list of all possible players - */ -- @Deprecated - public static List matchPlayer(String name) { - return server.matchPlayer(name); - } -diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index c9ef86e4..65ad9aa0 100644 ---- a/src/main/java/org/bukkit/Server.java -+++ b/src/main/java/org/bukkit/Server.java -@@ -303,23 +303,17 @@ public interface Server extends PluginMessageRecipient { - *

- * This method may not return objects for offline players. - * -- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer -- * guaranteed to be unique - * @param name the name to look up - * @return a player if one was found, null otherwise - */ -- @Deprecated - public Player getPlayer(String name); - - /** - * Gets the player with the exact given name, case insensitive. - * -- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer -- * guaranteed to be unique - * @param name Exact name of the player to retrieve - * @return a player object if one was found, null otherwise - */ -- @Deprecated - public Player getPlayerExact(String name); - - /** -@@ -329,12 +323,9 @@ public interface Server extends PluginMessageRecipient { - * This list is not sorted in any particular order. If an exact match is - * found, the returned list will only contain a single result. - * -- * @deprecated Use {@link #getPlayer(UUID)} as player names are no longer -- * guaranteed to be unique - * @param name the (partial) name to match - * @return list of all possible players - */ -- @Deprecated - public List matchPlayer(String name); - - /** --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0020-Add-PlayerSpawnLocationEvent.patch b/pre/Bukkit-Patches/0020-Add-PlayerSpawnLocationEvent.patch deleted file mode 100644 index f564a66bf3..0000000000 --- a/pre/Bukkit-Patches/0020-Add-PlayerSpawnLocationEvent.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 25627e006cc20d6a1c3fa505fbe69f8bc0a8db91 Mon Sep 17 00:00:00 2001 -From: ninja -Date: Tue, 8 Apr 2014 14:01:32 +0200 -Subject: [PATCH] Add PlayerSpawnLocationEvent. - - -diff --git a/src/main/java/org/spigotmc/event/player/PlayerSpawnLocationEvent.java b/src/main/java/org/spigotmc/event/player/PlayerSpawnLocationEvent.java -new file mode 100644 -index 00000000..dd3f58ca ---- /dev/null -+++ b/src/main/java/org/spigotmc/event/player/PlayerSpawnLocationEvent.java -@@ -0,0 +1,50 @@ -+package org.spigotmc.event.player; -+ -+import org.bukkit.Location; -+import org.bukkit.entity.Entity; -+import org.bukkit.entity.Player; -+import org.bukkit.event.HandlerList; -+import org.bukkit.event.player.PlayerEvent; -+ -+/** -+ * Called when player is about to spawn in a world after joining the server. -+ */ -+public class PlayerSpawnLocationEvent extends PlayerEvent { -+ private static final HandlerList handlers = new HandlerList(); -+ private Location spawnLocation; -+ -+ public PlayerSpawnLocationEvent(final Player who, Location spawnLocation) { -+ super(who); -+ this.spawnLocation = spawnLocation; -+ } -+ -+ -+ /** -+ * Gets player's spawn location. -+ * If the player {@link Player#hasPlayedBefore()}, it's going to default to the location inside player.dat file. -+ * For new players, the default spawn location is spawn of the main Bukkit world. -+ * -+ * @return the spawn location -+ */ -+ public Location getSpawnLocation() { -+ return spawnLocation; -+ } -+ -+ /** -+ * Sets player's spawn location. -+ * -+ * @param location the spawn location -+ */ -+ public void setSpawnLocation(Location location) { -+ this.spawnLocation = location; -+ } -+ -+ @Override -+ public HandlerList getHandlers() { -+ return handlers; -+ } -+ -+ public static HandlerList getHandlerList() { -+ return handlers; -+ } -+} --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0021-Ease-ClassLoader-Deadlocks-Where-Possible.patch b/pre/Bukkit-Patches/0021-Ease-ClassLoader-Deadlocks-Where-Possible.patch deleted file mode 100644 index 70e530844b..0000000000 --- a/pre/Bukkit-Patches/0021-Ease-ClassLoader-Deadlocks-Where-Possible.patch +++ /dev/null @@ -1,67 +0,0 @@ -From c920b663bcb6e08866c0847561424f87c95855a2 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Wed, 16 Jul 2014 17:24:21 +1000 -Subject: [PATCH] Ease ClassLoader Deadlocks Where Possible - -When on Java 7 we can register the classloader as parallel capable to prevent deadlocks caused by certain scenarios. Due to the nature of PluginClassLoader this isn't completely safe, but we can make it safer by switching to concurrency focused collections. Either way this is far better than crashing the server. - -diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 73372534..80c6a72e 100644 ---- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -49,7 +49,7 @@ import org.yaml.snakeyaml.error.YAMLException; - public final class JavaPluginLoader implements PluginLoader { - final Server server; - private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), }; -- private final Map> classes = new HashMap>(); -+ private final Map> classes = new java.util.concurrent.ConcurrentHashMap>(); // Spigot - private final List loaders = new CopyOnWriteArrayList(); - public static final CustomTimingsHandler pluginParentTimer = new CustomTimingsHandler("** Plugins"); // Spigot - -diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 5eb42df3..a9fc08e0 100644 ---- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -@@ -25,7 +25,7 @@ import org.bukkit.plugin.PluginDescriptionFile; - */ - final class PluginClassLoader extends URLClassLoader { - private final JavaPluginLoader loader; -- private final Map> classes = new HashMap>(); -+ private final Map> classes = new java.util.concurrent.ConcurrentHashMap>(); // Spigot - private final PluginDescriptionFile description; - private final File dataFolder; - private final File file; -@@ -36,6 +36,30 @@ final class PluginClassLoader extends URLClassLoader { - private JavaPlugin pluginInit; - private IllegalStateException pluginState; - -+ // Spigot Start -+ static -+ { -+ try -+ { -+ java.lang.reflect.Method method = ClassLoader.class.getDeclaredMethod( "registerAsParallelCapable" ); -+ if ( method != null ) -+ { -+ boolean oldAccessible = method.isAccessible(); -+ method.setAccessible( true ); -+ method.invoke( null ); -+ method.setAccessible( oldAccessible ); -+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.INFO, "Set PluginClassLoader as parallel capable" ); -+ } -+ } catch ( NoSuchMethodException ex ) -+ { -+ // Ignore -+ } catch ( Exception ex ) -+ { -+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.WARNING, "Error setting PluginClassLoader as parallel capable", ex ); -+ } -+ } -+ // Spigot End -+ - PluginClassLoader(final JavaPluginLoader loader, final ClassLoader parent, final PluginDescriptionFile description, final File dataFolder, final File file) throws IOException, InvalidPluginException, MalformedURLException { - super(new URL[] {file.toURI().toURL()}, parent); - Validate.notNull(loader, "Loader cannot be null"); --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0022-Undeprecate-Player-updateInventory-V.patch b/pre/Bukkit-Patches/0022-Undeprecate-Player-updateInventory-V.patch deleted file mode 100644 index d29e01d420..0000000000 --- a/pre/Bukkit-Patches/0022-Undeprecate-Player-updateInventory-V.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 68927f05d7fb93e977cdaa80db0b86ac4804559c Mon Sep 17 00:00:00 2001 -From: drXor -Date: Wed, 23 Jul 2014 15:50:36 -0400 -Subject: [PATCH] Undeprecate Player#updateInventory()V - - -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5c55c2e2..f59c2c19 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -395,10 +395,8 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline - /** - * Forces an update of the player's entire inventory. - * -- * @deprecated This method should not be relied upon as it is a temporary -- * work-around for a larger, more complicated issue. - */ -- @Deprecated -+ //@Deprecated // Spigot - undeprecate - public void updateInventory(); - - /** --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0023-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch b/pre/Bukkit-Patches/0023-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch deleted file mode 100644 index 7f9e5cfe3e..0000000000 --- a/pre/Bukkit-Patches/0023-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch +++ /dev/null @@ -1,43 +0,0 @@ -From ae59b59da62f5c3a76ad3e7931aa178aecbbaff3 Mon Sep 17 00:00:00 2001 -From: libraryaddict -Date: Fri, 22 Aug 2014 05:31:04 -0400 -Subject: [PATCH] Added isUnbreakable and setUnbreakable to ItemMeta - - -diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index e48616d2..62ddbbba 100644 ---- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -@@ -201,6 +201,29 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { - public class Spigot - { - -+ /** -+ * Sets the unbreakable tag -+ * -+ * @param unbreakable true if set unbreakable -+ * @deprecated see {@link ItemMeta#setUnbreakable(boolean)} -+ */ -+ @Deprecated -+ public void setUnbreakable(boolean unbreakable) -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } -+ -+ /** -+ * Return if the unbreakable tag is true -+ * -+ * @return true if the unbreakable tag is true -+ * @deprecated see {@link ItemMeta#isUnbreakable()} -+ */ -+ @Deprecated -+ public boolean isUnbreakable() -+ { -+ throw new UnsupportedOperationException( "Not supported yet." ); -+ } - } - - Spigot spigot(); --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0024-BungeeCord-Chat-API.patch b/pre/Bukkit-Patches/0024-BungeeCord-Chat-API.patch deleted file mode 100644 index 31747378ed..0000000000 --- a/pre/Bukkit-Patches/0024-BungeeCord-Chat-API.patch +++ /dev/null @@ -1,451 +0,0 @@ -From 3115ab07167acda0ecc19748172ba7ff26b2392e Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sat, 13 Dec 2014 02:59:14 +0100 -Subject: [PATCH] BungeeCord Chat API - - -diff --git a/pom.xml b/pom.xml -index 88b109e0..99ff13b3 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -76,6 +76,14 @@ - 1.21 - compile - -+ -+ net.md-5 -+ bungeecord-chat -+ 1.12-SNAPSHOT -+ jar -+ compile -+ -+ - - - junit -diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java -index b8872b41..adbae51a 100644 ---- a/src/main/java/org/bukkit/ChatColor.java -+++ b/src/main/java/org/bukkit/ChatColor.java -@@ -10,95 +10,205 @@ import com.google.common.collect.Maps; - /** - * All supported color values for chat - */ --public enum ChatColor { -+public enum ChatColor{ - /** - * Represents black - */ -- BLACK('0', 0x00), -+ BLACK('0', 0x00) { -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.BLACK; -+ } -+ }, - /** - * Represents dark blue - */ -- DARK_BLUE('1', 0x1), -+ DARK_BLUE('1', 0x1){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.DARK_BLUE; -+ } -+ }, - /** - * Represents dark green - */ -- DARK_GREEN('2', 0x2), -+ DARK_GREEN('2', 0x2){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.DARK_GREEN; -+ } -+ }, - /** - * Represents dark blue (aqua) - */ -- DARK_AQUA('3', 0x3), -+ DARK_AQUA('3', 0x3){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.DARK_AQUA; -+ } -+ }, - /** - * Represents dark red - */ -- DARK_RED('4', 0x4), -+ DARK_RED('4', 0x4){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.DARK_RED; -+ } -+ }, - /** - * Represents dark purple - */ -- DARK_PURPLE('5', 0x5), -+ DARK_PURPLE('5', 0x5){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.DARK_PURPLE; -+ } -+ }, - /** - * Represents gold - */ -- GOLD('6', 0x6), -+ GOLD('6', 0x6){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.GOLD; -+ } -+ }, - /** - * Represents gray - */ -- GRAY('7', 0x7), -+ GRAY('7', 0x7){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.GRAY; -+ } -+ }, - /** - * Represents dark gray - */ -- DARK_GRAY('8', 0x8), -+ DARK_GRAY('8', 0x8){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.DARK_GRAY; -+ } -+ }, - /** - * Represents blue - */ -- BLUE('9', 0x9), -+ BLUE('9', 0x9){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.BLUE; -+ } -+ }, - /** - * Represents green - */ -- GREEN('a', 0xA), -+ GREEN('a', 0xA){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.GREEN; -+ } -+ }, - /** - * Represents aqua - */ -- AQUA('b', 0xB), -+ AQUA('b', 0xB){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.AQUA; -+ } -+ }, - /** - * Represents red - */ -- RED('c', 0xC), -+ RED('c', 0xC){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.RED; -+ } -+ }, - /** - * Represents light purple - */ -- LIGHT_PURPLE('d', 0xD), -+ LIGHT_PURPLE('d', 0xD){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.LIGHT_PURPLE; -+ } -+ }, - /** - * Represents yellow - */ -- YELLOW('e', 0xE), -+ YELLOW('e', 0xE){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.YELLOW; -+ } -+ }, - /** - * Represents white - */ -- WHITE('f', 0xF), -+ WHITE('f', 0xF){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.WHITE; -+ } -+ }, - /** - * Represents magical characters that change around randomly - */ -- MAGIC('k', 0x10, true), -+ MAGIC('k', 0x10, true){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.MAGIC; -+ } -+ }, - /** - * Makes the text bold. - */ -- BOLD('l', 0x11, true), -+ BOLD('l', 0x11, true){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.BOLD; -+ } -+ }, - /** - * Makes a line appear through the text. - */ -- STRIKETHROUGH('m', 0x12, true), -+ STRIKETHROUGH('m', 0x12, true){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.STRIKETHROUGH; -+ } -+ }, - /** - * Makes the text appear underlined. - */ -- UNDERLINE('n', 0x13, true), -+ UNDERLINE('n', 0x13, true){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.UNDERLINE; -+ } -+ }, - /** - * Makes the text italic. - */ -- ITALIC('o', 0x14, true), -+ ITALIC('o', 0x14, true){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.ITALIC; -+ } -+ }, - /** - * Resets all previous chat colors or formats. - */ -- RESET('r', 0x15); -+ RESET('r', 0x15){ -+ @Override -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.RESET; -+ } -+ }; - - /** - * The special character which prefixes all chat colour codes. Use this if -@@ -125,6 +235,10 @@ public enum ChatColor { - this.toString = new String(new char[] {COLOR_CHAR, code}); - } - -+ public net.md_5.bungee.api.ChatColor asBungee() { -+ return net.md_5.bungee.api.ChatColor.RESET; -+ }; -+ - /** - * Gets the char value associated with this color - * -diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 65ad9aa0..2b8f039f 100644 ---- a/src/main/java/org/bukkit/Server.java -+++ b/src/main/java/org/bukkit/Server.java -@@ -1013,6 +1013,24 @@ public interface Server extends PluginMessageRecipient { - { - throw new UnsupportedOperationException( "Not supported yet." ); - } -+ -+ /** -+ * Sends the component to the player -+ * -+ * @param component the components to send -+ */ -+ public void broadcast(net.md_5.bungee.api.chat.BaseComponent component) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ /** -+ * Sends an array of components as a single message to the player -+ * -+ * @param components the components to send -+ */ -+ public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } - } - - Spigot spigot(); -diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java -index 5dcd2218..abf68a2c 100644 ---- a/src/main/java/org/bukkit/command/CommandSender.java -+++ b/src/main/java/org/bukkit/command/CommandSender.java -@@ -37,6 +37,23 @@ public interface CommandSender extends Permissible { - public class Spigot - { - -+ /** -+ * Sends this sender a chat component. -+ * -+ * @param component the components to send -+ */ -+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ /** -+ * Sends an array of components as a single message to the sender. -+ * -+ * @param components the components to send -+ */ -+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } - } - - Spigot spigot(); -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index f59c2c19..86eca9e1 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1511,6 +1511,36 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline - { - throw new UnsupportedOperationException( "Not supported yet." ); - } -+ -+ @Override -+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ @Override -+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ /** -+ * Sends the component to the specified screen position of this player -+ * -+ * @param position the screen position -+ * @param component the components to send -+ */ -+ public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent component) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ /** -+ * Sends an array of components as a single message to the specified screen position of this player -+ * -+ * @param position the screen position -+ * @param components the components to send -+ */ -+ public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } - } - - @Override -diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java -index 3b6bf419..75b03ac3 100644 ---- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java -+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java -@@ -1,6 +1,7 @@ - package org.bukkit.inventory.meta; - - import java.util.List; -+import net.md_5.bungee.api.chat.BaseComponent; - - import org.bukkit.Material; - -@@ -177,6 +178,68 @@ public interface BookMeta extends ItemMeta { - // Spigot start - public class Spigot extends ItemMeta.Spigot { - -+ /** -+ * Gets the specified page in the book. The given page must exist. -+ * -+ * @param page the page number to get -+ * @return the page from the book -+ */ -+ public BaseComponent[] getPage(int page) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ /** -+ * Sets the specified page in the book. Pages of the book must be -+ * contiguous. -+ *

-+ * The data can be up to 256 characters in length, additional characters -+ * are truncated. -+ * -+ * @param page the page number to set -+ * @param data the data to set for that page -+ */ -+ public void setPage(int page, BaseComponent... data) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ /** -+ * Gets all the pages in the book. -+ * -+ * @return list of all the pages in the book -+ */ -+ public List getPages() { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ /** -+ * Clears the existing book pages, and sets the book to use the provided -+ * pages. Maximum 50 pages with 256 characters per page. -+ * -+ * @param pages A list of pages to set the book to use -+ */ -+ public void setPages(List pages) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ /** -+ * Clears the existing book pages, and sets the book to use the provided -+ * pages. Maximum 50 pages with 256 characters per page. -+ * -+ * @param pages A list of component arrays, each being a page -+ */ -+ public void setPages(BaseComponent[]... pages) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } -+ -+ /** -+ * Adds new pages to the end of the book. Up to a maximum of 50 pages -+ * with 256 characters per page. -+ * -+ * @param pages A list of component arrays, each being a page -+ */ -+ public void addPage(BaseComponent[]... pages) { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } - } - - @Override --- -2.18.0 - diff --git a/pre/Bukkit-Patches/0025-Add-restart-API.patch b/pre/Bukkit-Patches/0025-Add-restart-API.patch deleted file mode 100644 index 793d91fe1d..0000000000 --- a/pre/Bukkit-Patches/0025-Add-restart-API.patch +++ /dev/null @@ -1,27 +0,0 @@ -From bba9b8e03ac67ddca6f739c1a0aad9a084bd1bca Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Mon, 13 Jul 2015 19:10:15 +1000 -Subject: [PATCH] Add restart API. - - -diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 2b8f039f..9c3eeaa9 100644 ---- a/src/main/java/org/bukkit/Server.java -+++ b/src/main/java/org/bukkit/Server.java -@@ -1031,6 +1031,13 @@ public interface Server extends PluginMessageRecipient { - public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { - throw new UnsupportedOperationException("Not supported yet."); - } -+ -+ /** -+ * Restart the server. If the server administrator has not configured restarting, the server will stop. -+ */ -+ public void restart() { -+ throw new UnsupportedOperationException("Not supported yet."); -+ } - } - - Spigot spigot(); --- -2.18.0 - diff --git a/Spigot-Server-Patches/0017-Configurable-speed-for-water-flowing-over-lava.patch b/removed/0017-Configurable-speed-for-water-flowing-over-lava.patch similarity index 100% rename from Spigot-Server-Patches/0017-Configurable-speed-for-water-flowing-over-lava.patch rename to removed/0017-Configurable-speed-for-water-flowing-over-lava.patch diff --git a/Spigot-Server-Patches/0033-Generator-Settings.patch b/removed/0033-Generator-Settings.patch similarity index 100% rename from Spigot-Server-Patches/0033-Generator-Settings.patch rename to removed/0033-Generator-Settings.patch diff --git a/Spigot-Server-Patches/0035-Stop-updating-flowing-block-if-material-has-changed.patch b/removed/0035-Stop-updating-flowing-block-if-material-has-changed.patch similarity index 100% rename from Spigot-Server-Patches/0035-Stop-updating-flowing-block-if-material-has-changed.patch rename to removed/0035-Stop-updating-flowing-block-if-material-has-changed.patch diff --git a/Spigot-Server-Patches/0036-Fast-draining.patch b/removed/0036-Fast-draining.patch similarity index 100% rename from Spigot-Server-Patches/0036-Fast-draining.patch rename to removed/0036-Fast-draining.patch diff --git a/Spigot-Server-Patches/0037-Configurable-lava-flow-speed.patch b/removed/0037-Configurable-lava-flow-speed.patch similarity index 100% rename from Spigot-Server-Patches/0037-Configurable-lava-flow-speed.patch rename to removed/0037-Configurable-lava-flow-speed.patch diff --git a/Spigot-Server-Patches/0080-Custom-replacement-for-eaten-items.patch b/removed/0080-Custom-replacement-for-eaten-items.patch similarity index 100% rename from Spigot-Server-Patches/0080-Custom-replacement-for-eaten-items.patch rename to removed/0080-Custom-replacement-for-eaten-items.patch diff --git a/Spigot-Server-Patches/0097-Prevent-Waterflow-BlockFromToEvent-from-loading-chun.patch b/removed/0097-Prevent-Waterflow-BlockFromToEvent-from-loading-chun.patch similarity index 100% rename from Spigot-Server-Patches/0097-Prevent-Waterflow-BlockFromToEvent-from-loading-chun.patch rename to removed/0097-Prevent-Waterflow-BlockFromToEvent-from-loading-chun.patch diff --git a/Spigot-Server-Patches/0115-Water-mobs-should-only-spawn-in-the-water.patch b/removed/0115-Water-mobs-should-only-spawn-in-the-water.patch similarity index 100% rename from Spigot-Server-Patches/0115-Water-mobs-should-only-spawn-in-the-water.patch rename to removed/0115-Water-mobs-should-only-spawn-in-the-water.patch diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh index 100db69839..ac4062c8dd 100755 --- a/scripts/applyPatches.sh +++ b/scripts/applyPatches.sh @@ -37,10 +37,7 @@ function applyPatch { echo " Applying patches to $target..." $gitcmd am --abort >/dev/null 2>&1 - #TODO: remove - if [ "$what_name" == "Bukkit" ]; then - what_name="../../pre/Bukkit"; - fi + # Special case Windows handling because of ARG_MAX constraint if [[ $windows == "true" ]]; then echo " Using workaround for Windows ARG_MAX constraint" @@ -72,13 +69,11 @@ function applyPatch { # Move into spigot dir cd "$workdir/Spigot" - basedir=$(pwd) # Apply Spigot ( -#TODO: remove ../pre/ and reset to HEAD - applyPatch ../Bukkit Spigot-API origin/preview # && - #applyPatch ../CraftBukkit Spigot-Server patched + applyPatch ../Bukkit Spigot-API HEAD && + applyPatch ../CraftBukkit Spigot-Server patched ) || ( echo "Failed to apply Spigot Patches" exit 1 @@ -89,15 +84,13 @@ cd "$basedir" echo "Importing MC Dev" -# TODO: Remove comment -# ./scripts/importmcdev.sh "$basedir" >/dev/null 2>&1 +./scripts/importmcdev.sh "$basedir" || exit 1 # Apply paper cd "$basedir" ( -#TODO remove comment - applyPatch "work/Spigot/Spigot-API" Paper-API HEAD # && - # applyPatch "work/Spigot/Spigot-Server" Paper-Server HEAD + applyPatch "work/Spigot/Spigot-API" Paper-API HEAD && + applyPatch "work/Spigot/Spigot-Server" Paper-Server HEAD ) || ( echo "Failed to apply Paper Patches" exit 1 diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 9e16057186..3c54ffbbd3 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -6,6 +6,7 @@ nms="net/minecraft/server" export MODLOG="" PS1="$" basedir="$(cd "$1" && pwd -P)" +source "$basedir/scripts/functions.sh" gitcmd="git -c commit.gpgsign=false" workdir="$basedir/work" @@ -21,8 +22,8 @@ function import { if [[ ! -f "$target" ]]; then export MODLOG="$MODLOG Imported $file from mc-dev\n"; - echo "Copying $base to $target" - cp "$base" "$target" + #echo "Copying $base to $target" + cp "$base" "$target" || exit 1 else echo "UN-NEEDED IMPORT: $file" fi @@ -36,85 +37,42 @@ function import { fi ) -import AxisAlignedBB -import BaseBlockPosition -import BiomeBase -import BlockBed -import BiomeBigHills -import BiomeJungle -import BiomeMesa -import BlockBeacon -import BlockChest -import BlockFalling -import BlockFurnace -import BlockIceFrost -import BlockPosition -import BlockSnowBlock -import BlockStateEnum -import ChunkCache -import ChunkCoordIntPair -import ChunkProviderFlat -import ChunkProviderGenerate -import ChunkProviderHell -import CommandAbstract -import CommandScoreboard -import CommandWhitelist -import ControllerJump -import DataBits -import DataConverterMaterialId -import DataInspectorBlockEntity -import DataPalette -import DefinedStructure -import DragonControllerLandedFlame -import EnchantmentManager -import Enchantments -import EnderDragonBattle -import EntityIllagerIllusioner -import EntityLlama -import EntitySquid -import EntityTypes -import EntityWaterAnimal -import EntityWitch -import EnumItemSlot -import EULA -import FileIOThread -import IHopper -import ItemBlock -import ItemFireworks -import ItemMonsterEgg -import IRangedEntity -import LegacyPingHandler -import LotoSelectorEntry -import NavigationAbstract -import NBTTagCompound -import NBTTagList -import PacketPlayInUseEntity -import PacketPlayOutMapChunk -import PacketPlayOutPlayerListHeaderFooter -import PacketPlayOutScoreboardTeam -import PacketPlayOutTitle -import PacketPlayOutUpdateTime -import PathfinderAbstract -import PathfinderGoal -import PathfinderGoalFloat -import PathfinderGoalGotoTarget -import PathfinderWater -import PersistentScoreboard -import PersistentVillage -import PlayerConnectionUtils -import RegionFile -import RegistryBlockID -import RemoteControlListener -import RecipeBookServer -import ServerPing -import StructureBoundingBox -import StructurePiece -import StructureStart -import TileEntityEnderChest -import TileEntityLootable -import WorldGenStronghold -import WorldProvider + +files=$(cat "$basedir/Spigot-Server-Patches/"* | grep "+++ b/src/main/java/net/minecraft/server/" | sort | uniq | sed 's/\+\+\+ b\/src\/main\/java\/net\/minecraft\/server\///g' | sed 's/.java//g') + +nonnms=$(cat "$basedir/Spigot-Server-Patches/"* | grep "create mode " | grep -Po "src/main/java/net/minecraft/server/(.*?).java" | sort | uniq | sed 's/src\/main\/java\/net\/minecraft\/server\///g' | sed 's/.java//g' ; + # TODO: Fix non nms to work for Paper, hard code these for now + echo "KeyedObject" ; + echo "MCUtil" ; + echo "PaperLightingQueue" +) + +function containsElement { + local e + for e in "${@:2}"; do + [[ "$e" == "$1" ]] && return 0; + done + return 1 +} +set +e +for f in $files; do + containsElement "$f" ${nonnms[@]} + if [ "$?" == "1" ]; then + if [ ! -f "$workdir/Spigot/Spigot-Server/src/main/java/net/minecraft/server/$f.java" ]; then + if [ ! -f "$decompiledir/$nms/$f.java" ]; then + echo "$(color 1 31) ERROR!!! Missing NMS$(color 1 34) $f $(colorend)"; + else + import $f + fi + fi + fi +done + +import NBTList +import TileEntityTypes + +set -e cd "$workdir/Spigot/Spigot-Server/" rm -rf nms-patches applyPatches.sh makePatches.sh >/dev/null 2>&1 $gitcmd add . -A >/dev/null 2>&1 diff --git a/scripts/rebuildPatches.sh b/scripts/rebuildPatches.sh index e0f6af26f9..ef64ea8182 100755 --- a/scripts/rebuildPatches.sh +++ b/scripts/rebuildPatches.sh @@ -39,10 +39,11 @@ function savePatches { echo "REBASE DETECTED - PARTIAL SAVE" last=$(cat "$basedir/$target/.git/rebase-apply/last") next=$(cat "$basedir/$target/.git/rebase-apply/next") + orderedfiles=$(find . -name "*.patch" | sort) for i in $(seq -f "%04g" 1 1 $last) do if [ $i -lt $next ]; then - rm ${i}-*.patch + rm $(echo "$orderedfiles{@}" | sed -n "${i}p") fi done else diff --git a/scripts/remap.sh b/scripts/remap.sh index c64bcca87f..b19d564af4 100755 --- a/scripts/remap.sh +++ b/scripts/remap.sh @@ -6,6 +6,7 @@ PS1="$" basedir="$(cd "$1" && pwd -P)" workdir="$basedir/work" minecraftversion=$(cat "${workdir}/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) +minecraftserverurl=$(cat "${workdir}/BuildData/info.json" | grep serverUrl | cut -d '"' -f 4) minecrafthash=$(cat "${workdir}/BuildData/info.json" | grep minecraftHash | cut -d '"' -f 4) accesstransforms="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep accessTransforms | cut -d '"' -f 4) classmappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep classMappings | cut -d '"' -f 4) @@ -16,7 +17,7 @@ jarpath="$workdir/Minecraft/$minecraftversion/$minecraftversion" echo "Downloading unmapped vanilla jar..." if [ ! -f "$jarpath.jar" ]; then mkdir -p "$workdir/Minecraft/$minecraftversion" - curl -s -o "$jarpath.jar" "https://s3.amazonaws.com/Minecraft.Download/versions/$minecraftversion/minecraft_server.$minecraftversion.jar" + curl -s -o "$jarpath.jar" "$minecraftserverurl" if [ "$?" != "0" ]; then echo "Failed to download the vanilla server jar. Check connectivity or try again later." exit 1 diff --git a/scripts/testServer.sh b/scripts/testServer.sh index 0a7cfbf25e..585768fa38 100755 --- a/scripts/testServer.sh +++ b/scripts/testServer.sh @@ -11,7 +11,7 @@ gitcmd="git -c commit.gpgsign=false" # # FUNCTIONS # -. $basedir/scripts/functions.sh +source $basedir/scripts/functions.sh updateTest() { paperstash diff --git a/work/BuildData b/work/BuildData index be360cc298..a5effc6142 160000 --- a/work/BuildData +++ b/work/BuildData @@ -1 +1 @@ -Subproject commit be360cc298a06b5355ecd057f5b1feb894a73f0f +Subproject commit a5effc614208d06202688a775f25d7b820b36d47 diff --git a/work/Bukkit b/work/Bukkit index bdd0eda71f..55a3379d9b 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit bdd0eda71f87cb8ca3b1842bd9bbd43bba5a08bd +Subproject commit 55a3379d9bcd38efb5c4f4d0db8bcee39db853df diff --git a/work/CraftBukkit b/work/CraftBukkit index 57ab4cfc6f..8fbc72b714 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 57ab4cfc6f4ff526d44319d9b8c79f6848db2de7 +Subproject commit 8fbc72b714a5051c6df8f05ac97528d747f1bdeb diff --git a/work/Spigot b/work/Spigot index 642f6d2288..6505f06b35 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 642f6d2288b830f41347e8c0a162fbc0584e1579 +Subproject commit 6505f06b355d5f1ea0fff2d0e8edbd60b2f75354