Nuggets now use jsons, and nuggets now return proper subtypes
|
@ -9,6 +9,7 @@ import techreborn.init.ModBlocks;
|
|||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemGems;
|
||||
import techreborn.items.ItemIngots;
|
||||
import techreborn.items.ItemNuggets;
|
||||
import techreborn.items.ItemPlates;
|
||||
|
||||
public class RegisterItemJsons {
|
||||
|
@ -53,6 +54,11 @@ public class RegisterItemJsons {
|
|||
String[] name = ItemPlates.types.clone();
|
||||
registerBlockstate(ModItems.plate, i, name[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < ItemNuggets.types.length; ++i) {
|
||||
String[] name = ItemNuggets.types.clone();
|
||||
registerBlockstate(ModItems.nuggets, i, name[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerBlocks() {
|
||||
|
|
|
@ -123,8 +123,7 @@ public class OreDict {
|
|||
for (String type : ItemNuggets.types) {
|
||||
if (type.equals(ModItems.META_PLACEHOLDER))
|
||||
continue; //Aware of placeholders!
|
||||
String oreDictName = "nugget" + OreDictUtils.toFirstUpper(type);
|
||||
OreDictionary.registerOre(oreDictName, ItemNuggets.getNuggetByName(type));
|
||||
OreDictionary.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "nugget_" + type), ItemNuggets.getNuggetByName(type));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,18 +3,17 @@ package techreborn.items;
|
|||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemNuggets extends ItemTextureBase {
|
||||
public class ItemNuggets extends ItemTRNoDestroy {
|
||||
|
||||
public static final String[] types = new String[] { "aluminum", "brass", "bronze", "chrome", "copper", "electrum",
|
||||
"invar", "iridium", "lead", "nickel", "platinum", "silver", "steel", "tin", "titanium", "tungsten",
|
||||
"hotTungstensteel", "tungstensteel", "zinc", "refinedIron", ModItems.META_PLACEHOLDER, ModItems.META_PLACEHOLDER,
|
||||
"hot_tungstensteel", "tungstensteel", "zinc", "refined_iron", ModItems.META_PLACEHOLDER, ModItems.META_PLACEHOLDER,
|
||||
ModItems.META_PLACEHOLDER, "iron", "diamond" };
|
||||
|
||||
public ItemNuggets() {
|
||||
|
@ -48,7 +47,8 @@ public class ItemNuggets extends ItemTextureBase {
|
|||
}
|
||||
|
||||
// Adds Dusts SubItems To Creative Tab
|
||||
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs creativeTabs, NonNullList list) {
|
||||
for (int meta = 0; meta < types.length; ++meta) {
|
||||
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
|
@ -56,14 +56,4 @@ public class ItemNuggets extends ItemTextureBase {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return ModInfo.MOD_ID + ":items/nuggets/" + types[damage] + "Nugget";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return types.length;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
121
src/main/resources/assets/techreborn/blockstates/nuggets.json
Normal file
|
@ -0,0 +1,121 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "builtin/generated",
|
||||
"transform": "forge:default-item"
|
||||
},
|
||||
"variants": {
|
||||
"type": {
|
||||
"aluminum": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/aluminum_nugget"
|
||||
}
|
||||
},
|
||||
"brass": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/brass_nugget"
|
||||
}
|
||||
},
|
||||
"bronze": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/bronze_nugget"
|
||||
}
|
||||
},
|
||||
"chrome": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/chrome_nugget"
|
||||
}
|
||||
},
|
||||
"copper": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/copper_nugget"
|
||||
}
|
||||
},
|
||||
"electrum": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/electrum_nugget"
|
||||
}
|
||||
},
|
||||
"invar": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/invar_nugget"
|
||||
}
|
||||
},
|
||||
"iridium": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/iridium_nugget"
|
||||
}
|
||||
},
|
||||
"lead": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/lead_nugget"
|
||||
}
|
||||
},
|
||||
"nickel": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/nickel_nugget"
|
||||
}
|
||||
},
|
||||
"platinum": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/platinum_nugget"
|
||||
}
|
||||
},
|
||||
"silver": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/silver_nugget"
|
||||
}
|
||||
},
|
||||
"steel": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/steel_nugget"
|
||||
}
|
||||
},
|
||||
"tin": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/tin_nugget"
|
||||
}
|
||||
},
|
||||
"titanium": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/titanium_nugget"
|
||||
}
|
||||
},
|
||||
"tungsten": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/tungsten_nugget"
|
||||
}
|
||||
},
|
||||
"hot_tungstensteel": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/hot_tungstensteel_nugget"
|
||||
}
|
||||
},
|
||||
"tungstensteel": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/tungstensteel_nugget"
|
||||
}
|
||||
},
|
||||
"zinc": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/zinc_nugget"
|
||||
}
|
||||
},
|
||||
"refined_iron": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/refined_iron_nugget"
|
||||
}
|
||||
},
|
||||
"iron": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/iron_nugget"
|
||||
}
|
||||
},
|
||||
"diamond": {
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/nugget/diamond_nugget"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 684 B After Width: | Height: | Size: 684 B |
Before Width: | Height: | Size: 728 B After Width: | Height: | Size: 728 B |
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 729 B |
Before Width: | Height: | Size: 695 B After Width: | Height: | Size: 695 B |
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 729 B |
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 661 B |
Before Width: | Height: | Size: 722 B After Width: | Height: | Size: 722 B |
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 390 B |
Before Width: | Height: | Size: 653 B After Width: | Height: | Size: 653 B |
Before Width: | Height: | Size: 594 B After Width: | Height: | Size: 594 B |
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 706 B |
Before Width: | Height: | Size: 719 B After Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 712 B After Width: | Height: | Size: 712 B |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 706 B |
Before Width: | Height: | Size: 692 B After Width: | Height: | Size: 692 B |
Before Width: | Height: | Size: 687 B After Width: | Height: | Size: 687 B |
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 670 B |
Before Width: | Height: | Size: 700 B After Width: | Height: | Size: 700 B |
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 704 B |
Before Width: | Height: | Size: 707 B After Width: | Height: | Size: 707 B |
Before Width: | Height: | Size: 633 B After Width: | Height: | Size: 633 B |