From 9874c9caa856f1034e843abec909bac1b301c728 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 14 Jul 2015 09:34:10 -0700 Subject: [PATCH] Various configurable toggles - Disable explosion knockback for players - Disable thunder logic - Disable ice and snow formation - Disable mood sounds --- .../Disable-explosion-knockback.patch | 71 +++++++++++++++++++ .../Disable-ice-and-snow.patch | 37 ++++++++++ .../Disable-mood-sounds.patch | 37 ++++++++++ Spigot-Server-Patches/Disable-thunder.patch | 37 ++++++++++ 4 files changed, 182 insertions(+) create mode 100644 Spigot-Server-Patches/Disable-explosion-knockback.patch create mode 100644 Spigot-Server-Patches/Disable-ice-and-snow.patch create mode 100644 Spigot-Server-Patches/Disable-mood-sounds.patch create mode 100644 Spigot-Server-Patches/Disable-thunder.patch diff --git a/Spigot-Server-Patches/Disable-explosion-knockback.patch b/Spigot-Server-Patches/Disable-explosion-knockback.patch new file mode 100644 index 000000000..3bb51c517 --- /dev/null +++ b/Spigot-Server-Patches/Disable-explosion-knockback.patch @@ -0,0 +1,71 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sudzzy +Date: Tue, 14 Jul 2015 09:20:44 -0700 +Subject: [PATCH] Disable explosion knockback + + +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { + } + } + +- if (flag) { ++ // PaperSpigot start - Disable explosion knockback ++ boolean knockbackCancelled = false; ++ if (flag && !(knockbackCancelled = world.paperSpigotConfig.disableExplosionKnockback && damagesource.isExplosion() && this instanceof EntityHuman)) { ++ // PaperSpigot end + this.world.broadcastEntityEffect(this, (byte) 2); + if (damagesource != DamageSource.DROWN) { + this.ac(); +@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { + } + } + ++ if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // PaperSpigot ++ + String s; + + if (this.getHealth() <= 0.0F) { +diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/Explosion.java ++++ b/src/main/java/net/minecraft/server/Explosion.java +@@ -0,0 +0,0 @@ public class Explosion { + continue; + } + // CraftBukkit end +- double d14 = EnchantmentProtection.a(entity, d13); ++ double d14 = entity instanceof EntityHuman && world.paperSpigotConfig.disableExplosionKnockback ? 0 : EnchantmentProtection.a(entity, d13); // PaperSpigot + + // PaperSpigot start - Fix cannons + /* +@@ -0,0 +0,0 @@ public class Explosion { + entity.g(d8 * d14, d9 * d14, d10 * d14); + // PaperSpigot end + +- if (entity instanceof EntityHuman && !((EntityHuman) entity).abilities.isInvulnerable) { ++ if (entity instanceof EntityHuman && !((EntityHuman) entity).abilities.isInvulnerable && !world.paperSpigotConfig.disableExplosionKnockback) { // PaperSpigot + this.k.put((EntityHuman) entity, new Vec3D(d8 * d13, d9 * d13, d10 * d13)); + } + } +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 + lavaFlowSpeedNormal = getInt( "lava-flow-speed.normal", 30 ); + lavaFlowSpeedNether = getInt( "lava-flow-speed.nether", 10 ); + } ++ ++ public boolean disableExplosionKnockback; ++ private void disableExplosionKnockback() ++ { ++ disableExplosionKnockback = getBoolean( "disable-explosion-knockback", false ); ++ } + } +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Disable-ice-and-snow.patch b/Spigot-Server-Patches/Disable-ice-and-snow.patch new file mode 100644 index 000000000..631fedc80 --- /dev/null +++ b/Spigot-Server-Patches/Disable-ice-and-snow.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sudzzy +Date: Tue, 14 Jul 2015 09:28:31 -0700 +Subject: [PATCH] Disable ice and snow + + +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { + } + + this.methodProfiler.c("iceandsnow"); +- if (this.random.nextInt(16) == 0) { ++ if (!this.paperSpigotConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // PaperSpigot - Disable ice and snow + this.m = this.m * 3 + 1013904223; + i1 = this.m >> 2; + blockposition = this.q(new BlockPosition(k + (i1 & 15), 0, l + (i1 >> 8 & 15))); +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 + { + disableThunder = getBoolean( "disable-thunder", false ); + } ++ ++ public boolean disableIceAndSnow; ++ private void disableIceAndSnow() ++ { ++ disableIceAndSnow = getBoolean( "disable-ice-and-snow", false ); ++ } + } +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Disable-mood-sounds.patch b/Spigot-Server-Patches/Disable-mood-sounds.patch new file mode 100644 index 000000000..e85b2b826 --- /dev/null +++ b/Spigot-Server-Patches/Disable-mood-sounds.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sudzzy +Date: Tue, 14 Jul 2015 09:30:28 -0700 +Subject: [PATCH] Disable mood sounds + + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + + protected void a(int i, int j, Chunk chunk) { + this.methodProfiler.c("moodSound"); +- if (this.L == 0 && !this.isClientSide) { ++ if (!this.paperSpigotConfig.disableMoodSounds && this.L == 0 && !this.isClientSide) { // PaperSpigot - Disable mood sounds + this.m = this.m * 3 + 1013904223; + int k = this.m >> 2; + int l = k & 15; +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 + { + disableIceAndSnow = getBoolean( "disable-ice-and-snow", false ); + } ++ ++ public boolean disableMoodSounds; ++ private void disableMoodSounds() ++ { ++ disableMoodSounds = getBoolean( "disable-mood-sounds", false ); ++ } + } +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Disable-thunder.patch b/Spigot-Server-Patches/Disable-thunder.patch new file mode 100644 index 000000000..4d0bff893 --- /dev/null +++ b/Spigot-Server-Patches/Disable-thunder.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sudzzy +Date: Tue, 14 Jul 2015 09:26:41 -0700 +Subject: [PATCH] Disable thunder + + +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { + int i1; + BlockPosition blockposition; + +- if (this.random.nextInt(100000) == 0 && this.S() && this.R()) { ++ if (!this.paperSpigotConfig.disableThunder && this.random.nextInt(100000) == 0 && this.S() && this.R()) { // PaperSpigot - Disable thunder + this.m = this.m * 3 + 1013904223; + i1 = this.m >> 2; + blockposition = this.a(new BlockPosition(k + (i1 & 15), 0, l + (i1 >> 8 & 15))); +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 + { + disableExplosionKnockback = getBoolean( "disable-explosion-knockback", false ); + } ++ ++ public boolean disableThunder; ++ private void disableThunder() ++ { ++ disableThunder = getBoolean( "disable-thunder", false ); ++ } + } +-- +1.9.5.msysgit.1 +