Force cluster-rebuilds on the first detected change, if their bounds do not match.

Also use a client-side method to update connected textures
for crafting cubes if two previously distinct clusters are connected.
Refactored MBCalculator to use generics for type checks and remove more casts.
This commit is contained in:
Sebastian Hartte
2020-07-19 00:16:33 +02:00
parent 7121426fc9
commit e1f9e01404
12 changed files with 178 additions and 247 deletions
@@ -49,7 +49,6 @@ import appeng.api.util.DimensionalCoord;
import appeng.block.qnb.QnbFormedState;
import appeng.core.Api;
import appeng.me.GridAccessException;
import appeng.me.cluster.IAECluster;
import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.implementations.QuantumCalculator;
import appeng.me.cluster.implementations.QuantumCluster;
@@ -57,7 +56,8 @@ import appeng.tile.grid.AENetworkInvTileEntity;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.inv.InvOperation;
public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements IAEMultiBlock, ITickableTileEntity {
public class QuantumBridgeTileEntity extends AENetworkInvTileEntity
implements IAEMultiBlock<QuantumCluster>, ITickableTileEntity {
public static final ModelProperty<QnbFormedState> FORMED_STATE = new ModelProperty<>();
@@ -191,7 +191,7 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
}
@Override
public IAECluster getCluster() {
public QuantumCluster getCluster() {
return this.cluster;
}
@@ -210,11 +210,7 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
}
if (this.isCorner() || this.isCenter()) {
final EnumSet<Direction> sides = EnumSet.noneOf(Direction.class);
for (final Direction dir : this.getAdjacentQuantumBridges()) {
sides.add(dir);
}
EnumSet<Direction> sides = EnumSet.copyOf(this.getAdjacentQuantumBridges());
this.getProxy().setValidSides(sides);
} else {
this.getProxy().setValidSides(EnumSet.allOf(Direction.class));
@@ -274,7 +270,7 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
}
public void neighborUpdate(BlockPos fromPos) {
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), fromPos);
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.pos, fromPos);
}
@Override