Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-09 13:00:05 +01:00
Fix #443
Temp as it's performance-degrading, but works well enough for now
Dieser Commit ist enthalten in:
Ursprung
35169230ad
Commit
3a7c23be45
@ -75,6 +75,8 @@ public class BukkitGetBlocks_1_15 extends CharGetBlocks {
|
|||||||
public Chunk nmsChunk;
|
public Chunk nmsChunk;
|
||||||
public WorldServer world;
|
public WorldServer world;
|
||||||
public int X, Z;
|
public int X, Z;
|
||||||
|
//This is (hopefully) a temp fix for random blocks returning the wrong biome. Static because it was seemingly using the wrong chunk to return the biome value.
|
||||||
|
private static final Object biomeLock = new Object();
|
||||||
|
|
||||||
public BukkitGetBlocks_1_15(World world, int X, int Z) {
|
public BukkitGetBlocks_1_15(World world, int X, int Z) {
|
||||||
this(((CraftWorld) world).getHandle(), X, Z);
|
this(((CraftWorld) world).getHandle(), X, Z);
|
||||||
@ -106,8 +108,10 @@ public class BukkitGetBlocks_1_15 extends CharGetBlocks {
|
|||||||
} else {
|
} else {
|
||||||
base = index.getBiome(x >> 2, y >> 2, z >> 2);
|
base = index.getBiome(x >> 2, y >> 2, z >> 2);
|
||||||
}
|
}
|
||||||
|
synchronized (biomeLock) {
|
||||||
return base != null ? BukkitAdapter.adapt(CraftBlock.biomeBaseToBiome(base)) : null;
|
return base != null ? BukkitAdapter.adapt(CraftBlock.biomeBaseToBiome(base)) : null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompoundTag getTile(int x, int y, int z) {
|
public CompoundTag getTile(int x, int y, int z) {
|
||||||
|
@ -80,6 +80,8 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks {
|
|||||||
public Chunk nmsChunk;
|
public Chunk nmsChunk;
|
||||||
public WorldServer world;
|
public WorldServer world;
|
||||||
public int X, Z;
|
public int X, Z;
|
||||||
|
//This is (hopefully) a temp fix for random blocks returning the wrong biome. Static because it was seemingly using the wrong chunk to return the biome value.
|
||||||
|
private static final Object biomeLock = new Object();
|
||||||
|
|
||||||
public BukkitGetBlocks_1_15_2(World world, int X, int Z) {
|
public BukkitGetBlocks_1_15_2(World world, int X, int Z) {
|
||||||
this(((CraftWorld) world).getHandle(), X, Z);
|
this(((CraftWorld) world).getHandle(), X, Z);
|
||||||
@ -111,8 +113,10 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks {
|
|||||||
} else {
|
} else {
|
||||||
base = index.getBiome(x >> 2, y >> 2, z >> 2);
|
base = index.getBiome(x >> 2, y >> 2, z >> 2);
|
||||||
}
|
}
|
||||||
|
synchronized (biomeLock) {
|
||||||
return base != null ? BukkitAdapter.adapt(CraftBlock.biomeBaseToBiome(base)) : null;
|
return base != null ? BukkitAdapter.adapt(CraftBlock.biomeBaseToBiome(base)) : null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompoundTag getTile(int x, int y, int z) {
|
public CompoundTag getTile(int x, int y, int z) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren