mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 20:52:22 +00:00
Fix more null warnings
This commit is contained in:
1 parent
ca1b4b03b1
commit
b2963069fc
6 files changed
+22
-19
No files matched your search
@@ -46,16 +46,14 @@ public class MachineGroup {
|
||||
}
|
||||
Binnie.Machine.registerMachineGroup(this);
|
||||
this.block = new BlockMachine(this, blockName);
|
||||
if (this.block != null) {
|
||||
GameRegistry.register(this.block);
|
||||
Item i = GameRegistry.register(new ItemMachine(this.block));
|
||||
for (int j = 0; j < types.length; j++) {
|
||||
BinnieCore.proxy.registermodel(i, j, new ModelResourceLocation(i.getRegistryName(), "machine_type=" + j));
|
||||
}
|
||||
GameRegistry.register(this.block);
|
||||
Item i = GameRegistry.register(new ItemMachine(this.block));
|
||||
for (int j = 0; j < types.length; j++) {
|
||||
BinnieCore.proxy.registermodel(i, j, new ModelResourceLocation(i.getRegistryName(), "machine_type=" + j));
|
||||
}
|
||||
|
||||
for (final MachinePackage pack2 : this.getPackages()) {
|
||||
pack2.register();
|
||||
}
|
||||
for (final MachinePackage pack2 : this.getPackages()) {
|
||||
pack2.register();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,10 @@ public class MachineUtil {
|
||||
return this.getTank(tank).drain(amount, true);
|
||||
}
|
||||
|
||||
public boolean liquidInTank(final int tank, final int amount) {
|
||||
return this.getTank(tank).drain(amount, false) != null && this.getTank(tank).drain(amount, false).amount == amount;
|
||||
public boolean liquidInTank(final int tankIndex, final int amount) {
|
||||
IFluidTank tank = this.getTank(tankIndex);
|
||||
FluidStack drain = tank.drain(amount, false);
|
||||
return drain != null && drain.amount == amount;
|
||||
}
|
||||
|
||||
public void damageItem(final int slot, final int damage) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.craftgui.minecraft;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
// TODO: remove this, it's very questionable
|
||||
class ListMap<T> implements List<T> {
|
||||
private LinkedHashMap<Integer, T> map;
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ public class Lumbermill {
|
||||
if (recipe.recipeItems.size() != 1) {
|
||||
continue;
|
||||
}
|
||||
if (!(recipe.recipeItems.get(0) instanceof ItemStack)) {
|
||||
if (!(recipe.recipeItems.get(0) != null)) {
|
||||
continue;
|
||||
}
|
||||
final ItemStack input = (ItemStack) recipe.recipeItems.get(0);
|
||||
final ItemStack input = recipe.recipeItems.get(0);
|
||||
if (recipe.getRecipeOutput() != null && recipe.getRecipeOutput().isItemEqual(output)) {
|
||||
list.add(input);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Incubator {
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(Binnie.Liquid.getLiquidStack("water", 25), GeneticLiquid.GrowthMedium.get(25), 0.2f) {
|
||||
@Override
|
||||
public boolean isItemStack(final ItemStack stack) {
|
||||
return GeneticsItems.GrowthMedium.get(1).isItemEqual(stack);
|
||||
return ItemStack.areItemsEqual(GeneticsItems.GrowthMedium.get(1), stack);
|
||||
}
|
||||
});
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(GeneticLiquid.GrowthMedium.get(25), GeneticLiquid.Bacteria.get(5), 0.2f) {
|
||||
@@ -54,7 +54,7 @@ public class Incubator {
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(GeneticLiquid.Bacteria.get(0), GeneticLiquid.Bacteria.get(5), 0.05f) {
|
||||
@Override
|
||||
public boolean isItemStack(final ItemStack stack) {
|
||||
return GeneticsItems.GrowthMedium.get(1).isItemEqual(stack);
|
||||
return ItemStack.areItemsEqual(GeneticsItems.GrowthMedium.get(1), stack);
|
||||
}
|
||||
});
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(GeneticLiquid.Bacteria.get(2), null, 0.5f, 0.2f) {
|
||||
@@ -66,13 +66,13 @@ public class Incubator {
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(GeneticLiquid.BacteriaPoly.get(0), GeneticLiquid.BacteriaPoly.get(5), 0.05f) {
|
||||
@Override
|
||||
public boolean isItemStack(final ItemStack stack) {
|
||||
return GeneticsItems.GrowthMedium.get(1).isItemEqual(stack);
|
||||
return ItemStack.areItemsEqual(GeneticsItems.GrowthMedium.get(1), stack);
|
||||
}
|
||||
});
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(GeneticLiquid.BacteriaVector.get(0), GeneticLiquid.BacteriaVector.get(5), 0.05f) {
|
||||
@Override
|
||||
public boolean isItemStack(final ItemStack stack) {
|
||||
return GeneticsItems.GrowthMedium.get(1).isItemEqual(stack);
|
||||
return ItemStack.areItemsEqual(GeneticsItems.GrowthMedium.get(1), stack);
|
||||
}
|
||||
});
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(GeneticLiquid.Bacteria.get(10), GeneticLiquid.BacteriaPoly.get(10), 0.1f) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.genetics.machine;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -17,8 +18,9 @@ public class MachineRendererLab {
|
||||
private ModelMachine model;
|
||||
|
||||
public MachineRendererLab() {
|
||||
this.dummyEntityItem = new EntityItem((World) null);
|
||||
this.itemSides = new EntityItem[]{new EntityItem((World) null), new EntityItem((World) null), new EntityItem((World) null), new EntityItem((World) null)};
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
this.dummyEntityItem = new EntityItem(world);
|
||||
this.itemSides = new EntityItem[]{new EntityItem(world), new EntityItem(world), new EntityItem(world), new EntityItem(world)};
|
||||
this.model = new ModelMachine();
|
||||
// (this.customRenderItem = new RenderItem() {
|
||||
// @Override
|
||||
|
||||
Reference in new issue
Block a user