Add boat fall damage config

This commit is contained in:
William Blake Galbreath
2025-01-09 20:58:52 -08:00
committed by granny
parent d2132cfbfa
commit d139523031
4 changed files with 28 additions and 56 deletions

View File

@@ -8,6 +8,20 @@
// Paper start - rewrite chunk system
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
@@ -1217,6 +_,13 @@
if (this.isInvulnerableTo(level, damageSource)) {
return false;
} else {
+ // Purpur start - Add boat fall damage config
+ if (damageSource.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) {
+ if (getRootVehicle() instanceof net.minecraft.world.entity.vehicle.Boat && !level().purpurConfig.boatsDoFallDamage) {
+ return false;
+ }
+ }
+ // Purpur end - Add boat fall damage config
Entity entity = damageSource.getEntity();
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
!(entity instanceof Player player && !this.canHarmPlayer(player))
@@ -2014,6 +_,26 @@
this.lastSentExp = -1; // CraftBukkit - Added to reset
}