2014-11-14 12:02:52 +01:00
|
|
|
/*
|
|
|
|
* This file is part of Applied Energistics 2.
|
|
|
|
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
|
|
|
*
|
|
|
|
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
|
|
|
*/
|
|
|
|
|
2014-04-08 02:43:57 +02:00
|
|
|
package appeng.tile.crafting;
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
|
2014-06-24 05:55:16 +02:00
|
|
|
import java.io.IOException;
|
2015-05-09 00:04:44 +02:00
|
|
|
import java.util.List;
|
2014-06-23 06:52:14 +02:00
|
|
|
|
2015-12-24 02:07:03 +01:00
|
|
|
import io.netty.buffer.ByteBuf;
|
|
|
|
|
2014-04-08 02:43:57 +02:00
|
|
|
import net.minecraft.inventory.IInventory;
|
2014-05-08 07:58:43 +02:00
|
|
|
import net.minecraft.inventory.InventoryCrafting;
|
2014-04-08 02:43:57 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2014-05-08 07:58:43 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2015-06-16 02:44:59 +02:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2016-06-19 14:43:27 +02:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2014-05-08 07:58:43 +02:00
|
|
|
import net.minecraft.world.World;
|
2014-06-22 09:00:38 +02:00
|
|
|
import net.minecraft.world.WorldServer;
|
2015-06-16 02:44:59 +02:00
|
|
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
|
|
|
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
2015-12-24 02:07:03 +01:00
|
|
|
|
2014-04-24 08:14:26 +02:00
|
|
|
import appeng.api.AEApi;
|
2014-05-09 06:09:42 +02:00
|
|
|
import appeng.api.config.Actionable;
|
|
|
|
import appeng.api.config.PowerMultiplier;
|
2014-04-24 08:14:26 +02:00
|
|
|
import appeng.api.config.RedstoneMode;
|
|
|
|
import appeng.api.config.Settings;
|
|
|
|
import appeng.api.config.Upgrades;
|
2015-01-03 02:53:14 +01:00
|
|
|
import appeng.api.definitions.ITileDefinition;
|
2014-06-24 05:55:16 +02:00
|
|
|
import appeng.api.implementations.IPowerChannelState;
|
2014-04-24 08:14:26 +02:00
|
|
|
import appeng.api.implementations.IUpgradeableHost;
|
2014-06-20 09:12:39 +02:00
|
|
|
import appeng.api.implementations.tiles.ICraftingMachine;
|
2014-05-08 07:58:43 +02:00
|
|
|
import appeng.api.networking.IGridNode;
|
2014-05-09 06:10:12 +02:00
|
|
|
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
2014-06-24 05:55:16 +02:00
|
|
|
import appeng.api.networking.events.MENetworkEventSubscribe;
|
|
|
|
import appeng.api.networking.events.MENetworkPowerStatusChange;
|
2014-05-08 07:58:43 +02:00
|
|
|
import appeng.api.networking.ticking.IGridTickable;
|
|
|
|
import appeng.api.networking.ticking.TickRateModulation;
|
|
|
|
import appeng.api.networking.ticking.TickingRequest;
|
2014-07-07 04:04:58 +02:00
|
|
|
import appeng.api.storage.data.IAEItemStack;
|
2014-04-08 02:43:57 +02:00
|
|
|
import appeng.api.util.AECableType;
|
2015-06-16 02:44:59 +02:00
|
|
|
import appeng.api.util.AEPartLocation;
|
2014-04-08 02:43:57 +02:00
|
|
|
import appeng.api.util.DimensionalCoord;
|
2014-04-24 08:14:26 +02:00
|
|
|
import appeng.api.util.IConfigManager;
|
2014-05-08 07:58:43 +02:00
|
|
|
import appeng.container.ContainerNull;
|
2014-07-07 04:04:58 +02:00
|
|
|
import appeng.core.sync.network.NetworkHandler;
|
|
|
|
import appeng.core.sync.packets.PacketAssemblerAnimation;
|
2014-05-08 07:58:43 +02:00
|
|
|
import appeng.items.misc.ItemEncodedPattern;
|
|
|
|
import appeng.me.GridAccessException;
|
2015-01-03 02:53:14 +01:00
|
|
|
import appeng.parts.automation.DefinitionUpgradeInventory;
|
2014-04-24 08:14:26 +02:00
|
|
|
import appeng.parts.automation.UpgradeInventory;
|
2014-08-28 09:39:52 +02:00
|
|
|
import appeng.tile.TileEvent;
|
2014-04-08 02:43:57 +02:00
|
|
|
import appeng.tile.events.TileEventType;
|
|
|
|
import appeng.tile.grid.AENetworkInvTile;
|
|
|
|
import appeng.tile.inventory.AppEngInternalInventory;
|
|
|
|
import appeng.tile.inventory.InvOperation;
|
2014-04-24 08:14:26 +02:00
|
|
|
import appeng.util.ConfigManager;
|
|
|
|
import appeng.util.IConfigManagerHost;
|
2014-05-08 07:58:43 +02:00
|
|
|
import appeng.util.InventoryAdaptor;
|
|
|
|
import appeng.util.Platform;
|
2014-07-07 04:04:58 +02:00
|
|
|
import appeng.util.item.AEItemStack;
|
2014-04-08 02:43:57 +02:00
|
|
|
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
public class TileMolecularAssembler extends AENetworkInvTile implements IUpgradeableHost, IConfigManagerHost, IGridTickable, ICraftingMachine, IPowerChannelState
|
2015-01-03 02:53:14 +01:00
|
|
|
{
|
2015-09-25 23:04:36 +02:00
|
|
|
private static final int[] SIDES = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
2014-04-08 02:43:57 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
private final InventoryCrafting craftingInv;
|
2014-09-29 09:54:34 +02:00
|
|
|
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 9 + 2 );
|
2015-01-03 02:53:14 +01:00
|
|
|
private final IConfigManager settings;
|
|
|
|
private final UpgradeInventory upgrades;
|
|
|
|
private boolean isPowered = false;
|
2015-06-16 02:44:59 +02:00
|
|
|
private AEPartLocation pushDirection = AEPartLocation.INTERNAL;
|
2014-05-08 07:58:43 +02:00
|
|
|
private ItemStack myPattern = null;
|
|
|
|
private ICraftingPatternDetails myPlan = null;
|
2014-05-09 06:09:42 +02:00
|
|
|
private double progress = 0;
|
2014-05-08 07:58:43 +02:00
|
|
|
private boolean isAwake = false;
|
2014-05-14 04:42:14 +02:00
|
|
|
private boolean forcePlan = false;
|
2014-06-23 06:52:14 +02:00
|
|
|
private boolean reboot = true;
|
2015-01-03 02:53:14 +01:00
|
|
|
|
|
|
|
public TileMolecularAssembler()
|
|
|
|
{
|
|
|
|
final ITileDefinition assembler = AEApi.instance().definitions().blocks().molecularAssembler();
|
|
|
|
|
|
|
|
this.settings = new ConfigManager( this );
|
|
|
|
this.settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
|
|
|
|
this.inv.setMaxStackSize( 1 );
|
2015-10-08 15:42:42 +02:00
|
|
|
this.getProxy().setIdlePowerUsage( 0.0 );
|
2015-01-03 02:53:14 +01:00
|
|
|
this.upgrades = new DefinitionUpgradeInventory( assembler, this, this.getUpgradeSlots() );
|
|
|
|
this.craftingInv = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
|
|
|
}
|
|
|
|
|
2015-10-08 15:42:42 +02:00
|
|
|
private int getUpgradeSlots()
|
2015-01-03 02:53:14 +01:00
|
|
|
{
|
|
|
|
return 5;
|
|
|
|
}
|
2014-06-23 06:52:14 +02:00
|
|
|
|
2014-09-28 20:34:00 +02:00
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table, final EnumFacing where )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.myPattern == null )
|
2014-05-14 04:42:14 +02:00
|
|
|
{
|
|
|
|
boolean isEmpty = true;
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int x = 0; x < this.inv.getSizeInventory(); x++ )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
isEmpty = this.inv.getStackInSlot( x ) == null && isEmpty;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-14 04:42:14 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( isEmpty && patternDetails.isCraftable() )
|
2014-05-14 04:42:14 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.forcePlan = true;
|
|
|
|
this.myPlan = patternDetails;
|
2015-06-16 02:44:59 +02:00
|
|
|
this.pushDirection = AEPartLocation.fromFacing( where );
|
2014-05-14 04:42:14 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int x = 0; x < table.getSizeInventory(); x++ )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.inv.setInventorySlotContents( x, table.getStackInSlot( x ) );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-14 04:42:14 +02:00
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.updateSleepiness();
|
|
|
|
this.markDirty();
|
2014-05-14 04:42:14 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-09-21 01:35:08 +02:00
|
|
|
private void updateSleepiness()
|
2014-05-14 04:42:14 +02:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final boolean wasEnabled = this.isAwake;
|
2014-12-29 15:13:47 +01:00
|
|
|
this.isAwake = this.myPlan != null && this.hasMats() || this.canPush();
|
2015-04-03 08:54:31 +02:00
|
|
|
if( wasEnabled != this.isAwake )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.isAwake )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-10-08 15:42:42 +02:00
|
|
|
this.getProxy().getTick().wakeDevice( this.getProxy().getNode() );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
else
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-10-08 15:42:42 +02:00
|
|
|
this.getProxy().getTick().sleepDevice( this.getProxy().getNode() );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
}
|
2015-09-30 14:24:40 +02:00
|
|
|
catch( final GridAccessException e )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
|
|
|
// :P
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-09 06:09:42 +02:00
|
|
|
private boolean canPush()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
return this.inv.getStackInSlot( 9 ) != null;
|
2014-05-09 06:09:42 +02:00
|
|
|
}
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
private boolean hasMats()
|
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.myPlan == null )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return false;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2015-01-03 02:53:14 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int x = 0; x < this.craftingInv.getSizeInventory(); x++ )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
this.craftingInv.setInventorySlotContents( x, this.inv.getStackInSlot( x ) );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2015-01-03 02:53:14 +01:00
|
|
|
|
2015-06-16 02:44:59 +02:00
|
|
|
return this.myPlan.getOutput( this.craftingInv, this.getWorld() ) != null;
|
2015-01-03 02:53:14 +01:00
|
|
|
}
|
|
|
|
|
2014-04-24 08:14:26 +02:00
|
|
|
@Override
|
2015-01-03 02:53:14 +01:00
|
|
|
public boolean acceptsPlans()
|
2014-04-24 08:14:26 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return this.inv.getStackInSlot( 10 ) == null;
|
2014-04-24 08:14:26 +02:00
|
|
|
}
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public int getInstalledUpgrades( final Upgrades u )
|
2014-04-24 08:14:26 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return this.upgrades.getInstalledUpgrades( u );
|
2014-04-24 08:14:26 +02:00
|
|
|
}
|
2014-04-08 02:43:57 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
@TileEvent( TileEventType.NETWORK_READ )
|
2015-09-30 14:24:40 +02:00
|
|
|
public boolean readFromStream_TileMolecularAssembler( final ByteBuf data )
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final boolean oldPower = this.isPowered;
|
2014-12-29 15:13:47 +01:00
|
|
|
this.isPowered = data.readBoolean();
|
|
|
|
return this.isPowered != oldPower;
|
2014-08-28 09:39:52 +02:00
|
|
|
}
|
2014-04-08 02:43:57 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
@TileEvent( TileEventType.NETWORK_WRITE )
|
2015-09-30 14:24:40 +02:00
|
|
|
public void writeToStream_TileMolecularAssembler( final ByteBuf data )
|
2014-08-28 09:39:52 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
data.writeBoolean( this.isPowered );
|
2014-08-28 09:39:52 +02:00
|
|
|
}
|
2014-04-08 02:43:57 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
@TileEvent( TileEventType.WORLD_NBT_WRITE )
|
2015-09-30 14:24:40 +02:00
|
|
|
public void writeToNBT_TileMolecularAssembler( final NBTTagCompound data )
|
2014-08-28 09:39:52 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.forcePlan && this.myPlan != null )
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack pattern = this.myPlan.getPattern();
|
2015-04-03 08:54:31 +02:00
|
|
|
if( pattern != null )
|
2014-05-14 04:42:14 +02:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final NBTTagCompound compound = new NBTTagCompound();
|
2014-09-28 11:47:17 +02:00
|
|
|
pattern.writeToNBT( compound );
|
|
|
|
data.setTag( "myPlan", compound );
|
2014-12-29 15:13:47 +01:00
|
|
|
data.setInteger( "pushDirection", this.pushDirection.ordinal() );
|
2014-05-14 04:42:14 +02:00
|
|
|
}
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.upgrades.writeToNBT( data, "upgrades" );
|
|
|
|
this.inv.writeToNBT( data, "inv" );
|
|
|
|
this.settings.writeToNBT( data );
|
2014-08-28 09:39:52 +02:00
|
|
|
}
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
@TileEvent( TileEventType.WORLD_NBT_READ )
|
2015-09-30 14:24:40 +02:00
|
|
|
public void readFromNBT_TileMolecularAssembler( final NBTTagCompound data )
|
2014-08-28 09:39:52 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( data.hasKey( "myPlan" ) )
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack myPat = ItemStack.loadItemStackFromNBT( data.getCompoundTag( "myPlan" ) );
|
2014-05-14 04:42:14 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( myPat != null && myPat.getItem() instanceof ItemEncodedPattern )
|
2014-08-28 09:39:52 +02:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final World w = this.getWorld();
|
|
|
|
final ItemEncodedPattern iep = (ItemEncodedPattern) myPat.getItem();
|
|
|
|
final ICraftingPatternDetails ph = iep.getPatternForItem( myPat, w );
|
2015-04-03 08:54:31 +02:00
|
|
|
if( ph != null && ph.isCraftable() )
|
2014-05-14 04:42:14 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.forcePlan = true;
|
|
|
|
this.myPlan = ph;
|
2015-06-16 02:44:59 +02:00
|
|
|
this.pushDirection = AEPartLocation.fromOrdinal( data.getInteger( "pushDirection" ) );
|
2014-05-14 04:42:14 +02:00
|
|
|
}
|
|
|
|
}
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.upgrades.readFromNBT( data, "upgrades" );
|
|
|
|
this.inv.readFromNBT( data, "inv" );
|
|
|
|
this.settings.readFromNBT( data );
|
|
|
|
this.recalculatePlan();
|
2014-08-28 09:39:52 +02:00
|
|
|
}
|
2014-04-08 02:43:57 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
private void recalculatePlan()
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
this.reboot = true;
|
2014-04-08 02:43:57 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.forcePlan )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-04-08 02:43:57 +02:00
|
|
|
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack is = this.inv.getStackInSlot( 10 );
|
2015-01-03 02:53:14 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( is != null && is.getItem() instanceof ItemEncodedPattern )
|
2015-01-03 02:53:14 +01:00
|
|
|
{
|
2016-11-04 09:27:52 +01:00
|
|
|
if( !Platform.itemComparisons().isEqualItem( is, this.myPattern ) )
|
2015-01-03 02:53:14 +01:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final World w = this.getWorld();
|
|
|
|
final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
|
|
|
|
final ICraftingPatternDetails ph = iep.getPatternForItem( is, w );
|
2015-01-03 02:53:14 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( ph != null && ph.isCraftable() )
|
2015-01-03 02:53:14 +01:00
|
|
|
{
|
|
|
|
this.progress = 0;
|
|
|
|
this.myPattern = is;
|
|
|
|
this.myPlan = ph;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
this.progress = 0;
|
|
|
|
this.forcePlan = false;
|
|
|
|
this.myPlan = null;
|
|
|
|
this.myPattern = null;
|
2015-06-16 02:44:59 +02:00
|
|
|
this.pushDirection = AEPartLocation.INTERNAL;
|
2015-01-03 02:53:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
this.updateSleepiness();
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|
|
|
|
|
2014-06-20 09:10:02 +02:00
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public AECableType getCableConnectionType( final AEPartLocation dir )
|
2014-06-20 09:10:02 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return AECableType.COVERED;
|
2014-06-20 09:10:02 +02:00
|
|
|
}
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
@Override
|
|
|
|
public DimensionalCoord getLocation()
|
2014-04-24 08:14:26 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return new DimensionalCoord( this );
|
2014-04-24 08:14:26 +02:00
|
|
|
}
|
|
|
|
|
2014-04-08 02:43:57 +02:00
|
|
|
@Override
|
2015-01-03 02:53:14 +01:00
|
|
|
public IConfigManager getConfigManager()
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return this.settings;
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public IInventory getInventoryByName( final String name )
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( name.equals( "upgrades" ) )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return this.upgrades;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2015-01-03 02:53:14 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( name.equals( "mac" ) )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return this.inv;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2015-01-03 02:53:14 +01:00
|
|
|
|
|
|
|
return null;
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
@Override
|
|
|
|
public IInventory getInternalInventory()
|
|
|
|
{
|
|
|
|
return this.inv;
|
|
|
|
}
|
|
|
|
|
2014-04-08 02:43:57 +02:00
|
|
|
@Override
|
2015-01-03 02:53:14 +01:00
|
|
|
public int getInventoryStackLimit()
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return 1;
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( i >= 9 )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return false;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2015-01-03 02:53:14 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.hasPattern() )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-06-16 02:44:59 +02:00
|
|
|
return this.myPlan.isValidItemForSlot( i, itemstack, this.getWorld() );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2015-01-03 02:53:14 +01:00
|
|
|
|
|
|
|
return false;
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
private boolean hasPattern()
|
2014-04-08 02:43:57 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return this.myPlan != null && this.inv.getStackInSlot( 10 ) != null;
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|
|
|
|
|
2014-04-24 08:14:26 +02:00
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
|
2014-04-24 08:14:26 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( inv == this.inv )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
this.recalculatePlan();
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-04-24 08:14:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side )
|
2014-04-24 08:14:26 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
return slotIndex == 9;
|
2014-04-24 08:14:26 +02:00
|
|
|
}
|
|
|
|
|
2014-05-08 07:58:43 +02:00
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public int[] getAccessibleSlotsBySide( final EnumFacing whichSide )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return SIDES;
|
2014-05-08 07:58:43 +02:00
|
|
|
}
|
|
|
|
|
2014-05-08 02:59:05 +02:00
|
|
|
public int getCraftingProgress()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
return (int) this.progress;
|
2014-05-08 07:58:43 +02:00
|
|
|
}
|
|
|
|
|
2014-06-23 06:52:14 +02:00
|
|
|
@Override
|
2016-01-01 02:02:05 +01:00
|
|
|
public void getDrops( final World w, final BlockPos pos, final List<ItemStack> drops )
|
2014-06-23 06:52:14 +02:00
|
|
|
{
|
2015-06-16 02:44:59 +02:00
|
|
|
super.getDrops( w, pos, drops );
|
2014-06-23 06:52:14 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int h = 0; h < this.upgrades.getSizeInventory(); h++ )
|
2014-06-23 06:52:14 +02:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack is = this.upgrades.getStackInSlot( h );
|
2015-04-03 08:54:31 +02:00
|
|
|
if( is != null )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-06-23 06:52:14 +02:00
|
|
|
drops.add( is );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-06-23 06:52:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-08 07:58:43 +02:00
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public TickingRequest getTickingRequest( final IGridNode node )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.recalculatePlan();
|
|
|
|
this.updateSleepiness();
|
|
|
|
return new TickingRequest( 1, 1, !this.isAwake, false );
|
2014-05-08 02:59:05 +02:00
|
|
|
}
|
|
|
|
|
2014-05-08 07:58:43 +02:00
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public TickRateModulation tickingRequest( final IGridNode node, int ticksSinceLastCall )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.inv.getStackInSlot( 9 ) != null )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.pushOut( this.inv.getStackInSlot( 9 ) );
|
2014-09-05 04:57:56 +02:00
|
|
|
|
|
|
|
// did it eject?
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.inv.getStackInSlot( 9 ) == null )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.markDirty();
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-09-05 04:57:56 +02:00
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.ejectHeldItems();
|
|
|
|
this.updateSleepiness();
|
|
|
|
this.progress = 0;
|
|
|
|
return this.isAwake ? TickRateModulation.IDLE : TickRateModulation.SLEEP;
|
2014-05-08 07:58:43 +02:00
|
|
|
}
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.myPlan == null )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.updateSleepiness();
|
2014-05-08 07:58:43 +02:00
|
|
|
return TickRateModulation.SLEEP;
|
|
|
|
}
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.reboot )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-05-08 23:25:19 +02:00
|
|
|
ticksSinceLastCall = 1;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-06-23 06:52:14 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( !this.isAwake )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-08-20 19:07:25 +02:00
|
|
|
return TickRateModulation.SLEEP;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-08-26 03:22:32 +02:00
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.reboot = false;
|
2014-07-07 04:04:58 +02:00
|
|
|
int speed = 10;
|
2015-04-03 08:54:31 +02:00
|
|
|
switch( this.upgrades.getInstalledUpgrades( Upgrades.SPEED ) )
|
2014-05-09 06:09:42 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
case 0:
|
2015-05-08 23:25:19 +02:00
|
|
|
this.progress += this.userPower( ticksSinceLastCall, speed = 10, 1.0 );
|
2015-01-03 02:53:14 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
2015-05-08 23:25:19 +02:00
|
|
|
this.progress += this.userPower( ticksSinceLastCall, speed = 13, 1.3 );
|
2015-01-03 02:53:14 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2015-05-08 23:25:19 +02:00
|
|
|
this.progress += this.userPower( ticksSinceLastCall, speed = 17, 1.7 );
|
2015-01-03 02:53:14 +01:00
|
|
|
break;
|
|
|
|
case 3:
|
2015-05-08 23:25:19 +02:00
|
|
|
this.progress += this.userPower( ticksSinceLastCall, speed = 20, 2.0 );
|
2015-01-03 02:53:14 +01:00
|
|
|
break;
|
|
|
|
case 4:
|
2015-05-08 23:25:19 +02:00
|
|
|
this.progress += this.userPower( ticksSinceLastCall, speed = 25, 2.5 );
|
2015-01-03 02:53:14 +01:00
|
|
|
break;
|
|
|
|
case 5:
|
2015-05-08 23:25:19 +02:00
|
|
|
this.progress += this.userPower( ticksSinceLastCall, speed = 50, 5.0 );
|
2015-01-03 02:53:14 +01:00
|
|
|
break;
|
2014-05-09 06:09:42 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.progress >= 100 )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int x = 0; x < this.craftingInv.getSizeInventory(); x++ )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.craftingInv.setInventorySlotContents( x, this.inv.getStackInSlot( x ) );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.progress = 0;
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack output = this.myPlan.getOutput( this.craftingInv, this.getWorld() );
|
2015-04-03 08:54:31 +02:00
|
|
|
if( output != null )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2015-06-16 02:44:59 +02:00
|
|
|
FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorld() ), output, this.craftingInv );
|
2014-06-22 09:00:38 +02:00
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.pushOut( output.copy() );
|
2014-07-12 02:02:09 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int x = 0; x < this.craftingInv.getSizeInventory(); x++ )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.inv.setInventorySlotContents( x, Platform.getContainerItem( this.craftingInv.getStackInSlot( x ) ) );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.inv.getStackInSlot( 10 ) == null )
|
2014-06-27 07:45:10 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.forcePlan = false;
|
|
|
|
this.myPlan = null;
|
2015-06-16 02:44:59 +02:00
|
|
|
this.pushDirection = AEPartLocation.INTERNAL;
|
2014-06-27 07:45:10 +02:00
|
|
|
}
|
2014-07-30 07:05:33 +02:00
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.ejectHeldItems();
|
2014-06-22 09:00:38 +02:00
|
|
|
|
2014-07-07 04:04:58 +02:00
|
|
|
try
|
|
|
|
{
|
2016-06-19 14:43:27 +02:00
|
|
|
final TargetPoint where = new TargetPoint( this.worldObj.provider.getDimension(), this.pos.getX(), this.pos.getY(), this.pos.getZ(), 32 );
|
2015-09-30 14:24:40 +02:00
|
|
|
final IAEItemStack item = AEItemStack.create( output );
|
2015-09-30 14:26:54 +02:00
|
|
|
NetworkHandler.instance.sendToAllAround( new PacketAssemblerAnimation( this.pos, (byte) speed, item ), where );
|
2014-07-07 04:04:58 +02:00
|
|
|
}
|
2015-09-30 14:24:40 +02:00
|
|
|
catch( final IOException e )
|
2014-07-07 04:04:58 +02:00
|
|
|
{
|
|
|
|
// ;P
|
|
|
|
}
|
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.markDirty();
|
|
|
|
this.updateSleepiness();
|
|
|
|
return this.isAwake ? TickRateModulation.IDLE : TickRateModulation.SLEEP;
|
2014-05-08 07:58:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return TickRateModulation.FASTER;
|
|
|
|
}
|
2014-06-22 09:00:38 +02:00
|
|
|
|
|
|
|
private void ejectHeldItems()
|
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.inv.getStackInSlot( 9 ) == null )
|
2014-06-22 09:00:38 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int x = 0; x < 9; x++ )
|
2014-06-22 09:00:38 +02:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack is = this.inv.getStackInSlot( x );
|
2015-04-03 08:54:31 +02:00
|
|
|
if( is != null )
|
2014-06-22 09:00:38 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.myPlan == null || !this.myPlan.isValidItemForSlot( x, is, this.worldObj ) )
|
2014-08-20 19:07:25 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.inv.setInventorySlotContents( 9, is );
|
|
|
|
this.inv.setInventorySlotContents( x, null );
|
|
|
|
this.markDirty();
|
2014-08-20 19:07:25 +02:00
|
|
|
return;
|
|
|
|
}
|
2014-06-22 09:00:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2015-09-30 14:24:40 +02:00
|
|
|
private int userPower( final int ticksPassed, final int bonusValue, final double acceleratorTax )
|
2014-05-09 06:09:42 +02:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2015-10-08 15:42:42 +02:00
|
|
|
return (int) ( this.getProxy().getEnergy().extractAEPower( ticksPassed * bonusValue * acceleratorTax, Actionable.MODULATE, PowerMultiplier.CONFIG ) / acceleratorTax );
|
2014-05-09 06:09:42 +02:00
|
|
|
}
|
2015-09-30 14:24:40 +02:00
|
|
|
catch( final GridAccessException e )
|
2014-05-09 06:09:42 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
private void pushOut( ItemStack output )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2015-06-16 02:44:59 +02:00
|
|
|
if( this.pushDirection == AEPartLocation.INTERNAL )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
for( final EnumFacing d : EnumFacing.VALUES )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
output = this.pushTo( output, d );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
}
|
|
|
|
else
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2015-06-16 02:44:59 +02:00
|
|
|
output = this.pushTo( output, this.pushDirection.getFacing() );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( output == null && this.forcePlan )
|
2014-05-14 04:42:14 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.forcePlan = false;
|
|
|
|
this.recalculatePlan();
|
2014-05-14 04:42:14 +02:00
|
|
|
}
|
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.inv.setInventorySlotContents( 9, output );
|
2014-05-08 07:58:43 +02:00
|
|
|
}
|
|
|
|
|
2015-09-30 14:24:40 +02:00
|
|
|
private ItemStack pushTo( ItemStack output, final EnumFacing d )
|
2014-05-08 07:58:43 +02:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( output == null )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-05-08 07:58:43 +02:00
|
|
|
return output;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2015-09-30 14:26:54 +02:00
|
|
|
final TileEntity te = this.getWorld().getTileEntity( this.pos.offset( d ) );
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( te == null )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-05-08 07:58:43 +02:00
|
|
|
return output;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2015-09-30 14:24:40 +02:00
|
|
|
final InventoryAdaptor adaptor = InventoryAdaptor.getAdaptor( te, d.getOpposite() );
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( adaptor == null )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-05-08 07:58:43 +02:00
|
|
|
return output;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-05-08 07:58:43 +02:00
|
|
|
|
2015-09-30 14:24:40 +02:00
|
|
|
final int size = output.stackSize;
|
2014-06-23 06:52:14 +02:00
|
|
|
output = adaptor.addItems( output );
|
2015-09-30 14:24:40 +02:00
|
|
|
final int newSize = output == null ? 0 : output.stackSize;
|
2014-06-23 06:52:14 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( size != newSize )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.markDirty();
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-06-23 06:52:14 +02:00
|
|
|
|
|
|
|
return output;
|
2014-05-08 07:58:43 +02:00
|
|
|
}
|
2014-06-19 08:28:45 +02:00
|
|
|
|
2014-06-24 05:55:16 +02:00
|
|
|
@MENetworkEventSubscribe
|
2015-09-30 14:24:40 +02:00
|
|
|
public void onPowerEvent( final MENetworkPowerStatusChange p )
|
2014-06-24 05:55:16 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.updatePowerState();
|
2014-09-12 05:55:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private void updatePowerState()
|
|
|
|
{
|
|
|
|
boolean newState = false;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2015-10-08 15:42:42 +02:00
|
|
|
newState = this.getProxy().isActive() && this.getProxy().getEnergy().extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.0001;
|
2014-09-12 05:55:30 +02:00
|
|
|
}
|
2015-09-30 14:24:40 +02:00
|
|
|
catch( final GridAccessException ignored )
|
2014-09-12 05:55:30 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
if( newState != this.isPowered )
|
2014-06-24 05:55:16 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.isPowered = newState;
|
|
|
|
this.markForUpdate();
|
2014-06-24 05:55:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isPowered()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
return this.isPowered;
|
2014-06-24 05:55:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isActive()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
return this.isPowered;
|
2014-06-24 05:55:16 +02:00
|
|
|
}
|
2015-10-08 15:42:42 +02:00
|
|
|
|
2014-04-08 02:43:57 +02:00
|
|
|
}
|