Paper/Spigot-Server-Patches/0143-Toggleable-Elytra-Wall-Damage.patch

46 lines
2.0 KiB
Diff
Raw Normal View History

2017-06-26 01:00:32 +02:00
From bd6532cf43d9fa4c84e78f1e543b3c9927a476b5 Mon Sep 17 00:00:00 2001
From: Jadon Fowler <jadonflower@gmail.com>
Date: Sat, 18 Jun 2016 23:13:59 -0700
Subject: [PATCH] Toggleable Elytra Wall Damage
Instead of calculating the damage taken from hitting a wall, you can
disable it in the config.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2017-06-26 01:00:32 +02:00
index ef60c15bd..cec9ea74c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2017-05-14 20:05:01 +02:00
@@ -355,4 +355,9 @@ public class PaperWorldConfig {
delayChunkUnloadsBy *= 1000;
}
}
+
+ public boolean elytraHitWallDamage = true;
+ private void elytraHitWallDamage() {
+ elytraHitWallDamage = getBoolean("elytra-hit-wall-damage", true);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
2017-06-26 01:00:32 +02:00
index f5b04ca48..3086a36f9 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
2017-06-26 01:00:32 +02:00
@@ -1732,6 +1732,7 @@ public abstract class EntityLiving extends Entity {
this.motY = 0.30000001192092896D;
}
2017-06-08 16:16:51 +02:00
} else if (this.cP()) {
2016-11-17 03:23:38 +01:00
+ if (world.paperConfig.elytraHitWallDamage) { // Paper start - Toggleable Elytra Wall Damage
if (this.motY > -0.5D) {
this.fallDistance = 1.0F;
}
2017-06-26 01:00:32 +02:00
@@ -1781,6 +1782,7 @@ public abstract class EntityLiving extends Entity {
2017-05-14 20:05:01 +02:00
this.damageEntity(DamageSource.FLY_INTO_WALL, f8);
}
}
+ } // Paper end - Elyta Wall Damage if statement
if (this.onGround && !this.world.isClientSide) {
if (getFlag(7) && !CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) // CraftBukkit
--
2017-06-26 01:00:32 +02:00
2.13.0