From 695f3acbc517a34a64d391559202db3bb6359d87 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Tue, 24 Nov 2020 05:33:16 -0600 Subject: [PATCH] Add configurable snowball damage --- ...146-Add-configurable-snowball-damage.patch | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 patches/server/0146-Add-configurable-snowball-damage.patch diff --git a/patches/server/0146-Add-configurable-snowball-damage.patch b/patches/server/0146-Add-configurable-snowball-damage.patch new file mode 100644 index 000000000..5a60bfaba --- /dev/null +++ b/patches/server/0146-Add-configurable-snowball-damage.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Tue, 24 Nov 2020 05:32:02 -0600 +Subject: [PATCH] Add configurable snowball damage + + +diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java +index 34a5f481e..d7bab4446 100644 +--- a/src/main/java/net/minecraft/server/EntitySnowball.java ++++ b/src/main/java/net/minecraft/server/EntitySnowball.java +@@ -29,7 +29,7 @@ public class EntitySnowball extends EntityProjectileThrowable { + protected void a(MovingObjectPositionEntity movingobjectpositionentity) { + super.a(movingobjectpositionentity); + Entity entity = movingobjectpositionentity.getEntity(); +- int i = entity instanceof EntityBlaze ? 3 : 0; ++ int i = entity.world.purpurConfig.snowballDamage >= 0 ? entity.world.purpurConfig.snowballDamage : entity instanceof EntityBlaze ? 3 : 0; // Purpur + + entity.damageEntity(DamageSource.projectile(this, this.getShooter()), (float) i); + } +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index ff1afb353..07dcc3596 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -196,6 +196,11 @@ public class PurpurWorldConfig { + witherSkullDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.wither_skull", witherSkullDespawnRate); + } + ++ public int snowballDamage = -1; ++ private void snowballSettings() { ++ snowballDamage = getInt("gameplay-mechanics.projectile-damage.snowball", snowballDamage); ++ } ++ + public boolean useBetterMending = false; + public boolean boatEjectPlayersOnLand = false; + public boolean disableDropsOnCrammingDeath = false;