mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-12 10:46:25 +00:00
cursed #equals
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user