From 398f6983bde0c0ed0f9a5e48a891968665f83964 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 27 Jul 2014 14:14:24 -0500 Subject: [PATCH] Update from upstream SpigotMC Make "moved too quickly" limit configurable SpigotMC/Spigot@99a0a640e8bb3c706e9c51f4f61f6e1b8594fa32 Undeprecate Player#updateInventory()V SpigotMC/Spigot@5c32e1cb4839f1148b85d4de5978af8b5a3e5585 Fetch complete profile for skull items, similarly to TileEntitySkull. SpigotMC/Spigot@33d758773e0d71865bd59971409e4dc714826c2b Move getDouble into the Spigot Configuration patch SpigotMC/Spigot@b5dd202af169bc98d3657b916e3c339a7ca90ab3 Add missing particle to particle API SpigotMC/Spigot@273c64bbad7cec15f457d4b64797fdd566dfafed Log debug levels to the log file. SpigotMC/Spigot@348eae75f4efcfffceb031d1a2b10a4ae1b3466c Fix PlayerItemDamageEvent (we already had this #badupstreamrelations) SpigotMC/Spigot@e207ea23cd47880f781dfc65a08faae427821750 Move hopper patch to top for PR180 SpigotMC/Spigot@abb775108de23f9096dc9bd4a22d229bafe9ba83 Don't be so spammy on Java 6 SpigotMC/Spigot@5abb82b1ca8636ca699c2c53a424239236ade48e Apply NBTReadLimiter to more things SpigotMC/Spigot@408944e9f5ab228dea9c0b4ac3987d94884791dd --- Bukkit-Patches/0006-Add-Particle-API.patch | 17 +- ...ClassLoader-Deadlocks-Where-Possible.patch | 9 +- ...Undeprecate-Player-updateInventory-V.patch | 25 +++ CraftBukkit-Patches/0002-mc-dev-imports.patch | 170 +++++++++++++++++- .../0005-Spigot-Configuration.patch | 12 +- .../0018-PlayerItemDamageEvent.patch | 13 +- ...2-Allow-Disabling-of-Command-Logging.patch | 23 ++- .../0133-Convert-player-skulls-async.patch | 131 +++++++++++++- ...ns-not-moving-invulnerable-entities.patch} | 0 ...-Add-damager-to-the-unhandled-error.patch} | 0 ...-Fireball-EntityDamageByEntityEvent.patch} | 0 ...47-Cross-World-Entity-Teleportation.patch} | 0 ...block-placement-interaction-packets.patch} | 0 ...atch => 0149-Better-item-validation.patch} | 0 ... => 0150-Further-Seed-Customisation.patch} | 0 ...> 0151-Disable-ResourceLeakDetector.patch} | 0 ...-Information-to-session.lock-Errors.patch} | 0 ...ng.patch => 0153-Safer-JSON-Loading.patch} | 0 ... => 0154-Fix-Slow-Loading-Libraries.patch} | 0 ...h => 0155-Add-CommandLine-EULA-Flag.patch} | 0 ...isnamed-function-from-1.7.10-update.patch} | 0 ...g-table-wiping-meta-when-placing-st.patch} | 0 ...-ocelots-when-plugins-spawn-ocelots.patch} | 0 ...revent-a-crash-involving-attributes.patch} | 0 ...anning.patch => 0160-Fix-IP-banning.patch} | 0 ...ke-moved-wrongly-limit-configurable.patch} | 15 +- ...=> 0162-Fix-Null-Tile-Entity-Worlds.patch} | 0 ...moved-too-quickly-limit-configurable.patch | 37 ++++ ...164-Log-debug-levels-to-the-log-file.patch | 29 +++ ... => 0165-Alternative-Hopper-Ticking.patch} | 0 ...-Apply-NBTReadLimiter-to-more-things.patch | 66 +++++++ SneakyThrow.jar | Bin 0 -> 643 bytes .../0031-Fix-PlayerItemDamageEvent.patch | 23 --- 33 files changed, 506 insertions(+), 64 deletions(-) create mode 100644 Bukkit-Patches/0029-Undeprecate-Player-updateInventory-V.patch rename CraftBukkit-Patches/{0145-Fix-explosions-not-moving-invulnerable-entities.patch => 0144-Fix-explosions-not-moving-invulnerable-entities.patch} (100%) rename CraftBukkit-Patches/{0146-Add-damager-to-the-unhandled-error.patch => 0145-Add-damager-to-the-unhandled-error.patch} (100%) rename CraftBukkit-Patches/{0147-Fix-ItemFrame-and-Fireball-EntityDamageByEntityEvent.patch => 0146-Fix-ItemFrame-and-Fireball-EntityDamageByEntityEvent.patch} (100%) rename CraftBukkit-Patches/{0148-Cross-World-Entity-Teleportation.patch => 0147-Cross-World-Entity-Teleportation.patch} (100%) rename CraftBukkit-Patches/{0149-Limit-block-placement-interaction-packets.patch => 0148-Limit-block-placement-interaction-packets.patch} (100%) rename CraftBukkit-Patches/{0150-Better-item-validation.patch => 0149-Better-item-validation.patch} (100%) rename CraftBukkit-Patches/{0151-Further-Seed-Customisation.patch => 0150-Further-Seed-Customisation.patch} (100%) rename CraftBukkit-Patches/{0152-Disable-ResourceLeakDetector.patch => 0151-Disable-ResourceLeakDetector.patch} (100%) rename CraftBukkit-Patches/{0153-Add-More-Information-to-session.lock-Errors.patch => 0152-Add-More-Information-to-session.lock-Errors.patch} (100%) rename CraftBukkit-Patches/{0154-Safer-JSON-Loading.patch => 0153-Safer-JSON-Loading.patch} (100%) rename CraftBukkit-Patches/{0155-Fix-Slow-Loading-Libraries.patch => 0154-Fix-Slow-Loading-Libraries.patch} (100%) rename CraftBukkit-Patches/{0156-Add-CommandLine-EULA-Flag.patch => 0155-Add-CommandLine-EULA-Flag.patch} (100%) rename CraftBukkit-Patches/{0157-Fix-misnamed-function-from-1.7.10-update.patch => 0156-Fix-misnamed-function-from-1.7.10-update.patch} (100%) rename CraftBukkit-Patches/{0158-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch => 0157-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch} (100%) rename CraftBukkit-Patches/{0159-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch => 0158-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch} (100%) rename CraftBukkit-Patches/{0160-Prevent-a-crash-involving-attributes.patch => 0159-Prevent-a-crash-involving-attributes.patch} (100%) rename CraftBukkit-Patches/{0161-Fix-IP-banning.patch => 0160-Fix-IP-banning.patch} (100%) rename CraftBukkit-Patches/{0162-Make-moved-wrongly-limit-configurable.patch => 0161-Make-moved-wrongly-limit-configurable.patch} (81%) rename CraftBukkit-Patches/{0163-Fix-Null-Tile-Entity-Worlds.patch => 0162-Fix-Null-Tile-Entity-Worlds.patch} (100%) create mode 100644 CraftBukkit-Patches/0163-Make-moved-too-quickly-limit-configurable.patch create mode 100644 CraftBukkit-Patches/0164-Log-debug-levels-to-the-log-file.patch rename CraftBukkit-Patches/{0144-Alternative-Hopper-Ticking.patch => 0165-Alternative-Hopper-Ticking.patch} (100%) create mode 100644 CraftBukkit-Patches/0166-Apply-NBTReadLimiter-to-more-things.patch create mode 100644 SneakyThrow.jar delete mode 100644 Spigot-Server-Patches/0031-Fix-PlayerItemDamageEvent.patch diff --git a/Bukkit-Patches/0006-Add-Particle-API.patch b/Bukkit-Patches/0006-Add-Particle-API.patch index d7ed33325..acab57c6f 100644 --- a/Bukkit-Patches/0006-Add-Particle-API.patch +++ b/Bukkit-Patches/0006-Add-Particle-API.patch @@ -1,11 +1,11 @@ -From a6da83fdbd71c75c3fc298b878e723aaaab9ee18 Mon Sep 17 00:00:00 2001 +From 2cc00cabffae84bcc74ee1c03a646dc92d012fbb 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 2474a2d..9964203 100644 +index 2474a2d..37f29e2 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; @@ -16,7 +16,7 @@ index 2474a2d..9964203 100644 import org.bukkit.potion.Potion; /** -@@ -79,27 +80,183 @@ public enum Effect { +@@ -79,27 +80,188 @@ public enum Effect { /** * The flames seen on a mobspawner; a visual effect. */ @@ -147,6 +147,11 @@ index 2474a2d..9964203 100644 + */ + HAPPY_VILLAGER("happyVillager", Type.PARTICLE), + /** ++ * The smoke particles that appears on blazes, minecarts ++ * with furnaces and fire ++ */ ++ 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. + */ @@ -204,7 +209,7 @@ index 2474a2d..9964203 100644 * @deprecated Magic value */ @Deprecated -@@ -108,6 +265,15 @@ public enum Effect { +@@ -108,6 +270,15 @@ public enum Effect { } /** @@ -220,7 +225,7 @@ index 2474a2d..9964203 100644 * @return The type of the effect. */ public Type getType() { -@@ -115,8 +281,7 @@ public enum Effect { +@@ -115,8 +286,7 @@ public enum Effect { } /** @@ -230,7 +235,7 @@ index 2474a2d..9964203 100644 */ public Class getData() { return this.data; -@@ -136,12 +301,32 @@ public enum Effect { +@@ -136,12 +306,32 @@ public enum Effect { static { for (Effect effect : values()) { diff --git a/Bukkit-Patches/0027-Ease-ClassLoader-Deadlocks-Where-Possible.patch b/Bukkit-Patches/0027-Ease-ClassLoader-Deadlocks-Where-Possible.patch index c82207cf4..aa2bdd3ad 100644 --- a/Bukkit-Patches/0027-Ease-ClassLoader-Deadlocks-Where-Possible.patch +++ b/Bukkit-Patches/0027-Ease-ClassLoader-Deadlocks-Where-Possible.patch @@ -1,4 +1,4 @@ -From 99d279c5236b39c7b1b15807adb06c350d2b2dc3 Mon Sep 17 00:00:00 2001 +From b4437c2fd60590de97f4c03a74dc2651e45a5b66 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 @@ -19,7 +19,7 @@ index 6611342..a845e81 100644 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 13f8633..6890106 100644 +index 13f8633..4cffa13 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -17,7 +17,7 @@ import org.bukkit.plugin.PluginDescriptionFile; @@ -31,7 +31,7 @@ index 13f8633..6890106 100644 private final PluginDescriptionFile description; private final File dataFolder; private final File file; -@@ -25,6 +25,27 @@ final class PluginClassLoader extends URLClassLoader { +@@ -25,6 +25,30 @@ final class PluginClassLoader extends URLClassLoader { private JavaPlugin pluginInit; private IllegalStateException pluginState; @@ -49,6 +49,9 @@ index 13f8633..6890106 100644 + 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 ); diff --git a/Bukkit-Patches/0029-Undeprecate-Player-updateInventory-V.patch b/Bukkit-Patches/0029-Undeprecate-Player-updateInventory-V.patch new file mode 100644 index 000000000..4d3783f57 --- /dev/null +++ b/Bukkit-Patches/0029-Undeprecate-Player-updateInventory-V.patch @@ -0,0 +1,25 @@ +From bfd8aa6acd79658dacc8ee531b048ab2f4b92ac9 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 37c8a58..b2ad5b7 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -333,10 +333,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(); + + /** +-- +1.9.1 + diff --git a/CraftBukkit-Patches/0002-mc-dev-imports.patch b/CraftBukkit-Patches/0002-mc-dev-imports.patch index 3b79c3409..6fc512d2c 100644 --- a/CraftBukkit-Patches/0002-mc-dev-imports.patch +++ b/CraftBukkit-Patches/0002-mc-dev-imports.patch @@ -1,10 +1,28 @@ -From 3396c90bea2a2d2bf1cd932b1355d4545c22ecaa Mon Sep 17 00:00:00 2001 +From 7d7028eccdbe9281dbfcc7d294d4ba650acc0ae1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 1 Dec 2013 15:10:48 +1100 Subject: [PATCH] mc-dev imports Imported files which are only modified by Spigot, not upstream. Files here should be completely unmodified aside from trivial changes such as adding throws statements to ensure proper compilation. You may need to add unrelated files in order to ensure a compilable result in the face of synthetic methods. +diff --git a/pom.xml b/pom.xml +index 6aeffa8..3c0cdff 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -108,6 +108,13 @@ + 1.3 + test + ++ ++ org.spigotmc ++ sneaky-throw ++ 1.0 ++ system ++ ${project.basedir}/../SneakyThrow.jar ++ + + + diff --git a/src/main/java/net/minecraft/server/BanEntrySerializer.java b/src/main/java/net/minecraft/server/BanEntrySerializer.java new file mode 100644 index 0000000..3b4b596 @@ -1604,6 +1622,144 @@ index 0000000..af13af5 + return this.toString(); + } +} +diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +new file mode 100644 +index 0000000..20fe0f1 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +@@ -0,0 +1,132 @@ ++package net.minecraft.server; ++ ++import java.io.BufferedInputStream; ++import java.io.BufferedOutputStream; ++import java.io.ByteArrayInputStream; ++import java.io.ByteArrayOutputStream; ++import java.io.DataInput; ++import java.io.DataInputStream; ++import java.io.DataOutput; ++import java.io.DataOutputStream; ++import java.io.IOException; ++import java.io.InputStream; ++import java.io.OutputStream; ++import java.util.zip.GZIPInputStream; ++import java.util.zip.GZIPOutputStream; ++ ++public class NBTCompressedStreamTools { ++ ++ public static NBTTagCompound a(InputStream inputstream) { ++ try { ++ DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(inputstream))); ++ ++ NBTTagCompound nbttagcompound; ++ ++ try { ++ nbttagcompound = a((DataInput) datainputstream, NBTReadLimiter.a); ++ } finally { ++ datainputstream.close(); ++ } ++ ++ return nbttagcompound; ++ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null; ++ } ++ ++ public static void a(NBTTagCompound nbttagcompound, OutputStream outputstream) { ++ try { ++ DataOutputStream dataoutputstream = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(outputstream))); ++ ++ try { ++ a(nbttagcompound, (DataOutput) dataoutputstream); ++ } finally { ++ dataoutputstream.close(); ++ } ++ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } ++ } ++ ++ public static NBTTagCompound a(byte[] abyte, NBTReadLimiter nbtreadlimiter) { ++ try { ++ DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(abyte)))); ++ ++ NBTTagCompound nbttagcompound; ++ ++ try { ++ nbttagcompound = a((DataInput) datainputstream, nbtreadlimiter); ++ } finally { ++ datainputstream.close(); ++ } ++ ++ return nbttagcompound; ++ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null; ++ } ++ ++ public static byte[] a(NBTTagCompound nbttagcompound) { ++ try { ++ ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); ++ DataOutputStream dataoutputstream = new DataOutputStream(new GZIPOutputStream(bytearrayoutputstream)); ++ ++ try { ++ a(nbttagcompound, (DataOutput) dataoutputstream); ++ } finally { ++ dataoutputstream.close(); ++ } ++ ++ return bytearrayoutputstream.toByteArray(); ++ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null; ++ } ++ ++ public static NBTTagCompound a(DataInputStream datainputstream) { ++ return a((DataInput) datainputstream, NBTReadLimiter.a); ++ } ++ ++ public static NBTTagCompound a(DataInput datainput, NBTReadLimiter nbtreadlimiter) { ++ try { ++ NBTBase nbtbase = a(datainput, 0, nbtreadlimiter); ++ ++ if (nbtbase instanceof NBTTagCompound) { ++ return (NBTTagCompound) nbtbase; ++ } else { ++ throw new IOException("Root tag must be a named compound tag"); ++ } ++ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null; ++ } ++ ++ public static void a(NBTTagCompound nbttagcompound, DataOutput dataoutput) { ++ a((NBTBase) nbttagcompound, dataoutput); ++ } ++ ++ private static void a(NBTBase nbtbase, DataOutput dataoutput) { ++ try { ++ dataoutput.writeByte(nbtbase.getTypeId()); ++ if (nbtbase.getTypeId() != 0) { ++ dataoutput.writeUTF(""); ++ nbtbase.write(dataoutput); ++ } ++ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } ++ } ++ ++ private static NBTBase a(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) { ++ try { ++ byte b0 = datainput.readByte(); ++ ++ if (b0 == 0) { ++ return new NBTTagEnd(); ++ } else { ++ datainput.readUTF(); ++ NBTBase nbtbase = NBTBase.createTag(b0); ++ ++ try { ++ nbtbase.load(datainput, i, nbtreadlimiter); ++ return nbtbase; ++ } catch (IOException ioexception) { ++ CrashReport crashreport = CrashReport.a(ioexception, "Loading NBT data"); ++ CrashReportSystemDetails crashreportsystemdetails = crashreport.a("NBT Tag"); ++ ++ crashreportsystemdetails.a("Tag name", "[UNNAMED TAG]"); ++ crashreportsystemdetails.a("Tag type", Byte.valueOf(b0)); ++ throw new ReportedException(crashreport); ++ } ++ } ++ } catch (IOException ex) { org.spigotmc.SneakyThrow.sneaky( ex ); } return null; ++ } ++} diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java new file mode 100644 index 0000000..3eeed3e @@ -3706,6 +3862,18 @@ index 0000000..7ca18a1 + return new WorldGenVillageStart(this.c, this.b, i, j, this.f); + } +} +diff --git a/src/main/resources/org/spigotmc/SneakyThrow.class b/src/main/resources/org/spigotmc/SneakyThrow.class +new file mode 100644 +index 0000000000000000000000000000000000000000..635518693adaeee6f771d2a4c9f92672048a4c4d +GIT binary patch +literal 184 +zcmX^0Z`VEsW(HjbE=C64;Jnnt?8=agqWp5bEOrKVMh1bb#Ii*FoW#6zegCAa)Z`LI +z2Cm@z(xT*4x6GVWMg|t={1hN1q2Ys22-csNl#^<$83vTfFG|-hF33#JFUd{TN3wyD +ufvp&9A3M-~MFu7YP6iNQ1kxM~Y(Sb7$m0Xjj6j-6Yd=U5$YufY7#IQ5^(s;T + +literal 0 +HcmV?d00001 + -- 1.9.1 diff --git a/CraftBukkit-Patches/0005-Spigot-Configuration.patch b/CraftBukkit-Patches/0005-Spigot-Configuration.patch index e93d098cd..50582356b 100644 --- a/CraftBukkit-Patches/0005-Spigot-Configuration.patch +++ b/CraftBukkit-Patches/0005-Spigot-Configuration.patch @@ -1,4 +1,4 @@ -From 2d68f826e2ef628afb3b6a375cec19d50c8be8d7 Mon Sep 17 00:00:00 2001 +From d86f6761992a8b01d66ef6ab05cf8f860e95281b Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 7 Jul 2013 09:32:53 +1000 Subject: [PATCH] Spigot Configuration @@ -96,10 +96,10 @@ index eb0b342..d997b48 100644 int pollCount = 0; diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java new file mode 100644 -index 0000000..a4de4e9 +index 0000000..f662b81 --- /dev/null +++ b/src/main/java/org/spigotmc/SpigotConfig.java -@@ -0,0 +1,132 @@ +@@ -0,0 +1,138 @@ +package org.spigotmc; + +import com.google.common.base.Throwables; @@ -231,6 +231,12 @@ index 0000000..a4de4e9 + config.addDefault( path, def ); + return config.getString( path, config.getString( path ) ); + } ++ ++ private static double getDouble(String path, double def) ++ { ++ config.addDefault( path, def ); ++ return config.getDouble( path, config.getDouble( path ) ); ++ } +} diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java new file mode 100644 diff --git a/CraftBukkit-Patches/0018-PlayerItemDamageEvent.patch b/CraftBukkit-Patches/0018-PlayerItemDamageEvent.patch index 3fc6df4d5..e6e643c5e 100644 --- a/CraftBukkit-Patches/0018-PlayerItemDamageEvent.patch +++ b/CraftBukkit-Patches/0018-PlayerItemDamageEvent.patch @@ -1,11 +1,11 @@ -From a7fee6f33394acc942799bac537e7e578fbf1791 Mon Sep 17 00:00:00 2001 +From 816009797a85563fe27578d16d24ede5d33f0a6d Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 4 Mar 2013 18:45:52 +1100 Subject: [PATCH] PlayerItemDamageEvent diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index c9d74d3..05d7c4e 100644 +index c9d74d3..a2ab06a 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -279,7 +279,13 @@ public final class ItemStack { @@ -40,6 +40,15 @@ index c9d74d3..05d7c4e 100644 return false; } } +@@ -307,7 +322,7 @@ public final class ItemStack { + public void damage(int i, EntityLiving entityliving) { + if (!(entityliving instanceof EntityHuman) || !((EntityHuman) entityliving).abilities.canInstantlyBuild) { + if (this.g()) { +- if (this.isDamaged(i, entityliving.aI())) { ++ if (this.isDamaged(i, entityliving.aI(), entityliving)) { // Spigot + entityliving.a(this); + --this.count; + if (entityliving instanceof EntityHuman) { -- 1.9.1 diff --git a/CraftBukkit-Patches/0032-Allow-Disabling-of-Command-Logging.patch b/CraftBukkit-Patches/0032-Allow-Disabling-of-Command-Logging.patch index 5d2670ad3..e3e0cbb69 100644 --- a/CraftBukkit-Patches/0032-Allow-Disabling-of-Command-Logging.patch +++ b/CraftBukkit-Patches/0032-Allow-Disabling-of-Command-Logging.patch @@ -1,6 +1,6 @@ -From 1c1d6e10d736b880eb6507ed711eda59efb05456 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Fri, 21 Jun 2013 18:01:29 +1000 +From b60ff81c08ad243e95bb23cf22bf03e73e630068 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Sun, 27 Jul 2014 14:12:17 -0500 Subject: [PATCH] Allow Disabling of Command Logging @@ -18,19 +18,24 @@ index 9596da2..3a24fcd 100644 CraftPlayer player = this.getPlayer(); diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index dc4d4b3..a83ee05 100644 +index 6dfa8b0..6ea100e 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java -@@ -142,4 +142,10 @@ public class SpigotConfig - config.addDefault( path, def ); - return config.getString( path, config.getString( path ) ); - } +@@ -145,7 +145,13 @@ public class SpigotConfig + + private static double getDouble(String path, double def) + { +- config.addDefault( path, def ); +- return config.getDouble( path, config.getDouble( path ) ); ++ config.addDefault(path, def); ++ return config.getDouble(path, config.getDouble(path)); ++ } + + public static boolean logCommands; + private static void logCommands() + { + logCommands = getBoolean( "commands.log", true ); -+ } + } } -- 1.9.1 diff --git a/CraftBukkit-Patches/0133-Convert-player-skulls-async.patch b/CraftBukkit-Patches/0133-Convert-player-skulls-async.patch index c97eff557..9080f4cdd 100644 --- a/CraftBukkit-Patches/0133-Convert-player-skulls-async.patch +++ b/CraftBukkit-Patches/0133-Convert-player-skulls-async.patch @@ -1,11 +1,85 @@ -From d23be5d57d15f481f15fe9e3fab86eae8e72836a Mon Sep 17 00:00:00 2001 +From 6eaf9a0a9503de652b7a3dfad975c891c09d74ca Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 20 Apr 2014 13:18:55 +0100 Subject: [PATCH] Convert player skulls async +diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java +index 2723ccb..26f9fae 100644 +--- a/src/main/java/net/minecraft/server/ItemStack.java ++++ b/src/main/java/net/minecraft/server/ItemStack.java +@@ -216,9 +216,61 @@ public final class ItemStack { + if (nbttagcompound.hasKeyOfType("tag", 10)) { + // CraftBukkit - make defensive copy as this data may be coming from the save thread + this.tag = (NBTTagCompound) nbttagcompound.getCompound("tag").clone(); ++ validateSkullSkin(); // Spigot + } + } + ++ // Spigot start - make sure the tag is given the full gameprofile if it's a skull (async lookup) ++ public void validateSkullSkin() ++ { ++ if ( this.item == Items.SKULL && this.getData() == 3 ) ++ { ++ String owner; ++ if ( this.tag.hasKeyOfType( "SkullOwner", 8 ) ) ++ { ++ owner = this.tag.getString( "SkullOwner" ); ++ } else if ( this.tag.hasKeyOfType( "SkullOwner", 10 ) ) ++ { ++ net.minecraft.util.com.mojang.authlib.GameProfile profile = GameProfileSerializer.deserialize( this.tag.getCompound( "SkullOwner" ) ); ++ if ( profile == null || !profile.getProperties().isEmpty() ) ++ { ++ return; ++ } else ++ { ++ owner = profile.getName(); ++ } ++ } else ++ { ++ return; ++ } ++ ++ final String finalOwner = owner; ++ TileEntitySkull.executor.execute( new Runnable() ++ { ++ @Override ++ public void run() ++ { ++ ++ final net.minecraft.util.com.mojang.authlib.GameProfile profile = TileEntitySkull.skinCache.getUnchecked( finalOwner.toLowerCase() ); ++ if ( profile != null ) ++ { ++ MinecraftServer.getServer().processQueue.add( new Runnable() ++ { ++ @Override ++ public void run() ++ { ++ NBTTagCompound nbtProfile = new NBTTagCompound(); ++ GameProfileSerializer.serialize( nbtProfile, profile ); ++ ItemStack.this.tag.set( "SkullOwner", nbtProfile ); ++ } ++ } ); ++ } ++ } ++ } ); ++ } ++ } ++ // Spigot end ++ + public int getMaxStackSize() { + return this.getItem().getMaxStackSize(); + } +@@ -457,6 +509,7 @@ public final class ItemStack { + + public void setTag(NBTTagCompound nbttagcompound) { + this.tag = nbttagcompound; ++ validateSkullSkin(); // Spigot + } + + public String getName() { diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index 2a50db9..2b59690 100644 +index 2a50db9..c95e4c8 100644 --- a/src/main/java/net/minecraft/server/TileEntitySkull.java +++ b/src/main/java/net/minecraft/server/TileEntitySkull.java @@ -6,11 +6,61 @@ import net.minecraft.util.com.google.common.collect.Iterables; @@ -30,12 +104,12 @@ index 2a50db9..2b59690 100644 private int i; private GameProfile j = null; + // Spigot start -+ private static final Executor executor = Executors.newFixedThreadPool(3, ++ public static final Executor executor = Executors.newFixedThreadPool(3, + new ThreadFactoryBuilder() + .setNameFormat("Head Conversion Thread - %1$d") + .build() + ); -+ private static final Cache skinCache = CacheBuilder.newBuilder() ++ public static final Cache skinCache = CacheBuilder.newBuilder() + .maximumSize( 5000 ) + .expireAfterAccess( 60, TimeUnit.MINUTES ) + .build( new CacheLoader() @@ -120,6 +194,51 @@ index 2a50db9..2b59690 100644 } } } +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +index d648d05..e32bcb1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +@@ -46,13 +46,39 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { + } + + @Override +- void applyToItem(NBTTagCompound tag) { ++ void applyToItem(final NBTTagCompound tag) { // Spigot - make final + super.applyToItem(tag); + + if (hasOwner()) { + NBTTagCompound owner = new NBTTagCompound(); + GameProfileSerializer.serialize(owner, profile); +- tag.set(SKULL_OWNER.NBT, owner); ++ tag.set( SKULL_OWNER.NBT, owner ); ++ // Spigot start - do an async lookup of the profile. ++ // Unfortunately there is not way to refresh the holding ++ // inventory, so that responsibility is left to the user. ++ net.minecraft.server.TileEntitySkull.executor.execute( new Runnable() ++ { ++ @Override ++ public void run() ++ { ++ ++ final GameProfile profile = net.minecraft.server.TileEntitySkull.skinCache.getUnchecked( CraftMetaSkull.this.profile.getName().toLowerCase() ); ++ if ( profile != null ) ++ { ++ MinecraftServer.getServer().processQueue.add( new Runnable() ++ { ++ @Override ++ public void run() ++ { ++ NBTTagCompound owner = new NBTTagCompound(); ++ GameProfileSerializer.serialize( owner, profile ); ++ tag.set( SKULL_OWNER.NBT, owner ); ++ } ++ } ); ++ } ++ } ++ } ); ++ // Spigot end + } + } + -- -1.9.1 - +1.9.1 \ No newline at end of file diff --git a/CraftBukkit-Patches/0145-Fix-explosions-not-moving-invulnerable-entities.patch b/CraftBukkit-Patches/0144-Fix-explosions-not-moving-invulnerable-entities.patch similarity index 100% rename from CraftBukkit-Patches/0145-Fix-explosions-not-moving-invulnerable-entities.patch rename to CraftBukkit-Patches/0144-Fix-explosions-not-moving-invulnerable-entities.patch diff --git a/CraftBukkit-Patches/0146-Add-damager-to-the-unhandled-error.patch b/CraftBukkit-Patches/0145-Add-damager-to-the-unhandled-error.patch similarity index 100% rename from CraftBukkit-Patches/0146-Add-damager-to-the-unhandled-error.patch rename to CraftBukkit-Patches/0145-Add-damager-to-the-unhandled-error.patch diff --git a/CraftBukkit-Patches/0147-Fix-ItemFrame-and-Fireball-EntityDamageByEntityEvent.patch b/CraftBukkit-Patches/0146-Fix-ItemFrame-and-Fireball-EntityDamageByEntityEvent.patch similarity index 100% rename from CraftBukkit-Patches/0147-Fix-ItemFrame-and-Fireball-EntityDamageByEntityEvent.patch rename to CraftBukkit-Patches/0146-Fix-ItemFrame-and-Fireball-EntityDamageByEntityEvent.patch diff --git a/CraftBukkit-Patches/0148-Cross-World-Entity-Teleportation.patch b/CraftBukkit-Patches/0147-Cross-World-Entity-Teleportation.patch similarity index 100% rename from CraftBukkit-Patches/0148-Cross-World-Entity-Teleportation.patch rename to CraftBukkit-Patches/0147-Cross-World-Entity-Teleportation.patch diff --git a/CraftBukkit-Patches/0149-Limit-block-placement-interaction-packets.patch b/CraftBukkit-Patches/0148-Limit-block-placement-interaction-packets.patch similarity index 100% rename from CraftBukkit-Patches/0149-Limit-block-placement-interaction-packets.patch rename to CraftBukkit-Patches/0148-Limit-block-placement-interaction-packets.patch diff --git a/CraftBukkit-Patches/0150-Better-item-validation.patch b/CraftBukkit-Patches/0149-Better-item-validation.patch similarity index 100% rename from CraftBukkit-Patches/0150-Better-item-validation.patch rename to CraftBukkit-Patches/0149-Better-item-validation.patch diff --git a/CraftBukkit-Patches/0151-Further-Seed-Customisation.patch b/CraftBukkit-Patches/0150-Further-Seed-Customisation.patch similarity index 100% rename from CraftBukkit-Patches/0151-Further-Seed-Customisation.patch rename to CraftBukkit-Patches/0150-Further-Seed-Customisation.patch diff --git a/CraftBukkit-Patches/0152-Disable-ResourceLeakDetector.patch b/CraftBukkit-Patches/0151-Disable-ResourceLeakDetector.patch similarity index 100% rename from CraftBukkit-Patches/0152-Disable-ResourceLeakDetector.patch rename to CraftBukkit-Patches/0151-Disable-ResourceLeakDetector.patch diff --git a/CraftBukkit-Patches/0153-Add-More-Information-to-session.lock-Errors.patch b/CraftBukkit-Patches/0152-Add-More-Information-to-session.lock-Errors.patch similarity index 100% rename from CraftBukkit-Patches/0153-Add-More-Information-to-session.lock-Errors.patch rename to CraftBukkit-Patches/0152-Add-More-Information-to-session.lock-Errors.patch diff --git a/CraftBukkit-Patches/0154-Safer-JSON-Loading.patch b/CraftBukkit-Patches/0153-Safer-JSON-Loading.patch similarity index 100% rename from CraftBukkit-Patches/0154-Safer-JSON-Loading.patch rename to CraftBukkit-Patches/0153-Safer-JSON-Loading.patch diff --git a/CraftBukkit-Patches/0155-Fix-Slow-Loading-Libraries.patch b/CraftBukkit-Patches/0154-Fix-Slow-Loading-Libraries.patch similarity index 100% rename from CraftBukkit-Patches/0155-Fix-Slow-Loading-Libraries.patch rename to CraftBukkit-Patches/0154-Fix-Slow-Loading-Libraries.patch diff --git a/CraftBukkit-Patches/0156-Add-CommandLine-EULA-Flag.patch b/CraftBukkit-Patches/0155-Add-CommandLine-EULA-Flag.patch similarity index 100% rename from CraftBukkit-Patches/0156-Add-CommandLine-EULA-Flag.patch rename to CraftBukkit-Patches/0155-Add-CommandLine-EULA-Flag.patch diff --git a/CraftBukkit-Patches/0157-Fix-misnamed-function-from-1.7.10-update.patch b/CraftBukkit-Patches/0156-Fix-misnamed-function-from-1.7.10-update.patch similarity index 100% rename from CraftBukkit-Patches/0157-Fix-misnamed-function-from-1.7.10-update.patch rename to CraftBukkit-Patches/0156-Fix-misnamed-function-from-1.7.10-update.patch diff --git a/CraftBukkit-Patches/0158-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch b/CraftBukkit-Patches/0157-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch similarity index 100% rename from CraftBukkit-Patches/0158-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch rename to CraftBukkit-Patches/0157-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch diff --git a/CraftBukkit-Patches/0159-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch b/CraftBukkit-Patches/0158-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch similarity index 100% rename from CraftBukkit-Patches/0159-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch rename to CraftBukkit-Patches/0158-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch diff --git a/CraftBukkit-Patches/0160-Prevent-a-crash-involving-attributes.patch b/CraftBukkit-Patches/0159-Prevent-a-crash-involving-attributes.patch similarity index 100% rename from CraftBukkit-Patches/0160-Prevent-a-crash-involving-attributes.patch rename to CraftBukkit-Patches/0159-Prevent-a-crash-involving-attributes.patch diff --git a/CraftBukkit-Patches/0161-Fix-IP-banning.patch b/CraftBukkit-Patches/0160-Fix-IP-banning.patch similarity index 100% rename from CraftBukkit-Patches/0161-Fix-IP-banning.patch rename to CraftBukkit-Patches/0160-Fix-IP-banning.patch diff --git a/CraftBukkit-Patches/0162-Make-moved-wrongly-limit-configurable.patch b/CraftBukkit-Patches/0161-Make-moved-wrongly-limit-configurable.patch similarity index 81% rename from CraftBukkit-Patches/0162-Make-moved-wrongly-limit-configurable.patch rename to CraftBukkit-Patches/0161-Make-moved-wrongly-limit-configurable.patch index bb0239920..35d79deb6 100644 --- a/CraftBukkit-Patches/0162-Make-moved-wrongly-limit-configurable.patch +++ b/CraftBukkit-Patches/0161-Make-moved-wrongly-limit-configurable.patch @@ -1,11 +1,11 @@ -From 15597ddb21ca4af28df3fef88ed70672dc71cbd2 Mon Sep 17 00:00:00 2001 +From 71ccfcaea97281da32267e9e77f7c170912da742 Mon Sep 17 00:00:00 2001 From: Jonas Konrad Date: Fri, 4 Jul 2014 23:03:13 +0200 Subject: [PATCH] Make "moved wrongly" limit configurable diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 9a7b256..f064f6e 100644 +index 20c49e3..cd4f0c9 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -399,7 +399,8 @@ public class PlayerConnection implements PacketPlayInListener { @@ -19,20 +19,14 @@ index 9a7b256..f064f6e 100644 c.warn(this.player.getName() + " moved wrongly!"); } diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 7998aac..2e6e172 100644 +index 429ad36..6a230f9 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java -@@ -327,4 +327,16 @@ public class SpigotConfig +@@ -333,4 +333,10 @@ public class SpigotConfig { intCacheLimit = getInt( "settings.int-cache-limit", 1024 ); } + -+ private static double getDouble(String path, double def) -+ { -+ config.addDefault( path, def ); -+ return config.getDouble( path, config.getDouble( path ) ); -+ } -+ + public static double movedWronglyThreshold; + private static void movedWronglyThreshold() + { @@ -41,4 +35,3 @@ index 7998aac..2e6e172 100644 } -- 1.9.1 - diff --git a/CraftBukkit-Patches/0163-Fix-Null-Tile-Entity-Worlds.patch b/CraftBukkit-Patches/0162-Fix-Null-Tile-Entity-Worlds.patch similarity index 100% rename from CraftBukkit-Patches/0163-Fix-Null-Tile-Entity-Worlds.patch rename to CraftBukkit-Patches/0162-Fix-Null-Tile-Entity-Worlds.patch diff --git a/CraftBukkit-Patches/0163-Make-moved-too-quickly-limit-configurable.patch b/CraftBukkit-Patches/0163-Make-moved-too-quickly-limit-configurable.patch new file mode 100644 index 000000000..4942e158d --- /dev/null +++ b/CraftBukkit-Patches/0163-Make-moved-too-quickly-limit-configurable.patch @@ -0,0 +1,37 @@ +From 7ff8738025484544f9c23f3ceeda084b78e1dbc2 Mon Sep 17 00:00:00 2001 +From: Jonas Konrad +Date: Tue, 22 Jul 2014 15:59:01 +0200 +Subject: [PATCH] Make "moved too quickly" limit configurable + + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index f064f6e..d8f334a 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -371,7 +371,8 @@ public class PlayerConnection implements PacketPlayInListener { + // CraftBukkit end + double d10 = d7 * d7 + d8 * d8 + d9 * d9; + +- if (d10 > 100.0D && this.checkMovement && (!this.minecraftServer.N() || !this.minecraftServer.M().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports ++ // Spigot: make "moved too quickly" limit configurable ++ if (d10 > org.spigotmc.SpigotConfig.movedTooQuicklyThreshold && this.checkMovement && (!this.minecraftServer.N() || !this.minecraftServer.M().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports + c.warn(this.player.getName() + " moved too quickly! " + d4 + "," + d5 + "," + d6 + " (" + d7 + ", " + d8 + ", " + d9 + ")"); + this.a(this.y, this.z, this.q, this.player.yaw, this.player.pitch); + return; +diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java +index 2e6e172..6189566 100644 +--- a/src/main/java/org/spigotmc/SpigotConfig.java ++++ b/src/main/java/org/spigotmc/SpigotConfig.java +@@ -339,4 +339,10 @@ public class SpigotConfig + { + movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D ); + } ++ ++ public static double movedTooQuicklyThreshold; ++ private static void movedTooQuicklyThreshold() ++ { ++ movedTooQuicklyThreshold = getDouble( "settings.moved-too-quickly-threshold", 100.0D ); ++ } + } +-- +1.9.1 diff --git a/CraftBukkit-Patches/0164-Log-debug-levels-to-the-log-file.patch b/CraftBukkit-Patches/0164-Log-debug-levels-to-the-log-file.patch new file mode 100644 index 000000000..4e3f2a71e --- /dev/null +++ b/CraftBukkit-Patches/0164-Log-debug-levels-to-the-log-file.patch @@ -0,0 +1,29 @@ +From 46bc58b1fa5b417fdf572b6d9fb3391896a5d36d Mon Sep 17 00:00:00 2001 +From: Minecrell +Date: Thu, 24 Jul 2014 13:18:36 +0200 +Subject: [PATCH] Log debug levels to the log file. + + +diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml +index e2209b8..adc0181 100644 +--- a/src/main/resources/log4j2.xml ++++ b/src/main/resources/log4j2.xml +@@ -14,13 +14,13 @@ + + + +- ++ + + + +- ++ + +- ++ + + + +-- +1.9.1 diff --git a/CraftBukkit-Patches/0144-Alternative-Hopper-Ticking.patch b/CraftBukkit-Patches/0165-Alternative-Hopper-Ticking.patch similarity index 100% rename from CraftBukkit-Patches/0144-Alternative-Hopper-Ticking.patch rename to CraftBukkit-Patches/0165-Alternative-Hopper-Ticking.patch diff --git a/CraftBukkit-Patches/0166-Apply-NBTReadLimiter-to-more-things.patch b/CraftBukkit-Patches/0166-Apply-NBTReadLimiter-to-more-things.patch new file mode 100644 index 000000000..5d0b6dd6d --- /dev/null +++ b/CraftBukkit-Patches/0166-Apply-NBTReadLimiter-to-more-things.patch @@ -0,0 +1,66 @@ +From 2058c5a4ca7b63a86f429fbf8fecd75ade24464a Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Sun, 27 Jul 2014 20:46:04 +1000 +Subject: [PATCH] Apply NBTReadLimiter to more things. + + +diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +index 20fe0f1..6defdf5 100644 +--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java ++++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +@@ -46,7 +46,7 @@ public class NBTCompressedStreamTools { + + public static NBTTagCompound a(byte[] abyte, NBTReadLimiter nbtreadlimiter) { + try { +- DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(abyte)))); ++ DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new org.spigotmc.LimitStream(new GZIPInputStream(new ByteArrayInputStream(abyte)), nbtreadlimiter))); // Spigot + + NBTTagCompound nbttagcompound; + +diff --git a/src/main/java/org/spigotmc/LimitStream.java b/src/main/java/org/spigotmc/LimitStream.java +new file mode 100644 +index 0000000..dcc0548 +--- /dev/null ++++ b/src/main/java/org/spigotmc/LimitStream.java +@@ -0,0 +1,39 @@ ++package org.spigotmc; ++ ++import java.io.FilterInputStream; ++import java.io.IOException; ++import java.io.InputStream; ++import net.minecraft.server.NBTReadLimiter; ++ ++public class LimitStream extends FilterInputStream ++{ ++ ++ private final NBTReadLimiter limit; ++ ++ public LimitStream(InputStream is, NBTReadLimiter limit) ++ { ++ super( is ); ++ this.limit = limit; ++ } ++ ++ @Override ++ public int read() throws IOException ++ { ++ limit.a( 1 ); ++ return super.read(); ++ } ++ ++ @Override ++ public int read(byte[] b) throws IOException ++ { ++ limit.a( b.length ); ++ return super.read( b ); ++ } ++ ++ @Override ++ public int read(byte[] b, int off, int len) throws IOException ++ { ++ limit.a( len ); ++ return super.read( b, off, len ); ++ } ++} +-- +1.9.1 diff --git a/SneakyThrow.jar b/SneakyThrow.jar new file mode 100644 index 0000000000000000000000000000000000000000..321f64ee813bb8dcefcdb0c791c4f34491cfdc97 GIT binary patch literal 643 zcmWIWW@h1H00G@4zg@r#D8a%Y!;oK;t{)o0$-rEC^-3@pS8y{hvb*b)0?=unDW~+kuIuZa@Hwx4()XJC zrpAelYbDMkv)@{O;=qvuCmEP}9A-5)@_KA$s;qICCFo(C`L_MkriKch9)0eEWnIpVA#^wif$y9IKgEH TD;vmb%s|M<$iR>T#0(4opB%MJ literal 0 HcmV?d00001 diff --git a/Spigot-Server-Patches/0031-Fix-PlayerItemDamageEvent.patch b/Spigot-Server-Patches/0031-Fix-PlayerItemDamageEvent.patch deleted file mode 100644 index 8de0124dc..000000000 --- a/Spigot-Server-Patches/0031-Fix-PlayerItemDamageEvent.patch +++ /dev/null @@ -1,23 +0,0 @@ -From b8f93f43ea39ca1be0f96207995bee00ead425eb Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Thu, 24 Jul 2014 22:23:38 -0500 -Subject: [PATCH] Fix PlayerItemDamageEvent - -Taken from SpigotMC/Spigot PR#202 - -diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 2723ccb..569b2e3 100644 ---- a/src/main/java/net/minecraft/server/ItemStack.java -+++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -328,7 +328,7 @@ public final class ItemStack { - public void damage(int i, EntityLiving entityliving) { - if (!(entityliving instanceof EntityHuman) || !((EntityHuman) entityliving).abilities.canInstantlyBuild) { - if (this.g()) { -- if (this.isDamaged(i, entityliving.aI())) { -+ if (this.isDamaged(i, entityliving.aI(), entityliving)) { - entityliving.a(this); - --this.count; - if (entityliving instanceof EntityHuman) { --- -1.9.1 -