When blocks adjacent to multiblock-capable blocks are updated, (#4474)
do not always recalculate existing multiblocks. Only do so, if the adjacent block is either part of the multiblock's bounding box, or if the adjacent block would be a valid part of the multiblock.
This commit is contained in:
@@ -121,11 +121,11 @@ public class CraftingTileEntity extends AENetworkTileEntity implements IAEMultiB
|
||||
public void onReady() {
|
||||
super.onReady();
|
||||
this.getProxy().setVisualRepresentation(this.getItemFromTile(this));
|
||||
this.updateMultiBlock();
|
||||
this.calc.calculateMultiblock(world, getLocation());
|
||||
}
|
||||
|
||||
public void updateMultiBlock() {
|
||||
this.calc.calculateMultiblock(this.world, this.getLocation());
|
||||
public void updateMultiBlock(BlockPos changedPos) {
|
||||
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), changedPos);
|
||||
}
|
||||
|
||||
public void updateStatus(final CraftingCPUCluster c) {
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
||||
import net.minecraftforge.client.model.data.ModelProperty;
|
||||
@@ -272,8 +273,8 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
|
||||
return AECableType.DENSE_SMART;
|
||||
}
|
||||
|
||||
public void neighborUpdate() {
|
||||
this.calc.calculateMultiblock(this.world, this.getLocation());
|
||||
public void neighborUpdate(BlockPos fromPos) {
|
||||
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), fromPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,6 +26,7 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
||||
import net.minecraftforge.client.model.data.ModelProperty;
|
||||
@@ -87,7 +88,7 @@ public class SpatialPylonTileEntity extends AENetworkTileEntity implements IAEMu
|
||||
@Override
|
||||
public void onReady() {
|
||||
super.onReady();
|
||||
this.neighborChanged();
|
||||
this.calc.calculateMultiblock(world, getLocation());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,8 +97,8 @@ public class SpatialPylonTileEntity extends AENetworkTileEntity implements IAEMu
|
||||
super.remove();
|
||||
}
|
||||
|
||||
public void neighborChanged() {
|
||||
this.calc.calculateMultiblock(this.world, this.getLocation());
|
||||
public void neighborChanged(BlockPos changedPos) {
|
||||
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), changedPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,9 +131,9 @@ public class SpatialPylonTileEntity extends AENetworkTileEntity implements IAEMu
|
||||
this.displayBits = 0;
|
||||
|
||||
if (this.cluster != null) {
|
||||
if (this.cluster.getMin().equals(this.getLocation())) {
|
||||
if (this.cluster.getBoundsMin().equals(this.getLocation())) {
|
||||
this.displayBits = DISPLAY_END_MIN;
|
||||
} else if (this.cluster.getMax().equals(this.getLocation())) {
|
||||
} else if (this.cluster.getBoundsMax().equals(this.getLocation())) {
|
||||
this.displayBits = DISPLAY_END_MAX;
|
||||
} else {
|
||||
this.displayBits = DISPLAY_MIDDLE;
|
||||
|
||||
Reference in New Issue
Block a user