diff --git a/README.md b/README.md index 7c95952..e45ddff 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ DoubleDoorDevelopment Core Download from our [website](http://doubledoordev.net/) or our [jenkins server](https://jenkins.dries007.net/view/D3_mods/) -Big thanks to @mallrat208 for updating to 1.9 / 1.10 +Big thanks to @mallrat208 for updating to 1.9 / 1.10 / 1.11.2 Materials --------- diff --git a/src/main/java/net/doubledoordev/d3core/util/CoreConstants.java b/src/main/java/net/doubledoordev/d3core/util/CoreConstants.java index 1d23345..443f624 100644 --- a/src/main/java/net/doubledoordev/d3core/util/CoreConstants.java +++ b/src/main/java/net/doubledoordev/d3core/util/CoreConstants.java @@ -50,7 +50,7 @@ public class CoreConstants { public static final String MODID = "d3core"; - public static final String NAME = "D³ Core"; + public static final String NAME = "D³Core"; public static final String BASE_URL = "http://doubledoordev.net/"; public static final String PERKS_URL = BASE_URL + "perks.json"; public static final String UPDATE_URL = BASE_URL + MODID + ".json"; diff --git a/src/main/java/net/doubledoordev/d3core/util/Materials.java b/src/main/java/net/doubledoordev/d3core/util/Materials.java index 3b9c7b8..f3daa97 100644 --- a/src/main/java/net/doubledoordev/d3core/util/Materials.java +++ b/src/main/java/net/doubledoordev/d3core/util/Materials.java @@ -93,11 +93,17 @@ public static void load() throws IOException continue; } ItemStack stack = new ItemStack(item, stacksize, meta); + if (stack.isEmpty()) // Technically, the previous if should have failed, but I'm not taking chances here. + { + D3Core.getLogger().error("Entry in materials.json {} invalid. Item {}:{} does not exist.", entry, mod, name); + stop = true; + continue; + } itemStackMap.put(entry.getKey().toLowerCase(), stack); } if (stop) { - D3Core.getLogger().error("The proper format for materials.json entries is (in regex): {}", CoreConstants.PATTERN_ITEMSTACK.pattern()); + D3Core.getLogger().fatal("The proper format for materials.json entries is (in regex): {}", CoreConstants.PATTERN_ITEMSTACK.pattern()); RuntimeException e = new RuntimeException("You have invalid entries in your materials.json file. Check the log for more info."); e.setStackTrace(new StackTraceElement[0]); // No need for this throw e; @@ -106,8 +112,22 @@ public static void load() throws IOException for (ToolMaterial material : ToolMaterial.values()) { ItemStack stack = itemStackMap.get(material.name().toLowerCase()); - if (stack == ItemStack.EMPTY || material.getRepairItemStack() != ItemStack.EMPTY) continue; + if (stack == null) continue; // null if no entry in map + + if (!material.getRepairItemStack().isEmpty()) // No longer allowed by Forge. + { + D3Core.getLogger().fatal("Material {} already has {} as repair material. You cannot override it.", material.name(), material.getRepairItemStack()); + stop = true; + continue; + } material.setRepairItem(stack); } + if (stop) + { + D3Core.getLogger().fatal("You tried to set the repair stack of a ToolMaterial that already has one. This is not allowed by Forge."); + RuntimeException e = new RuntimeException("You tried to set the repair stack of a ToolMaterial that already has one. This is not allowed by Forge. Check the log for more info."); + e.setStackTrace(new StackTraceElement[0]); // No need for this + throw e; + } } } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 1602cfa..6390edc 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,7 +1,7 @@ { "modListVersion": 2, "modList": [{ - "modid": "D3Core", + "modid": "d3core", "name": "D³Core", "description": "${description}", "version": "${version}",