mirror of
https://github.com/BentoBoxWorld/Boxed.git
synced 2025-01-31 22:41:28 +01:00
Fix a few bugs
This commit is contained in:
parent
8d2b9d52a2
commit
27e0c72dc8
@ -194,7 +194,7 @@ public class BoxedChunkGenerator extends AbstractBoxedChunkGenerator {
|
|||||||
int minY = worldInfo.getMinHeight();
|
int minY = worldInfo.getMinHeight();
|
||||||
int xx = repeatCalc(chunkX);
|
int xx = repeatCalc(chunkX);
|
||||||
int zz = repeatCalc(chunkZ);
|
int zz = repeatCalc(chunkZ);
|
||||||
ChunkSnapshot chunk = this.getChunk(xx,zz).snapshot();
|
ChunkStore chunk = this.getChunk(xx,zz);
|
||||||
if (chunk == null) {
|
if (chunk == null) {
|
||||||
// This should never be needed because islands should abut each other
|
// This should never be needed because islands should abut each other
|
||||||
//cd.setRegion(0, minY, 0, 16, 0, 16, Material.WATER);
|
//cd.setRegion(0, minY, 0, 16, 0, 16, Material.WATER);
|
||||||
@ -202,7 +202,7 @@ public class BoxedChunkGenerator extends AbstractBoxedChunkGenerator {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Copy the chunk
|
// Copy the chunk
|
||||||
copyChunkVerbatim(cd, chunk, minY, height);
|
copyChunkVerbatim(cd, chunk.snapshot(), minY, height);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ public class NewAreaListener implements Listener {
|
|||||||
private final Boxed addon;
|
private final Boxed addon;
|
||||||
private File structureFile;
|
private File structureFile;
|
||||||
private Queue<Item> itemsToBuild = new LinkedList<>();
|
private Queue<Item> itemsToBuild = new LinkedList<>();
|
||||||
|
private static Random rand = new Random();
|
||||||
private boolean pasting;
|
private boolean pasting;
|
||||||
private static Gson gson = new Gson();
|
private static Gson gson = new Gson();
|
||||||
private record Item(String name, Structure structure, Location location, StructureRotation rot, Mirror mirror) {};
|
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) {
|
private void LoadChunksAsync(Item item) {
|
||||||
pasting = true;
|
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()));
|
addon.log(item.name() + " placed at " + item.location().getWorld().getName() + " " + Util.xyz(item.location().toVector()));
|
||||||
// Find it
|
// Find it
|
||||||
removeJigsaw(item.location(), item.structure(), item.rot(), item.name());
|
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/pigs" -> EntityType.PIG;
|
||||||
case "minecraft:village/common/cows" -> EntityType.COW;
|
case "minecraft:village/common/cows" -> EntityType.COW;
|
||||||
case "minecraft:village/common/iron_golem" -> EntityType.IRON_GOLEM;
|
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/butcher_animals" -> BUTCHER_ANIMALS.get(rand.nextInt(3));
|
||||||
case "minecraft:village/common/animals" -> BUTCHER_ANIMALS.get(new Random().nextInt(3));
|
case "minecraft:village/common/animals" -> BUTCHER_ANIMALS.get(rand.nextInt(3));
|
||||||
default -> null;
|
default -> null;
|
||||||
};
|
};
|
||||||
if (bjb.getPool().contains("zombie/villagers")) {
|
if (bjb.getPool().contains("zombie/villagers")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user