Wireless block no uses placed side to orient, this is more natural for it instead of the place based version.
Added Wireless Encoder Gui to the Security Term Security Term now only accepts Biometric Cards in the config slot. Added Wireless Block. Added Wireless Terminal. Fixed Crash when loading world settings. Configure slot of Security Block now drops on destruction.
This commit is contained in:
@@ -9,12 +9,14 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
||||
public class ToolWirelessTerminal extends AEBasePoweredItem
|
||||
public class ToolWirelessTerminal extends AEBasePoweredItem implements IWirelessTermHandler
|
||||
{
|
||||
|
||||
String name;
|
||||
@@ -35,12 +37,14 @@ public class ToolWirelessTerminal extends AEBasePoweredItem
|
||||
@Override
|
||||
public void addInformation(ItemStack i, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
super.addInformation( i, p, l, b );
|
||||
|
||||
if ( i.hasTagCompound() )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( i );
|
||||
if ( tag != null )
|
||||
{
|
||||
String encKey = tag.getString( "encKey" );
|
||||
String encKey = tag.getString( "encryptionKey" );
|
||||
|
||||
if ( encKey == null || encKey == "" )
|
||||
l.add( GuiText.Unlinked.getLocal() );
|
||||
@@ -52,4 +56,37 @@ public class ToolWirelessTerminal extends AEBasePoweredItem
|
||||
l.add( StatCollector.translateToLocal( "AppEng.GuiITooltip.Unlinked" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle(ItemStack is)
|
||||
{
|
||||
return AEApi.instance().items().itemWirelessTerminal.sameAs( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usePower(Player player, float amount, ItemStack is)
|
||||
{
|
||||
return this.extractAEPower( is, amount ) >= amount - 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPower(Player player, ItemStack is)
|
||||
{
|
||||
return getAECurrentPower( is ) > 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncryptionKey(ItemStack item)
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( item );
|
||||
return tag.getString( "encryptionKey" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEncryptionKey(ItemStack item, String encKey, String name)
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( item );
|
||||
tag.setString( "encryptionKey", encKey );
|
||||
tag.setString( "name", name );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user