mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 11:42:55 +01:00
SPIGOT-1820: Fix custom travel agent search radius.
This commit is contained in:
parent
20d9f644a6
commit
ab83272e2a
1 changed files with 10 additions and 3 deletions
|
@ -85,7 +85,7 @@
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public BlockPosition findPortal(double x, double y, double z, int short1) {
|
+ public BlockPosition findPortal(double x, double y, double z, int radius) {
|
||||||
+ if (this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END) {
|
+ if (this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END) {
|
||||||
+ return this.findEndPortal(this.world.worldProvider.h());
|
+ return this.findEndPortal(this.world.worldProvider.h());
|
||||||
+ }
|
+ }
|
||||||
|
@ -100,15 +100,22 @@
|
||||||
boolean flag1 = true;
|
boolean flag1 = true;
|
||||||
Object object = BlockPosition.ZERO;
|
Object object = BlockPosition.ZERO;
|
||||||
long k = ChunkCoordIntPair.a(i, j);
|
long k = ChunkCoordIntPair.a(i, j);
|
||||||
@@ -65,7 +129,7 @@
|
@@ -65,12 +129,12 @@
|
||||||
portaltravelagent_chunkcoordinatesportal.c = this.world.getTime();
|
portaltravelagent_chunkcoordinatesportal.c = this.world.getTime();
|
||||||
flag1 = false;
|
flag1 = false;
|
||||||
} else {
|
} else {
|
||||||
- BlockPosition blockposition = new BlockPosition(entity);
|
- BlockPosition blockposition = new BlockPosition(entity);
|
||||||
+ BlockPosition blockposition = new BlockPosition(x, y, z); // CraftBukkit
|
+ BlockPosition blockposition = new BlockPosition(x, y, z); // CraftBukkit
|
||||||
|
|
||||||
for (int l = -128; l <= 128; ++l) {
|
- for (int l = -128; l <= 128; ++l) {
|
||||||
|
+ for (int l = -radius; l <= radius; ++l) {
|
||||||
BlockPosition blockposition1;
|
BlockPosition blockposition1;
|
||||||
|
|
||||||
|
- for (int i1 = -128; i1 <= 128; ++i1) {
|
||||||
|
+ for (int i1 = -radius; i1 <= radius; ++i1) {
|
||||||
|
for (BlockPosition blockposition2 = blockposition.a(l, this.world.Z() - 1 - blockposition.getY(), i1); blockposition2.getY() >= 0; blockposition2 = blockposition1) {
|
||||||
|
blockposition1 = blockposition2.down();
|
||||||
|
if (this.world.getType(blockposition2).getBlock() == Blocks.PORTAL) {
|
||||||
@@ -95,6 +159,29 @@
|
@@ -95,6 +159,29 @@
|
||||||
this.c.put(k, new PortalTravelAgent.ChunkCoordinatesPortal((BlockPosition) object, this.world.getTime()));
|
this.c.put(k, new PortalTravelAgent.ChunkCoordinatesPortal((BlockPosition) object, this.world.getTime()));
|
||||||
this.d.add(Long.valueOf(k));
|
this.d.add(Long.valueOf(k));
|
||||||
|
|
Loading…
Reference in a new issue