Improve code readability in binnie.botany package

This commit is contained in:
kordum authored and mezz committed 2017-04-28 17:45:38 -07:00
1 parent e05bf8bb7b
commit b609d6688f
93 files changed
+3594 -3838

No files matched your search

@@ -1,42 +1,36 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.botany.ceramic;
import binnie.botany.api.IFlower;
import net.minecraft.item.Item;
import binnie.botany.Botany;
import binnie.Binnie;
import net.minecraft.world.World;
import binnie.botany.Botany;
import binnie.botany.api.IFlower;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
public class PigmentRecipe implements IRecipe
{
private final ItemStack unknown;
public class PigmentRecipe implements IRecipe {
private ItemStack unknown;
ItemStack cached;
public PigmentRecipe() {
this.unknown = null;
unknown = null;
}
@Override
public boolean matches(final InventoryCrafting crafting, final World world) {
return this.getCraftingResult(crafting) != null;
public boolean matches(InventoryCrafting crafting, World world) {
return getCraftingResult(crafting) != null;
}
@Override
public ItemStack getRecipeOutput() {
if (this.cached != null) {
return this.cached;
if (cached != null) {
return cached;
}
return this.unknown;
return unknown;
}
@Override
public ItemStack getCraftingResult(final InventoryCrafting crafting) {
public ItemStack getCraftingResult(InventoryCrafting crafting) {
int n = 0;
ItemStack stack = null;
for (int i = 0; i < crafting.getSizeInventory(); ++i) {
@@ -44,11 +38,13 @@ public class PigmentRecipe implements IRecipe
if (++n > 1) {
return null;
}
if (Binnie.Genetics.getFlowerRoot().isMember(crafting.getStackInSlot(i))) {
final IFlower flower = Binnie.Genetics.getFlowerRoot().getMember(crafting.getStackInSlot(i));
if (flower.getAge() >= 1) {
stack = new ItemStack(Botany.pigment, 1, flower.getGenome().getPrimaryColor().getID());
}
if (!Binnie.Genetics.getFlowerRoot().isMember(crafting.getStackInSlot(i))) {
continue;
}
IFlower flower = Binnie.Genetics.getFlowerRoot().getMember(crafting.getStackInSlot(i));
if (flower.getAge() >= 1) {
stack = new ItemStack(Botany.pigment, 1, flower.getGenome().getPrimaryColor().getID());
}
}
}