concurrency issue w/ data not being cleared
This commit is contained in:
parent
8afcc054f0
commit
11327d49e1
@ -121,11 +121,8 @@ public class HeightMapMCAGenerator implements Extent {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int count;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBlock(int x, int y, int z, BaseBlock block) throws WorldEditException {
|
public boolean setBlock(int x, int y, int z, BaseBlock block) throws WorldEditException {
|
||||||
count++;
|
|
||||||
int index = z * width + x;
|
int index = z * width + x;
|
||||||
if (index < 0 || index >= heights.length) return false;
|
if (index < 0 || index >= heights.length) return false;
|
||||||
int height = heights[index] & 0xFF;
|
int height = heights[index] & 0xFF;
|
||||||
@ -733,9 +730,14 @@ public class HeightMapMCAGenerator implements Extent {
|
|||||||
try {
|
try {
|
||||||
MCAChunk chunk = chunkStore.get();
|
MCAChunk chunk = chunkStore.get();
|
||||||
int[] indexes = indexStore.get();
|
int[] indexes = indexStore.get();
|
||||||
for (byte[] array : chunk.ids) {
|
for (int i = 0; i < chunk.ids.length; i++) {
|
||||||
if (array != null) {
|
byte[] idsArray = chunk.ids[i];
|
||||||
Arrays.fill(array, (byte) 0);
|
if (idsArray != null) {
|
||||||
|
Arrays.fill(idsArray, (byte) 0);
|
||||||
|
}
|
||||||
|
byte[] dataArray = chunk.data[i];
|
||||||
|
if (dataArray != null) {
|
||||||
|
Arrays.fill(dataArray, (byte) 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@ -859,6 +861,7 @@ public class HeightMapMCAGenerator implements Extent {
|
|||||||
int maxYMod = 15 + (maxLayer << 4);
|
int maxYMod = 15 + (maxLayer << 4);
|
||||||
for (int layer = (maxY >> 4) + 1; layer < 16; layer++) {
|
for (int layer = (maxY >> 4) + 1; layer < 16; layer++) {
|
||||||
chunk.ids[layer] = null;
|
chunk.ids[layer] = null;
|
||||||
|
chunk.data[layer] = null;
|
||||||
}
|
}
|
||||||
index = 0;
|
index = 0;
|
||||||
{ // Bedrock
|
{ // Bedrock
|
||||||
|
@ -175,11 +175,11 @@ public interface Extent extends InputExtent, OutputExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default public void addOres(Region region, Mask mask) throws WorldEditException {
|
default public void addOres(Region region, Mask mask) throws WorldEditException {
|
||||||
addOre(region, mask, new BlockPattern(BlockID.DIRT), 30, 4, 100, 0, 255);
|
addOre(region, mask, new BlockPattern(BlockID.DIRT), 33, 10, 100, 0, 255);
|
||||||
addOre(region, mask, new BlockPattern(BlockID.GRAVEL), 30, 2, 100, 0, 255);
|
addOre(region, mask, new BlockPattern(BlockID.GRAVEL), 33, 8, 100, 0, 255);
|
||||||
addOre(region, mask, new BlockPattern(BlockID.STONE, 1), 30, 4, 100, 0, 79);
|
addOre(region, mask, new BlockPattern(BlockID.STONE, 1), 33, 10, 100, 0, 79);
|
||||||
addOre(region, mask, new BlockPattern(BlockID.STONE, 3), 30, 4, 100, 0, 79);
|
addOre(region, mask, new BlockPattern(BlockID.STONE, 3), 33, 10, 100, 0, 79);
|
||||||
addOre(region, mask, new BlockPattern(BlockID.STONE, 5), 30, 4, 100, 0, 79);
|
addOre(region, mask, new BlockPattern(BlockID.STONE, 5), 33, 10, 100, 0, 79);
|
||||||
addOre(region, mask, new BlockPattern(BlockID.COAL_ORE), 17, 20, 100, 0, 127);
|
addOre(region, mask, new BlockPattern(BlockID.COAL_ORE), 17, 20, 100, 0, 127);
|
||||||
addOre(region, mask, new BlockPattern(BlockID.IRON_ORE), 9, 20, 100, 0, 63);
|
addOre(region, mask, new BlockPattern(BlockID.IRON_ORE), 9, 20, 100, 0, 63);
|
||||||
addOre(region, mask, new BlockPattern(BlockID.GOLD_ORE), 9, 2, 100, 0, 31);
|
addOre(region, mask, new BlockPattern(BlockID.GOLD_ORE), 9, 2, 100, 0, 31);
|
||||||
|
Loading…
Reference in New Issue
Block a user