mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@996d529 Resend entity using the bundle packet (#9853) PaperMC/Paper@8cf2503 Updated Upstream (Bukkit/CraftBukkit) (#9876) PaperMC/Paper@2935067 Fix null item in sendEquipmentChange (#9869) PaperMC/Paper@b3cac04 Fix crash when version_history.json is empty (#9871) PaperMC/Paper@b1faa5d Fix PotionAPI ignores icon flag (#9864) PaperMC/Paper@52849f6 Cleanup disable explosion knockback patch (#9858) PaperMC/Paper@8b1ac39 Fix warden spawn reason from DEFAULT to NATURAL (#8744) PaperMC/Paper@c6fac38 fix UnsafeValues#loadAdvancement doesn't recalculate position (#9846) PaperMC/Paper@5bdfb29 Add player idle duration API (#9833) PaperMC/Paper@a81a384 Implement Velocity VarInt optimizations (#8418) PaperMC/Paper@415d708 [ci skip] Fix author in last patch PaperMC/Paper@3e4eaf2 [ci skip] Fix module derp PaperMC/Paper@5bb30ce Fix entity camera not being reset when cancelling spectating start/stop events (#9883) PaperMC/Paper@1865625 Fix NPE when no valid world is found on legacy Players (#9885)
52 lines
3.3 KiB
Diff
52 lines
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Thu, 27 Feb 2020 21:42:19 -0600
|
|
Subject: [PATCH] Configurable void damage height and damage
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 63d6fc245b38202674da4f7d15665b57d9c5ef3c..f93cf0029d51cf124bcbc4b4a8b5677978968dfd 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -860,7 +860,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
public void checkBelowWorld() {
|
|
// Paper start - Configurable nether ceiling damage
|
|
- if (this.getY() < (double) (this.level.getMinBuildHeight() - 64) || (this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
|
|
+ if (this.getY() < (double) (this.level.getMinBuildHeight() + level().purpurConfig.voidDamageHeight) || (this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER // Purpur
|
|
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
|
|
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
|
|
// Paper end
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
index eaff62f5dee0423723c259328d6c0c2c8a7156ef..5b80d41b267488d632492239298c94ded9ac40bb 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -2535,7 +2535,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
@Override
|
|
protected void onBelowWorld() {
|
|
- this.hurt(this.damageSources().fellOutOfWorld(), 4.0F);
|
|
+ this.hurt(this.damageSources().fellOutOfWorld(), (float) level().purpurConfig.voidDamageDealt); // Purpur
|
|
}
|
|
|
|
protected void updateSwingTime() {
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 189b59cd6218e8e6b7f7c0326211e1b6545e9ca3..9311e620a821bbd46d962dd01ef9b0c1ec99555f 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -98,10 +98,14 @@ public class PurpurWorldConfig {
|
|
public boolean disableDropsOnCrammingDeath = false;
|
|
public boolean milkCuresBadOmen = true;
|
|
public double tridentLoyaltyVoidReturnHeight = 0.0D;
|
|
+ public double voidDamageHeight = -64.0D;
|
|
+ public double voidDamageDealt = 4.0D;
|
|
private void miscGameplayMechanicsSettings() {
|
|
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
|
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
|
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
|
|
+ voidDamageHeight = getDouble("gameplay-mechanics.void-damage-height", voidDamageHeight);
|
|
+ voidDamageDealt = getDouble("gameplay-mechanics.void-damage-dealt", voidDamageDealt);
|
|
}
|
|
|
|
public double minecartMaxSpeed = 0.4D;
|