Option for hay block fall damage

This commit is contained in:
William Blake Galbreath
2019-11-30 01:32:45 -06:00
parent e77735f9a5
commit 584fb7f778
2 changed files with 46 additions and 0 deletions

View File

@@ -395,6 +395,11 @@ milk-cures-bad-omen
* **default**: false
* **description**: Allow players to drink milk to cure bad omen status effect
hay-block-fall-damage
~~~~~~~~~~~~~~~~~~~~~
* **default:** true
* **description:** Damage factor for when falling onto hay blocks. Set to true for no fall damage (Assassin's Creed style)
block-tick-events
~~~~~~~~~~~~~~~~~
* **default**: true

View File

@@ -0,0 +1,41 @@
From f8ffd6150b096620260a3bae19180b547ef2f493 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 30 Nov 2019 01:31:09 -0600
Subject: [PATCH] Option for hay block fall damage
---
src/main/java/net/minecraft/server/BlockHay.java | 2 +-
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/BlockHay.java b/src/main/java/net/minecraft/server/BlockHay.java
index e820cc0b06..e872d4666a 100644
--- a/src/main/java/net/minecraft/server/BlockHay.java
+++ b/src/main/java/net/minecraft/server/BlockHay.java
@@ -9,6 +9,6 @@ public class BlockHay extends BlockRotatable {
@Override
public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) {
- entity.b(f, 0.2F);
+ entity.b(f, world.purpurConfig.hayBlockFallDamage ? 0.2F : 0.0F); // Purpur
}
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 3ad3415c4a..a1237c5b9d 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -144,6 +144,11 @@ public class PurpurWorldConfig {
milkCuresBadOmen = getBoolean("milk-cures-bad-omen", milkCuresBadOmen);
}
+ public boolean hayBlockFallDamage = true;
+ private void hayBlockFallDamage() {
+ hayBlockFallDamage = getBoolean("hay-block-fall-damage", hayBlockFallDamage);
+ }
+
public int limitPillagerOutpostSpawns = 10;
private void limitPillagerOutpostSpawns() {
limitPillagerOutpostSpawns = getInt("limit-pillager-outpost-spawns", limitPillagerOutpostSpawns);
--
2.24.0.rc1