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