Fixed a missing exception handler in jump sequencer
This commit is contained in:
parent
d5b53b15d3
commit
5fe5d784b6
1 changed files with 22 additions and 14 deletions
|
@ -1163,21 +1163,29 @@ public class JumpSequencer extends AbstractSequencer {
|
||||||
WarpDrive.logger.info(String.format("Moving externals from (%d %d %d) of %s@%d",
|
WarpDrive.logger.info(String.format("Moving externals from (%d %d %d) of %s@%d",
|
||||||
jumpBlock.x, jumpBlock.y, jumpBlock.z, jumpBlock.block, jumpBlock.blockMeta));
|
jumpBlock.x, jumpBlock.y, jumpBlock.z, jumpBlock.block, jumpBlock.blockMeta));
|
||||||
}
|
}
|
||||||
final TileEntity tileEntitySource = jumpBlock.getTileEntity(worldSource);
|
try {
|
||||||
final BlockPos blockPosTarget = transformation.apply(jumpBlock.x, jumpBlock.y, jumpBlock.z);
|
final TileEntity tileEntitySource = jumpBlock.getTileEntity(worldSource);
|
||||||
final IBlockState blockStateTarget = worldTarget.getBlockState(blockPosTarget);
|
final BlockPos blockPosTarget = transformation.apply(jumpBlock.x, jumpBlock.y, jumpBlock.z);
|
||||||
for (final Entry<String, NBTBase> external : jumpBlock.externals.entrySet()) {
|
final IBlockState blockStateTarget = worldTarget.getBlockState(blockPosTarget);
|
||||||
final IBlockTransformer blockTransformer = WarpDriveConfig.blockTransformers.get(external.getKey());
|
for (final Entry<String, NBTBase> external : jumpBlock.externals.entrySet()) {
|
||||||
if (blockTransformer != null) {
|
final IBlockTransformer blockTransformer = WarpDriveConfig.blockTransformers.get(external.getKey());
|
||||||
if ( shipMovementType != EnumShipMovementType.INSTANTIATE
|
if (blockTransformer != null) {
|
||||||
&& shipMovementType != EnumShipMovementType.RESTORE ) {
|
if ( shipMovementType != EnumShipMovementType.INSTANTIATE
|
||||||
blockTransformer.removeExternals(worldSource, jumpBlock.x, jumpBlock.y, jumpBlock.z,
|
&& shipMovementType != EnumShipMovementType.RESTORE ) {
|
||||||
jumpBlock.block, jumpBlock.blockMeta, tileEntitySource);
|
blockTransformer.removeExternals(worldSource, jumpBlock.x, jumpBlock.y, jumpBlock.z,
|
||||||
}
|
jumpBlock.block, jumpBlock.blockMeta, tileEntitySource);
|
||||||
|
}
|
||||||
|
|
||||||
final TileEntity tileEntityTarget = jumpBlock.weakTileEntity == null ? null : worldTarget.getTileEntity(blockPosTarget);
|
final TileEntity tileEntityTarget = jumpBlock.weakTileEntity == null ? null : worldTarget.getTileEntity(blockPosTarget);
|
||||||
blockTransformer.restoreExternals(worldTarget, blockPosTarget,
|
blockTransformer.restoreExternals(worldTarget, blockPosTarget,
|
||||||
blockStateTarget, tileEntityTarget, transformation, external.getValue());
|
blockStateTarget, tileEntityTarget, transformation, external.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (final Exception exception) {
|
||||||
|
WarpDrive.logger.info(String.format("Exception while moving external %s@%d at (%d %d %d)",
|
||||||
|
jumpBlock.block, jumpBlock.blockMeta, jumpBlock.x, jumpBlock.y, jumpBlock.z));
|
||||||
|
if (WarpDriveConfig.LOGGING_JUMPBLOCKS) {
|
||||||
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
|
|
Loading…
Reference in a new issue