Make network reader not use energy when in creative mode.
This commit is contained in:
parent
4a404dfc78
commit
7214a88a7a
1 changed files with 5 additions and 2 deletions
|
@ -33,12 +33,13 @@ public class ItemNetworkReader extends ItemEnergized
|
||||||
if(!world.isRemote)
|
if(!world.isRemote)
|
||||||
{
|
{
|
||||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||||
|
boolean drain = !player.capabilities.isCreativeMode;
|
||||||
|
|
||||||
if(getEnergy(stack) >= ENERGY_PER_USE)
|
if(getEnergy(stack) >= ENERGY_PER_USE)
|
||||||
{
|
{
|
||||||
if(tileEntity instanceof IGridTransmitter)
|
if(tileEntity instanceof IGridTransmitter)
|
||||||
{
|
{
|
||||||
setEnergy(stack, getEnergy(stack)-ENERGY_PER_USE);
|
if(drain) setEnergy(stack, getEnergy(stack)-ENERGY_PER_USE);
|
||||||
|
|
||||||
IGridTransmitter<?> transmitter = (IGridTransmitter<?>)tileEntity;
|
IGridTransmitter<?> transmitter = (IGridTransmitter<?>)tileEntity;
|
||||||
|
|
||||||
|
@ -57,6 +58,8 @@ public class ItemNetworkReader extends ItemEnergized
|
||||||
}
|
}
|
||||||
else if(tileEntity instanceof IHeatTransfer)
|
else if(tileEntity instanceof IHeatTransfer)
|
||||||
{
|
{
|
||||||
|
if(drain) setEnergy(stack, getEnergy(stack)-ENERGY_PER_USE);
|
||||||
|
|
||||||
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||||
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Temperature: " + EnumColor.DARK_GREY + ((IHeatTransfer)tileEntity).getTemp() + "K above ambient"));
|
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Temperature: " + EnumColor.DARK_GREY + ((IHeatTransfer)tileEntity).getTemp() + "K above ambient"));
|
||||||
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||||
|
@ -65,7 +68,7 @@ public class ItemNetworkReader extends ItemEnergized
|
||||||
}
|
}
|
||||||
else if(tileEntity != null)
|
else if(tileEntity != null)
|
||||||
{
|
{
|
||||||
setEnergy(stack, getEnergy(stack)-ENERGY_PER_USE);
|
if(drain) setEnergy(stack, getEnergy(stack)-ENERGY_PER_USE);
|
||||||
|
|
||||||
Set<ITransmitterNetwork> iteratedNetworks = new HashSet<ITransmitterNetwork>();
|
Set<ITransmitterNetwork> iteratedNetworks = new HashSet<ITransmitterNetwork>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue