diff --git a/src/main/java/techreborn/Core.java b/src/main/java/techreborn/Core.java index c2f8ed4f2..83a99bc9c 100644 --- a/src/main/java/techreborn/Core.java +++ b/src/main/java/techreborn/Core.java @@ -25,6 +25,7 @@ package techreborn; import net.minecraft.block.BlockDispenser; +import net.minecraft.item.Item; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; import net.minecraft.world.gen.structure.MapGenStructureIO; @@ -44,6 +45,7 @@ import net.minecraftforge.fml.common.registry.EntityRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.VillagerRegistry; import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.registries.IForgeRegistry; import reborncore.RebornCore; import reborncore.api.recipe.RecipeHandler; import reborncore.common.multiblock.MultiblockEventHandler; @@ -73,6 +75,7 @@ import techreborn.world.village.VillageComponentRubberPlantaion; import techreborn.world.village.VillagePlantaionHandler; import java.io.File; +import java.util.Arrays; @Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = ModInfo.MOD_DEPENDENCIES, acceptedMinecraftVersions = "[1.12,1.12.2]", certificateFingerprint = "8727a3141c8ec7f173b87aa78b9b9807867c4e6b", guiFactory = "techreborn.client.TechRebornGuiFactory") public class Core { @@ -126,6 +129,12 @@ public class Core { //Register ModRecipes ModRecipes.init(); } + + @SubscribeEvent + public void registerItems(RegistryEvent.Register event) { + IForgeRegistry itemRegistry = event.getRegistry(); + Arrays.stream(ModPlates.values()).forEach(modPlate -> itemRegistry.register(modPlate.item)); + } @Mod.EventHandler public void init(FMLInitializationEvent event) { diff --git a/src/main/java/techreborn/client/RegisterItemJsons.java b/src/main/java/techreborn/client/RegisterItemJsons.java index 0e9de2e7a..c358dcc9a 100644 --- a/src/main/java/techreborn/client/RegisterItemJsons.java +++ b/src/main/java/techreborn/client/RegisterItemJsons.java @@ -38,7 +38,9 @@ import techreborn.blocks.cable.EnumCableType; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; import techreborn.init.ModItems; +import techreborn.init.ModPlates; import techreborn.items.*; +import techreborn.lib.ModInfo; import java.util.Map; @@ -131,11 +133,20 @@ public class RegisterItemJsons { registerBlockstate(ModItems.GEMS, i, name[i], "items/materials/"); } - name = ItemPlates.types.clone(); +/* name = ItemPlates.types.clone(); for (int i = 0; i < ItemPlates.types.length; ++i) { registerBlockstate(ModItems.PLATES, i, name[i], "items/materials/"); - } + }*/ + + + for (ModPlates plate : ModPlates.values()){ + ResourceLocation platesJson = new ResourceLocation(ModInfo.MOD_ID, "items/materials/plates/" + plate.name.getPath()); + ModelLoader.setCustomModelResourceLocation(plate.item, 0, new ModelResourceLocation(platesJson, "inventory")); + + //registerBlockstateMultiItem(plate.item, plate.name.getPath(), "items/materials/plates"); + } + name = ItemNuggets.types.clone(); for (int i = 0; i < ItemNuggets.types.length; ++i) { registerBlockstate(ModItems.NUGGETS, i, name[i], "items/materials/"); diff --git a/src/main/java/techreborn/init/ModItems.java b/src/main/java/techreborn/init/ModItems.java index 34d83b48a..7e2ececd6 100644 --- a/src/main/java/techreborn/init/ModItems.java +++ b/src/main/java/techreborn/init/ModItems.java @@ -80,8 +80,8 @@ public class ModItems { public static Item ENERGY_CRYSTAL; public static Item SCRAP_BOX; public static Item FREQUENCY_TRANSMITTER; - public static @Nullable - Item BRONZE_SWORD; + @Nullable + public static Item BRONZE_SWORD; @Nullable public static Item BRONZE_PICKAXE; @Nullable @@ -165,8 +165,8 @@ public class ModItems { registerItem(DUSTS, "dust"); SMALL_DUSTS = new ItemDustsSmall(); registerItem(SMALL_DUSTS, "smallDust"); - PLATES = new ItemPlates(); - registerItem(PLATES, "plates"); +// PLATES = new ItemPlates(); +// registerItem(PLATES, "plates"); NUGGETS = new ItemNuggets(); registerItem(NUGGETS, "nuggets"); // purifiedCrushedOre = new ItemPurifiedCrushedOre(); diff --git a/src/main/java/techreborn/init/ModPlates.java b/src/main/java/techreborn/init/ModPlates.java new file mode 100644 index 000000000..7830cffbd --- /dev/null +++ b/src/main/java/techreborn/init/ModPlates.java @@ -0,0 +1,65 @@ +/* + * This file is part of TechReborn, licensed under the MIT License (MIT). + * + * Copyright (c) 2018 TechReborn + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package techreborn.init; + +import net.minecraft.util.ResourceLocation; +import techreborn.lib.ModInfo; +import techreborn.items.ItemPlates; + + +/** + * @author drcrazy + * + */ +public enum ModPlates { + ADVANCED_ALLOY_PLATE("plateAdvancedAlloy"), + ALUMINUM_PLATE("plateAluminum"), + BRASS_PLATE("plateBrass"), + BRONZE_PLATE("plateBronze"), + CARBON_PLATE("plateCarbon"), + COAL_PLATE("plateCoal"), + COPPER_PLATE("plateCopper"), + DIAMOND_PLATE("plateDiamond"), + + IRON_PLATE("plateIron"), + GOLD_PLATE("plateGold"), + + WOOD_PLATE("plateWood"), + REDSTONE_PLATE("plateRedstone"), + + EMERALD_PLATE("plateEmerald"), + + OBSIDIAN_PLATE("plateObsidian"), + LAZURITE_PLATE("plateLazurite"); + + public ResourceLocation name; + public ItemPlates item; + + ModPlates(String name) { + this.name = new ResourceLocation(ModInfo.MOD_ID, name); + this.item = new ItemPlates(); + this.item.setRegistryName(this.name); + } +} diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 4abd2e00d..e863b49bc 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -108,59 +108,59 @@ public class ModRecipes { } private static void addCompressorRecipes() { - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(ItemIngots.getIngotByName("advanced_alloy"), - ItemPlates.getPlateByName("advanced_alloy"), 400, 20)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(ItemParts.getPartByName("carbon_mesh"), - ItemPlates.getPlateByName("carbon"), 400, 2)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("plankWood", 1), - OreUtil.getStackFromName("plateWood", 1), 300, 4)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustLazurite", 1), - ItemPlates.getPlateByName("lazurite", 1), 300, 4)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("obsidian", 1), - ItemPlates.getPlateByName("obsidian", 9), 300, 4)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustObsidian", 1), - ItemPlates.getPlateByName("obsidian", 1), 300, 4)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustYellowGarnet", 1), - ItemPlates.getPlateByName("YellowGarnet"), 300, 4)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("blockYellowGarnet", 1), - ItemPlates.getPlateByName("YellowGarnet", 9), 300, 4)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustRedGarnet", 1), - ItemPlates.getPlateByName("RedGarnet"), 300, 4)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("blockRedGarnet", 1), - ItemPlates.getPlateByName("RedGarnet", 9), 300, 4)); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("ingotRefinedIron", 1), - ItemPlates.getPlateByName("RefinedIron"), 300, 4)); - - ItemStack plate; - for (String ore : OreUtil.oreNames) { - if (ore.equals("iridium")) { - continue; - } - if (OreUtil.hasPlate(ore)) { - try { - plate = ItemPlates.getPlateByName(ore, 1); - } catch (InvalidParameterException e) { - plate = OreUtil.getStackFromName("plate" + OreUtil.capitalizeFirstLetter(ore), 1); - } - if (plate.isEmpty()) { - continue; - } - if (OreUtil.hasIngot(ore)) { - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe( - OreUtil.getStackFromName("ingot" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4)); - } - if (OreUtil.hasGem(ore) && OreUtil.hasDust(ore)) { - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe( - OreUtil.getStackFromName("dust" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4)); - } - if (OreUtil.hasBlock(ore)) { - ItemStack morePlates = plate.copy(); - morePlates.setCount(9); - RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe( - OreUtil.getStackFromName("block" + OreUtil.capitalizeFirstLetter(ore), 1), morePlates, 300, 4)); - } - } - } +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(ItemIngots.getIngotByName("advanced_alloy"), +// ItemPlates.getPlateByName("advanced_alloy"), 400, 20)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(ItemParts.getPartByName("carbon_mesh"), +// ItemPlates.getPlateByName("carbon"), 400, 2)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("plankWood", 1), +// OreUtil.getStackFromName("plateWood", 1), 300, 4)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustLazurite", 1), +// ItemPlates.getPlateByName("lazurite", 1), 300, 4)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("obsidian", 1), +// ItemPlates.getPlateByName("obsidian", 9), 300, 4)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustObsidian", 1), +// ItemPlates.getPlateByName("obsidian", 1), 300, 4)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustYellowGarnet", 1), +// ItemPlates.getPlateByName("YellowGarnet"), 300, 4)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("blockYellowGarnet", 1), +// ItemPlates.getPlateByName("YellowGarnet", 9), 300, 4)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("dustRedGarnet", 1), +// ItemPlates.getPlateByName("RedGarnet"), 300, 4)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("blockRedGarnet", 1), +// ItemPlates.getPlateByName("RedGarnet", 9), 300, 4)); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe(OreUtil.getStackFromName("ingotRefinedIron", 1), +// ItemPlates.getPlateByName("RefinedIron"), 300, 4)); +// +// ItemStack plate; +// for (String ore : OreUtil.oreNames) { +// if (ore.equals("iridium")) { +// continue; +// } +// if (OreUtil.hasPlate(ore)) { +// try { +// plate = ItemPlates.getPlateByName(ore, 1); +// } catch (InvalidParameterException e) { +// plate = OreUtil.getStackFromName("plate" + OreUtil.capitalizeFirstLetter(ore), 1); +// } +// if (plate.isEmpty()) { +// continue; +// } +// if (OreUtil.hasIngot(ore)) { +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe( +// OreUtil.getStackFromName("ingot" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4)); +// } +// if (OreUtil.hasGem(ore) && OreUtil.hasDust(ore)) { +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe( +// OreUtil.getStackFromName("dust" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4)); +// } +// if (OreUtil.hasBlock(ore)) { +// ItemStack morePlates = plate.copy(); +// morePlates.setCount(9); +// RecipeHandler.addRecipe(Reference.COMPRESSOR_RECIPE, new CompressorRecipe( +// OreUtil.getStackFromName("block" + OreUtil.capitalizeFirstLetter(ore), 1), morePlates, 300, 4)); +// } +// } +// } } static void addGrinderRecipes() { diff --git a/src/main/java/techreborn/init/OreDict.java b/src/main/java/techreborn/init/OreDict.java index 830ad0d98..e5f0dc9fe 100644 --- a/src/main/java/techreborn/init/OreDict.java +++ b/src/main/java/techreborn/init/OreDict.java @@ -90,8 +90,8 @@ public class OreDict { for (String ignore : plateGenIgnores) if (type.startsWith(ignore)) ignoreIt = true; - if (!ignoreIt) - ItemPlates.registerType(type); + // if (!ignoreIt) + // ItemPlates.registerType(type); } for (String type : ItemIngots.types) { @@ -100,19 +100,21 @@ public class OreDict { for (String ignore : plateGenIgnores) if (type.startsWith(ignore)) ignoreIt = true; - if (!ignoreIt) - ItemPlates.registerType(type); + // if (!ignoreIt) + // ItemPlates.registerType(type); } for (String type : ItemPlates.types) { - OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "plate_" + type), ItemPlates.getPlateByName(type)); + // TODO: fix recipe + // OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "plate_" + type), ItemPlates.getPlateByName(type)); } //Late registration of additional plates to keep meta - ItemPlates.registerType("magnalium"); - OreUtil.registerOre("plateMagnalium", ItemPlates.getPlateByName("magnalium")); - ItemPlates.registerType("iridium_alloy"); - OreUtil.registerOre("plateIridiumAlloy", ItemPlates.getPlateByName("iridiumAlloy")); + // ItemPlates.registerType("magnalium"); + // OreUtil.registerOre("plateMagnalium", ItemPlates.getPlateByName("magnalium")); + // TODO: Fix recipe + // ItemPlates.registerType("iridium_alloy"); + // OreUtil.registerOre("plateIridiumAlloy", ItemPlates.getPlateByName("iridiumAlloy")); for (String type : ItemDusts.types) { diff --git a/src/main/java/techreborn/init/SubItemRetriever.java b/src/main/java/techreborn/init/SubItemRetriever.java index 1535e8b83..09e30b252 100644 --- a/src/main/java/techreborn/init/SubItemRetriever.java +++ b/src/main/java/techreborn/init/SubItemRetriever.java @@ -104,15 +104,15 @@ public class SubItemRetriever implements ISubItemRetriever { return ItemParts.getPartByName(name, count); } - @Override - public ItemStack getPlateByName(String name) { - return ItemPlates.getPlateByName(name); - } +// @Override +// public ItemStack getPlateByName(String name) { +// return ItemPlates.getPlateByName(name); +// } - @Override - public ItemStack getPlateByName(String name, int count) { - return ItemPlates.getPlateByName(name, count); - } +// @Override +// public ItemStack getPlateByName(String name, int count) { +// return ItemPlates.getPlateByName(name, count); +// } @Override public ItemStack getUpgradeByName(String name) { @@ -143,4 +143,16 @@ public class SubItemRetriever implements ISubItemRetriever { public ItemStack getStorageBlockByName(String name, int count) { return BlockStorage.getStorageBlockByName(name, count); } + + @Override + public ItemStack getPlateByName(String name) { + // TODO Auto-generated method stub + return null; + } + + @Override + public ItemStack getPlateByName(String name, int count) { + // TODO Auto-generated method stub + return null; + } } diff --git a/src/main/java/techreborn/init/recipes/ImplosionCompressorRecipes.java b/src/main/java/techreborn/init/recipes/ImplosionCompressorRecipes.java index 8e95ad322..1f786d83a 100644 --- a/src/main/java/techreborn/init/recipes/ImplosionCompressorRecipes.java +++ b/src/main/java/techreborn/init/recipes/ImplosionCompressorRecipes.java @@ -38,7 +38,8 @@ import java.security.InvalidParameterException; */ public class ImplosionCompressorRecipes extends RecipeMethods { public static void init() { - register(getOre("ingotIridiumAlloy"), getMaterial("iridium_alloy", Type.PLATE), 4); + // TODO: fix recipe + // register(getOre("ingotIridiumAlloy"), getMaterial("iridium_alloy", Type.PLATE), 4); register(getOre("dustDiamond", 4), getStack(Items.DIAMOND, 3), 16); register(getOre("dustEmerald", 4), getStack(Items.EMERALD, 3), 12); register(getOre("dustRuby", 4), getMaterial("ruby", 3, Type.GEM), 12); diff --git a/src/main/java/techreborn/init/recipes/RecipeMethods.java b/src/main/java/techreborn/init/recipes/RecipeMethods.java index 453027e31..33a54c7a8 100644 --- a/src/main/java/techreborn/init/recipes/RecipeMethods.java +++ b/src/main/java/techreborn/init/recipes/RecipeMethods.java @@ -50,8 +50,8 @@ public abstract class RecipeMethods { return ItemIngots.getIngotByName(name, count); } else if (type == Type.GEM) { return ItemGems.getGemByName(name, count); - } else if (type == Type.PLATE) { - return ItemPlates.getPlateByName(name, count); +// } else if (type == Type.PLATE) { +// return ItemPlates.getPlateByName(name, count); } else if (type == Type.NUGGET) { return ItemNuggets.getNuggetByName(name, count); } else if (type == Type.CELL) { diff --git a/src/main/java/techreborn/init/recipes/RollingMachineRecipes.java b/src/main/java/techreborn/init/recipes/RollingMachineRecipes.java index 6a642dbca..8b5627d52 100644 --- a/src/main/java/techreborn/init/recipes/RollingMachineRecipes.java +++ b/src/main/java/techreborn/init/recipes/RollingMachineRecipes.java @@ -44,7 +44,8 @@ public class RollingMachineRecipes extends RecipeMethods { if (oresExist("ingotAluminium")) { register(new ResourceLocation(ModInfo.MOD_ID, "kanthal_heating_coil2"), getMaterial("kanthal_heating_coil", 3, Type.PART), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminium"); } - register(new ResourceLocation(ModInfo.MOD_ID, "plateMagnalium"), getMaterial("magnalium", 3, Type.PLATE), "AAA", "MMM", "AAA", 'A', "ingotAluminum", 'M', "dustMagnesium"); + // TODO: fix recipe + // register(new ResourceLocation(ModInfo.MOD_ID, "plateMagnalium"), getMaterial("magnalium", 3, Type.PLATE), "AAA", "MMM", "AAA", 'A', "ingotAluminum", 'M', "dustMagnesium"); register(new ResourceLocation(ModInfo.MOD_ID, "rail"), getStack(Blocks.RAIL, 24), "I I", "ISI", "I I", 'I', "ingotIron", 'S', "stickWood"); register(new ResourceLocation(ModInfo.MOD_ID, "gold_rail"), getStack(Blocks.GOLDEN_RAIL, 8), "I I", "ISI", "IRI", 'I', "ingotGold", 'S', "stickWood", 'R', "dustRedstone"); register(new ResourceLocation(ModInfo.MOD_ID, "detector_rail"), getStack(Blocks.DETECTOR_RAIL, 8), "I I", "IPI", "IRI", 'I', "ingotIron", 'P', getStack(Blocks.STONE_PRESSURE_PLATE), 'R', "dustRedstone"); diff --git a/src/main/java/techreborn/items/ItemDusts.java b/src/main/java/techreborn/items/ItemDusts.java index 8a7f91f50..517e6c883 100644 --- a/src/main/java/techreborn/items/ItemDusts.java +++ b/src/main/java/techreborn/items/ItemDusts.java @@ -47,7 +47,7 @@ public class ItemDusts extends ItemTR { public ItemDusts() { setTranslationKey("techreborn.dust"); - setHasSubtypes(true); + //setHasSubtypes(true); setCreativeTab(TechRebornCreativeTab.instance); TRRecipeHandler.hideEntry(this); } @@ -86,7 +86,7 @@ public class ItemDusts extends ItemTR { } - @Override +/* @Override // gets Unlocalized Name depending on meta data public String getTranslationKey(ItemStack itemStack) { int meta = itemStack.getItemDamage(); @@ -95,9 +95,9 @@ public class ItemDusts extends ItemTR { } return super.getTranslationKey() + "." + types[meta]; - } + }*/ - // Adds Dusts SubItems To Creative Tab +/* // Adds Dusts SubItems To Creative Tab @Override public void getSubItems(CreativeTabs creativeTabs, NonNullList list) { if (!isInCreativeTab(creativeTabs)) { @@ -106,6 +106,6 @@ public class ItemDusts extends ItemTR { for (int meta = 0; meta < types.length; ++meta) { list.add(new ItemStack(this, 1, meta)); } - } + }*/ } diff --git a/src/main/java/techreborn/items/ItemNuggets.java b/src/main/java/techreborn/items/ItemNuggets.java index 4cc734e4c..bafe24bd6 100644 --- a/src/main/java/techreborn/items/ItemNuggets.java +++ b/src/main/java/techreborn/items/ItemNuggets.java @@ -42,7 +42,7 @@ public class ItemNuggets extends ItemTR { public ItemNuggets() { setCreativeTab(TechRebornCreativeTab.instance); - setHasSubtypes(true); + //setHasSubtypes(true); setTranslationKey("techreborn.nuggets"); TRRecipeHandler.hideEntry(this); } @@ -61,7 +61,7 @@ public class ItemNuggets extends ItemTR { return getNuggetByName(name, 1); } - @Override +/* @Override // gets Unlocalized Name depending on meta data public String getTranslationKey(ItemStack itemStack) { int meta = itemStack.getItemDamage(); @@ -70,9 +70,9 @@ public class ItemNuggets extends ItemTR { } return super.getTranslationKey() + "." + types[meta]; - } + }*/ - // Adds Dusts SubItems To Creative Tab +/* // Adds Dusts SubItems To Creative Tab @Override public void getSubItems(CreativeTabs creativeTabs, NonNullList list) { if (!isInCreativeTab(creativeTabs)) { @@ -81,6 +81,6 @@ public class ItemNuggets extends ItemTR { for (int meta = 0; meta < types.length; ++meta) { list.add(new ItemStack(this, 1, meta)); } - } + }*/ } diff --git a/src/main/java/techreborn/items/ItemPlates.java b/src/main/java/techreborn/items/ItemPlates.java index db43034fa..a3d1adf2f 100644 --- a/src/main/java/techreborn/items/ItemPlates.java +++ b/src/main/java/techreborn/items/ItemPlates.java @@ -43,41 +43,40 @@ public class ItemPlates extends ItemTR { }; public ItemPlates() { - setTranslationKey("techreborn.plate"); - setHasSubtypes(true); - setCreativeTab(TechRebornCreativeTab.instance); + //setTranslationKey("techreborn.plate"); + //setHasSubtypes(true); TRRecipeHandler.hideEntry(this); } - public static ItemStack getPlateByName(String name, int count) { - name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name); - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.PLATES, count, i); - } - } - throw new InvalidParameterException("The plate " + name + " could not be found."); - } +// public static ItemStack getPlateByName(String name, int count) { +// name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name); +// for (int i = 0; i < types.length; i++) { +// if (types[i].equalsIgnoreCase(name)) { +// return new ItemStack(ModItems.PLATES, count, i); +// } +// } +// throw new InvalidParameterException("The plate " + name + " could not be found."); +// } +// +// public static ItemStack getPlateByName(String name) { +// return getPlateByName(name, 1); +// } +// +// public static void registerType(String plateType) { +// for (String type : types) { +// if (type.equals(plateType)) +// return; +// } +// int plateIndex = types.length; +// String[] newTypes = new String[plateIndex + 1]; +// System.arraycopy(types, 0, newTypes, 0, types.length); +// types = newTypes; +// newTypes[plateIndex] = plateType; +// String oreName = "plate" + CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, plateType); +// OreUtil.registerOre(oreName, new ItemStack(ModItems.PLATES, 1, plateIndex)); +// } - public static ItemStack getPlateByName(String name) { - return getPlateByName(name, 1); - } - - public static void registerType(String plateType) { - for (String type : types) { - if (type.equals(plateType)) - return; - } - int plateIndex = types.length; - String[] newTypes = new String[plateIndex + 1]; - System.arraycopy(types, 0, newTypes, 0, types.length); - types = newTypes; - newTypes[plateIndex] = plateType; - String oreName = "plate" + CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, plateType); - OreUtil.registerOre(oreName, new ItemStack(ModItems.PLATES, 1, plateIndex)); - } - - @Override +/* @Override // gets Unlocalized Name depending on meta data public String getTranslationKey(ItemStack itemStack) { int meta = itemStack.getItemDamage(); @@ -86,9 +85,9 @@ public class ItemPlates extends ItemTR { } return super.getTranslationKey() + "." + types[meta]; - } + }*/ - // Adds Dusts SubItems To Creative Tab +/* // Adds Dusts SubItems To Creative Tab @Override public void getSubItems(CreativeTabs creativeTabs, NonNullList list) { if (!isInCreativeTab(creativeTabs)) { @@ -97,5 +96,5 @@ public class ItemPlates extends ItemTR { for (int meta = 0; meta < types.length; ++meta) { list.add(new ItemStack(this, 1, meta)); } - } + }*/ } diff --git a/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java b/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java index 438574853..4e46c5abf 100644 --- a/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java +++ b/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java @@ -34,7 +34,6 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import org.apache.commons.lang3.tuple.Pair; import reborncore.api.IToolDrop; @@ -42,7 +41,6 @@ import reborncore.api.tile.IInventoryProvider; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.registration.RebornRegistry; import reborncore.common.registration.impl.ConfigRegistry; -import reborncore.common.tile.SlotConfiguration; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; import techreborn.client.container.IContainerProvider; @@ -55,7 +53,6 @@ import techreborn.lib.ModInfo; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import java.util.Objects; /** * Created by modmuss50 on 20/06/2017. diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates.json index 7b458e2ca..72d76e72d 100644 --- a/src/main/resources/assets/techreborn/blockstates/items/materials/plates.json +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates.json @@ -6,31 +6,11 @@ }, "variants": { "type": { - "aluminum": { - "textures": { - "layer0": "techreborn:items/plate/aluminum_plate" - } - }, - "brass": { - "textures": { - "layer0": "techreborn:items/plate/brass_plate" - } - }, - "bronze": { - "textures": { - "layer0": "techreborn:items/plate/bronze_plate" - } - }, "chrome": { "textures": { "layer0": "techreborn:items/plate/chrome_plate" } }, - "copper": { - "textures": { - "layer0": "techreborn:items/plate/copper_plate" - } - }, "electrum": { "textures": { "layer0": "techreborn:items/plate/electrum_plate" @@ -106,11 +86,6 @@ "layer0": "techreborn:items/plate/refined_iron_plate" } }, - "advanced_alloy": { - "textures": { - "layer0": "techreborn:items/plate/advanced_alloy_plate" - } - }, "mixed_metal": { "textures": { "layer0": "techreborn:items/plate/mixed_metal_plate" @@ -121,61 +96,11 @@ "layer0": "techreborn:items/plate/iridium_alloy_plate" } }, - "wood": { - "textures": { - "layer0": "techreborn:items/plate/wood_plate" - } - }, - "iron": { - "textures": { - "layer0": "techreborn:items/plate/iron_plate" - } - }, "lapis": { "textures": { "layer0": "techreborn:items/plate/lapis_plate" } }, - "lazurite": { - "textures": { - "layer0": "techreborn:items/plate/lazurite_plate" - } - }, - "gold": { - "textures": { - "layer0": "techreborn:items/plate/gold_plate" - } - }, - "redstone": { - "textures": { - "layer0": "techreborn:items/plate/redstone_plate" - } - }, - "diamond": { - "textures": { - "layer0": "techreborn:items/plate/diamond_plate" - } - }, - "emerald": { - "textures": { - "layer0": "techreborn:items/plate/emerald_plate" - } - }, - "coal": { - "textures": { - "layer0": "techreborn:items/plate/coal_plate" - } - }, - "obsidian": { - "textures": { - "layer0": "techreborn:items/plate/obsidian_plate" - } - }, - "carbon": { - "textures": { - "layer0": "techreborn:items/plate/carbon_plate" - } - }, "ruby": { "textures": { "layer0": "techreborn:items/plate/ruby_plate" diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateadvancedalloy.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateadvancedalloy.json new file mode 100644 index 000000000..1da3cda9d --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateadvancedalloy.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/advanced_alloy_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platealuminum.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platealuminum.json new file mode 100644 index 000000000..7c4eb9879 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platealuminum.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/aluminum_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platebrass.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platebrass.json new file mode 100644 index 000000000..e19b14c78 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platebrass.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/brass_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platebronze.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platebronze.json new file mode 100644 index 000000000..b6947feda --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platebronze.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/bronze_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platecarbon.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platecarbon.json new file mode 100644 index 000000000..720d5a2e6 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platecarbon.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/carbon_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platecoal.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platecoal.json new file mode 100644 index 000000000..941301053 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platecoal.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/coal_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platecopper.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platecopper.json new file mode 100644 index 000000000..e026ea88c --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platecopper.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/copper_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platediamond.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platediamond.json new file mode 100644 index 000000000..9edab643b --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platediamond.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/diamond_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateemerald.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateemerald.json new file mode 100644 index 000000000..77e6b676f --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateemerald.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/emerald_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plategold.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plategold.json new file mode 100644 index 000000000..4ee286410 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plategold.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/gold_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateiron.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateiron.json new file mode 100644 index 000000000..258edce0a --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateiron.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/iron_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platelazurite.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platelazurite.json new file mode 100644 index 000000000..0a323dc57 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platelazurite.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/lazurite_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateobsidian.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateobsidian.json new file mode 100644 index 000000000..502e04c00 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateobsidian.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/obsidian_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateredstone.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateredstone.json new file mode 100644 index 000000000..cc063d113 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/plateredstone.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/redstone_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platewood.json b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platewood.json new file mode 100644 index 000000000..3ca43b65b --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/plates/platewood.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "techreborn:items/plate/wood_plate" + } + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/lang/en_us.lang b/src/main/resources/assets/techreborn/lang/en_us.lang index 46c771d8d..23eae8310 100644 --- a/src/main/resources/assets/techreborn/lang/en_us.lang +++ b/src/main/resources/assets/techreborn/lang/en_us.lang @@ -422,8 +422,10 @@ item.techreborn.nuggets.refined_iron.name=Refined Iron Nugget item.techreborn.nuggets.diamond.name=Diamond Nugget #Plates -item.techreborn.plate.aluminum.name=Aluminium Plate -item.techreborn.plate.brass.name=Brass Plate +item.techreborn.plateadvancedalloy.name=Advanced Alloy Plate +item.techreborn.platealuminum.name=Aluminium Plate +item.techreborn.platebrass.name=Brass Plate + item.techreborn.plate.bronze.name=Bronze Plate item.techreborn.plate.carbon.name=Carbon Plate item.techreborn.plate.coal.name=Coal Plate @@ -459,7 +461,7 @@ item.techreborn.plate.yellow_garnet.name=Yellow Garnet Plate item.techreborn.plate.zinc.name=Zinc Plate item.techreborn.plate.refined_iron.name=Refined Iron Plate item.techreborn.plate.wood.name=Wooden Plate -item.techreborn.plate.advanced_alloy.name=Advanced Alloy Plate + item.techreborn.plate.lazurite.name=Lazurite Plate item.techreborn.plate.magnalium.name=Magnalium Plate item.techreborn.plate.iridium_alloy.name=Iridium Alloy Plate