testserver/Spigot-Server-Patches/0148-Toggleable-Elytra-Wall...

46 lines
2.0 KiB
Diff
Raw Normal View History

2016-12-20 22:34:27 +00:00
From 961f75590f7005e54499c7c9cb884efc9624f6df 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
2016-11-17 02:23:38 +00:00
index cda516f..965edc9 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2016-11-17 02:23:38 +00:00
@@ -360,4 +360,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
2016-12-20 22:34:27 +00:00
index 87c39c9..132e03f 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
2016-12-10 23:50:31 +00:00
@@ -1689,6 +1689,7 @@ public abstract class EntityLiving extends Entity {
this.motY = 0.30000001192092896D;
}
2016-11-17 02:23:38 +00:00
} else if (this.cH()) {
+ if (world.paperConfig.elytraHitWallDamage) { // Paper start - Toggleable Elytra Wall Damage
if (this.motY > -0.5D) {
this.fallDistance = 1.0F;
}
2016-12-10 23:50:31 +00:00
@@ -1738,6 +1739,7 @@ public abstract class EntityLiving extends Entity {
this.damageEntity(DamageSource.FLY_INTO_WALL, f7);
}
}
+ } // Paper end - Elyta Wall Damage if statement
if (this.onGround && !this.world.isClientSide) {
if (getFlag(7) && !CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) // CraftBukkit
--
2016-12-10 23:50:31 +00:00
2.9.3