mirror of https://github.com/YatopiaMC/Yatopia.git
36 lines
2.0 KiB
Diff
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/world/entity/projectile/EntitySnowball.java b/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java
|
|
index 0d3b9c81e47eef645335e49a1d6d88db7338aa4b..6bfd3f57e6c04ed426870d6dbf068bf324f22d6e 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java
|
|
@@ -40,7 +40,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 3b9898ee7ae0fb826cfc3102d3b84bc5323d163d..b6a3d73dc0866d98b00f52d65a39646ab001a1f2 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -258,6 +258,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;
|