mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 11:59:11 +00:00
improve null checks for Mods.java
This commit is contained in:
1 parent
975309598a
commit
307374ca2b
4 files changed
+90
-55
No files matched your search
@@ -16,6 +16,7 @@ import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -40,7 +41,7 @@ public class AlvearyMutator {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public static void addMutationItem(final ItemStack item, final float chance) {
|
||||
public static void addMutationItem(@Nullable final ItemStack item, final float chance) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -143,7 +144,7 @@ public enum EnumHoneyComb implements IItemEnum {
|
||||
return ExtraBees.proxy.localise("item.comb." + this.name().toLowerCase());
|
||||
}
|
||||
|
||||
public boolean addProduct(final ItemStack item, final Float chance) {
|
||||
public boolean addProduct(@Nullable final ItemStack item, final Float chance) {
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -151,7 +152,7 @@ public enum EnumHoneyComb implements IItemEnum {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void tryAddProduct(final ItemStack item, final Float chance) {
|
||||
public void tryAddProduct(@Nullable final ItemStack item, final Float chance) {
|
||||
this.active = this.addProduct(item, chance);
|
||||
}
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ public class ItemHoneyComb extends ItemProduct implements IColoredItem {
|
||||
QUARTZ;
|
||||
|
||||
public ItemStack get() {
|
||||
return new ItemStack(Mods.Forestry.item("beeCombs"), 1, this.ordinal());
|
||||
return Mods.Forestry.stack("beeCombs", 1, this.ordinal());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user