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

@ -28,12 +28,14 @@ import javax.annotation.Nonnull;
public enum EFluidGenerator {
THERMAL("TechReborn.ThermalGenerator"), GAS("TechReborn.GasGenerator"), DIESEL(
"TechReborn.DieselGenerator"), SEMIFLUID("TechReborn.SemifluidGenerator");
"TechReborn.DieselGenerator"), SEMIFLUID("TechReborn.SemifluidGenerator");
@Nonnull
private final String recipeID;
private EFluidGenerator(@Nonnull String recipeID) {
private EFluidGenerator(
@Nonnull
String recipeID) {
this.recipeID = recipeID;
}

View file

@ -30,9 +30,8 @@ public class FluidGeneratorRecipe {
private final EFluidGenerator generatorType;
private final Fluid fluid;
private final int energyPerMb;
public FluidGeneratorRecipe(Fluid fluid, int energyPerMb, EFluidGenerator generatorType)
{
public FluidGeneratorRecipe(Fluid fluid, int energyPerMb, EFluidGenerator generatorType) {
this.fluid = fluid;
this.energyPerMb = energyPerMb;
this.generatorType = generatorType;
@ -41,6 +40,7 @@ public class FluidGeneratorRecipe {
public Fluid getFluid() {
return fluid;
}
public int getEnergyPerMb() {
return energyPerMb;
}
@ -52,7 +52,7 @@ public class FluidGeneratorRecipe {
@Override
public String toString() {
return "FluidGeneratorRecipe [generatorType=" + generatorType + ", fluid=" + fluid + ", energyPerMb="
+ energyPerMb + "]";
+ energyPerMb + "]";
}
@Override

View file

@ -25,33 +25,29 @@
package techreborn.api.generator;
import com.google.common.collect.Sets;
import net.minecraftforge.fluids.Fluid;
import java.util.HashSet;
import java.util.Optional;
import net.minecraftforge.fluids.Fluid;
public class FluidGeneratorRecipeList {
private HashSet<FluidGeneratorRecipe> recipes;
public FluidGeneratorRecipeList(FluidGeneratorRecipe... recipes)
{
public FluidGeneratorRecipeList(FluidGeneratorRecipe... recipes) {
this.recipes = Sets.newHashSet(recipes);
}
public boolean addRecipe(FluidGeneratorRecipe fluidGeneratorRecipe) {
if(!this.getRecipeForFluid(fluidGeneratorRecipe.getFluid()).isPresent())
if (!this.getRecipeForFluid(fluidGeneratorRecipe.getFluid()).isPresent())
return this.getRecipes().add(fluidGeneratorRecipe);
return false;
}
public boolean removeRecipe(FluidGeneratorRecipe fluidGeneratorRecipe)
{
public boolean removeRecipe(FluidGeneratorRecipe fluidGeneratorRecipe) {
return this.getRecipes().remove(fluidGeneratorRecipe);
}
public Optional<FluidGeneratorRecipe> getRecipeForFluid(Fluid fluid)
{
public Optional<FluidGeneratorRecipe> getRecipeForFluid(Fluid fluid) {
return this.recipes.stream().filter(recipe -> recipe.getFluid().equals(fluid)).findAny();
}

View file

@ -24,10 +24,10 @@
package techreborn.api.generator;
import java.util.EnumMap;
import net.minecraftforge.fluids.Fluid;
import java.util.EnumMap;
public class GeneratorRecipeHelper {
/**
@ -36,19 +36,17 @@ public class GeneratorRecipeHelper {
* FluidGeneratorRecipe.
*/
public static EnumMap<EFluidGenerator, FluidGeneratorRecipeList> fluidRecipes = new EnumMap<>(
EFluidGenerator.class);
EFluidGenerator.class);
/**
* Register a Fluid energy recipe.
*
* @param generatorType
* A value of the EFluidGenerator type in which the fluid is
* allowed to be consumed.
*
* @param generatorType A value of the EFluidGenerator type in which the fluid is
* allowed to be consumed.
* @param fluidType
* @param energyPerMb
* Represent the energy / MILLI_BUCKET the fluid will produce.
* Some generators use this value to alter their fluid decay
* speed to match their maximum energy output.
* @param energyPerMb Represent the energy / MILLI_BUCKET the fluid will produce.
* Some generators use this value to alter their fluid decay
* speed to match their maximum energy output.
*/
public static void registerFluidRecipe(EFluidGenerator generatorType, Fluid fluidType, int energyPerMb) {
fluidRecipes.putIfAbsent(generatorType, new FluidGeneratorRecipeList());
@ -56,12 +54,10 @@ public class GeneratorRecipeHelper {
}
/**
*
* @param generatorType
* A value of the EFluidGenerator type in which the fluid is
* allowed to be consumed.
* @param generatorType A value of the EFluidGenerator type in which the fluid is
* allowed to be consumed.
* @return An object holding a set of availables recipes for this type of
* FluidGenerator.
* FluidGenerator.
*/
public static FluidGeneratorRecipeList getFluidRecipesForGenerator(EFluidGenerator generatorType) {
return fluidRecipes.get(generatorType);