package mcjty.deepresonance.blocks.valve; import mcjty.deepresonance.blocks.GenericDRBlock; import mcjty.deepresonance.client.ClientHandler; import mcjty.deepresonance.gui.GuiProxy; import mcjty.lib.container.GenericGuiContainer; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.input.Keyboard; import java.util.List; public class ValveBlock extends GenericDRBlock<ValveTileEntity, ValveContainer> { public ValveBlock() { super(Material.ROCK, ValveTileEntity.class, ValveContainer.class, "valve", true); } @Override public boolean isHorizRotation() { return true; } @SideOnly(Side.CLIENT) @Override public Class<? extends GenericGuiContainer> getGuiClass() { return GuiValve.class; } @Override @SideOnly(Side.CLIENT) public List<String> getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { return currentTip; } @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack itemStack, EntityPlayer player, List<String> list, boolean advancedToolTip) { super.addInformation(itemStack, player, list,advancedToolTip); if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { list.add("This machine will transfer fluids from the upper tank"); list.add("to a tank below if the fluid matches certain conditions"); } else { list.add(TextFormatting.WHITE + ClientHandler.getShiftMessage()); } } @Override public int getGuiID() { return GuiProxy.GUI_VALVE; } }