Begin work on Wireless Terminal Gui.
This commit is contained in:
@@ -8,8 +8,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.api.features.IWirelessTermRegistery;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
||||
public class WirelessRegistry implements IWirelessTermRegistery
|
||||
{
|
||||
@@ -62,9 +62,9 @@ public class WirelessRegistry implements IWirelessTermRegistery
|
||||
return;
|
||||
}
|
||||
|
||||
if ( handler.usePower( (Player) player, 10.0f, item ) )
|
||||
if ( handler.hasPower( player, 0.5, item ) )
|
||||
{
|
||||
|
||||
Platform.openGUI( player, null, null, GuiBridge.GUI_WIRELESS_TERM );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
package appeng.core.features.registries.entries;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
||||
public class BasicTerminalHandler implements IWirelessTermHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
return false;
|
||||
|
||||
if ( AEApi.instance().items().itemWirelessTerminal.sameAs( is ) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usePower(Player player, float amount, ItemStack is)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPower(Player player, ItemStack is)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncryptionKey(ItemStack i)
|
||||
{
|
||||
if ( i == null )
|
||||
return null;
|
||||
NBTTagCompound tag = Platform.openNbtData( i );
|
||||
if ( tag != null )
|
||||
{
|
||||
return tag.getString( "encKey" );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEncryptionKey(ItemStack i, String encKey, String name)
|
||||
{
|
||||
if ( i == null )
|
||||
return;
|
||||
NBTTagCompound tag = Platform.openNbtData( i );
|
||||
if ( tag != null )
|
||||
{
|
||||
tag.setString( "encKey", encKey );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user