Lots of compile fixes
This commit is contained in:
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
@@ -54,8 +55,8 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
|
||||
private IItemHandler cacheConfig = null;
|
||||
private boolean locked = false;
|
||||
|
||||
public TileCellWorkbench()
|
||||
{
|
||||
public TileCellWorkbench(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.manager.registerSetting( Settings.COPY_MODE, CopyMode.CLEAR_ON_REMOVE );
|
||||
this.cell.setEnableClientEvents( true );
|
||||
}
|
||||
@@ -103,9 +104,9 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
public CompoundNBT write(final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
super.write( data );
|
||||
this.cell.writeToNBT( data, "cell" );
|
||||
this.config.writeToNBT( data, "config" );
|
||||
this.manager.writeToNBT( data );
|
||||
@@ -113,9 +114,9 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
public void read(final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
super.read( data );
|
||||
this.cell.readFromNBT( data, "cell" );
|
||||
this.config.readFromNBT( data, "config" );
|
||||
this.manager.readFromNBT( data );
|
||||
|
||||
@@ -24,9 +24,11 @@ import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
@@ -63,8 +65,8 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
|
||||
|
||||
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 1, 1, new ChargerInvFilter() );
|
||||
|
||||
public TileCharger()
|
||||
{
|
||||
public TileCharger(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( Direction.class ) );
|
||||
this.getProxy().setFlags();
|
||||
this.setInternalMaxPower( POWER_MAXIMUM_AMOUNT );
|
||||
|
||||
@@ -19,18 +19,22 @@
|
||||
package appeng.tile.misc;
|
||||
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.FluidTankProperties;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidTankProperties;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
@@ -60,6 +64,8 @@ import appeng.util.inv.WrapperChainedItemHandler;
|
||||
import appeng.util.inv.WrapperFilteredItemHandler;
|
||||
import appeng.util.inv.filter.AEItemFilters;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
||||
public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost, IConfigurableObject
|
||||
{
|
||||
@@ -79,8 +85,8 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
|
||||
|
||||
private double storedPower = 0;
|
||||
|
||||
public TileCondenser()
|
||||
{
|
||||
public TileCondenser(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.cm.registerSetting( Settings.CONDENSER_OUTPUT, CondenserOutput.TRASH );
|
||||
}
|
||||
|
||||
@@ -219,35 +225,21 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
|
||||
this.storedPower = storedPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capability, Direction facing )
|
||||
{
|
||||
if( capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if( capability == Capabilities.STORAGE_MONITORABLE_ACCESSOR )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return super.hasCapability( capability, facing );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@Override
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable Direction facing )
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY )
|
||||
{
|
||||
return (T) this.externalInv;
|
||||
return (LazyOptional<T>) LazyOptional.of(() -> this.externalInv);
|
||||
}
|
||||
else if( capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY )
|
||||
{
|
||||
return (T) this.fluidHandler;
|
||||
return (LazyOptional<T>) LazyOptional.of(() -> this.fluidHandler);
|
||||
}
|
||||
else if( capability == Capabilities.STORAGE_MONITORABLE_ACCESSOR )
|
||||
{
|
||||
return (T) this.meHandler;
|
||||
return (LazyOptional<T>) LazyOptional.of(() -> this.meHandler);
|
||||
}
|
||||
return super.getCapability( capability, facing );
|
||||
}
|
||||
@@ -262,6 +254,11 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
|
||||
return slot == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot( int slot )
|
||||
{
|
||||
@@ -296,45 +293,76 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
|
||||
}
|
||||
}
|
||||
|
||||
private static final IFluidTankProperties[] EMPTY = { new FluidTankProperties( null, FluidAttributes.BUCKET_VOLUME, true, false ) };
|
||||
|
||||
/**
|
||||
* A fluid handler that exposes a 1 bucket tank that can only be filled, and - when filled - will add power
|
||||
* to this condenser.
|
||||
*/
|
||||
private class FluidHandler implements IFluidHandler
|
||||
private class FluidHandler implements IFluidTank, IFluidHandler
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IFluidTankProperties[] getTankProperties()
|
||||
{
|
||||
return EMPTY;
|
||||
public FluidStack getFluid() {
|
||||
return FluidStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill( FluidStack resource, boolean doFill )
|
||||
{
|
||||
if( doFill )
|
||||
public int getFluidAmount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return FluidAttributes.BUCKET_VOLUME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFluidValid(FluidStack stack) {
|
||||
return stack != FluidStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(FluidStack resource, FluidAction action) {
|
||||
if( action == FluidAction.EXECUTE )
|
||||
{
|
||||
final IStorageChannel<IAEFluidStack> chan = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
|
||||
TileCondenser.this.addPower( ( resource == null ? 0.0 : (double) resource.amount ) / chan.transferFactor() );
|
||||
TileCondenser.this.addPower( ( resource == null ? 0.0 : (double) resource.getAmount() ) / chan.transferFactor() );
|
||||
}
|
||||
|
||||
return resource == null ? 0 : resource.amount;
|
||||
return resource == null ? 0 : resource.getAmount();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Nonnull
|
||||
@Override
|
||||
public FluidStack drain( FluidStack resource, boolean doDrain )
|
||||
{
|
||||
return null;
|
||||
public FluidStack drain(int maxDrain, FluidAction action) {
|
||||
return FluidStack.EMPTY;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Nonnull
|
||||
@Override
|
||||
public FluidStack drain( int maxDrain, boolean doDrain )
|
||||
{
|
||||
return null;
|
||||
public FluidStack drain(FluidStack resource, FluidAction action) {
|
||||
return FluidStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTanks() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public FluidStack getFluidInTank(int tank) {
|
||||
return FluidStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTankCapacity(int tank) {
|
||||
return tank == 0 ? getCapacity() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFluidValid(int tank, @Nonnull FluidStack stack) {
|
||||
return tank == 0 && isFluidValid(stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,11 +26,13 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.core.Api;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -100,8 +102,9 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
|
||||
|
||||
private final IItemHandlerModifiable inv = new WrapperChainedItemHandler( this.topItemHandler, this.bottomItemHandler, this.sideItemHandler );
|
||||
|
||||
public TileInscriber()
|
||||
{
|
||||
public TileInscriber(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( Direction.class ) );
|
||||
this.setInternalMaxPower( 1600 );
|
||||
this.getProxy().setIdlePowerUsage( 0 );
|
||||
@@ -542,18 +545,15 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
|
||||
|
||||
final ItemStack startingItem = input.copy();
|
||||
final ItemStack renamedItem = input.copy();
|
||||
final CompoundNBT tag = renamedItem.getOrCreateTag();
|
||||
|
||||
final CompoundNBT display = tag.getCompoundTag( "display" );
|
||||
tag.setTag( "display", display );
|
||||
|
||||
if( name.length() > 0 )
|
||||
final CompoundNBT display = renamedItem.getOrCreateChildTag( "display" );
|
||||
if( !name.isEmpty() )
|
||||
{
|
||||
display.putString("Name", name);
|
||||
}
|
||||
else
|
||||
{
|
||||
display.removeTag( "Name" );
|
||||
display.remove( "Name" );
|
||||
}
|
||||
|
||||
final List<ItemStack> inputs = Lists.newArrayList( startingItem );
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.core.Api;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
@@ -32,10 +33,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -55,7 +58,7 @@ import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
|
||||
import appeng.helpers.DualityInterface;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
@@ -73,6 +76,10 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
||||
// Indicates that this interface has no specific direction set
|
||||
private boolean omniDirectional = true;
|
||||
|
||||
public TileInterface(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void stateChange( final MENetworkChannelsChanged c )
|
||||
{
|
||||
@@ -337,16 +344,10 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capability, @Nullable Direction facing )
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing )
|
||||
{
|
||||
return this.duality.hasCapability( capability, facing ) || super.hasCapability( capability, facing );
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable Direction facing )
|
||||
{
|
||||
T result = this.duality.getCapability( capability, facing );
|
||||
if( result != null )
|
||||
LazyOptional<T> result = this.duality.getCapability( capability, facing );
|
||||
if( result.isPresent() )
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -359,9 +360,9 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
||||
return Api.INSTANCE.definitions().blocks().iface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiBridge getGuiBridge()
|
||||
{
|
||||
return GuiBridge.GUI_INTERFACE;
|
||||
}
|
||||
// FIXME @Override
|
||||
// FIXME public GuiBridge getGuiBridge()
|
||||
// FIXME {
|
||||
// FIXME return GuiBridge.GUI_INTERFACE;
|
||||
// FIXME }
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ package appeng.tile.misc;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
||||
|
||||
public class TileLightDetector extends AEBaseTile implements ITickableTileEntity
|
||||
@@ -31,6 +32,10 @@ public class TileLightDetector extends AEBaseTile implements ITickableTileEntity
|
||||
private int lastCheck = 30;
|
||||
private int lastLight = 0;
|
||||
|
||||
public TileLightDetector(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
}
|
||||
|
||||
public boolean isReady()
|
||||
{
|
||||
return this.lastLight > 0;
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
@@ -51,6 +52,10 @@ public class TilePaint extends AEBaseTile
|
||||
private int isLit = 0;
|
||||
private List<Splotch> dots = null;
|
||||
|
||||
public TilePaint(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeRotated()
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.api.implementations.IPowerChannelState;
|
||||
@@ -41,8 +42,8 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower
|
||||
|
||||
private boolean hasPower = false;
|
||||
|
||||
public TileQuartzGrowthAccelerator()
|
||||
{
|
||||
public TileQuartzGrowthAccelerator(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( Direction.class ) );
|
||||
this.getProxy().setFlags();
|
||||
this.getProxy().setIdlePowerUsage( 8 );
|
||||
|
||||
@@ -24,12 +24,14 @@ import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.INBT;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -92,8 +94,8 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
private AEColor paintedColor = AEColor.TRANSPARENT;
|
||||
private boolean isActive = false;
|
||||
|
||||
public TileSecurityStation()
|
||||
{
|
||||
public TileSecurityStation(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
this.getProxy().setIdlePowerUsage( 2.0 );
|
||||
difference++;
|
||||
@@ -156,11 +158,11 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
public CompoundNBT write(final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
super.write( data );
|
||||
this.cm.writeToNBT( data );
|
||||
data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() );
|
||||
data.putByte( "paintedColor", (byte) this.paintedColor.ordinal() );
|
||||
|
||||
data.putLong( "securityKey", this.securityKey );
|
||||
this.getConfigSlot().writeToNBT( data, "config" );
|
||||
@@ -172,18 +174,18 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
{
|
||||
final CompoundNBT it = new CompoundNBT();
|
||||
ais.createItemStack().write(it);
|
||||
storedItems.setTag( String.valueOf( offset ), it );
|
||||
storedItems.put( String.valueOf( offset ), it );
|
||||
offset++;
|
||||
}
|
||||
|
||||
data.setTag( "storedItems", storedItems );
|
||||
data.put( "storedItems", storedItems );
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
public void read(final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
super.read( data );
|
||||
this.cm.readFromNBT( data );
|
||||
if( data.contains("paintedColor") )
|
||||
{
|
||||
@@ -193,10 +195,10 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
this.securityKey = data.getLong( "securityKey" );
|
||||
this.getConfigSlot().readFromNBT( data, "config" );
|
||||
|
||||
final CompoundNBT storedItems = data.getCompoundTag( "storedItems" );
|
||||
for( final Object key : storedItems.getKeySet() )
|
||||
final CompoundNBT storedItems = data.getCompound( "storedItems" );
|
||||
for( final Object key : storedItems.keySet() )
|
||||
{
|
||||
final NBTBase obj = storedItems.getTag( (String) key );
|
||||
final INBT obj = storedItems.get( (String) key );
|
||||
if( obj instanceof CompoundNBT )
|
||||
{
|
||||
this.inventory.getStoredItems().add( AEItemStack.fromItemStack( ItemStack.read((CompoundNBT) obj) ) );
|
||||
@@ -236,9 +238,9 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
public void onChunkUnloaded()
|
||||
{
|
||||
super.onChunkUnload();
|
||||
super.onChunkUnloaded();
|
||||
MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.UNREGISTER ) );
|
||||
this.isActive = false;
|
||||
}
|
||||
@@ -255,9 +257,9 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
public void remove()
|
||||
{
|
||||
super.invalidate();
|
||||
super.remove();
|
||||
MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.UNREGISTER ) );
|
||||
this.isActive = false;
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -66,8 +67,8 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
|
||||
// client side..
|
||||
public boolean isOn;
|
||||
|
||||
public TileVibrationChamber()
|
||||
{
|
||||
public TileVibrationChamber(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.getProxy().setIdlePowerUsage( 0 );
|
||||
this.getProxy().setFlags();
|
||||
}
|
||||
@@ -102,7 +103,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
|
||||
super.write( data );
|
||||
data.putDouble("burnTime", this.getBurnTime());
|
||||
data.putDouble("maxBurnTime", this.getMaxBurnTime());
|
||||
data.setInteger( "burnSpeed", this.getBurnSpeed() );
|
||||
data.putInt( "burnSpeed", this.getBurnSpeed() );
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -112,7 +113,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
|
||||
super.read( data );
|
||||
this.setBurnTime( data.getDouble( "burnTime" ) );
|
||||
this.setMaxBurnTime( data.getDouble( "maxBurnTime" ) );
|
||||
this.setBurnSpeed( data.getInteger( "burnSpeed" ) );
|
||||
this.setBurnSpeed( data.getInt( "burnSpeed" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,7 +152,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
|
||||
final ItemStack is = this.inv.getStackInSlot( 0 );
|
||||
if( !is.isEmpty() )
|
||||
{
|
||||
final int newBurnTime = TileEntityFurnace.getItemBurnTime( is );
|
||||
final int newBurnTime = ForgeHooks.getBurnTime( is );
|
||||
if( newBurnTime > 0 && is.getCount() > 0 )
|
||||
{
|
||||
return true;
|
||||
@@ -238,7 +239,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
|
||||
final ItemStack is = this.inv.getStackInSlot( 0 );
|
||||
if( !is.isEmpty() )
|
||||
{
|
||||
final int newBurnTime = TileEntityFurnace.getItemBurnTime( is );
|
||||
final int newBurnTime = ForgeHooks.getBurnTime( is );
|
||||
if( newBurnTime > 0 && is.getCount() > 0 )
|
||||
{
|
||||
this.setBurnTime( this.getBurnTime() + newBurnTime );
|
||||
@@ -319,13 +320,13 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
|
||||
@Override
|
||||
public boolean allowExtract( IItemHandler inv, int slot, int amount )
|
||||
{
|
||||
return !TileEntityFurnace.isItemFuel( inv.getStackInSlot( slot ) );
|
||||
return ForgeHooks.getBurnTime( inv.getStackInSlot( slot ) ) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowInsert( IItemHandler inv, int slot, ItemStack stack )
|
||||
{
|
||||
return TileEntityFurnace.isItemFuel( stack );
|
||||
return ForgeHooks.getBurnTime( stack ) != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user