Remove META_PLACEHOLDER

This commit is contained in:
modmuss50 2018-07-20 22:36:38 +01:00
parent f5c6b59ebd
commit 2910acc29c
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
11 changed files with 25 additions and 80 deletions

View file

@ -133,37 +133,27 @@ public class RegisterItemJsons {
name = ItemPlates.types.clone();
for (int i = 0; i < ItemPlates.types.length; ++i) {
if (!name[i].equals(ModItems.META_PLACEHOLDER)) {
registerBlockstate(ModItems.PLATES, i, name[i], "items/materials/");
}
registerBlockstate(ModItems.PLATES, i, name[i], "items/materials/");
}
name = ItemNuggets.types.clone();
for (int i = 0; i < ItemNuggets.types.length; ++i) {
if (!name[i].equals(ModItems.META_PLACEHOLDER)) {
registerBlockstate(ModItems.NUGGETS, i, name[i], "items/materials/");
}
registerBlockstate(ModItems.NUGGETS, i, name[i], "items/materials/");
}
name = ItemDusts.types.clone();
for (int i = 0; i < ItemDusts.types.length; ++i) {
if (!name[i].equals(ModItems.META_PLACEHOLDER)) {
registerBlockstate(ModItems.DUSTS, i, name[i], "items/materials/");
}
registerBlockstate(ModItems.DUSTS, i, name[i], "items/materials/");
}
name = ItemDustsSmall.types.clone();
for (int i = 0; i < ItemDustsSmall.types.length; ++i) {
if (!name[i].equals(ModItems.META_PLACEHOLDER)) {
registerBlockstate(ModItems.SMALL_DUSTS, i, name[i], "items/materials/");
}
registerBlockstate(ModItems.SMALL_DUSTS, i, name[i], "items/materials/");
}
name = ItemParts.types.clone();
for (int i = 0; i < ItemParts.types.length; ++i) {
if (!name[i].equals(ModItems.META_PLACEHOLDER)) {
registerBlockstate(ModItems.PARTS, i, name[i], "items/materials/");
}
registerBlockstate(ModItems.PARTS, i, name[i], "items/materials/");
}
name = ItemUpgrades.types.clone();

View file

@ -46,7 +46,6 @@ import javax.annotation.Nullable;
public class ModItems {
public static final String META_PLACEHOLDER = "PLACEHOLDER_ITEM";
public static Item GEMS;
public static Item INGOTS;
public static Item NUGGETS;

View file

@ -39,8 +39,7 @@ public class OreDict {
private static final ImmutableList<String> plateGenIgnores = ImmutableList.of(
"hot", //Hot ingots
"mixed_metal", //Mixed metal has own version of plate
"iridium_alloy", //Iridium alloy is plate itself
ModItems.META_PLACEHOLDER //...
"iridium_alloy" //Iridium alloy is plate itself
);
public static void init() {
@ -86,8 +85,6 @@ public class OreDict {
OreUtil.registerOre("dustAsh", ItemDusts.getDustByName("ashes"));
for (String type : ItemGems.types) {
if (type.equals(ModItems.META_PLACEHOLDER))
continue; //Aware of placeholders!
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "gem_" + type), ItemGems.getGemByName(type));
boolean ignoreIt = false;
for (String ignore : plateGenIgnores)
@ -98,8 +95,6 @@ public class OreDict {
}
for (String type : ItemIngots.types) {
if (type.equals(ModItems.META_PLACEHOLDER))
continue; //Aware of placeholders!
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "ingot_" + type), ItemIngots.getIngotByName(type));
boolean ignoreIt = false;
for (String ignore : plateGenIgnores)
@ -110,8 +105,6 @@ public class OreDict {
}
for (String type : ItemPlates.types) {
if (type.equals(ModItems.META_PLACEHOLDER))
continue; //Aware of placeholders!
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "plate_" + type), ItemPlates.getPlateByName(type));
}
@ -123,20 +116,14 @@ public class OreDict {
for (String type : ItemDusts.types) {
if (type.equals(ModItems.META_PLACEHOLDER))
continue; //Aware of placeholders!
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "dust_" + type), ItemDusts.getDustByName(type));
}
for (String type : ItemDustsSmall.types) {
if (type.equals(ModItems.META_PLACEHOLDER))
continue; //Aware of placeholders!
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "dust_small_" + type), ItemDustsSmall.getSmallDustByName(type));
}
for (String type : ItemNuggets.types) {
if (type.equals(ModItems.META_PLACEHOLDER))
continue; //Aware of placeholders!
OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "nugget_" + type), ItemNuggets.getNuggetByName(type));
}

View file

@ -316,15 +316,12 @@ public class CraftingTableRecipes extends RecipeMethods {
}
for (String name : ItemDustsSmall.types) {
if (name.equals(ModItems.META_PLACEHOLDER)) {
continue;
}
registerShapeless(getMaterial(name, 4, Type.SMALL_DUST), getMaterialObject(name, Type.DUST));
registerShapeless(getMaterial(name, Type.DUST), getMaterialObject(name, Type.SMALL_DUST), getMaterialObject(name, Type.SMALL_DUST), getMaterialObject(name, Type.SMALL_DUST), getMaterialObject(name, Type.SMALL_DUST));
}
for (String nuggets : ItemNuggets.types) {
if (nuggets.equals(ModItems.META_PLACEHOLDER) || nuggets.equalsIgnoreCase("diamond"))
if (nuggets.equalsIgnoreCase("diamond"))
continue;
registerShapeless(getMaterial(nuggets, 9, Type.NUGGET), CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "ingot_" + nuggets));
registerShaped(getMaterial(nuggets, Type.INGOT), "NNN", "NNN", "NNN", 'N', CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "nugget_" + nuggets));

View file

@ -192,21 +192,15 @@ public class ScrapboxRecipes extends RecipeMethods {
register(getStack(ModBlocks.RUBBER_SAPLING));
for (String i : ItemDusts.types) {
if (!i.equals(ModItems.META_PLACEHOLDER)) {
register(ItemDusts.getDustByName(i));
}
register(ItemDusts.getDustByName(i));
}
for (String i : ItemNuggets.types) {
if (!i.equals(ModItems.META_PLACEHOLDER)) {
register(ItemNuggets.getNuggetByName(i));
}
register(ItemNuggets.getNuggetByName(i));
}
for (String i : ItemGems.types) {
if (!i.equals(ModItems.META_PLACEHOLDER)) {
register(ItemGems.getGemByName(i));
}
register(ItemGems.getGemByName(i));
}
registerDyable(Items.DYE);

View file

@ -40,10 +40,10 @@ public class ItemDusts extends ItemTR {
"bauxite", "brass", "bronze", "calcite", "charcoal", "chrome", "cinnabar", "clay", "coal", "copper",
"dark_ashes", "diamond", "electrum", "emerald", "ender_eye", "ender_pearl", "endstone", "flint", "galena",
"gold", "grossular", "invar", "iron", "lazurite", "lead", "magnesium", "manganese", "marble", "netherrack",
"nickel", "obsidian", "peridot", "phosphorous", "platinum", "pyrite", "pyrope", "red_garnet", ModItems.META_PLACEHOLDER,
"nickel", "obsidian", "peridot", "phosphorous", "platinum", "pyrite", "pyrope", "red_garnet",
"ruby", "saltpeter", "sapphire", "saw_dust", "silver", "sodalite", "spessartine", "sphalerite", "steel",
"sulfur", "tin", "titanium", "tungsten", "uvarovite", ModItems.META_PLACEHOLDER, "yellow_garnet", "zinc",
ModItems.META_PLACEHOLDER, "andesite", "diorite", "granite" };
"sulfur", "tin", "titanium", "tungsten", "uvarovite", "yellow_garnet", "zinc",
"andesite", "diorite", "granite" };
public ItemDusts() {
setTranslationKey("techreborn.dust");
@ -56,9 +56,6 @@ public class ItemDusts extends ItemTR {
name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
for (int i = 0; i < types.length; i++) {
if (types[i].equalsIgnoreCase(name)) {
if (types[i].equals(ModItems.META_PLACEHOLDER)) {
throw new InvalidParameterException("The dust " + name + " could not be found.");
}
return new ItemStack(ModItems.DUSTS, count, i);
}
}
@ -107,9 +104,7 @@ public class ItemDusts extends ItemTR {
return;
}
for (int meta = 0; meta < types.length; ++meta) {
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(this, 1, meta));
}
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -40,10 +40,10 @@ public class ItemDustsSmall extends ItemTR {
"bauxite", "brass", "bronze", "calcite", "charcoal", "chrome", "cinnabar", "clay", "coal", "copper",
"dark_ashes", "diamond", "electrum", "emerald", "ender_eye", "ender_pearl", "endstone", "flint", "galena",
"gold", "grossular", "invar", "iron", "lazurite", "lead", "magnesium", "manganese", "marble", "netherrack",
"nickel", "obsidian", "peridot", "phosphorous", "platinum", "pyrite", "pyrope", "red_garnet", ModItems.META_PLACEHOLDER,
"nickel", "obsidian", "peridot", "phosphorous", "platinum", "pyrite", "pyrope", "red_garnet",
"ruby", "saltpeter", "sapphire", "saw_dust", "silver", "sodalite", "spessartine", "sphalerite", "steel",
"sulfur", "tin", "titanium", "tungsten", "uvarovite", ModItems.META_PLACEHOLDER, "yellow_garnet", "zinc",
ModItems.META_PLACEHOLDER, "redstone", "glowstone", "andesite", "diorite", "granite" };
"sulfur", "tin", "titanium", "tungsten", "uvarovite", "yellow_garnet", "zinc",
"redstone", "glowstone", "andesite", "diorite", "granite" };
public ItemDustsSmall() {
setTranslationKey("techreborn.dustsmall");
@ -56,9 +56,6 @@ public class ItemDustsSmall extends ItemTR {
name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
for (int i = 0; i < types.length; i++) {
if (types[i].equalsIgnoreCase(name)) {
if (types[i].equals(ModItems.META_PLACEHOLDER)) {
throw new InvalidParameterException("The small dust " + name + " could not be found.");
}
return new ItemStack(ModItems.SMALL_DUSTS, count, i);
}
}
@ -87,9 +84,7 @@ public class ItemDustsSmall extends ItemTR {
return;
}
for (int meta = 0; meta < types.length; ++meta) {
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(this, 1, meta));
}
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -86,9 +86,7 @@ public class ItemIngots extends ItemTR {
return;
}
for (int meta = 0; meta < types.length; ++meta) {
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(this, 1, meta));
}
list.add(new ItemStack(this, 1, meta));
}
}
}

View file

@ -38,8 +38,7 @@ public class ItemNuggets extends ItemTR {
public static final String[] types = new String[] { "aluminum", "brass", "bronze", "chrome", "copper", "electrum",
"invar", "iridium", "lead", "nickel", "platinum", "silver", "steel", "tin", "titanium", "tungsten",
"hot_tungstensteel", "tungstensteel", "zinc", "refined_iron", ModItems.META_PLACEHOLDER, ModItems.META_PLACEHOLDER,
ModItems.META_PLACEHOLDER, "iron", "diamond" };
"hot_tungstensteel", "tungstensteel", "zinc", "refined_iron", "iron", "diamond" };
public ItemNuggets() {
setCreativeTab(TechRebornCreativeTab.instance);
@ -80,9 +79,7 @@ public class ItemNuggets extends ItemTR {
return;
}
for (int meta = 0; meta < types.length; ++meta) {
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(this, 1, meta));
}
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -41,7 +41,7 @@ public class ItemParts extends ItemTR {
public static final String[] types = new String[] { "energy_flow_circuit", "data_control_circuit", "data_storage_circuit",
"data_orb", "diamond_grinding_head", "diamond_saw_blade", "tungsten_grinding_head", "helium_coolant_simple",
"helium_coolant_triple", "helium_coolant_six", "nak_coolant_simple", "nak_coolant_triple", "nak_coolant_six",
"cupronickel_heating_coil", "nichrome_heating_coil", "kanthal_heating_coil", ModItems.META_PLACEHOLDER, "super_conductor",
"cupronickel_heating_coil", "nichrome_heating_coil", "kanthal_heating_coil", "super_conductor",
"thorium_cell", "double_thorium_cell", "quad_thorium_cell", "plutonium_cell", "double_plutonium_cell",
"quad_plutonium_cell", "computer_monitor", "machine_parts", "neutron_reflector", "iridium_neutron_reflector",
"thick_neutron_reflector", "electronic_circuit", "advanced_circuit", "sap", "rubber", "scrap",
@ -100,9 +100,7 @@ public class ItemParts extends ItemTR {
return;
}
for (int meta = 0; meta < ItemParts.types.length; ++meta) {
if (!ItemParts.types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(this, 1, meta));
}
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -39,7 +39,7 @@ public class ItemPlates extends ItemTR {
//Vanilla plates or plates not from ingots or gems
public static String[] types = new String[] {
"iron", "gold", "carbon", "wood", "redstone", "diamond", "emerald", ModItems.META_PLACEHOLDER, "coal", "obsidian", "lazurite"
"iron", "gold", "carbon", "wood", "redstone", "diamond", "emerald", "coal", "obsidian", "lazurite"
};
public ItemPlates() {
@ -53,9 +53,6 @@ public class ItemPlates extends ItemTR {
name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
for (int i = 0; i < types.length; i++) {
if (types[i].equalsIgnoreCase(name)) {
if (types[i].equals(ModItems.META_PLACEHOLDER)) {
throw new InvalidParameterException("The plate " + name + " could not be found.");
}
return new ItemStack(ModItems.PLATES, count, i);
}
}
@ -98,9 +95,7 @@ public class ItemPlates extends ItemTR {
return;
}
for (int meta = 0; meta < types.length; ++meta) {
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(this, 1, meta));
}
list.add(new ItemStack(this, 1, meta));
}
}
}