Fixes crash when gem tools are disabled, closes #1008

This commit is contained in:
modmuss50 2017-03-15 10:08:58 +00:00
parent 5231e1d93b
commit 332fe1be48
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
2 changed files with 77 additions and 38 deletions

View file

@ -34,6 +34,7 @@ import techreborn.blocks.BlockOre;
import techreborn.blocks.BlockOre2;
import techreborn.blocks.BlockStorage;
import techreborn.blocks.BlockStorage2;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.items.*;
@ -79,6 +80,7 @@ public class RegisterItemJsons {
register(ModItems.LAPOTRONIC_ORB_PACK, "tool/lapotronic_orbpack");
register(ModItems.LITHIUM_BATTERY_PACK, "tool/lithium_batpack");
if (ConfigTechReborn.enableGemArmorAndTools) {
registerBlockstateMultiItem(ModItems.RUBY_HELMET, "ruby_helmet", "items/tool/armour");
registerBlockstateMultiItem(ModItems.RUBY_CHESTPLATE, "ruby_chestplate", "items/tool/armour");
registerBlockstateMultiItem(ModItems.RUBY_LEGGINGS, "ruby_leggings", "items/tool/armour");
@ -116,6 +118,7 @@ public class RegisterItemJsons {
registerBlockstateMultiItem(ModItems.BRONZE_AXE, "bronze_axe", "items/tool/tool");
registerBlockstateMultiItem(ModItems.BRONZE_SPADE, "bronze_spade", "items/tool/tool");
registerBlockstateMultiItem(ModItems.BRONZE_HOE, "bronze_hoe", "items/tool/tool");
}
for (int i = 0; i < ItemIngots.types.length; ++i) {
String[] name = ItemIngots.types.clone();

View file

@ -32,7 +32,6 @@ import net.minecraftforge.oredict.OreDictionary;
import reborncore.api.power.IEnergyInterfaceItem;
import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.BucketHandler;
import techreborn.Core;
import techreborn.api.Reference;
@ -45,6 +44,8 @@ import techreborn.items.armor.ItemTRArmour;
import techreborn.items.battery.*;
import techreborn.items.tools.*;
import javax.annotation.Nullable;
public class ModItems {
public static final String META_PLACEHOLDER = "PLACEHOLDER_ITEM";
@ -82,41 +83,76 @@ public class ModItems {
public static Item ENERGY_CRYSTAL;
public static Item SCRAP_BOX;
public static Item FREQUENCY_TRANSMITTER;
public static Item BRONZE_SWORD;
public static @Nullable Item BRONZE_SWORD;
@Nullable
public static Item BRONZE_PICKAXE;
@Nullable
public static Item BRONZE_SPADE;
@Nullable
public static Item BRONZE_AXE;
@Nullable
public static Item BRONZE_HOE;
@Nullable
public static Item BRONZE_HELMET;
@Nullable
public static Item BRONZE_CHESTPLATE;
@Nullable
public static Item BRONZE_LEGGINGS;
@Nullable
public static Item BRONZE_BOOTS;
@Nullable
public static Item RUBY_SWORD;
@Nullable
public static Item RUBY_PICKAXE;
@Nullable
public static Item RUBY_SPADE;
@Nullable
public static Item RUBY_AXE;
@Nullable
public static Item RUBY_HOE;
@Nullable
public static Item RUBY_HELMET;
@Nullable
public static Item RUBY_CHESTPLATE;
@Nullable
public static Item RUBY_LEGGINGS;
@Nullable
public static Item RUBY_BOOTS;
@Nullable
public static Item SAPPHIRE_SWORD;
@Nullable
public static Item SAPPHIRE_PICKAXE;
@Nullable
public static Item SAPPHIRE_SPADE;
@Nullable
public static Item SAPPHIRE_AXE;
@Nullable
public static Item SAPPHIRE_HOE;
@Nullable
public static Item SAPPHIRE_HELMET;
@Nullable
public static Item SAPPHIRE_CHSTPLATE;
@Nullable
public static Item SAPPHIRE_LEGGINGS;
@Nullable
public static Item SAPPHIRE_BOOTS;
@Nullable
public static Item PERIDOT_SWORD;
@Nullable
public static Item PERIDOT_PICKAXE;
@Nullable
public static Item PERIDOT_SAPPHIRE;
@Nullable
public static Item PERIDOT_AXE;
@Nullable
public static Item PERIDOT_HOE;
@Nullable
public static Item PERIDOT_HELMET;
@Nullable
public static Item PERIDOT_CHESTPLATE;
@Nullable
public static Item PERIDOT_LEGGINGS;
@Nullable
public static Item PERIDOT_BOOTS;
public static Item UPGRADES;
public static Item MISSING_RECIPE_PLACEHOLDER;