mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 04:52:26 +00:00
Begin code cleanup for generics, types, warnings, nulls, and spelling
This commit is contained in:
1 parent
c9b2f7bd3e
commit
406392e7f7
98 files changed
+472
-314
No files matched your search
@@ -2,7 +2,6 @@ package forestry.factory.recipes.jei;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package forestry.factory.recipes.jei.bottler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,17 +16,20 @@ public class BottlerRecipeWrapper extends ForestryRecipeWrapper<BottlerRecipe> {
|
||||
public BottlerRecipeWrapper(BottlerRecipe recipe) {
|
||||
super(recipe);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return Collections.singletonList(getRecipe().input);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs() {
|
||||
return Collections.singletonList(getRecipe().empty);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List getOutputs() {
|
||||
return Collections.singletonList(getRecipe().filled);
|
||||
|
||||
@@ -17,7 +17,8 @@ public class FabricatorRecipeWrapper extends ForestryRecipeWrapper<IFabricatorRe
|
||||
public FabricatorRecipeWrapper(@Nonnull IFabricatorRecipe recipe) {
|
||||
super(recipe);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List getInputs() {
|
||||
List<Object> inputs = new ArrayList<>();
|
||||
|
||||
@@ -24,7 +24,8 @@ public class FermenterRecipeWrapper extends ForestryRecipeWrapper<IFermenterReci
|
||||
super(recipe);
|
||||
this.fermentable = fermentable;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List getInputs() {
|
||||
List<ItemStack> inputs = new ArrayList<>();
|
||||
@@ -39,7 +40,8 @@ public class FermenterRecipeWrapper extends ForestryRecipeWrapper<IFermenterReci
|
||||
public ItemStack getFermentable() {
|
||||
return fermentable;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return Collections.singletonList(getRecipe().getFluidResource());
|
||||
|
||||
@@ -19,7 +19,8 @@ public class MoistenerRecipeWrapper extends ForestryRecipeWrapper<IMoistenerReci
|
||||
super(recipe);
|
||||
this.fuel = fuel;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs() {
|
||||
List<ItemStack> inputs = new ArrayList<>();
|
||||
@@ -29,6 +30,7 @@ public class MoistenerRecipeWrapper extends ForestryRecipeWrapper<IMoistenerReci
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
List<ItemStack> outputs = new ArrayList<>();
|
||||
|
||||
@@ -22,7 +22,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.CircuitSocketType;
|
||||
import forestry.api.circuits.ICircuitBoard;
|
||||
@@ -95,7 +97,7 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn
|
||||
|
||||
ItemStack chip = sockets.getStackInSlot(0);
|
||||
if (chip != null) {
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitboard(chip);
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitBoard(chip);
|
||||
if (chipset != null) {
|
||||
chipset.onLoad(this);
|
||||
}
|
||||
@@ -224,7 +226,7 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn
|
||||
// Dispose correctly of old chipsets
|
||||
if (sockets.getStackInSlot(slot) != null) {
|
||||
if (ChipsetManager.circuitRegistry.isChipset(sockets.getStackInSlot(slot))) {
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitboard(sockets.getStackInSlot(slot));
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitBoard(sockets.getStackInSlot(slot));
|
||||
if (chipset != null) {
|
||||
chipset.onRemoval(this);
|
||||
}
|
||||
@@ -236,7 +238,7 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn
|
||||
return;
|
||||
}
|
||||
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitboard(stack);
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitBoard(stack);
|
||||
if (chipset != null) {
|
||||
chipset.onInsertion(this);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
@@ -85,7 +86,7 @@ public class TileSqueezer extends TilePowered implements ISocketable, ISidedInve
|
||||
|
||||
ItemStack chip = sockets.getStackInSlot(0);
|
||||
if (chip != null) {
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitboard(chip);
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitBoard(chip);
|
||||
if (chipset != null) {
|
||||
chipset.onLoad(this);
|
||||
}
|
||||
@@ -261,7 +262,7 @@ public class TileSqueezer extends TilePowered implements ISocketable, ISidedInve
|
||||
// Dispose correctly of old chipsets
|
||||
if (sockets.getStackInSlot(slot) != null) {
|
||||
if (ChipsetManager.circuitRegistry.isChipset(sockets.getStackInSlot(slot))) {
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitboard(sockets.getStackInSlot(slot));
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitBoard(sockets.getStackInSlot(slot));
|
||||
if (chipset != null) {
|
||||
chipset.onRemoval(this);
|
||||
}
|
||||
@@ -273,7 +274,7 @@ public class TileSqueezer extends TilePowered implements ISocketable, ISidedInve
|
||||
return;
|
||||
}
|
||||
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitboard(stack);
|
||||
ICircuitBoard chipset = ChipsetManager.circuitRegistry.getCircuitBoard(stack);
|
||||
if (chipset != null) {
|
||||
chipset.onInsertion(this);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user