ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java

57 lines
2.5 KiB
Java
Raw Normal View History

2015-08-29 14:33:25 +02:00
/*
2016-05-16 22:52:27 +02:00
* This file ("Util.java") is part of the Actually Additions mod for Minecraft.
2015-08-29 14:33:25 +02:00
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
2016-05-16 22:52:27 +02:00
* http://ellpeck.de/actaddlicense
2015-08-29 14:33:25 +02:00
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2017-01-01 16:23:26 +01:00
* © 2015-2017 Ellpeck
2015-08-29 14:33:25 +02:00
*/
2016-01-05 04:47:35 +01:00
package de.ellpeck.actuallyadditions.mod.util;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
2016-03-18 23:47:22 +01:00
import net.minecraft.util.text.TextFormatting;
2019-05-02 09:08:15 +02:00
import net.minecraftforge.common.IRarity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.oredict.OreDictionary;
2019-05-02 09:08:15 +02:00
public final class Util {
public static final int WILDCARD = OreDictionary.WILDCARD_VALUE;
public static final int BUCKET = Fluid.BUCKET_VOLUME;
2019-05-02 09:08:15 +02:00
public static final IRarity CRYSTAL_RED_RARITY = addRarity("crystalRed", TextFormatting.DARK_RED, ActuallyAdditions.NAME + " Red Crystal");
public static final IRarity CRYSTAL_BLUE_RARITY = addRarity("crystalBlue", TextFormatting.DARK_BLUE, ActuallyAdditions.NAME + " Blue Crystal");
public static final IRarity CRYSTAL_LIGHT_BLUE_RARITY = addRarity("crystalLightBlue", TextFormatting.BLUE, ActuallyAdditions.NAME + " Light Blue Crystal");
public static final IRarity CRYSTAL_BLACK_RARITY = addRarity("crystalBlack", TextFormatting.DARK_GRAY, ActuallyAdditions.NAME + " Black Crystal");
public static final IRarity CRYSTAL_GREEN_RARITY = addRarity("crystalGreen", TextFormatting.DARK_GREEN, ActuallyAdditions.NAME + " Green Crystal");
public static final IRarity CRYSTAL_WHITE_RARITY = addRarity("crystalWhite", TextFormatting.GRAY, ActuallyAdditions.NAME + " White Crystal");
2019-05-02 09:08:15 +02:00
public static final IRarity FALLBACK_RARITY = addRarity("fallback", TextFormatting.STRIKETHROUGH, ActuallyAdditions.NAME + " Fallback");
2019-05-02 09:08:15 +02:00
private static IRarity addRarity(String name, TextFormatting color, String displayName) {
return new Rarity(color, displayName);
}
2019-05-02 09:08:15 +02:00
public static boolean isDevVersion() {
return ActuallyAdditions.VERSION.equals("@VERSION@");
2015-07-01 21:32:48 +02:00
}
2019-02-27 19:53:05 +01:00
2019-05-02 09:08:15 +02:00
public static boolean isClient() {
2019-02-27 19:53:05 +01:00
return FMLCommonHandler.instance().getEffectiveSide().isClient();
}
2019-05-02 09:08:15 +02:00
private static String[] splitVersion() {
return ActuallyAdditions.VERSION.split("-");
}
2019-05-02 09:08:15 +02:00
public static String getMcVersion() {
return splitVersion()[0];
}
2019-05-02 09:08:15 +02:00
public static String getMajorModVersion() {
return splitVersion()[1].substring(1);
}
}