2016-06-23 10:43:02 +08:00
|
|
|
From 3e529ff8e46271ef3e60ec7f9268f11735d97990 Mon Sep 17 00:00:00 2001
|
2016-03-01 07:09:49 +08: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
|
2016-05-17 10:07:12 +08:00
|
|
|
index 75e7b78..5807609 100644
|
2016-03-01 07:09:49 +08:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2016-05-17 10:07:12 +08:00
|
|
|
@@ -254,4 +254,9 @@ public class PaperWorldConfig {
|
2016-03-01 07:09:49 +08:00
|
|
|
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
|
2016-06-23 10:18:41 +08:00
|
|
|
index f93a95f..ee1ac7d 100644
|
2016-03-01 07:09:49 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
2016-05-12 10:07:46 +08:00
|
|
|
@@ -12,7 +12,7 @@ import org.bukkit.util.Vector;
|
2016-03-08 05:54:14 +08:00
|
|
|
|
|
|
|
public class PortalTravelAgent {
|
2016-03-01 07:09:49 +08:00
|
|
|
|
2016-03-08 05:54:14 +08:00
|
|
|
- private final WorldServer world;
|
|
|
|
+ protected final WorldServer world; // Paper - private -> protected
|
|
|
|
private final Random b;
|
2016-05-12 10:07:46 +08:00
|
|
|
private final Long2ObjectMap<PortalTravelAgent.ChunkCoordinatesPortal> c = new Long2ObjectOpenHashMap(4096);
|
|
|
|
|
2016-03-08 05:54:14 +08:00
|
|
|
@@ -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;
|
2016-03-01 07:09:49 +08:00
|
|
|
}
|
2016-03-08 05:54:14 +08:00
|
|
|
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;
|
2016-03-01 07:09:49 +08:00
|
|
|
|
2016-03-08 05:54:14 +08:00
|
|
|
- private int searchRadius = 128;
|
|
|
|
+ private int searchRadius = world.paperConfig.portalSearchRadius; // Paper - Configurable search radius
|
|
|
|
private int creationRadius = 16;
|
|
|
|
private boolean canCreatePortal = true;
|
2016-03-01 07:09:49 +08:00
|
|
|
|
|
|
|
--
|
2016-06-23 10:18:41 +08:00
|
|
|
2.9.0
|
2016-03-01 07:09:49 +08:00
|
|
|
|