mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-28 07:56:01 +00:00
More null annotations
This commit is contained in:
1 parent
16b955b443
commit
da8a833485
96 files changed
+573
-360
No files matched your search
@@ -21,11 +21,13 @@ import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
public class AnalystPageDatabase extends ControlAnalystPage {
|
||||
@Nullable
|
||||
ControlScrollableContent scroll;
|
||||
boolean isMaster;
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
ItemStack container = getContainer(soilStack2);
|
||||
if (container == null) {
|
||||
final ControlFluidDisplay display2 = new ControlFluidDisplay(this, biomeListX + dx, y + dy);
|
||||
display2.setItemStack(soilStack2);
|
||||
display2.setFluidStack(soilStack2);
|
||||
display2.setTooltip();
|
||||
} else {
|
||||
final ControlItemDisplay display3 = new ControlItemDisplay(this, biomeListX + dx, y + dy);
|
||||
|
||||
@@ -7,13 +7,14 @@ import binnie.craftgui.core.Tooltip;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ControlBiome extends Control implements ITooltip {
|
||||
Biome biome;
|
||||
String iconCategory;
|
||||
private final Biome biome;
|
||||
private String iconCategory;
|
||||
|
||||
public ControlBiome(final IWidget parent, final int x, final int y, final int w, final int h, final Biome biome) {
|
||||
super(parent, x, y, w, h);
|
||||
this.biome = null;
|
||||
this.iconCategory = "plains";
|
||||
this.biome = biome;
|
||||
}
|
||||
|
||||
@@ -16,12 +16,16 @@ import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.lepidopterology.EnumButterflyChromosome;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ControlChromosome extends Control implements IControlValue<IChromosomeType> {
|
||||
Texture BeeTexture;
|
||||
Texture TreeTexture;
|
||||
Texture MothTexture;
|
||||
Texture FlowerTexture;
|
||||
@Nullable
|
||||
IChromosomeType chromo;
|
||||
@Nullable
|
||||
ISpeciesRoot species;
|
||||
|
||||
public ControlChromosome(final IWidget parent, final int x, final int y) {
|
||||
@@ -34,11 +38,12 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
|
||||
this.species = null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ISpeciesRoot getRoot() {
|
||||
return this.species;
|
||||
}
|
||||
|
||||
public void setRoot(final ISpeciesRoot root) {
|
||||
public void setRoot(@Nullable final ISpeciesRoot root) {
|
||||
if (root != this.species) {
|
||||
this.species = root;
|
||||
this.deleteAllChildren();
|
||||
@@ -122,6 +127,7 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
|
||||
CraftGUI.render.texture(text, IPoint.ZERO);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Texture getTypeTexture() {
|
||||
if (this.species == Binnie.GENETICS.getBeeRoot()) {
|
||||
return this.BeeTexture;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Acclimatiser {
|
||||
private static Map<ItemStack, Float> humidityItems = new HashMap<>();
|
||||
|
||||
@Nullable
|
||||
private static ToleranceSystem getToleranceSystem(final ItemStack stack, final ItemStack acclim) {
|
||||
private static ToleranceSystem getToleranceSystem(@Nullable final ItemStack stack, final ItemStack acclim) {
|
||||
final ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(stack);
|
||||
if (root != null) {
|
||||
for (final ToleranceSystem system : Acclimatiser.toleranceSystems) {
|
||||
@@ -67,14 +67,14 @@ public class Acclimatiser {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public static void addTemperatureItem(final ItemStack itemstack, final float amount) {
|
||||
public static void addTemperatureItem(@Nullable final ItemStack itemstack, final float amount) {
|
||||
if (itemstack == null) {
|
||||
return;
|
||||
}
|
||||
Acclimatiser.temperatureItems.put(itemstack, amount);
|
||||
}
|
||||
|
||||
public static void addHumidityItem(final ItemStack itemstack, final float amount) {
|
||||
public static void addHumidityItem(@Nullable final ItemStack itemstack, final float amount) {
|
||||
if (itemstack == null) {
|
||||
return;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class Acclimatiser {
|
||||
addHumidityItem(FluidContainerType.CAPSULE.getFilled(FluidRegistry.WATER), 0.75f);
|
||||
}
|
||||
|
||||
public static boolean canAcclimatise(final ItemStack stack, final List<ItemStack> acclimatisers) {
|
||||
public static boolean canAcclimatise(@Nullable final ItemStack stack, final List<ItemStack> acclimatisers) {
|
||||
if (stack == null || acclimatisers.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class Acclimatiser {
|
||||
|
||||
public static Tolerance alterTolerance(final Tolerance tol, final float effect) {
|
||||
final int[] is = tol.getBounds();
|
||||
int[] range = new int[2];
|
||||
int[] range;
|
||||
if (effect < 0.0f) {
|
||||
range = new int[]{is[0] - 1, is[1]};
|
||||
} else {
|
||||
|
||||
@@ -48,21 +48,24 @@ public class AcclimatiserLogic extends ComponentProcessIndefinate {
|
||||
|
||||
protected void attemptAcclimatisation() {
|
||||
final List<ItemStack> acclms = new ArrayList<>();
|
||||
ItemStack target = this.getUtil().getStack(Acclimatiser.SLOT_TARGET);
|
||||
if (target == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (final ItemStack s : this.getUtil().getNonNullStacks(Acclimatiser.SLOT_ACCLIMATISER)) {
|
||||
if (Acclimatiser.canAcclimatise(this.getUtil().getStack(Acclimatiser.SLOT_TARGET), s)) {
|
||||
if (Acclimatiser.canAcclimatise(target, s)) {
|
||||
acclms.add(s);
|
||||
}
|
||||
}
|
||||
final ItemStack acc = acclms.get(this.getUtil().getRandom().nextInt(acclms.size()));
|
||||
final ItemStack acclimed = Acclimatiser.acclimatise(this.getUtil().getStack(Acclimatiser.SLOT_TARGET), acc);
|
||||
if (acclimed != null) {
|
||||
this.getUtil().setStack(Acclimatiser.SLOT_TARGET, acclimed);
|
||||
boolean removed = false;
|
||||
for (final int i : Acclimatiser.SLOT_ACCLIMATISER) {
|
||||
if (!removed && this.getUtil().getStack(i) != null && this.getUtil().getStack(i).isItemEqual(acc)) {
|
||||
this.getUtil().decreaseStack(i, 1);
|
||||
removed = true;
|
||||
}
|
||||
final ItemStack acclimed = Acclimatiser.acclimatise(target, acc);
|
||||
this.getUtil().setStack(Acclimatiser.SLOT_TARGET, acclimed);
|
||||
for (final int i : Acclimatiser.SLOT_ACCLIMATISER) {
|
||||
ItemStack stack = this.getUtil().getStack(i);
|
||||
if (stack != null && stack.isItemEqual(acc)) {
|
||||
this.getUtil().decreaseStack(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class Analyser {
|
||||
public static final int[] SLOT_RESERVE = new int[]{0, 1, 2, 3, 4, 5};
|
||||
public static final int SLOT_TARGET = 6;
|
||||
@@ -27,7 +29,7 @@ public class Analyser {
|
||||
return stack.getItem() instanceof IItemAnalysable && ((IItemAnalysable) stack.getItem()).isAnalysed(stack);
|
||||
}
|
||||
|
||||
public static ItemStack analyse(ItemStack stack) {
|
||||
public static ItemStack analyse(@Nullable ItemStack stack) {
|
||||
final ItemStack conv = Binnie.GENETICS.getConversionStack(stack);
|
||||
if (conv != null) {
|
||||
stack = conv;
|
||||
|
||||
@@ -5,8 +5,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public abstract class WindowMachine extends Window {
|
||||
public WindowMachine(final int width, final int height, final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public WindowMachine(final int width, final int height, final EntityPlayer player, @Nullable final IInventory inventory, final Side side) {
|
||||
super(width, height, player, inventory, side);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user