Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 04:50:05 +01:00
SPIGOT-1820: Fix custom travel agent search radius.
Dieser Commit ist enthalten in:
Ursprung
20d9f644a6
Commit
ab83272e2a
@ -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));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren