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;
|
2014-02-02 23:02:54 -06:00
|
|
|
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
|
|
|
|
{
|
|
|
|
|
2014-02-02 23:02:54 -06:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2014-02-02 23:02:54 -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;
|
2014-02-02 23:02:54 -06:00
|
|
|
}
|
2014-02-03 22:23:14 -06:00
|
|
|
else
|
|
|
|
{
|
2014-02-08 23:08:27 -06:00
|
|
|
powerMultiplier = AEConfig.instance.wireless_getDrainRate( wtgo.getRange() );
|
2014-02-03 22:23:14 -06:00
|
|
|
}
|
2014-02-02 23:02:54 -06:00
|
|
|
}
|
2014-02-02 22:33:50 -06:00
|
|
|
}
|