2018-09-28 23:31:59 +00:00
|
|
|
From ee19b52c8f80ea7fb920ff6736e719a610659b9d Mon Sep 17 00:00:00 2001
|
2016-02-29 23:09:49 +00:00
|
|
|
From: Joseph Hirschfeld <joe@ibj.io>
|
|
|
|
Date: Thu, 3 Mar 2016 02:46:17 -0600
|
|
|
|
Subject: [PATCH] Add configurable portal search radius
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-09-26 04:57:59 +00:00
|
|
|
index 3528b674fc..9db394d4ff 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-09-26 04:57:59 +00:00
|
|
|
@@ -185,4 +185,9 @@ public class PaperWorldConfig {
|
2016-08-27 23:41:58 +00:00
|
|
|
private void allChunksAreSlimeChunks() {
|
|
|
|
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public int portalSearchRadius;
|
|
|
|
+ private void portalSearchRadius() {
|
|
|
|
+ portalSearchRadius = getInt("portal-search-radius", 128);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
2018-08-26 18:11:49 +00:00
|
|
|
index 73d5b4d625..5e899e05cf 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
2018-07-15 01:53:17 +00:00
|
|
|
@@ -13,7 +13,7 @@ import org.bukkit.util.Vector;
|
2016-03-07 21:54:14 +00:00
|
|
|
public class PortalTravelAgent {
|
2016-02-29 23:09:49 +00:00
|
|
|
|
2018-07-15 01:53:17 +00:00
|
|
|
private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL;
|
2016-03-07 21:54:14 +00:00
|
|
|
- private final WorldServer world;
|
2018-07-15 01:53:17 +00:00
|
|
|
+ public final WorldServer world; // Paper - private -> public
|
|
|
|
private final Random c;
|
|
|
|
private final Long2ObjectMap<PortalTravelAgent.ChunkCoordinatesPortal> d = new Long2ObjectOpenHashMap(4096);
|
2016-05-12 02:07:46 +00:00
|
|
|
|
2018-07-15 01:53:17 +00:00
|
|
|
@@ -93,7 +93,7 @@ public class PortalTravelAgent {
|
2016-03-07 21:54:14 +00:00
|
|
|
|
|
|
|
public boolean b(Entity entity, float f) {
|
|
|
|
// CraftBukkit start - Modularize portal search process and entity teleportation
|
|
|
|
- BlockPosition found = this.findPortal(entity.locX, entity.locY, entity.locZ, 128);
|
|
|
|
+ BlockPosition found = this.findPortal(entity.locX, entity.locY, entity.locZ, world.paperConfig.portalSearchRadius); // Paper - Configurable search radius
|
|
|
|
if (found == null) {
|
|
|
|
return false;
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
2016-03-07 21:54:14 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java
|
2018-08-26 18:11:49 +00:00
|
|
|
index d4639c8221..e1eb3aa0f3 100644
|
2016-03-07 21:54:14 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java
|
2018-08-26 18:11:49 +00:00
|
|
|
@@ -12,7 +12,7 @@ public class CraftTravelAgent extends PortalTravelAgent implements TravelAgent {
|
2016-03-07 21:54:14 +00:00
|
|
|
|
|
|
|
public static TravelAgent DEFAULT = null;
|
2016-02-29 23:09:49 +00:00
|
|
|
|
2016-03-07 21:54:14 +00:00
|
|
|
- private int searchRadius = 128;
|
|
|
|
+ private int searchRadius = world.paperConfig.portalSearchRadius; // Paper - Configurable search radius
|
|
|
|
private int creationRadius = 16;
|
|
|
|
private boolean canCreatePortal = true;
|
2016-02-29 23:09:49 +00:00
|
|
|
|
|
|
|
--
|
2018-09-26 04:57:59 +00:00
|
|
|
2.19.0
|
2016-02-29 23:09:49 +00:00
|
|
|
|