From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 30 Nov 2020 19:36:35 -0600 Subject: [PATCH] Add boat fall damage config diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java index 9ec4008f2195908130410d2c36fb5bf21b26b991..f942c3ab757b768fbd1d459752b7f29094471c56 100644 --- a/src/main/java/net/minecraft/server/level/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java @@ -106,6 +106,7 @@ import net.minecraft.world.entity.monster.EntityMonster; import net.minecraft.world.entity.player.EntityHuman; import net.minecraft.world.entity.player.EnumChatVisibility; import net.minecraft.world.entity.projectile.EntityArrow; +import net.minecraft.world.entity.vehicle.EntityBoat; import net.minecraft.world.entity.vehicle.EntityMinecartAbstract; import net.minecraft.world.inventory.Container; import net.minecraft.world.inventory.ContainerHorse; @@ -1142,7 +1143,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (this.isInvulnerable(damagesource)) { return false; } else { - if (damagesource == DamageSource.FALL && getRootVehicle() instanceof EntityMinecartAbstract && world.purpurConfig.controllableMinecarts && !world.purpurConfig.controllableMinecartsFallDamage) return false; // Purpur + // Purpur start + if (damagesource == DamageSource.FALL) { + if (getRootVehicle() instanceof EntityMinecartAbstract && world.purpurConfig.controllableMinecarts && !world.purpurConfig.controllableMinecartsFallDamage) { + return false; + } + if (getRootVehicle() instanceof EntityBoat && !world.purpurConfig.boatsDoFallDamage) { + return false; + } + } + // Purpur end boolean flag = this.server.j() && this.canPvP() && "fall".equals(damagesource.translationIndex); if (!flag && isSpawnInvulnerable() && damagesource != DamageSource.OUT_OF_WORLD) { // Purpur diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java index 6b0b132ce3924722adbd8cb0beb45af446385fe6..34feb9f133044232846cd04f10268235d3076501 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -224,6 +224,7 @@ public class PurpurWorldConfig { public boolean useBetterMending = false; public boolean boatEjectPlayersOnLand = false; + public boolean boatsDoFallDamage = true; public boolean disableDropsOnCrammingDeath = false; public boolean entitiesPickUpLootBypassMobGriefing = false; public boolean entitiesCanUsePortals = true; @@ -237,6 +238,7 @@ public class PurpurWorldConfig { private void miscGameplayMechanicsSettings() { useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending); boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand); + boatsDoFallDamage = getBoolean("gameplay-mechanics.boat.do-fall-damage", boatsDoFallDamage); disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath); entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing); entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);