diff --git a/CraftBukkit-Patches/0166-Apply-NBTReadLimiter-to-more-things.patch b/CraftBukkit-Patches/0166-Apply-NBTReadLimiter-to-more-things.patch index 845f3e4e70..7aa463f806 100644 --- a/CraftBukkit-Patches/0166-Apply-NBTReadLimiter-to-more-things.patch +++ b/CraftBukkit-Patches/0166-Apply-NBTReadLimiter-to-more-things.patch @@ -9,14 +9,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java @@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/CraftBukkit-Patches/0167-Allow-Attribute-Capping.patch b/CraftBukkit-Patches/0167-Allow-Attribute-Capping.patch index 9a35396a42..43bf021df5 100644 --- a/CraftBukkit-Patches/0167-Allow-Attribute-Capping.patch +++ b/CraftBukkit-Patches/0167-Allow-Attribute-Capping.patch @@ -11,12 +11,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/AttributeRanged.java @@ -0,0 +0,0 @@ package net.minecraft.server; public class AttributeRanged extends AttributeBase { - + private final double a; - private final double b; + public double b; // Spigot private String c; - + public AttributeRanged(String s, double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/server/GenericAttributes.java b/src/main/java/net/minecraft/server/GenericAttributes.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/GenericAttributes.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; public class GenericAttributes { - + private static final Logger f = LogManager.getLogger(); - public static final IAttribute maxHealth = (new AttributeRanged("generic.maxHealth", 20.0D, 0.0D, Double.MAX_VALUE)).a("Max Health").a(true); + // Spigot Start @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public static final IAttribute d = (new AttributeRanged("generic.movementSpeed", 0.699999988079071D, 0.0D, org.spigotmc.SpigotConfig.movementSpeed)).a("Movement Speed").a(true); + public static final IAttribute e = new AttributeRanged("generic.attackDamage", 2.0D, 0.0D, org.spigotmc.SpigotConfig.attackDamage); + // Spigot End - + public static NBTTagList a(AttributeMapBase attributemapbase) { NBTTagList nbttaglist = new NBTTagList(); diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/CraftBukkit-Patches/0168-Set-the-minimum-max-health-attribute-value-to-0.1.patch b/CraftBukkit-Patches/0168-Set-the-minimum-max-health-attribute-value-to-0.1.patch index 6efb24c5dd..49649bcc1a 100644 --- a/CraftBukkit-Patches/0168-Set-the-minimum-max-health-attribute-value-to-0.1.patch +++ b/CraftBukkit-Patches/0168-Set-the-minimum-max-health-attribute-value-to-0.1.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/GenericAttributes.java +++ b/src/main/java/net/minecraft/server/GenericAttributes.java @@ -0,0 +0,0 @@ public class GenericAttributes { - + private static final Logger f = LogManager.getLogger(); // Spigot Start - public static final IAttribute maxHealth = (new AttributeRanged("generic.maxHealth", 20.0D, 0.0D, org.spigotmc.SpigotConfig.maxHealth)).a("Max Health").a(true); diff --git a/Spigot-Server-Patches/Configurable-nerf-for-TNT-cannons.patch b/Spigot-Server-Patches/Configurable-nerf-for-TNT-cannons.patch deleted file mode 100644 index ddb3dd3ea8..0000000000 --- a/Spigot-Server-Patches/Configurable-nerf-for-TNT-cannons.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Wed, 9 Jul 2014 17:38:48 -0500 -Subject: [PATCH] Configurable nerf for TNT cannons - - -diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java -+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -@@ -0,0 +0,0 @@ - package net.minecraft.server; - - import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit -+import org.github.paperspigot.PaperSpigotWorldConfig; - - public class EntityTNTPrimed extends Entity { - -@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity { - this.motY *= -0.5D; - } - -+ // PaperSpigot start - Configurable nerf for TNT cannons -+ if (this.locY > PaperSpigotWorldConfig.tntHeightNerf && PaperSpigotWorldConfig.tntHeightNerf != 0) { -+ this.die(); -+ } -+ // PaperSpigot end -+ - if (this.fuseTicks-- <= 0) { - // CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event - if (!this.world.isStatic) { -diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java -+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig - keepSpawnInMemory = getBoolean( "keep-spawn-loaded", true ); - log( "Keep spawn chunk loaded: " + keepSpawnInMemory ); - } -+ -+ public static double tntHeightNerf; -+ private void tntHeightNerf() -+ { -+ tntHeightNerf = getDouble( "tnt-entity-height-nerf", 0 ); -+ } - } --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Drop-falling-block-entities-that-are-above-the-speci.patch b/Spigot-Server-Patches/Drop-falling-block-entities-that-are-above-the-speci.patch new file mode 100644 index 0000000000..d3d7d073b2 --- /dev/null +++ b/Spigot-Server-Patches/Drop-falling-block-entities-that-are-above-the-speci.patch @@ -0,0 +1,54 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Byteflux +Date: Wed, 30 Jul 2014 03:31:43 -0500 +Subject: [PATCH] Drop falling block entities that are above the specified + height + + +diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java ++++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java +@@ -0,0 +0,0 @@ import java.util.ArrayList; + import java.util.Iterator; + + import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import org.github.paperspigot.PaperSpigotWorldConfig; + + public class EntityFallingBlock extends Entity { + +@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { + ++this.ticksLived; + this.motY -= 0.03999999910593033D; + this.move(this.motX, this.motY, this.motZ); ++ ++ // PaperSpigot start - Drop falling blocks above the specified height ++ if (PaperSpigotWorldConfig.fallingBlockHeightNerf != 0 && this.locY > PaperSpigotWorldConfig.fallingBlockHeightNerf) { ++ if (this.dropItem) { ++ this.a(new ItemStack(this.id, 1, this.id.getDropData(this.data)), 0.0F); ++ } ++ ++ this.die(); ++ } ++ // PaperSpigot end ++ + this.motX *= 0.9800000190734863D; + this.motY *= 0.9800000190734863D; + this.motZ *= 0.9800000190734863D; +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig + keepSpawnInMemory = getBoolean( "keep-spawn-loaded", true ); + log( "Keep spawn chunk loaded: " + keepSpawnInMemory ); + } ++ ++ public static double fallingBlockHeightNerf; ++ private void fallingBlockHeightNerf() ++ { ++ // Technically a little disingenuous as it applies to all falling blocks but alas, backwards compat prevails! ++ fallingBlockHeightNerf = getDouble( "tnt-entity-height-nerf", 0 ); ++ } + } +-- \ No newline at end of file