PaperMC/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch

39 lines
2.1 KiB
Diff
Raw Normal View History

2016-02-21 07:33:37 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <joe@ibj.io>
2016-03-01 00:09:49 +01:00
Date: Thu, 3 Mar 2016 02:46:17 -0600
2016-02-21 07:33:37 +01:00
Subject: [PATCH] Add configurable portal search radius
2016-03-01 00:09:49 +01:00
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2019-04-26 03:24:00 +02:00
index be91b11242..320fd07c62 100644
2016-03-01 00:09:49 +01:00
--- 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 {
private void allChunksAreSlimeChunks() {
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
2016-03-01 00:09:49 +01:00
}
+
+ public int portalSearchRadius;
+ private void portalSearchRadius() {
+ portalSearchRadius = getInt("portal-search-radius", 128);
+ }
}
2016-02-21 07:33:37 +01:00
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
2019-04-26 03:24:00 +02:00
index 1685e694ba..e7ca777c16 100644
2016-02-21 07:33:37 +01:00
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
@@ -0,0 +0,0 @@ public class PortalTravelAgent {
2019-04-26 03:24:00 +02:00
} else {
double d2 = Double.MAX_VALUE;
2016-02-21 07:33:37 +01:00
2019-04-26 03:24:00 +02:00
- for (int i = -128; i <= 128; ++i) {
+ int portalSearchRadius = world.paperConfig.portalSearchRadius; // Paper
+ for (int i = portalSearchRadius; i <= portalSearchRadius; ++i) { // Paper
BlockPosition blockposition2;
2016-02-21 07:33:37 +01:00
2019-04-26 03:24:00 +02:00
- for (int j = -128; j <= 128; ++j) {
+ for (int j = -world.paperConfig.portalSearchRadius; j <= world.paperConfig.portalSearchRadius; ++j) { // Paper
for (BlockPosition blockposition3 = blockposition.b(i, this.world.getHeight() - 1 - blockposition.getY(), j); blockposition3.getY() >= 0; blockposition3 = blockposition2) {
blockposition2 = blockposition3.down();
if (this.world.getType(blockposition3).getBlock() == PortalTravelAgent.b) {
2016-02-21 07:33:37 +01:00
--