From 4ca0002759f8ee8990143ec9abccbec603f03c43 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 14 May 2019 01:43:16 +0200 Subject: [PATCH] Improved external placement CPU/RAM load (minor) --- src/main/java/cr0s/warpdrive/event/JumpSequencer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/event/JumpSequencer.java b/src/main/java/cr0s/warpdrive/event/JumpSequencer.java index add2abb1..a9373581 100644 --- a/src/main/java/cr0s/warpdrive/event/JumpSequencer.java +++ b/src/main/java/cr0s/warpdrive/event/JumpSequencer.java @@ -1146,6 +1146,8 @@ public class JumpSequencer extends AbstractSequencer { jumpBlock.x, jumpBlock.y, jumpBlock.z, jumpBlock.block, jumpBlock.blockMeta)); } final TileEntity tileEntitySource = jumpBlock.getTileEntity(sourceWorld); + final BlockPos blockPosTarget = transformation.apply(jumpBlock.x, jumpBlock.y, jumpBlock.z); + final IBlockState blockStateTarget = targetWorld.getBlockState(blockPosTarget); for (final Entry external : jumpBlock.externals.entrySet()) { final IBlockTransformer blockTransformer = WarpDriveConfig.blockTransformers.get(external.getKey()); if (blockTransformer != null) { @@ -1155,11 +1157,9 @@ public class JumpSequencer extends AbstractSequencer { jumpBlock.block, jumpBlock.blockMeta, tileEntitySource); } - final BlockPos blockPosTarget = transformation.apply(jumpBlock.x, jumpBlock.y, jumpBlock.z); - final IBlockState blockStateTarget = targetWorld.getBlockState(blockPosTarget); - final TileEntity newTileEntity = jumpBlock.weakTileEntity == null ? null : targetWorld.getTileEntity(blockPosTarget); + final TileEntity tileEntityTarget = jumpBlock.weakTileEntity == null ? null : targetWorld.getTileEntity(blockPosTarget); blockTransformer.restoreExternals(targetWorld, blockPosTarget, - blockStateTarget, newTileEntity, transformation, external.getValue()); + blockStateTarget, tileEntityTarget, transformation, external.getValue()); } } index++;