mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
remove LivingEntity#safeFallDistance API
This commit is contained in:
35
patches/server/0101-Add-configurable-snowball-damage.patch
Normal file
35
patches/server/0101-Add-configurable-snowball-damage.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
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 2b4d206c0d31ba38d7b2af654bd420e85145d441..f59a2903bfb8ae591a638ea5bb387caaa93ce664 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
|
||||
@@ -58,7 +58,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(this.damageSources().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 8a35a9ad7a81308237a3c69ea9a1330a0e8b7548..a63c53c5d0309237337f3ef927b0eec8e7a6fbb5 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -350,6 +350,11 @@ public class PurpurWorldConfig {
|
||||
//}
|
||||
}
|
||||
|
||||
+ public int snowballDamage = -1;
|
||||
+ private void snowballSettings() {
|
||||
+ snowballDamage = getInt("gameplay-mechanics.projectile-damage.snowball", snowballDamage);
|
||||
+ }
|
||||
+
|
||||
public boolean anvilAllowColors = false;
|
||||
public boolean anvilColorsUseMiniMessage;
|
||||
private void anvilSettings() {
|
||||
Reference in New Issue
Block a user