From fea65f7fc8890a9789daac9d49fb13d68af9a09b 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 34a5f481e6ed1357861dca15fb4013ec8484a292..d7bab4446a5a8eef98c10b1f6eb89de90365dfeb 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 d14a4955e5e2fc805b8fb6b46c9750ccc9955df0..effcabfd6b4cfb0ff2bdf058b60923f2162d9ce4 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;