Applied-Energistics-2-tiler.../container/implementations/ContainerWirelessTerm.java

37 lines
877 B
Java
Raw Normal View History

2014-02-02 22:33:50 -06:00
package appeng.container.implementations;
import net.minecraft.entity.player.InventoryPlayer;
2014-02-08 23:08:27 -06:00
import appeng.core.AEConfig;
import appeng.core.localization.PlayerMessages;
import appeng.helpers.WirelessTerminalGuiObject;
2014-02-11 02:40:00 -06:00
import appeng.util.Platform;
2014-02-02 22:33:50 -06:00
public class ContainerWirelessTerm extends ContainerMEPortableCell
{
WirelessTerminalGuiObject wtgo;
2014-09-21 01:06:22 +02:00
public ContainerWirelessTerm(InventoryPlayer ip, WirelessTerminalGuiObject monitorable) {
super( ip, monitorable );
wtgo = monitorable;
2014-02-02 22:33:50 -06:00
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
if ( !wtgo.rangeCheck() )
{
2014-02-11 02:40:00 -06:00
if ( Platform.isServer() && isContainerValid )
getPlayerInv().player.addChatMessage( PlayerMessages.OutOfRange.get() );
2014-02-08 19:34:52 -06:00
isContainerValid = false;
}
else
{
2014-02-08 23:08:27 -06:00
powerMultiplier = AEConfig.instance.wireless_getDrainRate( wtgo.getRange() );
}
}
2014-02-02 22:33:50 -06:00
}