More null annotations

This commit is contained in:
mezz committed 2017-02-07 00:05:24 -08:00
1 parent da8a833485
commit a5daa93bf1
163 files changed
+952 -849

No files matched your search

@@ -1,8 +1,6 @@
package binnie.extrabees.gui;
import binnie.core.AbstractMod;
import binnie.core.machines.Machine;
import binnie.core.machines.TileEntityMachine;
import binnie.craftgui.minecraft.Window;
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.craftgui.minecraft.control.ControlSlot;
@@ -11,17 +9,17 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
import javax.annotation.Nullable;
public class WindowAlvearyFrame extends Window {
Machine machine;
ControlPlayerInventory playerInventory;
public WindowAlvearyFrame(final EntityPlayer player, final IInventory inventory, final Side side) {
super(176, 144, player, inventory, side);
this.machine = ((TileEntityMachine) inventory).getMachine();
}
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
if (player == null || inventory == null) {
@Nullable
public static Window create(final EntityPlayer player, @Nullable final IInventory inventory, final Side side) {
if (inventory == null) {
return null;
}
return new WindowAlvearyFrame(player, inventory, side);
@@ -30,9 +28,8 @@ public class WindowAlvearyFrame extends Window {
@Override
public void initialiseClient() {
this.setTitle("Frame Housing");
this.playerInventory = new ControlPlayerInventory(this);
final ControlSlot slot = new ControlSlot(this, 79, 30);
slot.assign(0);
ControlPlayerInventory playerInventory = new ControlPlayerInventory(this);
new ControlSlot.Builder(this, 79, 30).assign(0);
}
@Override
@@ -12,17 +12,16 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
public class WindowAlvearyHatchery extends Window {
Machine machine;
ControlPlayerInventory playerInventory;
import javax.annotation.Nullable;
public class WindowAlvearyHatchery extends Window {
public WindowAlvearyHatchery(final EntityPlayer player, final IInventory inventory, final Side side) {
super(176, 144, player, inventory, side);
this.machine = ((TileEntityMachine) inventory).getMachine();
}
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
if (player == null || inventory == null) {
@Nullable
public static Window create(final EntityPlayer player, @Nullable final IInventory inventory, final Side side) {
if (inventory == null) {
return null;
}
return new WindowAlvearyHatchery(player, inventory, side);
@@ -31,8 +30,8 @@ public class WindowAlvearyHatchery extends Window {
@Override
public void initialiseClient() {
this.setTitle("Hatchery");
this.playerInventory = new ControlPlayerInventory(this);
final ControlSlotArray slot = new ControlSlotArray(this, 43, 30, 5, 1);
ControlPlayerInventory playerInventory = new ControlPlayerInventory(this);
final ControlSlotArray.Builder slot = new ControlSlotArray.Builder(this, 43, 30, 5, 1);
slot.create(AlvearyHatchery.slotLarvae);
}
@@ -12,27 +12,19 @@ import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
public class WindowAlvearyIndustrialFrame extends Window {
Machine machine;
ControlPlayerInventory playerInventory;
public WindowAlvearyIndustrialFrame(final EntityPlayer player, final IInventory inventory, final Side side) {
super(176, 144, player, inventory, side);
this.machine = ((TileEntityMachine) inventory).getMachine();
}
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
if (player == null || inventory == null) {
return null;
}
return new WindowAlvearyIndustrialFrame(player, inventory, side);
}
@Override
public void initialiseClient() {
this.setTitle("Industrial Frame Housing");
this.playerInventory = new ControlPlayerInventory(this);
final ControlSlot slot = new ControlSlot(this, 79, 30);
slot.assign(0);
ControlPlayerInventory playerInventory = new ControlPlayerInventory(this);
new ControlSlot.Builder(this, 79, 30).assign(0);
}
@Override
@@ -17,17 +17,16 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
public class WindowAlvearyMutator extends Window {
Machine machine;
ControlPlayerInventory playerInventory;
import javax.annotation.Nullable;
public class WindowAlvearyMutator extends Window {
public WindowAlvearyMutator(final EntityPlayer player, final IInventory inventory, final Side side) {
super(176, 176, player, inventory, side);
this.machine = ((TileEntityMachine) inventory).getMachine();
}
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
if (player == null || inventory == null) {
@Nullable
public static Window create(final EntityPlayer player, @Nullable final IInventory inventory, final Side side) {
if (inventory == null) {
return null;
}
return new WindowAlvearyMutator(player, inventory, side);
@@ -36,9 +35,8 @@ public class WindowAlvearyMutator extends Window {
@Override
public void initialiseClient() {
this.setTitle("Mutator");
this.playerInventory = new ControlPlayerInventory(this);
final ControlSlot slot = new ControlSlot(this, 79, 30);
slot.assign(0);
new ControlPlayerInventory(this);
new ControlSlot.Builder(this, 79, 30).assign(0);
new ControlText(this, new IArea(0, 52, this.w(), 16), "Possible Mutagens:", TextJustification.MiddleCenter).setColour(5592405);
final int size = AlvearyMutator.getMutagens().size();
final int w = size * 18;
@@ -14,17 +14,16 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
public class WindowAlvearyStimulator extends Window {
Machine machine;
ControlPlayerInventory playerInventory;
import javax.annotation.Nullable;
public class WindowAlvearyStimulator extends Window {
public WindowAlvearyStimulator(final EntityPlayer player, final IInventory inventory, final Side side) {
super(176, 144, player, inventory, side);
this.machine = ((TileEntityMachine) inventory).getMachine();
}
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
if (player == null || inventory == null) {
@Nullable
public static Window create(final EntityPlayer player, @Nullable final IInventory inventory, final Side side) {
if (inventory == null) {
return null;
}
return new WindowAlvearyStimulator(player, inventory, side);
@@ -34,9 +33,8 @@ public class WindowAlvearyStimulator extends Window {
public void initialiseClient() {
this.setTitle("Stimulator");
new ControlEnergyBar(this, 75, 29, 60, 16, Position.Left);
final ControlSlot slot = new ControlSlot(this, 41, 28);
slot.assign(AlvearyStimulator.slotCircuit);
this.playerInventory = new ControlPlayerInventory(this);
new ControlSlot.Builder(this, 41, 28).assign(AlvearyStimulator.slotCircuit);
new ControlPlayerInventory(this);
}
@Override