Applied-Energistics-2-tiler.../container/implementations/ContainerWirelessTerm.java
2014-09-21 01:06:22 +02:00

36 lines
877 B
Java

package appeng.container.implementations;
import net.minecraft.entity.player.InventoryPlayer;
import appeng.core.AEConfig;
import appeng.core.localization.PlayerMessages;
import appeng.helpers.WirelessTerminalGuiObject;
import appeng.util.Platform;
public class ContainerWirelessTerm extends ContainerMEPortableCell
{
WirelessTerminalGuiObject wtgo;
public ContainerWirelessTerm(InventoryPlayer ip, WirelessTerminalGuiObject monitorable) {
super( ip, monitorable );
wtgo = monitorable;
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
if ( !wtgo.rangeCheck() )
{
if ( Platform.isServer() && isContainerValid )
getPlayerInv().player.addChatMessage( PlayerMessages.OutOfRange.get() );
isContainerValid = false;
}
else
{
powerMultiplier = AEConfig.instance.wireless_getDrainRate( wtgo.getRange() );
}
}
}