From c92072e21d45fc1994d254eb310f1dd5eed16569 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 11 Jan 2021 01:44:06 +0000 Subject: [PATCH] nerf nether search radius config (#4781) --- .../Add-configurable-portal-search-radius.patch | 10 +++++++++- ...Configurable-inter-world-teleportation-safety.patch | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch b/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch index fc1b9033ac1..a57399eb171 100644 --- a/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch +++ b/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch @@ -15,9 +15,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public int portalSearchRadius; + public int portalCreateRadius; ++ public boolean portalSearchVanillaDimensionScaling; + private void portalSearchRadius() { + portalSearchRadius = getInt("portal-search-radius", 128); + portalCreateRadius = getInt("portal-create-radius", 16); ++ portalSearchVanillaDimensionScaling = getBoolean("portal-search-vanilla-dimension-scaling", true); + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java @@ -29,7 +31,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 BlockPosition blockposition = new BlockPosition(MathHelper.a(this.locX() * d4, d0, d2), this.locY(), MathHelper.a(this.locZ() * d4, d1, d3)); // CraftBukkit start - CraftPortalEvent event = callPortalEvent(this, worldserver, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); -+ CraftPortalEvent event = callPortalEvent(this, worldserver, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, worldserver.paperConfig.portalSearchRadius, worldserver.paperConfig.portalCreateRadius); // Paper start - configurable portal radius ++ // Paper start ++ int portalSearchRadius = worldserver.paperConfig.portalSearchRadius; ++ if (world.paperConfig.portalSearchVanillaDimensionScaling && flag2) { // == THE_NETHER ++ portalSearchRadius = (int) (portalSearchRadius / worldserver.getDimensionManager().getCoordinateScale()); ++ } ++ // Paper end ++ CraftPortalEvent event = callPortalEvent(this, worldserver, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, worldserver.paperConfig.portalCreateRadius); // Paper start - configurable portal radius if (event == null) { return null; } diff --git a/Spigot-Server-Patches/Configurable-inter-world-teleportation-safety.patch b/Spigot-Server-Patches/Configurable-inter-world-teleportation-safety.patch index 05a2d3c2f56..0969946e5c6 100644 --- a/Spigot-Server-Patches/Configurable-inter-world-teleportation-safety.patch +++ b/Spigot-Server-Patches/Configurable-inter-world-teleportation-safety.patch @@ -20,8 +20,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { - portalSearchRadius = getInt("portal-search-radius", 128); portalCreateRadius = getInt("portal-create-radius", 16); + portalSearchVanillaDimensionScaling = getBoolean("portal-search-vanilla-dimension-scaling", true); } + + public boolean disableTeleportationSuffocationCheck;