Files
Purpur/patches/server/0138-Add-boat-fall-damage-config.patch
BillyGalbreath dc4a1cba43 Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
dc7b7a160 Fix missing username console death message (#5654) (#5658)
c639a52a6 Add basic Datapack API (#5653) (#5653)
99c1d9da6 Updated Upstream (CraftBukkit) (#5652)
2d50c17e2 [CI-SKIP] Add PR rebasing steps (#5634)
2c5f8085e Remove boat interaction event (Fixes #5539)
96ee1fb8f fix WorldSaveEvent not firing with /save-all (#5650)
e90e7829e remove unneeded patch (#5641)
d875bacc2 Activate warning by default when people are doing silly things (#5642)
cb896d471 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5643)
ecbf5a38e Revert "Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636)"
20fc4ab70 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636)
20d8812ea Fix CraftPotionBrewer cache (#5632)

Tuinity Changes:
1222573d0 Fix incorrect status dataconverter for pre 1.13 chunks
2021-05-16 19:11:04 -05:00

49 lines
3.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
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 999eb87c688f0bc5d3d4bb4beb9f468f0eadc184..27d65af750e7b420da9d2817d75f257e4f729339 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -1140,7 +1140,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (this.isInvulnerable(damagesource)) {
return false;
} else {
- if (damagesource == DamageSource.FALL && getRootVehicle() instanceof net.minecraft.world.entity.vehicle.EntityMinecartAbstract && world.purpurConfig.minecartControllable && !world.purpurConfig.minecartControllableFallDamage) return false; // Purpur
+ // Purpur start
+ if (damagesource == DamageSource.FALL) {
+ if (getRootVehicle() instanceof net.minecraft.world.entity.vehicle.EntityMinecartAbstract && world.purpurConfig.minecartControllable && !world.purpurConfig.minecartControllableFallDamage) {
+ return false;
+ }
+ if (getRootVehicle() instanceof net.minecraft.world.entity.vehicle.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 5e3b23d50b6e8494066c71bdf7c14edc4a4a3716..944c1bbcb868e2e24f26db04b588f6f0c13164e5 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -268,6 +268,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;
@@ -282,6 +283,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);