From fab2a52fe1d43a13d18fecaf3f4e6b347c978844 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 18 Jun 2016 00:25:37 -0500 Subject: [PATCH] Fix missed case in top of nether void damage patch General cleanup, etc. Closes GH-343 --- ...nfigurable-top-of-nether-void-damage.patch | 68 +++++++++++++++---- ...oreboards-for-non-players-by-default.patch | 6 +- .../0097-Don-t-teleport-dead-entities.patch | 6 +- ...9-Vehicle-Event-Cancellation-Changes.patch | 14 ++-- ...56-Optional-old-TNT-cannon-behaviors.patch | 12 ++-- 5 files changed, 73 insertions(+), 33 deletions(-) diff --git a/Spigot-Server-Patches/0028-Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/0028-Configurable-top-of-nether-void-damage.patch index 48d6887b23..7498349417 100644 --- a/Spigot-Server-Patches/0028-Configurable-top-of-nether-void-damage.patch +++ b/Spigot-Server-Patches/0028-Configurable-top-of-nether-void-damage.patch @@ -1,4 +1,4 @@ -From 7f3fc798c035b20cfaca5d6cffc6575ba19764a8 Mon Sep 17 00:00:00 2001 +From 62b72202a06a326fb3ad80b5fcff791500bd3df1 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 @@ -20,31 +20,71 @@ index 8fc2f6c..d78b688 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 8f88bc8..1b58f7d 100644 +index bb9be9b..18062df 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -305,6 +305,13 @@ public abstract class Entity implements ICommandListener { - this.U(); +@@ -385,9 +385,15 @@ public abstract class Entity implements ICommandListener { + this.fallDistance *= 0.5F; + } + ++ // Paper start - Configurable nether ceiling damage ++ // Extracted to own function ++ /* + if (this.locY < -64.0D) { + this.Y(); + } ++ */ ++ this.checkAndDoHeightDamage(); ++ // Paper end + + if (!this.world.isClientSide) { + this.setFlag(0, this.fireTicks > 0); +@@ -397,6 +403,18 @@ public abstract class Entity implements ICommandListener { + this.world.methodProfiler.b(); } -+ /** -+ * Paper - Checks if the feature is enabled and the entity is above the nether world bedrock height -+ */ ++ // 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; + } + - public void U() { - this.world.methodProfiler.a("entityBaseTick"); - if (this.isPassenger() && this.bB().dead) { -@@ -385,7 +392,7 @@ public abstract class Entity implements ICommandListener { - this.fallDistance *= 0.5F; ++ protected void checkAndDoHeightDamage() { ++ if (this.locY < -64.0D || paperNetherCheck()) { ++ this.kill(); ++ } ++ } ++ // Paper end ++ + protected void H() { + if (this.portalCooldown > 0) { + --this.portalCooldown; +@@ -453,6 +471,7 @@ public abstract class Entity implements ICommandListener { + this.fireTicks = 0; + } + ++ protected final void kill() { this.Y(); } // Paper - OBFHELPER + protected void Y() { + this.die(); + } +diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +index 36ef2da..4438d83 100644 +--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java ++++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +@@ -210,9 +210,15 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT + this.setDamage(this.getDamage() - 1.0F); } -- if (this.locY < -64.0D) { -+ if (this.locY < -64.0D || paperNetherCheck()) { // Paper - Configurable top-of-nether void damage) ++ // Paper start - Configurable nether ceiling damage ++ // Extracted to own function ++ /* + if (this.locY < -64.0D) { this.Y(); } ++ */ ++ this.checkAndDoHeightDamage(); ++ // Paper end + + int i; -- 2.8.3 diff --git a/Spigot-Server-Patches/0073-Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/0073-Disable-Scoreboards-for-non-players-by-default.patch index b92ec0f1f8..bd66a4b28d 100644 --- a/Spigot-Server-Patches/0073-Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/0073-Disable-Scoreboards-for-non-players-by-default.patch @@ -1,4 +1,4 @@ -From 9567aaa67ebbdbfc570e398ba6d9a5ee7676bb59 Mon Sep 17 00:00:00 2001 +From b7cbd2b9ee5b422b23f63f71139095e6ad13741b 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 @@ -37,10 +37,10 @@ index 5f579bc..8e5419d 100644 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 2dfe212..f192fe5 100644 +index 1764791..153fc76 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1882,6 +1882,7 @@ public abstract class Entity implements ICommandListener { +@@ -1894,6 +1894,7 @@ public abstract class Entity implements ICommandListener { @Nullable public ScoreboardTeamBase aQ() { diff --git a/Spigot-Server-Patches/0097-Don-t-teleport-dead-entities.patch b/Spigot-Server-Patches/0097-Don-t-teleport-dead-entities.patch index f012e8e77d..e33a869760 100644 --- a/Spigot-Server-Patches/0097-Don-t-teleport-dead-entities.patch +++ b/Spigot-Server-Patches/0097-Don-t-teleport-dead-entities.patch @@ -1,4 +1,4 @@ -From b378c82821f7f7a5fee66bd12b7b861c8cd8378f Mon Sep 17 00:00:00 2001 +From f914a2ed987032315fc8febb9439ae4311e75e91 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 6a1bc3a..306e9cd 100644 +index 3d5a23c..3ed3732 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2132,7 +2132,7 @@ public abstract class Entity implements ICommandListener { +@@ -2144,7 +2144,7 @@ public abstract class Entity implements ICommandListener { } public Entity teleportTo(Location exit, boolean portal) { diff --git a/Spigot-Server-Patches/0139-Vehicle-Event-Cancellation-Changes.patch b/Spigot-Server-Patches/0139-Vehicle-Event-Cancellation-Changes.patch index 7516c58de7..e00a74282e 100644 --- a/Spigot-Server-Patches/0139-Vehicle-Event-Cancellation-Changes.patch +++ b/Spigot-Server-Patches/0139-Vehicle-Event-Cancellation-Changes.patch @@ -1,14 +1,14 @@ -From ba1a119f2fdbbc0b152da75993ce0f02ce6ba469 Mon Sep 17 00:00:00 2001 +From 8d2082d83ba9184205d4334e34de9cb6b6a9e9f7 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 22 Apr 2016 18:20:05 -0500 Subject: [PATCH] Vehicle Event Cancellation Changes diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index f4a804b..b9d9fb9 100644 +index eff088d..c3efc7f 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1687,6 +1687,10 @@ public abstract class Entity implements ICommandListener { +@@ -1699,6 +1699,10 @@ public abstract class Entity implements ICommandListener { } public boolean a(Entity entity, boolean flag) { @@ -19,7 +19,7 @@ index f4a804b..b9d9fb9 100644 if (!flag && (!this.n(entity) || !entity.q(this))) { return false; } else { -@@ -1695,7 +1699,7 @@ public abstract class Entity implements ICommandListener { +@@ -1707,7 +1711,7 @@ public abstract class Entity implements ICommandListener { } this.au = entity; @@ -28,7 +28,7 @@ index f4a804b..b9d9fb9 100644 return true; } } -@@ -1722,12 +1726,20 @@ public abstract class Entity implements ICommandListener { +@@ -1734,12 +1738,20 @@ public abstract class Entity implements ICommandListener { } protected void o(Entity entity) { @@ -49,7 +49,7 @@ index f4a804b..b9d9fb9 100644 CraftEntity craft = (CraftEntity) entity.getBukkitEntity().getVehicle(); Entity orig = craft == null ? null : craft.getHandle(); if (getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity && entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4, false)) { // Boolean not used -@@ -1750,6 +1762,8 @@ public abstract class Entity implements ICommandListener { +@@ -1762,6 +1774,8 @@ public abstract class Entity implements ICommandListener { return; } // Spigot end @@ -58,7 +58,7 @@ index f4a804b..b9d9fb9 100644 if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bw() instanceof EntityHuman)) { this.passengers.add(0, entity); } else { -@@ -1775,16 +1789,29 @@ public abstract class Entity implements ICommandListener { +@@ -1787,16 +1801,29 @@ public abstract class Entity implements ICommandListener { CraftEntity craftn = (CraftEntity) entity.getBukkitEntity().getVehicle(); Entity n = craftn == null ? null : craftn.getHandle(); if (event.isCancelled() || n != orig) { diff --git a/Spigot-Server-Patches/0156-Optional-old-TNT-cannon-behaviors.patch b/Spigot-Server-Patches/0156-Optional-old-TNT-cannon-behaviors.patch index 77f5ce83cf..c3c3814de6 100644 --- a/Spigot-Server-Patches/0156-Optional-old-TNT-cannon-behaviors.patch +++ b/Spigot-Server-Patches/0156-Optional-old-TNT-cannon-behaviors.patch @@ -1,4 +1,4 @@ -From 6eeca920de7374cfc679c530eda2858b90ba6258 Mon Sep 17 00:00:00 2001 +From d070b172f6515fcefdd6d18b1b3918a54be6f39c Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 22 May 2016 20:20:55 -0500 Subject: [PATCH] Optional old TNT cannon behaviors @@ -208,10 +208,10 @@ index 8530952..b50e3d6 100644 world.getServer().getPluginManager().callEvent(event); } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ef97ad1..9a08388 100644 +index 797e078..e21769f 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -967,6 +967,12 @@ public abstract class Entity implements ICommandListener { +@@ -979,6 +979,12 @@ public abstract class Entity implements ICommandListener { } public boolean ak() { @@ -224,7 +224,7 @@ index ef97ad1..9a08388 100644 if (this.bB() instanceof EntityBoat) { this.inWater = false; } else if (this.world.a(this.getBoundingBox().grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.001D), Material.WATER, this)) { -@@ -1168,6 +1174,12 @@ public abstract class Entity implements ICommandListener { +@@ -1180,6 +1186,12 @@ public abstract class Entity implements ICommandListener { } public double f(double d0, double d1, double d2) { @@ -237,7 +237,7 @@ index ef97ad1..9a08388 100644 double d3 = this.locX - d0; double d4 = this.locY - d1; double d5 = this.locZ - d2; -@@ -1222,6 +1234,12 @@ public abstract class Entity implements ICommandListener { +@@ -1234,6 +1246,12 @@ public abstract class Entity implements ICommandListener { } public void g(double d0, double d1, double d2) { @@ -250,7 +250,7 @@ index ef97ad1..9a08388 100644 this.motX += d0; this.motY += d1; this.motZ += d2; -@@ -2340,6 +2358,12 @@ public abstract class Entity implements ICommandListener { +@@ -2352,6 +2370,12 @@ public abstract class Entity implements ICommandListener { } public boolean bg() {