Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 04:50:05 +01:00
835bc39b03
Updated Upstream (Bukkit/CraftBukkit/Spigot) Bukkit Changes: 2dcc44dc SPIGOT-4307: Fix hacky API for banners on shields e0fc6572 SPIGOT-4309: Add "forced" display of particles efeeab2f Add index to README.md for easier navigation f502bc6f Update to Minecraft 1.13.1 CraftBukkit Changes:d0bb0a1d
Fix some tests randomly failing997d378d
Fix client stall in specific teleportation scenariosb3dc2366
SPIGOT-4307: Fix hacky API for banners on shields2a271162
SPIGOT-4301: Fix more invalid enchants5d0d83bb
SPIGOT-4309: Add "forced" display of particlesa6772578
Add additional tests for CraftBlockDatace1af0c3
Update to Minecraft 1.13.1 Spigot Changes: 2440e189 Rebuild patches 4ecffced Update to Minecraft 1.13.1
59 Zeilen
2.7 KiB
Diff
59 Zeilen
2.7 KiB
Diff
From 34714cc6991d2727f764745fdae5a08c88a8e87f 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 7d1f6cde94..c982869995 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -183,4 +183,9 @@ public class PaperWorldConfig {
|
|
private void allChunksAreSlimeChunks() {
|
|
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
|
|
}
|
|
+
|
|
+ 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 73d5b4d625..5e899e05cf 100644
|
|
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
|
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
|
@@ -13,7 +13,7 @@ import org.bukkit.util.Vector;
|
|
public class PortalTravelAgent {
|
|
|
|
private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL;
|
|
- private final WorldServer world;
|
|
+ public final WorldServer world; // Paper - private -> public
|
|
private final Random c;
|
|
private final Long2ObjectMap<PortalTravelAgent.ChunkCoordinatesPortal> d = new Long2ObjectOpenHashMap(4096);
|
|
|
|
@@ -93,7 +93,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 d4639c8221..e1eb3aa0f3 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java
|
|
@@ -12,7 +12,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.18.0
|
|
|