Auto format code

This commit is contained in:
modmuss50 2017-06-12 14:23:32 +01:00
parent fc4d8686b8
commit b25742dde0
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
175 changed files with 527 additions and 737 deletions

View file

@ -158,7 +158,7 @@ public class CTGeneric {
public void apply() {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
for (Object stack : recipeType.getInputs()) {
if(stack instanceof ItemStack){
if (stack instanceof ItemStack) {
if (output.matches(MineTweakerMC.getIItemStack((ItemStack) stack))) {
removedRecipes.add((BaseRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);

View file

@ -54,7 +54,7 @@ public class CTIndustrialGrinder extends CTGeneric {
fluidStack = CraftTweakerCompat.toFluidStack(fluid);
}
IndustrialGrinderRecipe r = new IndustrialGrinderRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
IndustrialGrinderRecipe r = new IndustrialGrinderRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
addRecipe(r);
}

View file

@ -35,7 +35,6 @@ import reborncore.common.util.ItemUtils;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.RollingMachineRecipe;
import techreborn.api.TechRebornAPI;
import java.util.ArrayList;
import java.util.List;
@ -44,17 +43,16 @@ import java.util.Map;
@ZenClass("mods.techreborn.rollingMachine")
public class CTRollingMachine {
//TODO 1.12 Crafttweaker
// @ZenMethod
// public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
// TechRebornAPI.addRollingOreMachinceRecipe(toStack(output), toShapedObjects(ingredients));
// }
// @ZenMethod
// public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
// TechRebornAPI.addRollingOreMachinceRecipe(toStack(output), toShapedObjects(ingredients));
// }
// @ZenMethod
// public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
// TechRebornAPI.addShapelessOreRollingMachinceRecipe(toStack(output), toObjects(ingredients));
// }
// @ZenMethod
// public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
// TechRebornAPI.addShapelessOreRollingMachinceRecipe(toStack(output), toObjects(ingredients));
// }
@ZenMethod
public static void removeRecipe(IItemStack output) {
@ -64,7 +62,7 @@ public class CTRollingMachine {
toRemove.add(recipe.getKey());
}
}
for(ResourceLocation resourceLocation : toRemove){
for (ResourceLocation resourceLocation : toRemove) {
RollingMachineRecipe.instance.getRecipeList().remove(resourceLocation);
}
}

View file

@ -47,7 +47,7 @@ public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecip
inputs = new ArrayList<>();
outputs = new ArrayList<>();
for (Object input : baseRecipe.getInputs()) {
if(input instanceof ItemStack){
if (input instanceof ItemStack) {
ItemStack stack = (ItemStack) input;
if (baseRecipe.useOreDic()) {
List<ItemStack> oreDictInputs = expandOreDict(stack);
@ -55,7 +55,7 @@ public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecip
} else {
inputs.add(Collections.singletonList(stack));
}
} else if (input instanceof String){
} else if (input instanceof String) {
inputs.add(OreDictionary.getOres((String) input));
}
}

View file

@ -24,15 +24,13 @@
package techreborn.compat.jei;
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
import net.minecraft.inventory.Slot;
import techreborn.client.container.builder.BuiltContainer;
import java.util.ArrayList;
import java.util.List;
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltContainer> {
private final String containerName, recipeCategory;
@ -40,8 +38,8 @@ public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltCont
private final int recipeSlotStart, recipeSlotCount, inventorySlotStart, inventorySlotCount;
public BuiltContainerTransferInfo(final String containerName, final String recipeCategory,
final int recipeSlotStart, final int recipeSlotCount, final int inventorySlotStart,
final int inventorySlotCount) {
final int recipeSlotStart, final int recipeSlotCount, final int inventorySlotStart,
final int inventorySlotCount) {
this.containerName = containerName;
this.recipeCategory = recipeCategory;

View file

@ -189,7 +189,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper),
new IndustrialSawmillRecipeCategory(guiHelper));
if(!IC2Duplicates.deduplicate()){
if (!IC2Duplicates.deduplicate()) {
registry.addRecipeCategories(new ExtractorRecipeCategory(guiHelper));
registry.addRecipeHandlers(new ExtractorRecipeHandler(jeiHelpers));
}

View file

@ -62,7 +62,7 @@ public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReac
progressright.draw(minecraft, 25, 12);
progressleft.draw(minecraft, 75, 12);
int y = 30 ;
int y = 30;
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
minecraft.fontRendererObj.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRendererObj.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2), y, 0x444444);

View file

@ -86,7 +86,7 @@ public class FluidGeneratorRecipeCategory extends BlankRecipeCategory<FluidGener
@Override
public void setRecipe(IRecipeLayout recipeLayout, FluidGeneratorRecipeWrapper recipeWrapper,
IIngredients ingredients) {
IIngredients ingredients) {
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 8, 12, 47, 10000, true, tankOverlay);

View file

@ -24,18 +24,20 @@
package techreborn.compat.jei.generators.fluid;
import javax.annotation.Nonnull;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.generator.FluidGeneratorRecipe;
import javax.annotation.Nonnull;
public class FluidGeneratorRecipeHandler implements IRecipeHandler<FluidGeneratorRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public FluidGeneratorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
public FluidGeneratorRecipeHandler(
@Nonnull
IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}

View file

@ -24,13 +24,6 @@
package techreborn.compat.jei.generators.fluid;
import javax.annotation.Nonnull;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawable;
@ -41,6 +34,12 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import techreborn.api.generator.FluidGeneratorRecipe;
import javax.annotation.Nonnull;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;
public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
private static final DecimalFormat formatter;
@ -58,13 +57,17 @@ public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
private final FluidGeneratorRecipe baseRecipe;
private final IDrawable energyProduced;
public FluidGeneratorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull FluidGeneratorRecipe recipe) {
public FluidGeneratorRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
FluidGeneratorRecipe recipe) {
this.baseRecipe = recipe;
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
energyProduced = guiHelper.createDrawable(FluidGeneratorRecipeCategory.texture, 176, 3,
(int) (25 * ((recipe.getEnergyPerMb() * 1000.0) / FLUID_GENERATOR_STORAGE)), 14);
(int) (25 * ((recipe.getEnergyPerMb() * 1000.0) / FLUID_GENERATOR_STORAGE)), 14);
}
@Override
@ -74,7 +77,7 @@ public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
energyProduced.draw(minecraft, 73, 26);
minecraft.fontRendererObj.drawString(formatter.format(baseRecipe.getEnergyPerMb() * 1000) + " FE", 70, 13,
0x444444);
0x444444);
}
@Override

View file

@ -50,6 +50,7 @@ public class GrinderRecipeCategory extends BlankRecipeCategory<GrinderRecipeWrap
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
title = I18n.translateToLocal("tile.techreborn.grinder.name");
}
@Override
public String getModName() {
return ModInfo.MOD_NAME;

View file

@ -44,15 +44,14 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
private final String title;
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_sawmill.png");
"textures/gui/industrial_sawmill.png");
private final IDrawable background;
private final IDrawable tankOverlay;
private static final int[] INPUT_SLOTS = { 0, 1 };
private static final int[] OUTPUT_SLOTS = { 2, 3, 4 };
private static final int[] INPUT_TANKS = { 0 };
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper){
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) {
title = Translator.translateToLocal("tile.techreborn.industrialsawmill.name");
background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);
@ -62,25 +61,25 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
public String getModName() {
return ModInfo.MOD_NAME;
}
@Nonnull
@Override
public String getUid() {
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
}
@Nonnull
@Override
public String getTitle() {
return title;
}
@Nonnull
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IndustrialSawmillRecipeWrapper recipeWrapper, IIngredients ingredients) {
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
@ -90,11 +89,11 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 19);
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 19);
guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19);
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay);
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
}
}

View file

@ -24,23 +24,24 @@
package techreborn.compat.jei.industrialSawmill;
import javax.annotation.Nonnull;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.Core;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class IndustrialSawmillRecipeHandler implements IRecipeHandler<IndustrialSawmillRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public IndustrialSawmillRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
public IndustrialSawmillRecipeHandler(
@Nonnull
IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Nonnull
@Override
public Class<IndustrialSawmillRecipe> getRecipeClass() {
@ -51,7 +52,7 @@ public class IndustrialSawmillRecipeHandler implements IRecipeHandler<Industrial
@Override
public String getRecipeCategoryUid(
@Nonnull
IndustrialSawmillRecipe recipe) {
IndustrialSawmillRecipe recipe) {
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
}
@ -59,14 +60,14 @@ public class IndustrialSawmillRecipeHandler implements IRecipeHandler<Industrial
@Override
public IRecipeWrapper getRecipeWrapper(
@Nonnull
IndustrialSawmillRecipe recipe) {
IndustrialSawmillRecipe recipe) {
return new IndustrialSawmillRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(
@Nonnull
IndustrialSawmillRecipe recipe) {
IndustrialSawmillRecipe recipe) {
return true;
}
}

View file

@ -24,11 +24,6 @@
package techreborn.compat.jei.industrialSawmill;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
@ -40,16 +35,18 @@ import net.minecraftforge.fluids.FluidStack;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
/**
* @author drcrazy
*
*/
public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper <IndustrialSawmillRecipe>{
public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper<IndustrialSawmillRecipe> {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_sawmill.png");
"textures/gui/industrial_sawmill.png");
private final IDrawableAnimated progress;
public IndustrialSawmillRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@ -80,23 +77,20 @@ public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper <Industria
return Collections.emptyList();
}
}
@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
progress.draw(minecraft, 48, 23);
if (minecraft.fontRendererObj != null) {
int x = 70;
int y = 40;
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
minecraft.fontRendererObj.drawString("FE: " + baseRecipe.euPerTick + " FE/t", x, y += lineHeight, 0x444444);
}
}
}

View file

@ -61,7 +61,7 @@ public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements I
} else if (baseRecipe instanceof ShapedOreRecipe) {
recipeWrapper = new ShapedOreRecipeWrapper(jeiHelpers, (ShapedOreRecipe) baseRecipe);
} else if (baseRecipe instanceof ShapelessOreRecipe) {
recipeWrapper = new ShapelessRecipeWrapper(jeiHelpers, baseRecipe);
recipeWrapper = new ShapelessRecipeWrapper(jeiHelpers, baseRecipe);
} else {
return null;
}