fix: crashing issues due to node desync
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.7.1/helper.gradle"
|
apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.7.1/helper.gradle"
|
||||||
|
|
||||||
|
ext {
|
||||||
|
forgeVersion = "47.1.0"
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
name = 'JEI'
|
name = 'JEI'
|
||||||
@@ -38,10 +42,7 @@ dependencies {
|
|||||||
|
|
||||||
compileOnly fg.deobf('curse.maven:crafting-tweaks-233071:4596466')
|
compileOnly fg.deobf('curse.maven:crafting-tweaks-233071:4596466')
|
||||||
|
|
||||||
// TODO mixin issue
|
implementation fg.deobf("top.theillusivec4.curios:curios-forge:5.2.0-beta.3+1.20.1")
|
||||||
// runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:5.2.0-beta.3+1.20.1")
|
|
||||||
// can't depend on API due to Javadoc build error (CuriosApi imports stuff from common)
|
|
||||||
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:5.2.0-beta.3+1.20.1")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
|
@@ -122,6 +122,7 @@ public class CableBlock extends NetworkNodeBlock implements SimpleWaterloggedBlo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean isPathfindable(BlockState state, BlockGetter worldIn, BlockPos pos, PathComputationType type) {
|
public boolean isPathfindable(BlockState state, BlockGetter worldIn, BlockPos pos, PathComputationType type) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -197,8 +198,8 @@ public class CableBlock extends NetworkNodeBlock implements SimpleWaterloggedBlo
|
|||||||
}
|
}
|
||||||
|
|
||||||
return blockEntity.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction).isPresent()
|
return blockEntity.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction).isPresent()
|
||||||
&& !isSideCovered(blockEntity, direction)
|
&& !isSideCovered(blockEntity, direction)
|
||||||
&& !isSideCovered(world.getBlockEntity(pos.relative(direction)), direction.getOpposite());
|
&& !isSideCovered(world.getBlockEntity(pos.relative(direction)), direction.getOpposite());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSideCovered(BlockEntity blockEntity, Direction direction) {
|
private boolean isSideCovered(BlockEntity blockEntity, Direction direction) {
|
||||||
@@ -229,12 +230,12 @@ public class CableBlock extends NetworkNodeBlock implements SimpleWaterloggedBlo
|
|||||||
boolean down = hasNodeConnection(world, pos.relative(Direction.DOWN), currentState, Direction.UP);
|
boolean down = hasNodeConnection(world, pos.relative(Direction.DOWN), currentState, Direction.UP);
|
||||||
|
|
||||||
return currentState
|
return currentState
|
||||||
.setValue(NORTH, north)
|
.setValue(NORTH, north)
|
||||||
.setValue(EAST, east)
|
.setValue(EAST, east)
|
||||||
.setValue(SOUTH, south)
|
.setValue(SOUTH, south)
|
||||||
.setValue(WEST, west)
|
.setValue(WEST, west)
|
||||||
.setValue(UP, up)
|
.setValue(UP, up)
|
||||||
.setValue(DOWN, down);
|
.setValue(DOWN, down);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -27,7 +27,7 @@ public class CableBlockEntity extends NetworkNodeBlockEntity<CableNetworkNode> {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public CableBlockEntity(BlockPos pos, BlockState state) {
|
public CableBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.CABLE.get(), pos, state, SPEC);
|
super(RSBlockEntities.CABLE.get(), pos, state, SPEC, CableNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -42,7 +42,7 @@ public class ConstructorBlockEntity extends NetworkNodeBlockEntity<ConstructorNe
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public ConstructorBlockEntity(BlockPos pos, BlockState state) {
|
public ConstructorBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.CONSTRUCTOR.get(), pos, state, SPEC);
|
super(RSBlockEntities.CONSTRUCTOR.get(), pos, state, SPEC, ConstructorNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -33,7 +33,7 @@ public class CrafterBlockEntity extends NetworkNodeBlockEntity<CrafterNetworkNod
|
|||||||
private final LazyOptional<IItemHandler> patternsCapability = LazyOptional.of(() -> getNode().getPatternInventory());
|
private final LazyOptional<IItemHandler> patternsCapability = LazyOptional.of(() -> getNode().getPatternInventory());
|
||||||
|
|
||||||
public CrafterBlockEntity(BlockPos pos, BlockState state) {
|
public CrafterBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.CRAFTER.get(), pos, state, SPEC);
|
super(RSBlockEntities.CRAFTER.get(), pos, state, SPEC, CrafterNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -35,7 +35,7 @@ public class CrafterManagerBlockEntity extends NetworkNodeBlockEntity<CrafterMan
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public CrafterManagerBlockEntity(BlockPos pos, BlockState state) {
|
public CrafterManagerBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.CRAFTER_MANAGER.get(), pos, state, SPEC);
|
super(RSBlockEntities.CRAFTER_MANAGER.get(), pos, state, SPEC, CrafterManagerNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -45,7 +45,7 @@ public class DestructorBlockEntity extends NetworkNodeBlockEntity<DestructorNetw
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public DestructorBlockEntity(BlockPos pos, BlockState state) {
|
public DestructorBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.DESTRUCTOR.get(), pos, state, SPEC);
|
super(RSBlockEntities.DESTRUCTOR.get(), pos, state, SPEC, DestructorNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -43,7 +43,7 @@ public class DetectorBlockEntity extends NetworkNodeBlockEntity<DetectorNetworkN
|
|||||||
private static final String NBT_POWERED = "Powered";
|
private static final String NBT_POWERED = "Powered";
|
||||||
|
|
||||||
public DetectorBlockEntity(BlockPos pos, BlockState state) {
|
public DetectorBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.DETECTOR.get(), pos, state, SPEC);
|
super(RSBlockEntities.DETECTOR.get(), pos, state, SPEC, DetectorNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -99,7 +99,7 @@ public class DiskDriveBlockEntity extends NetworkNodeBlockEntity<DiskDriveNetwor
|
|||||||
private final DiskState[] diskState = new DiskState[8];
|
private final DiskState[] diskState = new DiskState[8];
|
||||||
|
|
||||||
public DiskDriveBlockEntity(BlockPos pos, BlockState state) {
|
public DiskDriveBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.DISK_DRIVE.get(), pos, state, SPEC);
|
super(RSBlockEntities.DISK_DRIVE.get(), pos, state, SPEC, DiskDriveNetworkNode.class);
|
||||||
Arrays.fill(diskState, DiskState.NONE);
|
Arrays.fill(diskState, DiskState.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ public class DiskManipulatorBlockEntity extends NetworkNodeBlockEntity<DiskManip
|
|||||||
private final DiskState[] diskState = new DiskState[6];
|
private final DiskState[] diskState = new DiskState[6];
|
||||||
|
|
||||||
public DiskManipulatorBlockEntity(BlockPos pos, BlockState state) {
|
public DiskManipulatorBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.DISK_MANIPULATOR.get(), pos, state, SPEC);
|
super(RSBlockEntities.DISK_MANIPULATOR.get(), pos, state, SPEC, DiskManipulatorNetworkNode.class);
|
||||||
Arrays.fill(diskState, DiskState.NONE);
|
Arrays.fill(diskState, DiskState.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class ExporterBlockEntity extends NetworkNodeBlockEntity<ExporterNetworkN
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public ExporterBlockEntity(BlockPos pos, BlockState state) {
|
public ExporterBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.EXPORTER.get(), pos, state, SPEC);
|
super(RSBlockEntities.EXPORTER.get(), pos, state, SPEC, ExporterNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -10,6 +10,7 @@ import com.refinedmods.refinedstorage.blockentity.config.*;
|
|||||||
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationParameter;
|
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationParameter;
|
||||||
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationSpec;
|
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationSpec;
|
||||||
import com.refinedmods.refinedstorage.blockentity.data.RSSerializers;
|
import com.refinedmods.refinedstorage.blockentity.data.RSSerializers;
|
||||||
|
import com.refinedmods.refinedstorage.config.ServerConfig;
|
||||||
import com.refinedmods.refinedstorage.util.LevelUtils;
|
import com.refinedmods.refinedstorage.util.LevelUtils;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
@@ -72,7 +73,7 @@ public class ExternalStorageBlockEntity extends NetworkNodeBlockEntity<ExternalS
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public ExternalStorageBlockEntity(BlockPos pos, BlockState state) {
|
public ExternalStorageBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.EXTERNAL_STORAGE.get(), pos, state, SPEC);
|
super(RSBlockEntities.EXTERNAL_STORAGE.get(), pos, state, SPEC, ExternalStorageNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -26,16 +26,16 @@ public class FluidInterfaceBlockEntity extends NetworkNodeBlockEntity<FluidInter
|
|||||||
public static final BlockEntitySynchronizationParameter<FluidStack, FluidInterfaceBlockEntity> TANK_OUT = new BlockEntitySynchronizationParameter<>(new ResourceLocation(RS.ID, "fluid_interface_out"), RSSerializers.FLUID_STACK_SERIALIZER, FluidStack.EMPTY, t -> t.getNode().getTankOut().getFluid());
|
public static final BlockEntitySynchronizationParameter<FluidStack, FluidInterfaceBlockEntity> TANK_OUT = new BlockEntitySynchronizationParameter<>(new ResourceLocation(RS.ID, "fluid_interface_out"), RSSerializers.FLUID_STACK_SERIALIZER, FluidStack.EMPTY, t -> t.getNode().getTankOut().getFluid());
|
||||||
|
|
||||||
public static BlockEntitySynchronizationSpec SPEC = BlockEntitySynchronizationSpec.builder()
|
public static BlockEntitySynchronizationSpec SPEC = BlockEntitySynchronizationSpec.builder()
|
||||||
.addWatchedParameter(REDSTONE_MODE)
|
.addWatchedParameter(REDSTONE_MODE)
|
||||||
.addParameter(TANK_IN)
|
.addParameter(TANK_IN)
|
||||||
.addParameter(TANK_OUT)
|
.addParameter(TANK_OUT)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
private final LazyOptional<IFluidHandler> tankCapability = LazyOptional.of(() -> getNode().getTank());
|
private final LazyOptional<IFluidHandler> tankCapability = LazyOptional.of(() -> getNode().getTank());
|
||||||
private final LazyOptional<IItemHandler> inCapability = LazyOptional.of(() -> getNode().getIn());
|
private final LazyOptional<IItemHandler> inCapability = LazyOptional.of(() -> getNode().getIn());
|
||||||
|
|
||||||
public FluidInterfaceBlockEntity(BlockPos pos, BlockState state) {
|
public FluidInterfaceBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.FLUID_INTERFACE.get(), pos, state, SPEC);
|
super(RSBlockEntities.FLUID_INTERFACE.get(), pos, state, SPEC, FluidInterfaceNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@@ -39,7 +39,7 @@ public class FluidStorageBlockEntity extends NetworkNodeBlockEntity<FluidStorage
|
|||||||
private final FluidStorageType type;
|
private final FluidStorageType type;
|
||||||
|
|
||||||
public FluidStorageBlockEntity(FluidStorageType type, BlockPos pos, BlockState state) {
|
public FluidStorageBlockEntity(FluidStorageType type, BlockPos pos, BlockState state) {
|
||||||
super(getType(type), pos, state, SPEC);
|
super(getType(type), pos, state, SPEC, FluidStorageNetworkNode.class);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ public class ImporterBlockEntity extends NetworkNodeBlockEntity<ImporterNetworkN
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public ImporterBlockEntity(BlockPos pos, BlockState state) {
|
public ImporterBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.IMPORTER.get(), pos, state, SPEC);
|
super(RSBlockEntities.IMPORTER.get(), pos, state, SPEC, ImporterNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -30,7 +30,7 @@ public class InterfaceBlockEntity extends NetworkNodeBlockEntity<InterfaceNetwor
|
|||||||
private final LazyOptional<IItemHandler> itemsCapability = LazyOptional.of(() -> getNode().getItems());
|
private final LazyOptional<IItemHandler> itemsCapability = LazyOptional.of(() -> getNode().getItems());
|
||||||
|
|
||||||
public InterfaceBlockEntity(BlockPos pos, BlockState state) {
|
public InterfaceBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.INTERFACE.get(), pos, state, SPEC);
|
super(RSBlockEntities.INTERFACE.get(), pos, state, SPEC, InterfaceNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@@ -28,16 +28,26 @@ import javax.annotation.Nonnull;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public abstract class NetworkNodeBlockEntity<N extends NetworkNode> extends BaseBlockEntity implements INetworkNodeProxy<N>, IRedstoneConfigurable {
|
public abstract class NetworkNodeBlockEntity<N extends NetworkNode> extends BaseBlockEntity implements INetworkNodeProxy<N>, IRedstoneConfigurable {
|
||||||
public static final BlockEntitySynchronizationParameter<Integer, NetworkNodeBlockEntity> REDSTONE_MODE = RedstoneMode.createParameter(new ResourceLocation(RS.ID, "redstone_mode"));
|
public static final BlockEntitySynchronizationParameter<Integer, NetworkNodeBlockEntity<?>> REDSTONE_MODE = RedstoneMode.createParameter(new ResourceLocation(RS.ID, "redstone_mode"));
|
||||||
|
|
||||||
private final LazyOptional<INetworkNodeProxy<N>> networkNodeProxy = LazyOptional.of(() -> this);
|
private final LazyOptional<INetworkNodeProxy<N>> networkNodeProxy = LazyOptional.of(() -> this);
|
||||||
|
private final Class<N> networkNodeClass;
|
||||||
private N clientNode;
|
private N clientNode;
|
||||||
private N removedNode;
|
private N removedNode;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogManager.getLogger();
|
||||||
|
|
||||||
|
// TODO: remove this ctor in 1.21
|
||||||
|
@Deprecated
|
||||||
protected NetworkNodeBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state, BlockEntitySynchronizationSpec syncSpec) {
|
protected NetworkNodeBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state, BlockEntitySynchronizationSpec syncSpec) {
|
||||||
super(type, pos, state, syncSpec);
|
super(type, pos, state, syncSpec);
|
||||||
|
this.networkNodeClass = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected NetworkNodeBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state, BlockEntitySynchronizationSpec syncSpec,
|
||||||
|
Class<N> networkNodeClass) {
|
||||||
|
super(type, pos, state, syncSpec);
|
||||||
|
this.networkNodeClass = networkNodeClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -72,13 +82,20 @@ public abstract class NetworkNodeBlockEntity<N extends NetworkNode> extends Base
|
|||||||
node = createAndSetNode(manager);
|
node = createAndSetNode(manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (N) node;
|
return doCast(node);
|
||||||
} catch (ClassCastException e) {
|
} catch (ClassCastException e) {
|
||||||
LOGGER.warn("Node @ {} got desynced with it's block entity container, recreating", worldPosition, e);
|
LOGGER.warn("Node @ {} got desynced with it's block entity container, recreating", worldPosition, e);
|
||||||
return (N) createAndSetNode(manager);
|
return (N) createAndSetNode(manager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private N doCast(INetworkNode node) {
|
||||||
|
if (networkNodeClass == null) {
|
||||||
|
return (N) node;
|
||||||
|
}
|
||||||
|
return networkNodeClass.cast(node);
|
||||||
|
}
|
||||||
|
|
||||||
private INetworkNode createAndSetNode(INetworkNodeManager manager) {
|
private INetworkNode createAndSetNode(INetworkNodeManager manager) {
|
||||||
INetworkNode node = createNode(level, worldPosition);
|
INetworkNode node = createNode(level, worldPosition);
|
||||||
manager.setNode(worldPosition, node);
|
manager.setNode(worldPosition, node);
|
||||||
@@ -110,7 +127,11 @@ public abstract class NetworkNodeBlockEntity<N extends NetworkNode> extends Base
|
|||||||
INetworkNode node = manager.getNode(worldPosition);
|
INetworkNode node = manager.getNode(worldPosition);
|
||||||
|
|
||||||
if (node != null) {
|
if (node != null) {
|
||||||
removedNode = (N) node;
|
try {
|
||||||
|
removedNode = doCast(node);
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
removedNode = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.removeNode(worldPosition);
|
manager.removeNode(worldPosition);
|
||||||
|
@@ -15,7 +15,7 @@ public class NetworkReceiverBlockEntity extends NetworkNodeBlockEntity<NetworkRe
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public NetworkReceiverBlockEntity(BlockPos pos, BlockState state) {
|
public NetworkReceiverBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.NETWORK_RECEIVER.get(), pos, state, SPEC);
|
super(RSBlockEntities.NETWORK_RECEIVER.get(), pos, state, SPEC, NetworkReceiverNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -40,7 +40,7 @@ public class NetworkTransmitterBlockEntity extends NetworkNodeBlockEntity<Networ
|
|||||||
private final LazyOptional<IItemHandler> networkCardCapability = LazyOptional.of(() -> getNode().getNetworkCard());
|
private final LazyOptional<IItemHandler> networkCardCapability = LazyOptional.of(() -> getNode().getNetworkCard());
|
||||||
|
|
||||||
public NetworkTransmitterBlockEntity(BlockPos pos, BlockState state) {
|
public NetworkTransmitterBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.NETWORK_TRANSMITTER.get(), pos, state, SPEC);
|
super(RSBlockEntities.NETWORK_TRANSMITTER.get(), pos, state, SPEC, NetworkTransmitterNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -15,7 +15,7 @@ public class RelayBlockEntity extends NetworkNodeBlockEntity<RelayNetworkNode> {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public RelayBlockEntity(BlockPos pos, BlockState state) {
|
public RelayBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.RELAY.get(), pos, state, SPEC);
|
super(RSBlockEntities.RELAY.get(), pos, state, SPEC, RelayNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -15,7 +15,7 @@ public class SecurityManagerBlockEntity extends NetworkNodeBlockEntity<SecurityM
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public SecurityManagerBlockEntity(BlockPos pos, BlockState state) {
|
public SecurityManagerBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.SECURITY_MANAGER.get(), pos, state, SPEC);
|
super(RSBlockEntities.SECURITY_MANAGER.get(), pos, state, SPEC, SecurityManagerNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -39,7 +39,7 @@ public class StorageBlockEntity extends NetworkNodeBlockEntity<StorageNetworkNod
|
|||||||
private final ItemStorageType type;
|
private final ItemStorageType type;
|
||||||
|
|
||||||
public StorageBlockEntity(ItemStorageType type, BlockPos pos, BlockState state) {
|
public StorageBlockEntity(ItemStorageType type, BlockPos pos, BlockState state) {
|
||||||
super(getType(type), pos, state, SPEC);
|
super(getType(type), pos, state, SPEC, StorageNetworkNode.class);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ import com.refinedmods.refinedstorage.blockentity.config.IComparable;
|
|||||||
import com.refinedmods.refinedstorage.blockentity.config.IType;
|
import com.refinedmods.refinedstorage.blockentity.config.IType;
|
||||||
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationParameter;
|
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationParameter;
|
||||||
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationSpec;
|
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationSpec;
|
||||||
|
import com.refinedmods.refinedstorage.config.ServerConfig;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -40,7 +41,7 @@ public class StorageMonitorBlockEntity extends NetworkNodeBlockEntity<StorageMon
|
|||||||
private FluidStack fluidStack = FluidStack.EMPTY;
|
private FluidStack fluidStack = FluidStack.EMPTY;
|
||||||
|
|
||||||
public StorageMonitorBlockEntity(BlockPos pos, BlockState state) {
|
public StorageMonitorBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.STORAGE_MONITOR.get(), pos, state, SPEC);
|
super(RSBlockEntities.STORAGE_MONITOR.get(), pos, state, SPEC, StorageMonitorNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -22,7 +22,7 @@ public class WirelessTransmitterBlockEntity extends NetworkNodeBlockEntity<Wirel
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public WirelessTransmitterBlockEntity(BlockPos pos, BlockState state) {
|
public WirelessTransmitterBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.WIRELESS_TRANSMITTER.get(), pos, state, SPEC);
|
super(RSBlockEntities.WIRELESS_TRANSMITTER.get(), pos, state, SPEC, WirelessTransmitterNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -41,7 +41,7 @@ public class CraftingMonitorBlockEntity extends NetworkNodeBlockEntity<CraftingM
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public CraftingMonitorBlockEntity(BlockPos pos, BlockState state) {
|
public CraftingMonitorBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(RSBlockEntities.CRAFTING_MONITOR.get(), pos, state, SPEC);
|
super(RSBlockEntities.CRAFTING_MONITOR.get(), pos, state, SPEC, CraftingMonitorNetworkNode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -119,7 +119,7 @@ public class GridBlockEntity extends NetworkNodeBlockEntity<GridNetworkNode> {
|
|||||||
private final LazyOptional<IItemHandler> diskCapability = LazyOptional.of(() -> getNode().getPatterns());
|
private final LazyOptional<IItemHandler> diskCapability = LazyOptional.of(() -> getNode().getPatterns());
|
||||||
|
|
||||||
public GridBlockEntity(GridType type, BlockPos pos, BlockState state) {
|
public GridBlockEntity(GridType type, BlockPos pos, BlockState state) {
|
||||||
super(getType(type), pos, state, SPEC);
|
super(getType(type), pos, state, SPEC, GridNetworkNode.class);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user