Lots of fixes
This commit is contained in:
@@ -64,11 +64,10 @@ public class GridStorage implements IGridStorage {
|
||||
}
|
||||
|
||||
public void saveState() {
|
||||
throw new IllegalStateException();
|
||||
// FIXME FABRIC final Grid currentGrid = (Grid) this.getGrid();
|
||||
// FIXME FABRIC if (currentGrid != null) {
|
||||
// FIXME FABRIC currentGrid.saveState();
|
||||
// FIXME FABRIC }
|
||||
final Grid currentGrid = (Grid) this.getGrid();
|
||||
if (currentGrid != null) {
|
||||
currentGrid.saveState();
|
||||
}
|
||||
}
|
||||
|
||||
public IGrid getGrid() {
|
||||
|
||||
@@ -95,8 +95,8 @@ public abstract class MBCalculator<TTile extends IAEMultiBlock<TCluster>, TClust
|
||||
}
|
||||
|
||||
try {
|
||||
final BlockPos.Mutable min = new BlockPos.Mutable(loc);
|
||||
final BlockPos.Mutable max = new BlockPos.Mutable(loc);
|
||||
final BlockPos.Mutable min = loc.mutableCopy();
|
||||
final BlockPos.Mutable max = loc.mutableCopy();
|
||||
|
||||
// find size of MB structure...
|
||||
while (this.isValidTileAt(world, min.getX() - 1, min.getY(), min.getZ())) {
|
||||
@@ -259,7 +259,7 @@ public abstract class MBCalculator<TTile extends IAEMultiBlock<TCluster>, TClust
|
||||
return false;
|
||||
}
|
||||
|
||||
for (BlockPos p : BlockPos.getAllInBoxMutable(minX, minY, minZ, maxX, maxY, maxZ)) {
|
||||
for (BlockPos p : BlockPos.iterate(minX, minY, minZ, maxX, maxY, maxZ)) {
|
||||
final BlockEntity te = w.getBlockEntity(p);
|
||||
if (this.isValidTile(te)) {
|
||||
return true;
|
||||
|
||||
@@ -33,9 +33,9 @@ import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.me.cluster.MBCalculator;
|
||||
import appeng.tile.crafting.CraftingBlockEntity;
|
||||
|
||||
public class CraftingCPUCalculator extends MBCalculator<CraftingTileEntity, CraftingCPUCluster> {
|
||||
public class CraftingCPUCalculator extends MBCalculator<CraftingBlockEntity, CraftingCPUCluster> {
|
||||
|
||||
public CraftingCPUCalculator(final CraftingTileEntity t) {
|
||||
public CraftingCPUCalculator(final CraftingBlockEntity t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class CraftingCPUCalculator extends MBCalculator<CraftingTileEntity, Craf
|
||||
public boolean verifyInternalStructure(final World w, final BlockPos min, final BlockPos max) {
|
||||
boolean storage = false;
|
||||
|
||||
for (BlockPos blockPos : BlockPos.getAllInBoxMutable(min, max)) {
|
||||
for (BlockPos blockPos : BlockPos.iterate(min, max)) {
|
||||
final IAEMultiBlock<?> te = (IAEMultiBlock<?>) w.getBlockEntity(blockPos);
|
||||
|
||||
if (te == null || !te.isValid()) {
|
||||
@@ -82,7 +82,7 @@ public class CraftingCPUCalculator extends MBCalculator<CraftingTileEntity, Craf
|
||||
|
||||
@Override
|
||||
public void updateTiles(final CraftingCPUCluster c, final World w, final BlockPos min, final BlockPos max) {
|
||||
for (BlockPos blockPos : BlockPos.getAllInBoxMutable(min, max)) {
|
||||
for (BlockPos blockPos : BlockPos.iterate(min, max)) {
|
||||
final CraftingBlockEntity te = (CraftingBlockEntity) w.getBlockEntity(blockPos);
|
||||
te.updateStatus(c);
|
||||
c.addTile(te);
|
||||
@@ -90,7 +90,7 @@ public class CraftingCPUCalculator extends MBCalculator<CraftingTileEntity, Craf
|
||||
|
||||
c.done();
|
||||
|
||||
final Iterator<CraftingTileEntity> i = c.getTiles();
|
||||
final Iterator<CraftingBlockEntity> i = c.getTiles();
|
||||
while (i.hasNext()) {
|
||||
final IGridHost gh = i.next();
|
||||
final IGridNode n = gh.getGridNode(AEPartLocation.INTERNAL);
|
||||
|
||||
@@ -183,7 +183,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<CraftingTileEntity> getTiles() {
|
||||
public Iterator<CraftingBlockEntity> getTiles() {
|
||||
return this.tiles.iterator();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.me.cluster.MBCalculator;
|
||||
import appeng.tile.qnb.QuantumBridgeBlockEntity;
|
||||
|
||||
public class QuantumCalculator extends MBCalculator<QuantumBridgeTileEntity, QuantumCluster> {
|
||||
public class QuantumCalculator extends MBCalculator<QuantumBridgeBlockEntity, QuantumCluster> {
|
||||
|
||||
public QuantumCalculator(final QuantumBridgeTileEntity t) {
|
||||
public QuantumCalculator(final QuantumBridgeBlockEntity t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
@@ -60,8 +60,8 @@ public class QuantumCalculator extends MBCalculator<QuantumBridgeTileEntity, Qua
|
||||
|
||||
byte num = 0;
|
||||
|
||||
for (BlockPos p : BlockPos.getAllInBoxMutable(min, max)) {
|
||||
final IAEMultiBlock<?> te = (IAEMultiBlock<?>) w.getTileEntity(p);
|
||||
for (BlockPos p : BlockPos.iterate(min, max)) {
|
||||
final IAEMultiBlock<?> te = (IAEMultiBlock<?>) w.getBlockEntity(p);
|
||||
|
||||
if (te == null || !te.isValid()) {
|
||||
return false;
|
||||
@@ -87,7 +87,7 @@ public class QuantumCalculator extends MBCalculator<QuantumBridgeTileEntity, Qua
|
||||
byte num = 0;
|
||||
byte ringNum = 0;
|
||||
|
||||
for (BlockPos p : BlockPos.getAllInBoxMutable(min, max)) {
|
||||
for (BlockPos p : BlockPos.iterate(min, max)) {
|
||||
final QuantumBridgeBlockEntity te = (QuantumBridgeBlockEntity) w.getBlockEntity(p);
|
||||
|
||||
num++;
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.me.cluster.implementations;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
@@ -234,7 +235,7 @@ public class QuantumCluster implements ILocatable, IAECluster {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<QuantumBridgeTileEntity> getTiles() {
|
||||
public Iterator<QuantumBridgeBlockEntity> getTiles() {
|
||||
return new ChainedIterator<>(this.getRing()[0], this.getRing()[1], this.getRing()[2], this.getRing()[3],
|
||||
this.getRing()[4], this.getRing()[5], this.getRing()[6], this.getRing()[7], this.center);
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.me.cluster.MBCalculator;
|
||||
import appeng.tile.spatial.SpatialPylonBlockEntity;
|
||||
|
||||
public class SpatialPylonCalculator extends MBCalculator<SpatialPylonTileEntity, SpatialPylonCluster> {
|
||||
public class SpatialPylonCalculator extends MBCalculator<SpatialPylonBlockEntity, SpatialPylonCluster> {
|
||||
|
||||
public SpatialPylonCalculator(final SpatialPylonTileEntity t) {
|
||||
public SpatialPylonCalculator(final SpatialPylonBlockEntity t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ public class SpatialPylonCalculator extends MBCalculator<SpatialPylonTileEntity,
|
||||
@Override
|
||||
public boolean verifyInternalStructure(final World w, final BlockPos min, final BlockPos max) {
|
||||
|
||||
for (BlockPos p : BlockPos.getAllInBoxMutable(min, max)) {
|
||||
final IAEMultiBlock<?> te = (IAEMultiBlock<?>) w.getTileEntity(p);
|
||||
for (BlockPos p : BlockPos.iterate(min, max)) {
|
||||
final IAEMultiBlock<?> te = (IAEMultiBlock<?>) w.getBlockEntity(p);
|
||||
|
||||
if (te == null || !te.isValid()) {
|
||||
return false;
|
||||
@@ -60,8 +60,8 @@ public class SpatialPylonCalculator extends MBCalculator<SpatialPylonTileEntity,
|
||||
|
||||
@Override
|
||||
public void updateTiles(final SpatialPylonCluster c, final World w, final BlockPos min, final BlockPos max) {
|
||||
for (BlockPos p : BlockPos.getAllInBoxMutable(min, max)) {
|
||||
final SpatialPylonTileEntity te = (SpatialPylonTileEntity) w.getTileEntity(p);
|
||||
for (BlockPos p : BlockPos.iterate(min, max)) {
|
||||
final SpatialPylonBlockEntity te = (SpatialPylonBlockEntity) w.getBlockEntity(p);
|
||||
te.updateStatus(c);
|
||||
c.getLine().add(te);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class SpatialPylonCluster implements IAECluster {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<SpatialPylonTileEntity> getTiles() {
|
||||
public Iterator<SpatialPylonBlockEntity> getTiles() {
|
||||
return this.getLine().iterator();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user