Fabric port in progress
This commit is contained in:
+10
-10
@@ -36,7 +36,7 @@ import net.minecraft.util.math.Direction;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
||||
import net.minecraftforge.client.model.data.ModelProperty;
|
||||
import net.minecraftforge.items.wrapper.EmptyHandler;
|
||||
import alexiil.mc.lib.attributes.item.impl.EmptyFixedItemInv;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
@@ -52,11 +52,11 @@ import appeng.me.cluster.IAECluster;
|
||||
import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.me.cluster.implementations.QuantumCalculator;
|
||||
import appeng.me.cluster.implementations.QuantumCluster;
|
||||
import appeng.tile.grid.AENetworkInvTileEntity;
|
||||
import appeng.tile.grid.AENetworkInvBlockEntity;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.util.inv.InvOperation;
|
||||
|
||||
public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements IAEMultiBlock, ITickableTileEntity {
|
||||
public class QuantumBridgeBlockEntity extends AENetworkInvBlockEntity implements IAEMultiBlock, ITickableTileEntity {
|
||||
|
||||
public static final ModelProperty<QnbFormedState> FORMED_STATE = new ModelProperty<>();
|
||||
|
||||
@@ -70,7 +70,7 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
|
||||
private QuantumCluster cluster;
|
||||
private boolean updateStatus = false;
|
||||
|
||||
public QuantumBridgeTileEntity(BlockEntityType<?> tileEntityTypeIn) {
|
||||
public QuantumBridgeBlockEntity(BlockEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.getProxy().setValidSides(EnumSet.noneOf(Direction.class));
|
||||
this.getProxy().setFlags(GridFlags.DENSE_CAPACITY);
|
||||
@@ -130,12 +130,12 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
|
||||
if (this.isCenter()) {
|
||||
return this.internalInventory;
|
||||
}
|
||||
return EmptyHandler.INSTANCE;
|
||||
return EmptyFixedItemInv.INSTANCE;
|
||||
}
|
||||
|
||||
private boolean isCenter() {
|
||||
return AEApi.instance().definitions().blocks().quantumLink().maybeBlock()
|
||||
.map(link -> this.getBlockState().getBlock() == link).orElse(false);
|
||||
.map(link -> getCachedState().getBlock() == link).orElse(false);
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
@@ -159,7 +159,7 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
|
||||
|
||||
final boolean isPresent = maybeLinkBlock.isPresent() && maybeLinkStack.isPresent();
|
||||
|
||||
if (isPresent && this.getBlockState().getBlock() == maybeLinkBlock.get()) {
|
||||
if (isPresent && getCachedState().getBlock() == maybeLinkBlock.get()) {
|
||||
final ItemStack linkStack = maybeLinkStack.get();
|
||||
|
||||
this.getProxy().setVisualRepresentation(linkStack);
|
||||
@@ -229,8 +229,8 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
|
||||
final EnumSet<Direction> set = EnumSet.noneOf(Direction.class);
|
||||
|
||||
for (final Direction d : Direction.values()) {
|
||||
final BlockEntity te = this.world.getTileEntity(this.pos.offset(d));
|
||||
if (te instanceof QuantumBridgeTileEntity) {
|
||||
final BlockEntity te = this.world.getBlockEntity(this.pos.offset(d));
|
||||
if (te instanceof QuantumBridgeBlockEntity) {
|
||||
set.add(d);
|
||||
}
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I
|
||||
}
|
||||
|
||||
public boolean isPowered() {
|
||||
if (isRemote()) {
|
||||
if (isClient()) {
|
||||
return (this.constructed & this.powered) == this.powered && this.constructed != -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user