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:
@@ -59,7 +59,7 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingTileEntity> ex
|
|||||||
final BlockPos fromPos, boolean isMoving) {
|
final BlockPos fromPos, boolean isMoving) {
|
||||||
final CraftingTileEntity cp = this.getTileEntity(worldIn, pos);
|
final CraftingTileEntity cp = this.getTileEntity(worldIn, pos);
|
||||||
if (cp != null) {
|
if (cp != null) {
|
||||||
cp.updateMultiBlock();
|
cp.updateMultiBlock(fromPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeTile
|
|||||||
boolean isMoving) {
|
boolean isMoving) {
|
||||||
final QuantumBridgeTileEntity bridge = this.getTileEntity(world, pos);
|
final QuantumBridgeTileEntity bridge = this.getTileEntity(world, pos);
|
||||||
if (bridge != null) {
|
if (bridge != null) {
|
||||||
bridge.neighborUpdate();
|
bridge.neighborUpdate(fromPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class SpatialPylonBlock extends AEBaseTileBlock<SpatialPylonTileEntity> {
|
|||||||
boolean isMoving) {
|
boolean isMoving) {
|
||||||
final SpatialPylonTileEntity tsp = this.getTileEntity(world, pos);
|
final SpatialPylonTileEntity tsp = this.getTileEntity(world, pos);
|
||||||
if (tsp != null) {
|
if (tsp != null) {
|
||||||
tsp.neighborChanged();
|
tsp.neighborChanged(fromPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-20
@@ -82,21 +82,21 @@ public class SpatialPylonCache implements ISpatialCache {
|
|||||||
int pylonBlocks = 0;
|
int pylonBlocks = 0;
|
||||||
for (final SpatialPylonCluster cl : this.clusters.values()) {
|
for (final SpatialPylonCluster cl : this.clusters.values()) {
|
||||||
if (this.captureMax == null) {
|
if (this.captureMax == null) {
|
||||||
this.captureMax = cl.getMax().copy();
|
this.captureMax = new DimensionalCoord(cl.getWorld(), cl.getBoundsMax());
|
||||||
}
|
}
|
||||||
if (this.captureMin == null) {
|
if (this.captureMin == null) {
|
||||||
this.captureMin = cl.getMin().copy();
|
this.captureMin = new DimensionalCoord(cl.getWorld(), cl.getBoundsMin());
|
||||||
}
|
}
|
||||||
|
|
||||||
pylonBlocks += cl.tileCount();
|
pylonBlocks += cl.tileCount();
|
||||||
|
|
||||||
this.captureMin.x = Math.min(this.captureMin.x, cl.getMin().x);
|
this.captureMin.x = Math.min(this.captureMin.x, cl.getBoundsMin().getX());
|
||||||
this.captureMin.y = Math.min(this.captureMin.y, cl.getMin().y);
|
this.captureMin.y = Math.min(this.captureMin.y, cl.getBoundsMin().getY());
|
||||||
this.captureMin.z = Math.min(this.captureMin.z, cl.getMin().z);
|
this.captureMin.z = Math.min(this.captureMin.z, cl.getBoundsMin().getZ());
|
||||||
|
|
||||||
this.captureMax.x = Math.max(this.captureMax.x, cl.getMax().x);
|
this.captureMax.x = Math.max(this.captureMax.x, cl.getBoundsMax().getX());
|
||||||
this.captureMax.y = Math.max(this.captureMax.y, cl.getMax().y);
|
this.captureMax.y = Math.max(this.captureMax.y, cl.getBoundsMax().getY());
|
||||||
this.captureMax.z = Math.max(this.captureMax.z, cl.getMax().z);
|
this.captureMax.z = Math.max(this.captureMax.z, cl.getBoundsMax().getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
double maxPower = 0;
|
double maxPower = 0;
|
||||||
@@ -110,28 +110,40 @@ public class SpatialPylonCache implements ISpatialCache {
|
|||||||
case X:
|
case X:
|
||||||
|
|
||||||
this.isValid = this.isValid
|
this.isValid = this.isValid
|
||||||
&& ((this.captureMax.y == cl.getMin().y || this.captureMin.y == cl.getMax().y)
|
&& ((this.captureMax.y == cl.getBoundsMin().getY()
|
||||||
|| (this.captureMax.z == cl.getMin().z || this.captureMin.z == cl.getMax().z))
|
|| this.captureMin.y == cl.getBoundsMax().getY())
|
||||||
&& ((this.captureMax.y == cl.getMax().y || this.captureMin.y == cl.getMin().y)
|
|| (this.captureMax.z == cl.getBoundsMin().getZ()
|
||||||
|| (this.captureMax.z == cl.getMax().z || this.captureMin.z == cl.getMin().z));
|
|| this.captureMin.z == cl.getBoundsMax().getZ()))
|
||||||
|
&& ((this.captureMax.y == cl.getBoundsMax().getY()
|
||||||
|
|| this.captureMin.y == cl.getBoundsMin().getY())
|
||||||
|
|| (this.captureMax.z == cl.getBoundsMax().getZ()
|
||||||
|
|| this.captureMin.z == cl.getBoundsMin().getZ()));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Y:
|
case Y:
|
||||||
|
|
||||||
this.isValid = this.isValid
|
this.isValid = this.isValid
|
||||||
&& ((this.captureMax.x == cl.getMin().x || this.captureMin.x == cl.getMax().x)
|
&& ((this.captureMax.x == cl.getBoundsMin().getX()
|
||||||
|| (this.captureMax.z == cl.getMin().z || this.captureMin.z == cl.getMax().z))
|
|| this.captureMin.x == cl.getBoundsMax().getX())
|
||||||
&& ((this.captureMax.x == cl.getMax().x || this.captureMin.x == cl.getMin().x)
|
|| (this.captureMax.z == cl.getBoundsMin().getZ()
|
||||||
|| (this.captureMax.z == cl.getMax().z || this.captureMin.z == cl.getMin().z));
|
|| this.captureMin.z == cl.getBoundsMax().getZ()))
|
||||||
|
&& ((this.captureMax.x == cl.getBoundsMax().getX()
|
||||||
|
|| this.captureMin.x == cl.getBoundsMin().getX())
|
||||||
|
|| (this.captureMax.z == cl.getBoundsMax().getZ()
|
||||||
|
|| this.captureMin.z == cl.getBoundsMin().getZ()));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Z:
|
case Z:
|
||||||
|
|
||||||
this.isValid = this.isValid
|
this.isValid = this.isValid
|
||||||
&& ((this.captureMax.y == cl.getMin().y || this.captureMin.y == cl.getMax().y)
|
&& ((this.captureMax.y == cl.getBoundsMin().getY()
|
||||||
|| (this.captureMax.x == cl.getMin().x || this.captureMin.x == cl.getMax().x))
|
|| this.captureMin.y == cl.getBoundsMax().getY())
|
||||||
&& ((this.captureMax.y == cl.getMax().y || this.captureMin.y == cl.getMin().y)
|
|| (this.captureMax.x == cl.getBoundsMin().getX()
|
||||||
|| (this.captureMax.x == cl.getMax().x || this.captureMin.x == cl.getMin().x));
|
|| this.captureMin.x == cl.getBoundsMax().getX()))
|
||||||
|
&& ((this.captureMax.y == cl.getBoundsMax().getY()
|
||||||
|
|| this.captureMin.y == cl.getBoundsMin().getY())
|
||||||
|
|| (this.captureMax.x == cl.getBoundsMax().getX()
|
||||||
|
|| this.captureMin.x == cl.getBoundsMin().getX()));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case UNFORMED:
|
case UNFORMED:
|
||||||
|
|||||||
@@ -20,10 +20,23 @@ package appeng.me.cluster;
|
|||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
import appeng.api.networking.IGridHost;
|
import appeng.api.networking.IGridHost;
|
||||||
|
|
||||||
public interface IAECluster {
|
public interface IAECluster {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The minimum x,y,z position still within the bounds of the cluster.
|
||||||
|
*/
|
||||||
|
BlockPos getBoundsMin();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The maximum x,y,z position still within the bounds of the cluster.
|
||||||
|
*/
|
||||||
|
BlockPos getBoundsMax();
|
||||||
|
|
||||||
void updateStatus(boolean updateGrid);
|
void updateStatus(boolean updateGrid);
|
||||||
|
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|||||||
@@ -54,6 +54,32 @@ public abstract class MBCalculator {
|
|||||||
return modificationInProgress.get() != null;
|
return modificationInProgress.get() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateMultiblockAfterNeighborUpdate(final World world, final WorldCoord loc, BlockPos changedPos) {
|
||||||
|
boolean recheck;
|
||||||
|
|
||||||
|
IAECluster cluster = target.getCluster();
|
||||||
|
if (cluster != null) {
|
||||||
|
if (isWithinBounds(changedPos, cluster.getBoundsMin(), cluster.getBoundsMax())) {
|
||||||
|
// If the location is part of the current multiblock, always re-check
|
||||||
|
recheck = true;
|
||||||
|
} else {
|
||||||
|
// If the location is outside, only re-check if it would now be considered part
|
||||||
|
// of it
|
||||||
|
recheck = isValidTileAt(world, changedPos.getX(), changedPos.getY(), changedPos.getZ());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Always recheck if the tile is not part of a cluster, because the adjacent
|
||||||
|
// block could have
|
||||||
|
// previously been a valid tile, but in a wrong placement, or the other way
|
||||||
|
// around.
|
||||||
|
recheck = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (recheck) {
|
||||||
|
calculateMultiblock(world, loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void calculateMultiblock(final World world, final WorldCoord loc) {
|
public void calculateMultiblock(final World world, final WorldCoord loc) {
|
||||||
if (Platform.isClient() || isModificationInProgress()) {
|
if (Platform.isClient() || isModificationInProgress()) {
|
||||||
return;
|
return;
|
||||||
@@ -127,6 +153,14 @@ public abstract class MBCalculator {
|
|||||||
this.disconnect();
|
this.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isWithinBounds(BlockPos pos, BlockPos boundsMin, BlockPos boundsMax) {
|
||||||
|
int x = pos.getX();
|
||||||
|
int y = pos.getY();
|
||||||
|
int z = pos.getZ();
|
||||||
|
return (x >= boundsMin.getX() && y >= boundsMin.getY() && z >= boundsMin.getZ() && x <= boundsMax.getX()
|
||||||
|
&& y <= boundsMax.getY() && z <= boundsMax.getZ());
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isValidTileAt(final World w, final int x, final int y, final int z) {
|
private boolean isValidTileAt(final World w, final int x, final int y, final int z) {
|
||||||
return this.isValidTile(w.getTileEntity(new BlockPos(x, y, z)));
|
return this.isValidTile(w.getTileEntity(new BlockPos(x, y, z)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import net.minecraft.inventory.CraftingInventory;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.nbt.ListNBT;
|
import net.minecraft.nbt.ListNBT;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.server.ServerWorld;
|
import net.minecraft.world.server.ServerWorld;
|
||||||
@@ -83,8 +84,8 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
|
|||||||
|
|
||||||
private static final String LOG_MARK_AS_COMPLETE = "Completed job for %s.";
|
private static final String LOG_MARK_AS_COMPLETE = "Completed job for %s.";
|
||||||
|
|
||||||
private final WorldCoord min;
|
private final BlockPos boundsMin;
|
||||||
private final WorldCoord max;
|
private final BlockPos boundsMax;
|
||||||
private final int[] usedOps = new int[3];
|
private final int[] usedOps = new int[3];
|
||||||
private final Map<ICraftingPatternDetails, TaskProgress> tasks = new HashMap<>();
|
private final Map<ICraftingPatternDetails, TaskProgress> tasks = new HashMap<>();
|
||||||
// INSTANCE sate
|
// INSTANCE sate
|
||||||
@@ -115,9 +116,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
|
|||||||
private long startItemCount;
|
private long startItemCount;
|
||||||
private long remainingItemCount;
|
private long remainingItemCount;
|
||||||
|
|
||||||
public CraftingCPUCluster(final WorldCoord min, final WorldCoord max) {
|
public CraftingCPUCluster(final WorldCoord boundsMin, final WorldCoord boundsMax) {
|
||||||
this.min = min;
|
this.boundsMin = boundsMin.getBlockPos();
|
||||||
this.max = max;
|
this.boundsMax = boundsMax.getBlockPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -129,6 +130,16 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
|
|||||||
return this.myLastLink;
|
return this.myLastLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockPos getBoundsMin() {
|
||||||
|
return boundsMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockPos getBoundsMax() {
|
||||||
|
return boundsMax;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add a new Listener to the monitor, be sure to properly remove yourself when
|
* add a new Listener to the monitor, be sure to properly remove yourself when
|
||||||
* your done.
|
* your done.
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package appeng.me.cluster.implementations;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.ChunkPos;
|
import net.minecraft.util.math.ChunkPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.dimension.DimensionType;
|
||||||
@@ -46,8 +47,8 @@ import appeng.util.iterators.ChainedIterator;
|
|||||||
|
|
||||||
public class QuantumCluster implements ILocatable, IAECluster {
|
public class QuantumCluster implements ILocatable, IAECluster {
|
||||||
|
|
||||||
private final WorldCoord min;
|
private final BlockPos boundsMin;
|
||||||
private final WorldCoord max;
|
private final BlockPos boundsMax;
|
||||||
private boolean isDestroyed = false;
|
private boolean isDestroyed = false;
|
||||||
private boolean updateStatus = true;
|
private boolean updateStatus = true;
|
||||||
private QuantumBridgeTileEntity[] Ring;
|
private QuantumBridgeTileEntity[] Ring;
|
||||||
@@ -58,8 +59,8 @@ public class QuantumCluster implements ILocatable, IAECluster {
|
|||||||
private QuantumBridgeTileEntity center;
|
private QuantumBridgeTileEntity center;
|
||||||
|
|
||||||
public QuantumCluster(final WorldCoord min, final WorldCoord max) {
|
public QuantumCluster(final WorldCoord min, final WorldCoord max) {
|
||||||
this.min = min;
|
this.boundsMin = min.getBlockPos();
|
||||||
this.max = max;
|
this.boundsMax = max.getBlockPos();
|
||||||
this.setRing(new QuantumBridgeTileEntity[8]);
|
this.setRing(new QuantumBridgeTileEntity[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +191,16 @@ public class QuantumCluster implements ILocatable, IAECluster {
|
|||||||
return this.thisSide != 0;
|
return this.thisSide != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockPos getBoundsMin() {
|
||||||
|
return boundsMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockPos getBoundsMax() {
|
||||||
|
return boundsMax;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDestroyed() {
|
public boolean isDestroyed() {
|
||||||
return isDestroyed;
|
return isDestroyed;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import appeng.api.util.DimensionalCoord;
|
|
||||||
import appeng.api.util.WorldCoord;
|
import appeng.api.util.WorldCoord;
|
||||||
import appeng.me.cluster.IAECluster;
|
import appeng.me.cluster.IAECluster;
|
||||||
import appeng.me.cluster.IAEMultiBlock;
|
import appeng.me.cluster.IAEMultiBlock;
|
||||||
@@ -47,8 +46,7 @@ public class SpatialPylonCalculator extends MBCalculator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAECluster createCluster(final World w, final WorldCoord min, final WorldCoord max) {
|
public IAECluster createCluster(final World w, final WorldCoord min, final WorldCoord max) {
|
||||||
return new SpatialPylonCluster(new DimensionalCoord(w, min.x, min.y, min.z),
|
return new SpatialPylonCluster(w, min.getBlockPos(), max.getBlockPos());
|
||||||
new DimensionalCoord(w, max.x, max.y, max.z));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,31 +22,35 @@ import java.util.ArrayList;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import appeng.api.networking.IGridHost;
|
import appeng.api.networking.IGridHost;
|
||||||
import appeng.api.util.DimensionalCoord;
|
|
||||||
import appeng.me.cluster.IAECluster;
|
import appeng.me.cluster.IAECluster;
|
||||||
import appeng.me.cluster.MBCalculator;
|
import appeng.me.cluster.MBCalculator;
|
||||||
import appeng.tile.spatial.SpatialPylonTileEntity;
|
import appeng.tile.spatial.SpatialPylonTileEntity;
|
||||||
|
|
||||||
public class SpatialPylonCluster implements IAECluster {
|
public class SpatialPylonCluster implements IAECluster {
|
||||||
|
|
||||||
private final DimensionalCoord min;
|
private final World world;
|
||||||
private final DimensionalCoord max;
|
private final BlockPos boundsMin;
|
||||||
|
private final BlockPos boundsMax;
|
||||||
private final List<SpatialPylonTileEntity> line = new ArrayList<>();
|
private final List<SpatialPylonTileEntity> line = new ArrayList<>();
|
||||||
private boolean isDestroyed = false;
|
private boolean isDestroyed = false;
|
||||||
|
|
||||||
private Axis currentAxis = Axis.UNFORMED;
|
private Axis currentAxis = Axis.UNFORMED;
|
||||||
private boolean isValid;
|
private boolean isValid;
|
||||||
|
|
||||||
public SpatialPylonCluster(final DimensionalCoord min, final DimensionalCoord max) {
|
public SpatialPylonCluster(final World world, final BlockPos boundsMin, final BlockPos boundsMax) {
|
||||||
this.min = min.copy();
|
this.world = world;
|
||||||
this.max = max.copy();
|
this.boundsMin = boundsMin.toImmutable();
|
||||||
|
this.boundsMax = boundsMax.toImmutable();
|
||||||
|
|
||||||
if (this.getMin().x != this.getMax().x) {
|
if (this.getBoundsMin().getX() != this.getBoundsMax().getX()) {
|
||||||
this.setCurrentAxis(Axis.X);
|
this.setCurrentAxis(Axis.X);
|
||||||
} else if (this.getMin().y != this.getMax().y) {
|
} else if (this.getBoundsMin().getY() != this.getBoundsMax().getY()) {
|
||||||
this.setCurrentAxis(Axis.Y);
|
this.setCurrentAxis(Axis.Y);
|
||||||
} else if (this.getMin().z != this.getMax().z) {
|
} else if (this.getBoundsMin().getZ() != this.getBoundsMax().getZ()) {
|
||||||
this.setCurrentAxis(Axis.Z);
|
this.setCurrentAxis(Axis.Z);
|
||||||
} else {
|
} else {
|
||||||
this.setCurrentAxis(Axis.UNFORMED);
|
this.setCurrentAxis(Axis.UNFORMED);
|
||||||
@@ -108,12 +112,18 @@ public class SpatialPylonCluster implements IAECluster {
|
|||||||
this.isValid = isValid;
|
this.isValid = isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DimensionalCoord getMax() {
|
public World getWorld() {
|
||||||
return this.max;
|
return world;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DimensionalCoord getMin() {
|
@Override
|
||||||
return this.min;
|
public BlockPos getBoundsMax() {
|
||||||
|
return this.boundsMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockPos getBoundsMin() {
|
||||||
|
return this.boundsMin;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SpatialPylonTileEntity> getLine() {
|
List<SpatialPylonTileEntity> getLine() {
|
||||||
|
|||||||
@@ -121,11 +121,11 @@ public class CraftingTileEntity extends AENetworkTileEntity implements IAEMultiB
|
|||||||
public void onReady() {
|
public void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
this.getProxy().setVisualRepresentation(this.getItemFromTile(this));
|
this.getProxy().setVisualRepresentation(this.getItemFromTile(this));
|
||||||
this.updateMultiBlock();
|
this.calc.calculateMultiblock(world, getLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateMultiBlock() {
|
public void updateMultiBlock(BlockPos changedPos) {
|
||||||
this.calc.calculateMultiblock(this.world, this.getLocation());
|
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), changedPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateStatus(final CraftingCPUCluster c) {
|
public void updateStatus(final CraftingCPUCluster c) {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import net.minecraft.tileentity.ITickableTileEntity;
|
|||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.client.model.data.IModelData;
|
import net.minecraftforge.client.model.data.IModelData;
|
||||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
import net.minecraftforge.client.model.data.ModelDataMap;
|
||||||
import net.minecraftforge.client.model.data.ModelProperty;
|
import net.minecraftforge.client.model.data.ModelProperty;
|
||||||
@@ -272,8 +273,8 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
|
|||||||
return AECableType.DENSE_SMART;
|
return AECableType.DENSE_SMART;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void neighborUpdate() {
|
public void neighborUpdate(BlockPos fromPos) {
|
||||||
this.calc.calculateMultiblock(this.world, this.getLocation());
|
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), fromPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import javax.annotation.Nonnull;
|
|||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.client.model.data.IModelData;
|
import net.minecraftforge.client.model.data.IModelData;
|
||||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
import net.minecraftforge.client.model.data.ModelDataMap;
|
||||||
import net.minecraftforge.client.model.data.ModelProperty;
|
import net.minecraftforge.client.model.data.ModelProperty;
|
||||||
@@ -87,7 +88,7 @@ public class SpatialPylonTileEntity extends AENetworkTileEntity implements IAEMu
|
|||||||
@Override
|
@Override
|
||||||
public void onReady() {
|
public void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
this.neighborChanged();
|
this.calc.calculateMultiblock(world, getLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -96,8 +97,8 @@ public class SpatialPylonTileEntity extends AENetworkTileEntity implements IAEMu
|
|||||||
super.remove();
|
super.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void neighborChanged() {
|
public void neighborChanged(BlockPos changedPos) {
|
||||||
this.calc.calculateMultiblock(this.world, this.getLocation());
|
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), changedPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -130,9 +131,9 @@ public class SpatialPylonTileEntity extends AENetworkTileEntity implements IAEMu
|
|||||||
this.displayBits = 0;
|
this.displayBits = 0;
|
||||||
|
|
||||||
if (this.cluster != null) {
|
if (this.cluster != null) {
|
||||||
if (this.cluster.getMin().equals(this.getLocation())) {
|
if (this.cluster.getBoundsMin().equals(this.getLocation())) {
|
||||||
this.displayBits = DISPLAY_END_MIN;
|
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;
|
this.displayBits = DISPLAY_END_MAX;
|
||||||
} else {
|
} else {
|
||||||
this.displayBits = DISPLAY_MIDDLE;
|
this.displayBits = DISPLAY_MIDDLE;
|
||||||
|
|||||||
Reference in New Issue
Block a user