Fabric port in progress
This commit is contained in:
+8
-7
@@ -25,6 +25,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.util.math.Direction;
|
||||
@@ -39,9 +40,9 @@ import appeng.api.config.PowerUnits;
|
||||
import appeng.api.networking.energy.IAEPowerStorage;
|
||||
import appeng.api.networking.events.MENetworkPowerStorage.PowerEventType;
|
||||
import appeng.capabilities.Capabilities;
|
||||
import appeng.tile.AEBaseInvTileEntity;
|
||||
import appeng.tile.AEBaseInvBlockEntity;
|
||||
|
||||
public abstract class AEBasePoweredTileEntity extends AEBaseInvTileEntity
|
||||
public abstract class AEBasePoweredBlockEntity extends AEBaseInvBlockEntity
|
||||
implements IAEPowerStorage, IExternalPowerSink {
|
||||
|
||||
// values that determine general function, are set by inheriting classes if
|
||||
@@ -59,7 +60,7 @@ public abstract class AEBasePoweredTileEntity extends AEBaseInvTileEntity
|
||||
|
||||
// IC2 private IC2PowerSink ic2Sink;
|
||||
|
||||
public AEBasePoweredTileEntity(BlockEntityType<?> tileEntityTypeIn) {
|
||||
public AEBasePoweredBlockEntity(BlockEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.forgeEnergyAdapter = new ForgeEnergyAdapter(this);
|
||||
this.forgeEnergyAdapterOptional = LazyOptional.of(() -> forgeEnergyAdapter);
|
||||
@@ -78,15 +79,15 @@ public abstract class AEBasePoweredTileEntity extends AEBaseInvTileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag write(final CompoundTag data) {
|
||||
super.write(data);
|
||||
public CompoundTag toTag(final CompoundTag data) {
|
||||
super.toTag(data);
|
||||
data.putDouble("internalCurrentPower", this.getInternalCurrentPower());
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(final CompoundTag data) {
|
||||
super.read(data);
|
||||
public void fromTag(BlockState state, final CompoundTag data) {
|
||||
super.fromTag(state, data);
|
||||
this.setInternalCurrentPower(data.getDouble("internalCurrentPower"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user