fa8f621d56
closes GH-57
58 lines
2.7 KiB
Diff
58 lines
2.7 KiB
Diff
From c6fb8f63240d3ee1457c3c31a041b50df8cab965 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index fd9aa5c..904d9a8 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -267,4 +267,9 @@ public class PaperWorldConfig {
|
|
private void allowBlockLocationTabCompletion() {
|
|
allowBlockLocationTabCompletion = getBoolean("allow-block-location-tab-completion", true);
|
|
}
|
|
+
|
|
+ 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
|
|
index 519d27c..3f35303 100644
|
|
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
|
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
|
@@ -11,7 +11,7 @@ import java.util.Random;
|
|
|
|
public class PortalTravelAgent {
|
|
|
|
- private final WorldServer world;
|
|
+ protected final WorldServer world; // Paper - private -> protected
|
|
private final Random b;
|
|
private final LongHashMap<PortalTravelAgent.ChunkCoordinatesPortal> c = new LongHashMap();
|
|
private final List<Long> d = Lists.newArrayList();
|
|
@@ -92,7 +92,7 @@ public class PortalTravelAgent {
|
|
|
|
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;
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java
|
|
index 1d5dce1..7ca2617 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java
|
|
@@ -11,7 +11,7 @@ public class CraftTravelAgent extends PortalTravelAgent implements TravelAgent {
|
|
|
|
public static TravelAgent DEFAULT = null;
|
|
|
|
- private int searchRadius = 128;
|
|
+ private int searchRadius = world.paperConfig.portalSearchRadius; // Paper - Configurable search radius
|
|
private int creationRadius = 16;
|
|
private boolean canCreatePortal = true;
|
|
|
|
--
|
|
2.7.3
|
|
|