Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit ae7e7cc

Browse files
BillyGalbreathgranny
authored andcommitted
Add option to teleport to spawn on nether ceiling damage
1 parent 0318f1c commit ae7e7cc

3 files changed

Lines changed: 10 additions & 38 deletions

File tree

patches/server/0265-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch

Lines changed: 0 additions & 38 deletions
This file was deleted.

purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959
this.position = Vec3.ZERO;
6060
this.blockPosition = BlockPos.ZERO;
6161
this.chunkPosition = ChunkPos.ZERO;
62+
@@ -908,6 +_,7 @@
63+
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
64+
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
65+
// Paper end - Configurable nether ceiling damage
66+
+ 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 - Add option to teleport to spawn on nether ceiling damage
67+
this.onBelowWorld();
68+
}
69+
}
6270
@@ -1830,7 +_,7 @@
6371
}
6472

purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ private void playerNetheriteFireResistance() {
419419
public String playerDeathExpDropEquation = "expLevel * 7";
420420
public int playerDeathExpDropMax = 100;
421421
public boolean teleportIfOutsideBorder = false;
422+
public boolean teleportOnNetherCeilingDamage = false;
422423
public boolean totemOfUndyingWorksInInventory = false;
423424
public boolean playerFixStuckPortal = false;
424425
public boolean creativeOnePunch = false;
@@ -446,6 +447,7 @@ private void playerSettings() {
446447
playerDeathExpDropEquation = getString("gameplay-mechanics.player.exp-dropped-on-death.equation", playerDeathExpDropEquation);
447448
playerDeathExpDropMax = getInt("gameplay-mechanics.player.exp-dropped-on-death.maximum", playerDeathExpDropMax);
448449
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
450+
teleportOnNetherCeilingDamage = getBoolean("gameplay-mechanics.player.teleport-on-nether-ceiling-damage", teleportOnNetherCeilingDamage);
449451
totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
450452
playerFixStuckPortal = getBoolean("gameplay-mechanics.player.fix-stuck-in-portal", playerFixStuckPortal);
451453
creativeOnePunch = getBoolean("gameplay-mechanics.player.one-punch-in-creative", creativeOnePunch);

0 commit comments

Comments
 (0)