mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
36 lines
1.9 KiB
Diff
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 ed2f039c4042861bcfa2e41d8281eefd37daa9fa..d5d84893c77b4e60a19032d765d76bfd24cbbb2b 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/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 7fa4e1e1e31de83d00aa32f2b4aeb6c245ae3131..985bf48699eb7bf205ec98c044552714a094fef7 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -295,6 +295,11 @@ public class PurpurWorldConfig {
|
|
totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
|
|
}
|
|
|
|
+ public int snowballDamage = -1;
|
|
+ private void snowballSettings() {
|
|
+ snowballDamage = getInt("gameplay-mechanics.projectile-damage.snowball", snowballDamage);
|
|
+ }
|
|
+
|
|
public int dragonFireballDespawnRate = -1;
|
|
public int eggDespawnRate = -1;
|
|
public int enderPearlDespawnRate = -1;
|