Fix whitespace and add comments

This commit is contained in:
Joseph C. Sible committed 2017-10-02 21:30:48 -04:00
1 parent 6cafac7166
commit 46f6e50f2a
8 files changed
+32 -32

No files matched your search

@@ -62,7 +62,7 @@ public class GuiDoubleElectricMachine extends GuiMekanism
}
}, getProgressType(), this, tileEntity.guiLocation, 77, 37));
}
public ProgressBar getProgressType()
{
return ProgressBar.BLUE;
@@ -30,14 +30,14 @@ public class DoubleMachineRecipeCategory extends BaseRecipeCategory
@Nullable
private DoubleMachineRecipe tempRecipe;
public DoubleMachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress)
{
super(helper, "mekanism:gui/guibasicmachine.png", name, unlocalized, progress);
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), 28, 16, 144, 54);
}
@Override
public void addGuiElements()
{
@@ -45,7 +45,7 @@ public class DoubleMachineRecipeCategory extends BaseRecipeCategory
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 30, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 55, 52));
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 111, 30));
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
@Override
public double getLevel()
@@ -64,13 +64,13 @@ public class DoubleMachineRecipeCategory extends BaseRecipeCategory
}
@Override
public IDrawable getBackground()
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(!(recipeWrapper instanceof DoubleMachineRecipeWrapper))
{
@@ -78,11 +78,11 @@ public class DoubleMachineRecipeCategory extends BaseRecipeCategory
}
tempRecipe = ((DoubleMachineRecipeWrapper)recipeWrapper).getRecipe();
DoubleMachineInput input = (DoubleMachineInput)tempRecipe.recipeInput;
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 27, 0);
itemStacks.init(1, false, 87, 18);
itemStacks.init(2, false, 27, 36);
@@ -12,14 +12,14 @@ import net.minecraft.item.ItemStack;
public abstract class DoubleMachineRecipeWrapper implements IRecipeWrapper
{
private final DoubleMachineRecipe recipe;
public DoubleMachineRecipeWrapper(DoubleMachineRecipe r)
{
recipe = r;
}
@Override
public void getIngredients(IIngredients ingredients)
public void getIngredients(IIngredients ingredients)
{
DoubleMachineInput input = (DoubleMachineInput)recipe.getInput();
ingredients.setInputs(ItemStack.class, Arrays.asList(input.itemStack, input.extraStack));
@@ -48,7 +48,7 @@ public class Combiner
}
@ZenMethod
@Deprecated
@Deprecated // TODO remove this method in MC 1.13
public static void addRecipe(IItemStack itemInput, IItemStack itemOutput)
{
if (itemInput == null || itemOutput == null)
@@ -116,7 +116,7 @@ public final class RecipeHandler
* @param input - input ItemStack
* @param output - output ItemStack
*/
@Deprecated
@Deprecated // TODO remove this method in MC 1.13
public static void addCombinerRecipe(ItemStack input, ItemStack output)
{
addRecipe(Recipe.COMBINER, new CombinerRecipe(input, output));
@@ -17,9 +17,9 @@ public class DoubleMachineInput extends MachineInput<DoubleMachineInput>
itemStack = item;
extraStack = extra;
}
public DoubleMachineInput() {}
@Override
public void load(NBTTagCompound nbtTags)
{
@@ -47,10 +47,10 @@ public class DoubleMachineInput extends MachineInput<DoubleMachineInput>
{
inventory.set(index, StackUtils.subtract(inventory.get(index), stack));
}
return true;
}
return false;
}
@@ -83,7 +83,7 @@ public class DoubleMachineInput extends MachineInput<DoubleMachineInput>
{
return !other.isValid();
}
return StackUtils.equalsWildcardWithNBT(itemStack, other.itemStack) && StackUtils.equalsWildcardWithNBT(extraStack, other.extraStack);
}
@@ -17,7 +17,7 @@ public class CombinerRecipe extends DoubleMachineRecipe<CombinerRecipe>
super(input, extra, output);
}
@Deprecated
@Deprecated // TODO remove this method in MC 1.13
public CombinerRecipe(ItemStack input, ItemStack output)
{
super(input, new ItemStack(Blocks.COBBLESTONE), output);
@@ -41,7 +41,7 @@ public abstract class TileEntityDoubleElectricMachine<RECIPE extends DoubleMachi
super(soundPath, name, maxEnergy, baseEnergyUsage, 4, ticksRequired, MekanismUtils.getResource(ResourceType.GUI, "guibasicmachine.png"));
configComponent = new TileComponentConfig(this, TransmissionType.ITEM, TransmissionType.ENERGY);
configComponent.addOutput(TransmissionType.ITEM, new SideData("None", EnumColor.GREY, InventoryUtils.EMPTY));
configComponent.addOutput(TransmissionType.ITEM, new SideData("Input", EnumColor.DARK_RED, new int[] {0}));
configComponent.addOutput(TransmissionType.ITEM, new SideData("Output", EnumColor.DARK_BLUE, new int[] {2}));
@@ -56,7 +56,7 @@ public abstract class TileEntityDoubleElectricMachine<RECIPE extends DoubleMachi
ejectorComponent = new TileComponentEjector(this);
ejectorComponent.setOutputData(TransmissionType.ITEM, configComponent.getOutputs(TransmissionType.ITEM).get(2));
}
@Override
public boolean upgrade(BaseTier upgradeTier)
{
@@ -64,13 +64,13 @@ public abstract class TileEntityDoubleElectricMachine<RECIPE extends DoubleMachi
{
return false;
}
world.setBlockToAir(getPos());
world.setBlockState(getPos(), MekanismBlocks.MachineBlock.getStateFromMeta(5), 3);
TileEntityFactory factory = (TileEntityFactory)world.getTileEntity(getPos());
RecipeType type = RecipeType.getFromMachine(getBlockType(), getBlockMetadata());
//Basic
factory.facing = facing;
factory.clientFacing = clientFacing;
@@ -78,13 +78,13 @@ public abstract class TileEntityDoubleElectricMachine<RECIPE extends DoubleMachi
factory.redstone = redstone;
factory.redstoneLastTick = redstoneLastTick;
factory.doAutoSync = doAutoSync;
//Electric
factory.electricityStored = electricityStored;
//Noisy
factory.soundURL = soundURL;
//Machine
factory.progress[0] = operatingTicks;
factory.updateDelay = updateDelay;
@@ -99,28 +99,28 @@ public abstract class TileEntityDoubleElectricMachine<RECIPE extends DoubleMachi
factory.recipeType = type;
factory.upgradeComponent.setSupported(Upgrade.GAS, type.fuelEnergyUpgrades());
factory.securityComponent.readFrom(securityComponent);
for(TransmissionType transmission : configComponent.transmissions)
{
factory.configComponent.setConfig(transmission, configComponent.getConfig(transmission).asByteArray());
factory.configComponent.setEjecting(transmission, configComponent.isEjecting(transmission));
}
//Double Machine
factory.inventory.set(5, inventory.get(0));
factory.inventory.set(4, inventory.get(1));
factory.inventory.set(5+3, inventory.get(2));
factory.inventory.set(1, inventory.get(3));
factory.inventory.set(0, inventory.get(4));
for(Upgrade upgrade : factory.upgradeComponent.getSupportedTypes())
{
factory.recalculateUpgradables(upgrade);
}
factory.upgraded = true;
factory.markDirty();
return true;
}