Fix a few bugs

This commit is contained in:
tastybento 2023-04-16 14:17:30 -07:00
parent 8d2b9d52a2
commit 27e0c72dc8
2 changed files with 25 additions and 24 deletions

View File

@ -194,7 +194,7 @@ public class BoxedChunkGenerator extends AbstractBoxedChunkGenerator {
int minY = worldInfo.getMinHeight();
int xx = repeatCalc(chunkX);
int zz = repeatCalc(chunkZ);
ChunkSnapshot chunk = this.getChunk(xx,zz).snapshot();
ChunkStore chunk = this.getChunk(xx,zz);
if (chunk == null) {
// This should never be needed because islands should abut each other
//cd.setRegion(0, minY, 0, 16, 0, 16, Material.WATER);
@ -202,7 +202,7 @@ public class BoxedChunkGenerator extends AbstractBoxedChunkGenerator {
return;
}
// Copy the chunk
copyChunkVerbatim(cd, chunk, minY, height);
copyChunkVerbatim(cd, chunk.snapshot(), minY, height);
}

View File

@ -62,6 +62,7 @@ public class NewAreaListener implements Listener {
private final Boxed addon;
private File structureFile;
private Queue<Item> itemsToBuild = new LinkedList<>();
private static Random rand = new Random();
private boolean pasting;
private static Gson gson = new Gson();
private record Item(String name, Structure structure, Location location, StructureRotation rot, Mirror mirror) {};
@ -181,7 +182,7 @@ public class NewAreaListener implements Listener {
private void LoadChunksAsync(Item item) {
pasting = true;
item.structure().place(item.location(), true, item.rot(), item.mirror(), -1, 1, new Random());
item.structure().place(item.location(), true, item.rot(), item.mirror(), -1, 1, rand);
addon.log(item.name() + " placed at " + item.location().getWorld().getName() + " " + Util.xyz(item.location().toVector()));
// Find it
removeJigsaw(item.location(), item.structure(), item.rot(), item.name());
@ -274,8 +275,8 @@ public class NewAreaListener implements Listener {
case "minecraft:village/common/pigs" -> EntityType.PIG;
case "minecraft:village/common/cows" -> EntityType.COW;
case "minecraft:village/common/iron_golem" -> EntityType.IRON_GOLEM;
case "minecraft:village/common/butcher_animals" -> BUTCHER_ANIMALS.get(new Random().nextInt(3));
case "minecraft:village/common/animals" -> BUTCHER_ANIMALS.get(new Random().nextInt(3));
case "minecraft:village/common/butcher_animals" -> BUTCHER_ANIMALS.get(rand.nextInt(3));
case "minecraft:village/common/animals" -> BUTCHER_ANIMALS.get(rand.nextInt(3));
default -> null;
};
if (bjb.getPool().contains("zombie/villagers")) {