From 5e4f57f51d8cd024abf210ef0e8d6638215a0b65 Mon Sep 17 00:00:00 2001 From: asiekierka Date: Thu, 26 Feb 2015 16:55:46 +0100 Subject: [PATCH] fix style --- .../api/recipes/IProgrammingRecipe.java | 33 ++++++++++++++++--- common/buildcraft/BuildCraftEnergy.java | 3 +- .../core/statements/TriggerEnergy.java | 2 -- .../silicon/TileProgrammingTable.java | 2 +- .../boards/BoardProgrammingRecipe.java | 6 +--- .../silicon/gui/GuiProgrammingTable.java | 2 -- .../transport/PipeTriggerProvider.java | 2 -- 7 files changed, 32 insertions(+), 18 deletions(-) diff --git a/api/buildcraft/api/recipes/IProgrammingRecipe.java b/api/buildcraft/api/recipes/IProgrammingRecipe.java index c969e067..46fdb71e 100644 --- a/api/buildcraft/api/recipes/IProgrammingRecipe.java +++ b/api/buildcraft/api/recipes/IProgrammingRecipe.java @@ -4,11 +4,34 @@ import java.util.List; import net.minecraft.item.ItemStack; public interface IProgrammingRecipe { - public String getId(); + String getId(); - public List getOptions(int width, int height); - public int getEnergyCost(ItemStack option); + /** + * Get a list (size at least width*height) of ItemStacks representing options. + * @param width The width of the Programming Table panel. + * @param height The height of the Programming Table panel. + * @return + */ + List getOptions(int width, int height); - public boolean canCraft(ItemStack input); - public ItemStack craft(ItemStack input, ItemStack option); + /** + * Get the energy cost of a given option ItemStack. + * @param option + * @return + */ + int getEnergyCost(ItemStack option); + + /** + * @param input The input stack. + * @return Whether this recipe applies to the given input stack. + */ + boolean canCraft(ItemStack input); + + /** + * Craft the input ItemStack with the given option into an output ItemStack. + * @param input + * @param option + * @return The output ItemStack. + */ + ItemStack craft(ItemStack input, ItemStack option); } diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java index 5fb7042c..263e6747 100644 --- a/common/buildcraft/BuildCraftEnergy.java +++ b/common/buildcraft/BuildCraftEnergy.java @@ -230,7 +230,8 @@ public class BuildCraftEnergy extends BuildCraftMod { if (fluidRedPlasma.getBlock() == null) { blockRedPlasma = new BlockBuildcraftFluid(fluidRedPlasma, Material.water, MapColor.redColor).setFlammable( - false).setParticleColor(0.9F, 0, 0);blockRedPlasma.setBlockName("blockRedPlasma"); + false).setParticleColor(0.9F, 0, 0); + blockRedPlasma.setBlockName("blockRedPlasma"); CoreProxy.proxy.registerBlock(blockRedPlasma); fluidRedPlasma.setBlock(blockRedPlasma); } else { diff --git a/common/buildcraft/core/statements/TriggerEnergy.java b/common/buildcraft/core/statements/TriggerEnergy.java index 741108bd..888d054e 100644 --- a/common/buildcraft/core/statements/TriggerEnergy.java +++ b/common/buildcraft/core/statements/TriggerEnergy.java @@ -21,11 +21,9 @@ import cofh.api.energy.IEnergyHandler; import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyReceiver; -import buildcraft.api.gates.IGate; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import buildcraft.api.statements.ITriggerExternal; -import buildcraft.api.statements.ITriggerInternal; import buildcraft.core.utils.StringUtils; public class TriggerEnergy extends BCStatement implements ITriggerExternal { diff --git a/common/buildcraft/silicon/TileProgrammingTable.java b/common/buildcraft/silicon/TileProgrammingTable.java index 144ab07f..654eaf2c 100644 --- a/common/buildcraft/silicon/TileProgrammingTable.java +++ b/common/buildcraft/silicon/TileProgrammingTable.java @@ -226,7 +226,7 @@ public class TileProgrammingTable extends TileLaserTableBase implements IInvento @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { - return (slot == 0 || stack == null); + return slot == 0 || stack == null; } @Override diff --git a/common/buildcraft/silicon/boards/BoardProgrammingRecipe.java b/common/buildcraft/silicon/boards/BoardProgrammingRecipe.java index 08cca6d5..dd7eca0a 100644 --- a/common/buildcraft/silicon/boards/BoardProgrammingRecipe.java +++ b/common/buildcraft/silicon/boards/BoardProgrammingRecipe.java @@ -3,7 +3,6 @@ package buildcraft.silicon.boards; import java.util.ArrayList; import java.util.Comparator; import java.util.List; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import buildcraft.BuildCraftSilicon; import buildcraft.api.boards.RedstoneBoardNBT; @@ -12,9 +11,6 @@ import buildcraft.api.recipes.IProgrammingRecipe; import buildcraft.core.utils.NBTUtils; import buildcraft.silicon.ItemRedstoneBoard; -/** - * Created by asie on 2/24/15. - */ public class BoardProgrammingRecipe implements IProgrammingRecipe { private class BoardSorter implements Comparator { private BoardProgrammingRecipe recipe; @@ -55,7 +51,7 @@ public class BoardProgrammingRecipe implements IProgrammingRecipe { @Override public boolean canCraft(ItemStack input) { - return (input.getItem() instanceof ItemRedstoneBoard); + return input.getItem() instanceof ItemRedstoneBoard; } @Override diff --git a/common/buildcraft/silicon/gui/GuiProgrammingTable.java b/common/buildcraft/silicon/gui/GuiProgrammingTable.java index acb5809f..f33070f4 100644 --- a/common/buildcraft/silicon/gui/GuiProgrammingTable.java +++ b/common/buildcraft/silicon/gui/GuiProgrammingTable.java @@ -9,7 +9,6 @@ package buildcraft.silicon.gui; import java.util.Iterator; -import java.util.List; import org.lwjgl.opengl.GL11; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureMap; @@ -17,7 +16,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import buildcraft.BuildCraftCore; -import buildcraft.api.recipes.CraftingResult; import buildcraft.core.CoreIconProvider; import buildcraft.core.DefaultProps; import buildcraft.core.gui.AdvancedSlot; diff --git a/common/buildcraft/transport/PipeTriggerProvider.java b/common/buildcraft/transport/PipeTriggerProvider.java index c9f4aafa..c47419c5 100644 --- a/common/buildcraft/transport/PipeTriggerProvider.java +++ b/common/buildcraft/transport/PipeTriggerProvider.java @@ -21,11 +21,9 @@ import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.ITriggerExternal; import buildcraft.api.statements.ITriggerInternal; import buildcraft.api.statements.ITriggerProvider; -import buildcraft.transport.pipes.PipePowerWood; import buildcraft.transport.statements.TriggerPipeContents; public class PipeTriggerProvider implements ITriggerProvider { - @Override public LinkedList getInternalTriggers(IStatementContainer container) { LinkedList result = new LinkedList();