Files
Purpur/patches/server/0138-Add-configurable-snowball-damage.patch
jmp 7f4c8f8715 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
7232d8f2a EntityLoadCrossbowEvent#shouldConsumeItem
4740bd6c8 Mark PlayerInventory#getItem as nullable
bd9ace578 Add a config option to limit the number of entities of each type to load/save in a chunk (#4792)
6bafeb5a9 Move logic from last patch into correct place
9668118fd disable entity ticking flag after watchdog obliteration
2021-01-14 14:47:12 -08:00

36 lines
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
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 5df5f771dfcdd01386600531defa4ab1b612160b..478184f94b146419f9a3107b4f8fd3b08e914588 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;