fixed blocks building too early
This commit is contained in:
parent
d08d15d4c1
commit
967650a073
1 changed files with 23 additions and 16 deletions
|
@ -37,23 +37,30 @@ public class BuildingSlotBlock extends BuildingSlot implements Comparable<Buildi
|
|||
|
||||
@Override
|
||||
public void writeToWorld(IBuilderContext context) {
|
||||
try {
|
||||
getSchematic().writeToWorld(context, x, y, z);
|
||||
|
||||
// Once the schematic has been written, we're going to issue calls
|
||||
// to various functions, in particular updating the tile entity.
|
||||
// If these calls issue problems, in order to avoid corrupting
|
||||
// the world, we're logging the problem and setting the block to
|
||||
// air.
|
||||
|
||||
TileEntity e = context.world().getTileEntity(x, y, z);
|
||||
|
||||
if (e != null) {
|
||||
e.updateEntity();
|
||||
if (mode == Mode.ClearIfInvalid) {
|
||||
if (!getSchematic().isValid(context, x, y, z)) {
|
||||
context.world().setBlockToAir(x, y, z);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
getSchematic().writeToWorld(context, x, y, z);
|
||||
|
||||
// Once the schematic has been written, we're going to issue
|
||||
// calls
|
||||
// to various functions, in particular updating the tile entity.
|
||||
// If these calls issue problems, in order to avoid corrupting
|
||||
// the world, we're logging the problem and setting the block to
|
||||
// air.
|
||||
|
||||
TileEntity e = context.world().getTileEntity(x, y, z);
|
||||
|
||||
if (e != null) {
|
||||
e.updateEntity();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
context.world().setBlockToAir(x, y, z);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
context.world().setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue