Files
Purpur/patches/server/0287-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch
granny 1f589eb065 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@487109f Readd 0414 use distance map to optimise entity tracker (#9868)
PaperMC/Paper@230682d Add raw iron & raw copper blocks to anti xray defaults (#7622)
PaperMC/Paper@44057da Remove duplicate water-sensitivity damage for unaware mobs (#9908)
PaperMC/Paper@f78d7ce Remove "fix-curing-zombie-villager-discount" exploit option (#9895)
PaperMC/Paper@aa6c4c1 Include packet class name in packet encoding error messages (#9907)
PaperMC/Paper@6592fed Use a server impl for hopper event to track get/setItem calls (#9905)
PaperMC/Paper@bffb08c Deprecate Player#boostElytra (#9899)
PaperMC/Paper@43c3432 Add entity API for getting the combined gene of a Panda (#9891)
PaperMC/Paper@15a0de2 Make Team extend ForwardingAudience (#9852)
PaperMC/Paper@0cdce89 Fix a bunch of stuff with player spawn locations (#9887)
PaperMC/Paper@8a3980c Add API to get the collision shape of a block before it's placed (#9821)
PaperMC/Paper@23860da Add predicate for block when raytracing (#9691)
PaperMC/Paper@75d04e9 Broadcast take item packets with collector as source (#9884)
PaperMC/Paper@2553f30 fix secure profile with proxy online mode (#9700)
PaperMC/Paper@e289acc Add more API to LingeringPotionSplashEvent (#9901)
PaperMC/Paper@8cafc07 Added missing enchantables to material tags (#9888)
2023-11-04 20:29:02 -07:00

39 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Sun, 13 Nov 2022 05:05:34 -0600
Subject: [PATCH] Add option to teleport to spawn on nether ceiling damage
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 1b58e4c4919d6e697533dd2f29f7c91ff5074987..d61d7ae47285d9779221011212f871c4ef7de830 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -917,6 +917,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
// Paper end
+ if (this.level().purpurConfig.teleportOnNetherCeilingDamage && this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this instanceof ServerPlayer player) player.teleport(io.papermc.paper.util.MCUtil.toLocation(this.level, this.level.getSharedSpawnPos())); else // Purpur
this.onBelowWorld();
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index c04befc0e4d97497087bc8961daefe814e199a84..443871290764e6863509acd0847f8c4c8f8566b6 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -417,6 +417,7 @@ public class PurpurWorldConfig {
public String playerDeathExpDropEquation = "expLevel * 7";
public int playerDeathExpDropMax = 100;
public boolean teleportIfOutsideBorder = false;
+ public boolean teleportOnNetherCeilingDamage = false;
public boolean totemOfUndyingWorksInInventory = false;
public boolean playerFixStuckPortal = false;
public boolean creativeOnePunch = false;
@@ -446,6 +447,7 @@ public class PurpurWorldConfig {
playerDeathExpDropEquation = getString("gameplay-mechanics.player.exp-dropped-on-death.equation", playerDeathExpDropEquation);
playerDeathExpDropMax = getInt("gameplay-mechanics.player.exp-dropped-on-death.maximum", playerDeathExpDropMax);
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
+ teleportOnNetherCeilingDamage = getBoolean("gameplay-mechanics.player.teleport-on-nether-ceiling-damage", teleportOnNetherCeilingDamage);
totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
playerFixStuckPortal = getBoolean("gameplay-mechanics.player.fix-stuck-in-portal", playerFixStuckPortal);
creativeOnePunch = getBoolean("gameplay-mechanics.player.one-punch-in-creative", creativeOnePunch);