aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0145-Toggleable-Elytra-Wall-Damage.patch
blob: ecdf42102cd896a5ec1a5f38b0c4fa2135507912 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From dcfa2ba7251ae9627d3dda488cbdf7e3cc31892e 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
index 04861f146..dc96bd7f4 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -354,4 +354,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
index ec901150d..b8ac99e5d 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1690,6 +1690,7 @@ public abstract class EntityLiving extends Entity {
                     this.motY = 0.30000001192092896D;
                 }
             } else if (this.cH()) {
+                if (world.paperConfig.elytraHitWallDamage) { // Paper start - Toggleable Elytra Wall Damage
                 if (this.motY > -0.5D) {
                     this.fallDistance = 1.0F;
                 }
@@ -1739,6 +1740,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
-- 
2.12.2.windows.2