lastTickUpdate = false;
}
}
else if(mc.thePlayer.isSneaking() && StackUtils.getItem(mc.thePlayer.getCurrentEquippedItem()) instanceof ItemElectricBow)
{
ItemElectricBow item = (ItemElectricBow)mc.thePlayer.getCurrentEquippedItem().getItem();
if(MekanismKeyHandler.modeSwitchKey.getIsKeyPressed())
{
if(!lastTickUpdate)
{
item.setFireState(stack, !item.getFireState(stack));
Mekanism.packetHandler.sendToServer(new ElectricBowStateMessage(item.getFireState(stack)));
mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + MekanismUtils.localize("tooltip.fireMode") + ": " + (item.getFireState(stack) ? EnumColor.DARK_GREEN : EnumColor.DARK_RED) + LangUtils.transYesNo(item.getFireState(stack))));
lastTickUpdate = true;
}
}
else {
lastTickUpdate = false;
}
}
else if(mc.thePlayer.isSneaking() && StackUtils.getItem(mc.thePlayer.getCurrentEquippedItem()) instanceof ItemBlockMachine)
{
ItemBlockMachine item = (ItemBlockMachine)mc.thePlayer.getCurrentEquippedItem().getItem();
if(MachineType.get(mc.thePlayer.getCurrentEquippedItem()) == MachineType.PORTABLE_TANK)
{
if(MekanismKeyHandler.modeSwitchKey.getIsKeyPressed())
{
if(!lastTickUpdate)
{
item.setBucketMode(stack, !item.getBucketMode(stack));
Mekanism.packetHandler.sendToServer(new PortableTankStateMessage(item.getBucketMode(stack)));
mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + MekanismUtils.localize("tooltip.portableTank.bucketMode") + ": " + (item.getBucketMode(stack) ? (EnumColor.DARK_GREEN + "ON") : (EnumColor.DARK_RED + "OFF"))));
lastTickUpdate = true;
}
}
else {
lastTickUpdate = false;
}
}
}
else if(mc.thePlayer.isSneaking() && StackUtils.getItem(mc.thePlayer.getCurrentEquippedItem()) instanceof ItemWalkieTalkie)
{
ItemWalkieTalkie item = (ItemWalkieTalkie)mc.thePlayer.getCurrentEquippedItem().getItem();
if(MekanismKeyHandler.modeSwitchKey.getIsKeyPressed() && item.getOn(stack))
{
if(!lastTickUpdate)
{
int newChan = item.getChannel(stack) < 9 ? item.getChannel(stack)+1 : 1;
item.setChannel(stack, newChan);
Mekanism.packetHandler.sendToServer(new WalkieTalkieStateMessage(newChan));
SoundHandler.playSound("mekanism:etc.Ding");
lastTickUpdate = true;
}
}