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
|
|
|
|
*
|
2016-05-16 22:54:42 +02:00
|
|
|
* © 2015-2016 Ellpeck
|
2015-08-29 14:33:25 +02:00
|
|
|
*/
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.util;
|
2014-11-10 16:47:04 +01:00
|
|
|
|
2015-12-03 20:15:07 +01:00
|
|
|
import net.minecraft.item.EnumRarity;
|
2016-03-18 23:47:22 +01:00
|
|
|
import net.minecraft.util.text.TextFormatting;
|
2015-12-03 20:15:07 +01:00
|
|
|
import net.minecraftforge.common.util.EnumHelper;
|
2016-06-10 21:52:37 +02:00
|
|
|
import net.minecraftforge.fluids.Fluid;
|
2015-02-09 17:25:05 +01:00
|
|
|
import net.minecraftforge.oredict.OreDictionary;
|
2014-11-10 16:47:04 +01:00
|
|
|
|
2016-05-16 17:00:29 +02:00
|
|
|
import java.util.Locale;
|
2015-11-22 18:52:11 +01:00
|
|
|
import java.util.Random;
|
2015-08-28 21:17:09 +02:00
|
|
|
|
2016-06-17 23:50:38 +02:00
|
|
|
public final class Util{
|
2014-11-10 16:47:04 +01:00
|
|
|
|
2015-11-22 18:52:11 +01:00
|
|
|
public static final Random RANDOM = new Random();
|
2015-02-09 17:25:05 +01:00
|
|
|
public static final int WILDCARD = OreDictionary.WILDCARD_VALUE;
|
2016-06-10 21:52:37 +02:00
|
|
|
public static final int BUCKET = Fluid.BUCKET_VOLUME;
|
2016-01-01 23:54:36 +01:00
|
|
|
|
2016-05-30 23:55:16 +02:00
|
|
|
public static final EnumRarity CRYSTAL_RED_RARITY = addRarity("crystalRed", TextFormatting.DARK_RED, ModUtil.NAME+" Red Crystal");
|
|
|
|
public static final EnumRarity CRYSTAL_BLUE_RARITY = addRarity("crystalBlue", TextFormatting.DARK_BLUE, ModUtil.NAME+" Blue Crystal");
|
|
|
|
public static final EnumRarity CRYSTAL_LIGHT_BLUE_RARITY = addRarity("crystalLightBlue", TextFormatting.BLUE, ModUtil.NAME+" Light Blue Crystal");
|
|
|
|
public static final EnumRarity CRYSTAL_BLACK_RARITY = addRarity("crystalBlack", TextFormatting.DARK_GRAY, ModUtil.NAME+" Black Crystal");
|
|
|
|
public static final EnumRarity CRYSTAL_GREEN_RARITY = addRarity("crystalGreen", TextFormatting.DARK_GREEN, ModUtil.NAME+" Green Crystal");
|
|
|
|
public static final EnumRarity CRYSTAL_WHITE_RARITY = addRarity("crystalWhite", TextFormatting.GRAY, ModUtil.NAME+" White Crystal");
|
2016-01-01 23:54:36 +01:00
|
|
|
|
2016-05-30 23:55:16 +02:00
|
|
|
public static final EnumRarity FALLBACK_RARITY = addRarity("fallback", TextFormatting.STRIKETHROUGH, ModUtil.NAME+" Fallback");
|
2015-02-09 17:25:05 +01:00
|
|
|
|
2016-05-16 17:00:29 +02:00
|
|
|
private static EnumRarity addRarity(String name, TextFormatting color, String displayName){
|
|
|
|
return EnumHelper.addRarity((ModUtil.MOD_ID+"_"+name).toUpperCase(Locale.ROOT), color, displayName);
|
2015-12-13 23:01:56 +01:00
|
|
|
}
|
|
|
|
|
2016-05-16 17:00:29 +02:00
|
|
|
public static boolean isDevVersion(){
|
|
|
|
return ModUtil.VERSION.equals("@VERSION@");
|
2015-07-01 21:32:48 +02:00
|
|
|
}
|
2016-08-01 16:29:35 +02:00
|
|
|
|
|
|
|
private static String[] splitVersion(){
|
|
|
|
return ModUtil.VERSION.split("-");
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String getMcVersion(){
|
|
|
|
return splitVersion()[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String getMajorModVersion(){
|
|
|
|
return splitVersion()[1].substring(1);
|
|
|
|
}
|
2015-02-17 16:15:16 +01:00
|
|
|
}
|