From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: 12emin34 <macanovic.emin@gmail.com>
Date: Wed, 4 Aug 2021 11:44:26 +0200
Subject: [PATCH] Toggle for kinetic damage


diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 3bef0780fa95a63887fdb64cb1b038d44cf1c028..34bf7a2a869329a4a1dd8b36fd8ab09fbcd3669e 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2792,7 +2792,11 @@ public abstract class LivingEntity extends Entity {
 
                     if (f4 > 0.0F) {
                         this.playSound(this.getFallDamageSound((int) f4), 1.0F, 1.0F);
-                        this.hurt(DamageSource.FLY_INTO_WALL, f4);
+                        // Purpur start
+                        if (level.purpurConfig.elytraKineticDamage) {
+                            this.hurt(DamageSource.FLY_INTO_WALL, f4);
+                        }
+                        // Purpur end
                     }
                 }
 
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 0cb6779f0da78830564b7d30ac2c1e018b9a0861..6e0c228e6171ce0acc3ee2a85527785a2e1204fb 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -137,12 +137,14 @@ public class PurpurWorldConfig {
     public boolean elytraIgnoreUnbreaking = false;
     public int elytraDamagePerFireworkBoost = 0;
     public int elytraDamagePerTridentBoost = 0;
+    public boolean elytraKineticDamage = true;
     private void elytraSettings() {
         elytraDamagePerSecond = getInt("gameplay-mechanics.elytra.damage-per-second", elytraDamagePerSecond);
         elytraDamageMultiplyBySpeed = getDouble("gameplay-mechanics.elytra.damage-multiplied-by-speed", elytraDamageMultiplyBySpeed);
         elytraIgnoreUnbreaking = getBoolean("gameplay-mechanics.elytra.ignore-unbreaking", elytraIgnoreUnbreaking);
         elytraDamagePerFireworkBoost = getInt("gameplay-mechanics.elytra.damage-per-boost.firework", elytraDamagePerFireworkBoost);
         elytraDamagePerTridentBoost = getInt("gameplay-mechanics.elytra.damage-per-boost.trident", elytraDamagePerTridentBoost);
+        elytraKineticDamage = getBoolean("gameplay-mechanics.elytra.kinetic-damage", elytraKineticDamage);
     }
 
     public int entityLifeSpan = 0;
