cursed #equals

This commit is contained in:
dfsek
2021-02-24 02:00:47 -07:00
parent 5c0482e972
commit 3c56813d6b
6 changed files with 19 additions and 13 deletions

View File

@@ -18,13 +18,18 @@ public class BufferedLootApplication implements BufferedItem {
@Override
public void paste(Location origin) {
BlockState data = origin.getBlock().getState();
if(!(data instanceof Container)) {
main.logger().severe("Failed to place loot at " + origin + "; block " + data + " is not container.");
return;
try {
BlockState data = origin.getBlock().getState();
if(!(data instanceof Container)) {
main.logger().severe("Failed to place loot at " + origin + "; block " + data + " is not container.");
return;
}
Container container = (Container) data;
table.fillInventory(container.getInventory(), new FastRandom(origin.hashCode()));
data.update(false);
} catch(Exception e) {
main.logger().warning("Could not apply loot at " + origin + ": " + e.getMessage());
main.getDebugLogger().stack(e);
}
Container container = (Container) data;
table.fillInventory(container.getInventory(), new FastRandom(origin.hashCode()));
data.update(false);
}
}

View File

@@ -15,8 +15,8 @@ public class BufferedStateManipulator implements BufferedItem {
@Override
public void paste(Location origin) {
BlockState state = origin.getBlock().getState();
try {
BlockState state = origin.getBlock().getState();
state.applyState(data);
state.update(false);
} catch(Exception e) {

View File

@@ -43,6 +43,7 @@ public class StructurePopulator implements TerraBlockPopulator {
continue;
Random random = new FastRandom(MathUtil.getCarverChunkSeed(FastMath.floorDiv(spawn.getBlockX(), 16), FastMath.floorDiv(spawn.getBlockZ(), 16), world.getSeed()));
System.out.println("chunk: {" + chunk.getX() + ", " + chunk.getZ() + "}");
System.out.println(world.getBlockAt(cx, 255, cz).getBlockData());
conf.getStructure().get(random).execute(spawn.setY(conf.getSpawnStart().get(random)), chunk, random, Rotation.fromDegrees(90 * random.nextInt(4)));
}
}