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

@ -1,8 +1,7 @@
package WayofTime.bloodmagic.recipe.alchemyTable;
import java.util.ArrayList;
import java.util.List;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemBanner;
@ -11,15 +10,14 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
public class AlchemyTableDyeableRecipe extends AlchemyTableRecipe
{
import java.util.ArrayList;
import java.util.List;
public class AlchemyTableDyeableRecipe extends AlchemyTableRecipe {
private ItemStack inputItem;
public AlchemyTableDyeableRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem)
{
public AlchemyTableDyeableRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem) {
super(inputItem, lpDrained, ticksRequired, tierRequired);
ArrayList<ItemStack> validDyes = new ArrayList<ItemStack>();
@ -36,58 +34,46 @@ public class AlchemyTableDyeableRecipe extends AlchemyTableRecipe
}
@Override
public ItemStack getRecipeOutput(List<ItemStack> inputList)
{
public ItemStack getRecipeOutput(List<ItemStack> inputList) {
int nameTagOrDyeLocation = -1;
int inputItemLocation = -1;
for (int x = 0; x < inputList.size(); x++)
{
for (int x = 0; x < inputList.size(); x++) {
ItemStack slot = inputList.get(x);
if (slot != null)
{
if (slot != null) {
boolean match = OreDictionary.itemMatches(inputItem, slot, false);
if (match)
{
if (match) {
inputItemLocation = x;
} else
{
if (slot.getItem() == Items.NAME_TAG || slot.getItem() == Items.DYE)
{
} else {
if (slot.getItem() == Items.NAME_TAG || slot.getItem() == Items.DYE) {
nameTagOrDyeLocation = x;
}
}
}
}
if (nameTagOrDyeLocation != -1 && inputItemLocation != -1)
{
if (nameTagOrDyeLocation != -1 && inputItemLocation != -1) {
ItemStack tagOrDyeStack = inputList.get(nameTagOrDyeLocation);
ItemStack inputStack = inputList.get(inputItemLocation);
if (inputStack.isEmpty() || tagOrDyeStack.isEmpty())
{
if (inputStack.isEmpty() || tagOrDyeStack.isEmpty()) {
return output.copy();
}
ItemStack outputStack = inputStack.copy();
if (tagOrDyeStack.getItem() == Items.NAME_TAG)
{
if (!outputStack.hasTagCompound())
{
if (tagOrDyeStack.getItem() == Items.NAME_TAG) {
if (!outputStack.hasTagCompound()) {
outputStack.setTagCompound(new NBTTagCompound());
}
outputStack.getTagCompound().setString(Constants.NBT.COLOR, tagOrDyeStack.getDisplayName());
return outputStack;
} else
{
} else {
EnumDyeColor dyeColor = ItemBanner.getBaseColor(tagOrDyeStack);
if (!outputStack.hasTagCompound())
{
if (!outputStack.hasTagCompound()) {
outputStack.setTagCompound(new NBTTagCompound());
}
@ -101,32 +87,23 @@ public class AlchemyTableDyeableRecipe extends AlchemyTableRecipe
}
@Override
public boolean matches(List<ItemStack> checkedList, World world, BlockPos pos)
{
public boolean matches(List<ItemStack> checkedList, World world, BlockPos pos) {
boolean hasNameTagOrDye = false;
boolean hasInputItem = false;
for (ItemStack slot : checkedList)
{
if (!slot.isEmpty())
{
for (ItemStack slot : checkedList) {
if (!slot.isEmpty()) {
boolean match = OreDictionary.itemMatches(inputItem, slot, false);
if (match && hasInputItem)
{
if (match && hasInputItem) {
return false;
} else if (match)
{
} else if (match) {
hasInputItem = true;
} else
{
if (slot.getItem() == Items.NAME_TAG || slot.getItem() == Items.DYE)
{
if (hasNameTagOrDye)
{
} else {
if (slot.getItem() == Items.NAME_TAG || slot.getItem() == Items.DYE) {
if (hasNameTagOrDye) {
return false;
} else
{
} else {
hasNameTagOrDye = true;
}
}

View file

@ -1,27 +1,26 @@
package WayofTime.bloodmagic.recipe.alchemyTable;
import java.util.*;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.potion.BMPotionUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.potion.PotionUtils;
import WayofTime.bloodmagic.potion.BMPotionUtils;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe
{
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe {
protected double lengthAugment = 0;
protected int powerAugment = 0;
protected Potion wantedPotion;
public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, List<ItemStack> inputItems, PotionEffect baseEffect, double lengthAugment, int powerAugment)
{
public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, List<ItemStack> inputItems, PotionEffect baseEffect, double lengthAugment, int powerAugment) {
super(lpDrained, ticksRequired, tierRequired, inputItems, baseEffect);
ArrayList<Object> recipe = new ArrayList<Object>();
for (ItemStack stack : inputItems)
{
for (ItemStack stack : inputItems) {
recipe.add(stack);
}
recipe.add(getAugmentedPotionFlask(baseEffect));
@ -33,19 +32,15 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe
this.powerAugment = powerAugment;
}
public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect, double lengthAugment, int powerAugment)
{
public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect, double lengthAugment, int powerAugment) {
this(lpDrained, ticksRequired, tierRequired, Collections.singletonList(inputItem), baseEffect, lengthAugment, powerAugment);
}
@Override
public boolean isPotionFlaskValidInput(ItemStack stack)
{
public boolean isPotionFlaskValidInput(ItemStack stack) {
List<PotionEffect> effectList = PotionUtils.getEffectsFromStack(stack);
for (PotionEffect eff : effectList)
{
if (eff.getPotion() == wantedPotion)
{
for (PotionEffect eff : effectList) {
if (eff.getPotion() == wantedPotion) {
double currentAugment = BMPotionUtils.getLengthAugment(stack, wantedPotion);
return currentAugment < lengthAugment || eff.getAmplifier() < powerAugment;
@ -56,10 +51,8 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe
}
@Override
public ItemStack getModifiedFlaskForInput(ItemStack inputStack)
{
if (inputStack == null)
{
public ItemStack getModifiedFlaskForInput(ItemStack inputStack) {
if (inputStack == null) {
ItemStack outputStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK);
List<PotionEffect> effectList = new ArrayList<PotionEffect>();
@ -93,8 +86,7 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe
return outputStack;
}
public static ItemStack getAugmentedPotionFlask(PotionEffect baseEffect)
{
public static ItemStack getAugmentedPotionFlask(PotionEffect baseEffect) {
ItemStack outputStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK);
List<PotionEffect> effectList = new ArrayList<PotionEffect>();

View file

@ -1,32 +1,30 @@
package WayofTime.bloodmagic.recipe.alchemyTable;
import java.util.*;
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.potion.PotionUtils;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
{
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class AlchemyTablePotionRecipe extends AlchemyTableRecipe {
public static final ItemStack basePotionFlaskStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK, 1, OreDictionary.WILDCARD_VALUE);
protected PotionEffect baseEffect;
public static final int temporaryMaximumEffectsOnThePotionFlaskYesThisIsALongFieldItIsJustSoIRemember = 3;
protected PotionEffect baseEffect;
protected double baseAddedImpurity = 5;
public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, List<ItemStack> inputItems, PotionEffect baseEffect)
{
public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, List<ItemStack> inputItems, PotionEffect baseEffect) {
super(basePotionFlaskStack, lpDrained, ticksRequired, tierRequired);
ArrayList<Object> recipe = new ArrayList<Object>();
for (ItemStack stack : inputItems)
{
for (ItemStack stack : inputItems) {
recipe.add(stack);
}
recipe.add(basePotionFlaskStack);
@ -35,32 +33,26 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
this.baseEffect = baseEffect;
}
public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect)
{
public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect) {
this(lpDrained, ticksRequired, tierRequired, Collections.singletonList(inputItem), baseEffect);
}
@Override
public ItemStack getRecipeOutput(List<ItemStack> inputList)
{
public ItemStack getRecipeOutput(List<ItemStack> inputList) {
int flaskLocation = -1;
for (int x = 0; x < inputList.size(); x++)
{
for (int x = 0; x < inputList.size(); x++) {
ItemStack slot = inputList.get(x);
if (slot != null)
{
if (slot != null) {
boolean match = slot.getItem() == RegistrarBloodMagicItems.POTION_FLASK;
if (match)
{
if (match) {
flaskLocation = x;
}
}
}
if (flaskLocation != -1)
{
if (flaskLocation != -1) {
return getModifiedFlaskForInput(inputList.get(flaskLocation));
}
@ -68,8 +60,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
}
@Override
public boolean matches(List<ItemStack> checkedList, World world, BlockPos pos)
{
public boolean matches(List<ItemStack> checkedList, World world, BlockPos pos) {
ArrayList<Object> required = new ArrayList<Object>(input);
for (ItemStack slot : checkedList) {
@ -112,18 +103,14 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
return required.isEmpty();
}
public boolean isPotionFlaskValidInput(ItemStack stack)
{
public boolean isPotionFlaskValidInput(ItemStack stack) {
List<PotionEffect> effectList = PotionUtils.getEffectsFromStack(stack);
if (effectList.size() >= temporaryMaximumEffectsOnThePotionFlaskYesThisIsALongFieldItIsJustSoIRemember)
{
if (effectList.size() >= temporaryMaximumEffectsOnThePotionFlaskYesThisIsALongFieldItIsJustSoIRemember) {
return false;
}
for (PotionEffect eff : effectList)
{
if (eff.getPotion() == baseEffect.getPotion())
{
for (PotionEffect eff : effectList) {
if (eff.getPotion() == baseEffect.getPotion()) {
return false;
}
}
@ -131,10 +118,8 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
return true;
}
public ItemStack getModifiedFlaskForInput(ItemStack inputStack)
{
if (inputStack.isEmpty())
{
public ItemStack getModifiedFlaskForInput(ItemStack inputStack) {
if (inputStack.isEmpty()) {
ItemStack outputStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK);
List<PotionEffect> effectList = new ArrayList<PotionEffect>();