2021-06-12 00:37:16 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
|
|
Date: Tue, 1 Mar 2016 23:58:50 -0600
|
|
|
|
Subject: [PATCH] Configurable top of nether void damage
|
|
|
|
|
2022-10-09 08:52:09 +02:00
|
|
|
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
2021-06-12 00:37:16 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
2024-10-22 20:04:31 +02:00
|
|
|
index e97853cbfa6da8ecdb4c92cf634831492e1fc7e3..49df5f4b09926556986e3a45d52ff299b878af76 100644
|
2021-06-12 00:37:16 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2024-10-22 20:04:31 +02:00
|
|
|
@@ -720,7 +720,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
2021-06-12 00:37:16 +02:00
|
|
|
}
|
|
|
|
|
2023-06-07 20:31:32 +02:00
|
|
|
public void checkBelowWorld() {
|
2024-10-22 20:04:31 +02:00
|
|
|
- if (this.getY() < (double) (this.level().getMinY() - 64)) {
|
2021-06-12 00:37:16 +02:00
|
|
|
+ // Paper start - Configurable nether ceiling damage
|
2024-10-22 20:04:31 +02:00
|
|
|
+ if (this.getY() < (double) (this.level.getMinY() - 64) || (this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
|
2022-10-09 08:52:09 +02:00
|
|
|
+ && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
|
2022-10-07 20:43:26 +02:00
|
|
|
+ && (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
|
2024-01-24 11:45:17 +01:00
|
|
|
+ // Paper end - Configurable nether ceiling damage
|
2023-06-07 20:31:32 +02:00
|
|
|
this.onBelowWorld();
|
2021-06-12 00:37:16 +02:00
|
|
|
}
|
|
|
|
|
2022-10-09 08:52:09 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
2024-10-22 20:04:31 +02:00
|
|
|
index 36accb58ed269a129f92d2b64f5a0b14416de735..355f1ce10f9564c7c0be505a5af849e0428fec17 100644
|
2022-10-09 08:52:09 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
2024-06-13 19:12:48 +02:00
|
|
|
@@ -58,7 +58,7 @@ public class PortalForcer {
|
|
|
|
}, blockposition, i, PoiManager.Occupancy.ANY).map(PoiRecord::getPos);
|
|
|
|
|
|
|
|
Objects.requireNonNull(worldborder);
|
|
|
|
- return stream.filter(worldborder::isWithinBounds).filter((blockposition1) -> {
|
|
|
|
+ return stream.filter(worldborder::isWithinBounds).filter(pos -> !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> pos.getY() >= v))).filter((blockposition1) -> { // Paper - Configurable nether ceiling damage
|
|
|
|
return this.level.getBlockState(blockposition1).hasProperty(BlockStateProperties.HORIZONTAL_AXIS);
|
|
|
|
}).min(Comparator.comparingDouble((BlockPos blockposition1) -> { // CraftBukkit - decompile error
|
|
|
|
return blockposition1.distSqr(blockposition);
|
|
|
|
@@ -79,6 +79,11 @@ public class PortalForcer {
|
2022-10-09 08:52:09 +02:00
|
|
|
BlockPos blockposition2 = null;
|
|
|
|
WorldBorder worldborder = this.level.getWorldBorder();
|
2024-10-22 20:04:31 +02:00
|
|
|
int i = Math.min(this.level.getMaxY(), this.level.getMinY() + this.level.getLogicalHeight() - 1);
|
2024-01-24 11:45:17 +01:00
|
|
|
+ // Paper start - Configurable nether ceiling damage; make sure the max height doesn't exceed the void damage height
|
2023-08-13 22:30:48 +02:00
|
|
|
+ if (this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.enabled()) {
|
2022-10-09 08:52:09 +02:00
|
|
|
+ i = Math.min(i, this.level.paperConfig().environment.netherCeilingVoidDamageHeight.intValue() - 1);
|
|
|
|
+ }
|
2024-01-24 11:45:17 +01:00
|
|
|
+ // Paper end - Configurable nether ceiling damage
|
2024-06-13 19:12:48 +02:00
|
|
|
boolean flag = true;
|
2022-10-09 08:52:09 +02:00
|
|
|
BlockPos.MutableBlockPos blockposition_mutableblockposition = blockposition.mutable();
|
|
|
|
Iterator iterator = BlockPos.spiralAround(blockposition, createRadius, Direction.EAST, Direction.SOUTH).iterator(); // CraftBukkit
|