Refactor and import cleanup (Excluding network PR changed files)
This commit is contained in:
parent
a36a0e6f4a
commit
c4ef977f16
165 changed files with 1572 additions and 1625 deletions
|
@ -27,16 +27,16 @@ package techreborn.api.generator;
|
|||
import javax.annotation.Nonnull;
|
||||
|
||||
public enum EFluidGenerator {
|
||||
THERMAL("TechReborn.ThermalGenerator"),
|
||||
GAS("TechReborn.GasGenerator"),
|
||||
DIESEL("TechReborn.DieselGenerator"),
|
||||
THERMAL("TechReborn.ThermalGenerator"),
|
||||
GAS("TechReborn.GasGenerator"),
|
||||
DIESEL("TechReborn.DieselGenerator"),
|
||||
SEMIFLUID("TechReborn.SemifluidGenerator"),
|
||||
PLASMA("TechReborn.PlasmaGenerator");
|
||||
|
||||
@Nonnull
|
||||
private final String recipeID;
|
||||
|
||||
private EFluidGenerator(@Nonnull String recipeID) {
|
||||
EFluidGenerator(@Nonnull String recipeID) {
|
||||
this.recipeID = recipeID;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class FluidGeneratorRecipe {
|
|||
@Override
|
||||
public String toString() {
|
||||
return "FluidGeneratorRecipe [generatorType=" + generatorType + ", fluid=" + fluid + ", energyPerMb="
|
||||
+ energyPerMb + "]";
|
||||
+ energyPerMb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -83,8 +83,6 @@ public class FluidGeneratorRecipe {
|
|||
return false;
|
||||
} else if (!FluidUtils.fluidEquals(other.fluid, fluid))
|
||||
return false;
|
||||
if (generatorType != other.generatorType)
|
||||
return false;
|
||||
return true;
|
||||
return generatorType == other.generatorType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,10 +83,7 @@ public class FluidGeneratorRecipeList {
|
|||
return false;
|
||||
FluidGeneratorRecipeList other = (FluidGeneratorRecipeList) obj;
|
||||
if (recipes == null) {
|
||||
if (other.recipes != null)
|
||||
return false;
|
||||
} else if (!recipes.equals(other.recipes))
|
||||
return false;
|
||||
return true;
|
||||
return other.recipes == null;
|
||||
} else return recipes.equals(other.recipes);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.api.generator;
|
||||
|
||||
|
||||
|
||||
import net.minecraft.fluid.Fluid;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
@ -39,17 +38,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.
|
||||
* 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());
|
||||
|
@ -58,19 +57,19 @@ public class GeneratorRecipeHelper {
|
|||
|
||||
/**
|
||||
* @param generatorType A value of the EFluidGenerator type in which the fluid is
|
||||
* allowed to be consumed.
|
||||
* allowed to be consumed.
|
||||
* @return An object holding a set of availables recipes for this type of
|
||||
* FluidGenerator.
|
||||
*/
|
||||
public static FluidGeneratorRecipeList getFluidRecipesForGenerator(EFluidGenerator generatorType) {
|
||||
return fluidRecipes.get(generatorType);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes recipe
|
||||
*
|
||||
* Removes recipe
|
||||
*
|
||||
* @param generatorType A value of the EFluidGenerator type for which we should remove recipe
|
||||
* @param fluidType Fluid to remove from generator recipes
|
||||
* @param fluidType Fluid to remove from generator recipes
|
||||
*/
|
||||
public static void removeFluidRecipe(EFluidGenerator generatorType, Fluid fluidType) {
|
||||
FluidGeneratorRecipeList recipeList = getFluidRecipesForGenerator(generatorType);
|
||||
|
|
|
@ -34,14 +34,13 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class ScrapboxRecipeCrafter extends RecipeCrafter {
|
||||
|
||||
/**
|
||||
* @param parent Tile having this crafter
|
||||
* @param inventory Inventory from parent blockEntity
|
||||
* @param inputSlots Slot IDs for input
|
||||
* @param parent Tile having this crafter
|
||||
* @param inventory Inventory from parent blockEntity
|
||||
* @param inputSlots Slot IDs for input
|
||||
* @param outputSlots Slot IDs for output
|
||||
*/
|
||||
public ScrapboxRecipeCrafter(BlockEntity parent, RebornInventory<?> inventory, int[] inputSlots, int[] outputSlots) {
|
||||
|
@ -49,9 +48,9 @@ public class ScrapboxRecipeCrafter extends RecipeCrafter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateCurrentRecipe(){
|
||||
public void updateCurrentRecipe() {
|
||||
List<RebornRecipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(blockEntity.getWorld());
|
||||
if(scrapboxRecipeList.isEmpty()){
|
||||
if (scrapboxRecipeList.isEmpty()) {
|
||||
setCurrentRecipe(null);
|
||||
return;
|
||||
}
|
||||
|
@ -62,4 +61,4 @@ public class ScrapboxRecipeCrafter extends RecipeCrafter {
|
|||
this.currentTickTime = 0;
|
||||
setIsActive();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class BlastFurnaceRecipe extends RebornRecipe {
|
|||
super(type, name, ingredients, outputs, power, time);
|
||||
this.heat = heat;
|
||||
}
|
||||
|
||||
|
||||
public int getHeat() {
|
||||
return heat;
|
||||
}
|
||||
|
|
|
@ -37,10 +37,9 @@ import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntit
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class FusionReactorRecipe extends RebornRecipe {
|
||||
|
||||
|
||||
private int startE;
|
||||
private int minSize;
|
||||
|
||||
|
@ -53,11 +52,11 @@ public class FusionReactorRecipe extends RebornRecipe {
|
|||
this.startE = startE;
|
||||
this.minSize = minSize;
|
||||
}
|
||||
|
||||
public int getStartEnergy () {
|
||||
|
||||
public int getStartEnergy() {
|
||||
return startE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deserialize(JsonObject jsonObject) {
|
||||
super.deserialize(jsonObject);
|
||||
|
@ -71,7 +70,7 @@ public class FusionReactorRecipe extends RebornRecipe {
|
|||
jsonObject.addProperty("start-power", startE);
|
||||
jsonObject.addProperty("min-size", minSize);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canCraft(final BlockEntity blockEntity) {
|
||||
if (blockEntity instanceof FusionControlComputerBlockEntity) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class RollingMachineRecipe extends RebornRecipe {
|
|||
|
||||
@Override
|
||||
public void deserialize(JsonObject jsonObject) {
|
||||
if(jsonObject.has("shaped")) {
|
||||
if (jsonObject.has("shaped")) {
|
||||
JsonObject json = JsonHelper.getObject(jsonObject, "shaped");
|
||||
shapedRecipe = RecipeSerializer.SHAPED.read(getId(), json);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue