ActuallyAdditions/src/main/java/ellpeck/someprettytechystuff/util/Util.java

32 lines
1.1 KiB
Java
Raw Normal View History

2015-01-05 22:14:01 +01:00
package ellpeck.someprettytechystuff.util;
2015-01-05 22:14:01 +01:00
import net.minecraft.item.Item;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard;
2014-12-20 21:34:07 +01:00
@SuppressWarnings("unused")
public class Util{
2015-01-05 22:14:01 +01:00
public static final String MOD_ID = "someprettytechystuff";
2015-01-05 22:50:20 +01:00
public static final String NAME = "SomePrettyTechyStuff";
public static final String VERSION = "1.7.10-0.0.1";
public static boolean isShiftPressed(){
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
}
public static boolean isControlPressed(){
return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
}
2014-12-18 19:24:06 +01:00
public static String shiftForInfo() {
2014-12-20 21:34:07 +01:00
return (char)167+"2" + (char)167+"o" + StatCollector.translateToLocal("tooltip.shiftForInfo.desc");
}
2015-01-05 22:14:01 +01:00
public static String addStandardInformation(Item item){
if(isShiftPressed()) return StatCollector.translateToLocal("tooltip." + item.getUnlocalizedName().substring(5) + ".desc");
else return shiftForInfo();
}
}