Run formatter

This commit is contained in:
Nicholas Ignoffo 2017-08-15 21:30:48 -07:00
parent 61c44a831b
commit 08258fd6ef
606 changed files with 13464 additions and 22975 deletions

View file

@ -2,13 +2,11 @@ package WayofTime.bloodmagic.util.helper;
import java.util.TreeMap;
public class NumeralHelper
{
public class NumeralHelper {
private static final TreeMap<Integer, String> romanNumerals = new TreeMap<Integer, String>();
static
{
static {
romanNumerals.put(1000, "M");
romanNumerals.put(900, "CM");
romanNumerals.put(500, "D");
@ -24,8 +22,7 @@ public class NumeralHelper
romanNumerals.put(1, "I");
}
public static String toRoman(int arabic)
{
public static String toRoman(int arabic) {
int convert = romanNumerals.floorKey(arabic);
if (arabic == convert)
return romanNumerals.get(convert);

View file

@ -1,25 +1,19 @@
package WayofTime.bloodmagic.util.helper;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
import WayofTime.bloodmagic.api.registry.TartaricForgeRecipeRegistry;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
public class RecipeHelper
{
public static IRecipe getRecipeForOutput(ItemStack stack)
{
for (IRecipe recipe : ForgeRegistries.RECIPES.getValues())
{
if (recipe != null)
{
public class RecipeHelper {
public static IRecipe getRecipeForOutput(ItemStack stack) {
for (IRecipe recipe : ForgeRegistries.RECIPES.getValues()) {
if (recipe != null) {
ItemStack resultStack = recipe.getRecipeOutput();
if (!resultStack.isEmpty())
{
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage())
{
if (!resultStack.isEmpty()) {
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage()) {
return recipe;
}
}
@ -29,17 +23,12 @@ public class RecipeHelper
return null;
}
public static AltarRecipeRegistry.AltarRecipe getAltarRecipeForOutput(ItemStack stack)
{
for (AltarRecipeRegistry.AltarRecipe recipe : AltarRecipeRegistry.getRecipes().values())
{
if (recipe != null && !recipe.isFillable())
{
public static AltarRecipeRegistry.AltarRecipe getAltarRecipeForOutput(ItemStack stack) {
for (AltarRecipeRegistry.AltarRecipe recipe : AltarRecipeRegistry.getRecipes().values()) {
if (recipe != null && !recipe.isFillable()) {
ItemStack resultStack = recipe.getOutput();
if (!resultStack.isEmpty())
{
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage())
{
if (!resultStack.isEmpty()) {
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage()) {
return recipe;
}
}
@ -49,17 +38,12 @@ public class RecipeHelper
return null;
}
public static TartaricForgeRecipe getForgeRecipeForOutput(ItemStack stack)
{
for (TartaricForgeRecipe recipe : TartaricForgeRecipeRegistry.getRecipeList())
{
if (recipe != null)
{
public static TartaricForgeRecipe getForgeRecipeForOutput(ItemStack stack) {
for (TartaricForgeRecipe recipe : TartaricForgeRecipeRegistry.getRecipeList()) {
if (recipe != null) {
ItemStack resultStack = recipe.getRecipeOutput();
if (!resultStack.isEmpty())
{
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage())
{
if (!resultStack.isEmpty()) {
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage()) {
return recipe;
}
}

View file

@ -6,25 +6,20 @@ import org.apache.commons.lang3.text.WordUtils;
import java.util.ArrayList;
import java.util.List;
public class TextHelper
{
public static String getFormattedText(String string)
{
public class TextHelper {
public static String getFormattedText(String string) {
return string.replaceAll("&", "\u00A7");
}
public static String localize(String input, Object... format)
{
public static String localize(String input, Object... format) {
return I18n.translateToLocalFormatted(input, format);
}
public static String localizeEffect(String input, Object... format)
{
public static String localizeEffect(String input, Object... format) {
return getFormattedText(localize(input, format));
}
public static String[] localizeAll(String[] input)
{
public static String[] localizeAll(String[] input) {
String[] ret = new String[input.length];
for (int i = 0; i < input.length; i++)
ret[i] = localize(input[i]);
@ -32,8 +27,7 @@ public class TextHelper
return ret;
}
public static String[] localizeAllEffect(String[] input)
{
public static String[] localizeAllEffect(String[] input) {
String[] ret = new String[input.length];
for (int i = 0; i < input.length; i++)
ret[i] = localizeEffect(input[i]);
@ -41,8 +35,7 @@ public class TextHelper
return ret;
}
public static ArrayList<String> localizeAll(List<String> input)
{
public static ArrayList<String> localizeAll(List<String> input) {
ArrayList<String> ret = new ArrayList<String>(input.size());
for (int i = 0; i < input.size(); i++)
ret.add(i, localize(input.get(i)));
@ -50,8 +43,7 @@ public class TextHelper
return ret;
}
public static ArrayList<String> localizeAllEffect(List<String> input)
{
public static ArrayList<String> localizeAllEffect(List<String> input) {
ArrayList<String> ret = new ArrayList<String>(input.size());
for (int i = 0; i < input.size(); i++)
ret.add(i, localizeEffect(input.get(i)));
@ -59,18 +51,15 @@ public class TextHelper
return ret;
}
public static String[] cutLongString(String string, int characters)
{
public static String[] cutLongString(String string, int characters) {
return WordUtils.wrap(string, characters, "/cut", false).split("/cut");
}
public static String[] cutLongString(String string)
{
public static String[] cutLongString(String string) {
return cutLongString(string, 30);
}
public static boolean canTranslate(String key)
{
public static boolean canTranslate(String key) {
return I18n.canTranslate(key);
}
}