Files
Purpur/patches/server/0113-Add-configurable-snowball-damage.patch
2022-08-05 15:30:11 -05:00

36 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <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/world/entity/projectile/Snowball.java b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
index a725851060f13e734dbd2fbf8c83c9e1af57a8b7..74f798baafc53cd7dd1d4f58bc9a3581ba4f21da 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
@@ -54,7 +54,7 @@ public class Snowball extends ThrowableItemProjectile {
protected void onHitEntity(EntityHitResult entityHitResult) {
super.onHitEntity(entityHitResult);
Entity entity = entityHitResult.getEntity();
- int i = entity instanceof Blaze ? 3 : 0;
+ int i = entity.level.purpurConfig.snowballDamage >= 0 ? entity.level.purpurConfig.snowballDamage : entity instanceof Blaze ? 3 : 0; // Purpur
entity.hurt(DamageSource.thrown(this, this.getOwner()), (float)i);
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 7db751ad178e01f692452e0201c03891ce6eb299..0670df9d9ad1b62af6f2e14732cbe8da03fc78b9 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -356,6 +356,11 @@ public class PurpurWorldConfig {
}
}
+ public int snowballDamage = -1;
+ private void snowballSettings() {
+ snowballDamage = getInt("gameplay-mechanics.projectile-damage.snowball", snowballDamage);
+ }
+
public boolean silkTouchEnabled = false;
public String silkTouchSpawnerName = "<reset><white>Spawner";
public List<String> silkTouchSpawnerLore = new ArrayList<>();