-
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to teleport to spawn on nether ceiling damage
- Loading branch information
1 parent
85bc4a4
commit b3d374f
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
patches/server/0313-Add-option-to-teleport-to-spawn-on-nether-ceiling-da.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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 9f3a065a24d2e8cc2ea7ae307545af013fdbbf1b..193b6621d6506a04bc1f9f23571aeb2e635d562c 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/Entity.java | ||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java | ||
@@ -419,7 +419,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { | ||
public int activatedPriority = gg.pufferfish.pufferfish.PufferfishConfig.maximumActivationPrio; // golf score | ||
public final BlockPos.MutableBlockPos cachedBlockPos = new BlockPos.MutableBlockPos(); // used where needed | ||
// Pufferfish end | ||
- | ||
+ | ||
public float getBukkitYaw() { | ||
return this.yRot; | ||
} | ||
@@ -896,6 +896,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 (level.purpurConfig.teleportOnNetherCeilingDamage && this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER) ((ServerPlayer) this).teleport(MCUtil.toLocation(level, level.getSharedSpawnPos())); else // Purpur | ||
this.outOfWorld(); | ||
} | ||
|
||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java | ||
index 3409480d4e01db19e3e54474c9e122232043e4b0..bb352ed86e4047e38ad27900f72fc0ddb741bf71 100644 | ||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java | ||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java | ||
@@ -418,6 +418,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; | ||
@@ -449,6 +450,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); |