2020-09-09 16:48:43 +02:00
|
|
|
package de.ellpeck.actuallyadditions.common.util;
|
2014-11-10 16:47:04 +01:00
|
|
|
|
2020-09-09 16:48:43 +02:00
|
|
|
import de.ellpeck.actuallyadditions.common.ActuallyAdditions;
|
2020-09-09 09:58:55 +02:00
|
|
|
import net.minecraft.item.Rarity;
|
2016-03-18 23:47:22 +01:00
|
|
|
import net.minecraft.util.text.TextFormatting;
|
2014-11-10 16:47:04 +01:00
|
|
|
|
2019-05-02 09:08:15 +02:00
|
|
|
public final class Util {
|
2014-11-10 16:47:04 +01:00
|
|
|
|
2020-09-09 09:58:55 +02:00
|
|
|
@Deprecated // canitzp: Wildcards and Oredict not supported anymore -> Tags
|
|
|
|
public static final int WILDCARD = -1;//OreDictionary.WILDCARD_VALUE;
|
|
|
|
public static final int BUCKET = 1000;
|
2016-01-01 23:54:36 +01:00
|
|
|
|
2020-09-09 09:58:55 +02:00
|
|
|
public static final Rarity CRYSTAL_RED_RARITY = addRarity("crystalRed", TextFormatting.DARK_RED, ActuallyAdditions.NAME + " Red Crystal");
|
|
|
|
public static final Rarity CRYSTAL_BLUE_RARITY = addRarity("crystalBlue", TextFormatting.DARK_BLUE, ActuallyAdditions.NAME + " Blue Crystal");
|
|
|
|
public static final Rarity CRYSTAL_LIGHT_BLUE_RARITY = addRarity("crystalLightBlue", TextFormatting.BLUE, ActuallyAdditions.NAME + " Light Blue Crystal");
|
|
|
|
public static final Rarity CRYSTAL_BLACK_RARITY = addRarity("crystalBlack", TextFormatting.DARK_GRAY, ActuallyAdditions.NAME + " Black Crystal");
|
|
|
|
public static final Rarity CRYSTAL_GREEN_RARITY = addRarity("crystalGreen", TextFormatting.DARK_GREEN, ActuallyAdditions.NAME + " Green Crystal");
|
|
|
|
public static final Rarity CRYSTAL_WHITE_RARITY = addRarity("crystalWhite", TextFormatting.GRAY, ActuallyAdditions.NAME + " White Crystal");
|
2016-01-01 23:54:36 +01:00
|
|
|
|
2020-09-09 09:58:55 +02:00
|
|
|
public static final Rarity FALLBACK_RARITY = addRarity("fallback", TextFormatting.STRIKETHROUGH, ActuallyAdditions.NAME + " Fallback");
|
2015-02-09 17:25:05 +01:00
|
|
|
|
2020-09-09 09:58:55 +02:00
|
|
|
private static Rarity addRarity(String name, TextFormatting color, String displayName) {
|
|
|
|
return Rarity.create(displayName, color);
|
2015-12-13 23:01:56 +01:00
|
|
|
}
|
|
|
|
|
2019-05-02 09:08:15 +02:00
|
|
|
public static boolean isDevVersion() {
|
2018-05-10 11:40:16 +02:00
|
|
|
return ActuallyAdditions.VERSION.equals("@VERSION@");
|
2015-07-01 21:32:48 +02:00
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2020-09-09 09:58:55 +02:00
|
|
|
@Deprecated // canitzp: should not be used and removed asap
|
2019-05-02 09:08:15 +02:00
|
|
|
public static boolean isClient() {
|
2020-09-09 09:58:55 +02:00
|
|
|
return false;//FMLCommonHandler.instance().getEffectiveSide().isClient();
|
2017-07-28 03:17:50 +02:00
|
|
|
}
|
2016-08-01 16:29:35 +02:00
|
|
|
|
2019-05-02 09:08:15 +02:00
|
|
|
private static String[] splitVersion() {
|
2018-05-10 11:40:16 +02:00
|
|
|
return ActuallyAdditions.VERSION.split("-");
|
2016-08-01 16:29:35 +02:00
|
|
|
}
|
|
|
|
|
2019-05-02 09:08:15 +02:00
|
|
|
public static String getMcVersion() {
|
2016-08-01 16:29:35 +02:00
|
|
|
return splitVersion()[0];
|
|
|
|
}
|
|
|
|
|
2019-05-02 09:08:15 +02:00
|
|
|
public static String getMajorModVersion() {
|
2016-08-01 16:29:35 +02:00
|
|
|
return splitVersion()[1].substring(1);
|
|
|
|
}
|
2015-02-17 16:15:16 +01:00
|
|
|
}
|