bedrock ore item autogen

This commit is contained in:
Boblet 2024-06-26 15:19:45 +02:00
parent 7eb8eef1f0
commit 725a3a8a10
7 changed files with 140 additions and 2 deletions

View File

@ -18,6 +18,8 @@
* Replaced recipes for the wind turbine and atomic disassembler
* Added a config option for toggling Mekanism compat
* Added recipe caching to the combinator funnel, meaning it no longer has to iterate over the entire recipe list all the time for compression/automation, this should improve performance by a fair bit
* Diodes now use silicon nuggets instead of nether quartz
* Aluminium wire's coloring is now consistent with the ingot
## Fixed
* Fixed crash caused by PRISM updating unloaded worlds

View File

@ -213,6 +213,7 @@ public class ModItems {
public static Item ore_seared;
//public static Item ore_radcleaned;
public static Item ore_enriched; //final stage
public static Item bedrock_ore;
public static Item billet_uranium;
public static Item billet_u233;
@ -1085,7 +1086,7 @@ public class ModItems {
public static Item waste_u233;
public static Item waste_u235;
public static Item waste_schrabidium;
public static Item waste_zfb_mox; //TODO: remind me to smite these useless waste items and condense em like the rbmk waste
public static Item waste_zfb_mox;
public static Item waste_plate_u233;
public static Item waste_plate_u235;
@ -2720,6 +2721,7 @@ public class ModItems {
ore_seared = new ItemBedrockOre().setUnlocalizedName("ore_seared").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ore_seared");
//ore_radcleaned = new ItemBedrockOre().setUnlocalizedName("ore_radcleaned").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ore_radcleaned");
ore_enriched = new ItemBedrockOre().setUnlocalizedName("ore_enriched").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ore_enriched");
bedrock_ore = new ItemBedrockOreNew().setUnlocalizedName("bedrock_ore").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":bedrock_ore_base");
ingot_lanthanium = new ItemCustomLore().setUnlocalizedName("ingot_lanthanium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_lanthanium");
ingot_actinium = new ItemCustomLore().setUnlocalizedName("ingot_actinium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_actinium");
@ -5940,6 +5942,7 @@ public class ModItems {
//GameRegistry.registerItem(ore_radcleaned, ore_radcleaned.getUnlocalizedName());
GameRegistry.registerItem(ore_enriched, ore_enriched.getUnlocalizedName());
GameRegistry.registerItem(ore_byproduct, ore_byproduct.getUnlocalizedName());
GameRegistry.registerItem(bedrock_ore, bedrock_ore.getUnlocalizedName());
//Crystals
GameRegistry.registerItem(crystal_coal, crystal_coal.getUnlocalizedName());

View File

@ -0,0 +1,133 @@
package com.hbm.items.special;
import static com.hbm.inventory.OreDictManager.*;
import java.util.List;
import com.hbm.items.ModItems;
import com.hbm.util.EnumUtil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import com.hbm.items.ItemEnums.EnumChunkType;
import com.hbm.lib.RefStrings;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class ItemBedrockOreNew extends Item {
public IIcon[] icons = new IIcon[BedrockOreType.values().length * BedrockOreGrade.values().length];
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister reg) {
super.registerIcons(reg);
for(int i = 0; i < BedrockOreGrade.values().length; i++) {
BedrockOreGrade grade = BedrockOreGrade.values()[i];
for(int j = 0; j < BedrockOreType.values().length; j++) {
BedrockOreType type = BedrockOreType.values()[j];
this.icons[i * BedrockOreType.values().length + j] = reg.registerIcon(RefStrings.MODID + ":bedrock_ore_" + grade.prefix + "_" + type.suffix);
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list) {
for(int i = 0; i < BedrockOreGrade.values().length; i++) {
BedrockOreGrade grade = BedrockOreGrade.values()[i];
for(int j = 0; j < BedrockOreType.values().length; j++) {
BedrockOreType type = BedrockOreType.values()[j];
list.add(this.make(grade, type));
}
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamageForRenderPass(int meta, int pass) {
int icon = this.getGrade(meta).ordinal() * BedrockOreType.values().length + this.getType(meta).ordinal();
return icons[Math.abs(icon % icons.length)];
}
public static enum BedrockOreType {
// primary sulfuric solvent radsolvent
LIGHT_METAL( "light", IRON, CU, TI, AL, AL, CHLOROCALCITE, LI, NA, CHLOROCALCITE, LI, NA),
HEAVY_METAL( "heavy", W, PB, GOLD, GOLD, BE, W, PB, GOLD, BI, BI, GOLD),
RARE_EARTH( "rare", CO, DictFrame.fromOne(ModItems.chunk_ore, EnumChunkType.RARE), B, LA, NB, ND, B, ZR, CO, ND, ZR),
ACTINIDE( "actinide", U, TH232, RA226, RA226, PO210, RA226, RA226, PO210, TC99, TC99, U238),
NON_METAL( "nonmetal", COAL, S, LIGNITE, KNO, F, P_RED, F, S, CHLOROCALCITE, SI, SI),
CRYSTALLINE( "crystal", DIAMOND, SODALITE, CINNABAR, ASBESTOS, REDSTONE, CINNABAR, ASBESTOS, EMERALD, BORAX, MOLYSITE, SODALITE);
public String suffix;
public Object primary1, primary2;
public Object byproductAcid1, byproductAcid2, byproductAcid3;
public Object byproductSolvent1, byproductSolvent2, byproductSolvent3;
public Object byproductRad1, byproductRad2, byproductRad3;
private BedrockOreType(String suffix, Object p1, Object p2, Object bA1, Object bA2, Object bA3, Object bS1, Object bS2, Object bS3, Object bR1, Object bR2, Object bR3) {
this.suffix = suffix;
this.primary1 = p1; this.primary2 = p2;
this.byproductAcid1 = bA1; this.byproductAcid2 = bA2; this.byproductAcid3 = bA3;
this.byproductSolvent1 = bS1; this.byproductSolvent2 = bS2; this.byproductSolvent3 = bS3;
this.byproductRad1 = bR1; this.byproductRad2 = bR2; this.byproductRad3 = bR3;
}
}
public static enum BedrockOreGrade {
BASE("base"), //from the slopper
BASE_ROASTED("base"), //optional combination oven step, yields vitriol
BASE_WASHED("base"), //primitive-ass acidizer with water
PRIMARY("primary"), //centrifuging for more primary
PRIMARY_ROASTED("primary"), //optional comboven
PRIMARY_SULFURIC("primary"), //sulfuric acid
PRIMARY_NOSULFURIC("primary"), //from centrifuging, sulfuric byproduct removed
PRIMARY_SOLVENT("primary"), //solvent
PRIMARY_NOSOLVENT("primary"), //solvent byproduct removed
PRIMARY_RAD("primary"), //radsolvent
PRIMARY_NORAD("primary"), //radsolvent byproduct removed
PRIMARY_FIRST("primary"), //higher first material yield
PRIMARY_SECOND("primary"), //higher second material yield
CRUMBS("crumbs"), //endpoint for primary, recycling
SULFURIC_BYPRODUCT("sulfuric"), //from centrifuging
SULFURIC_ROASTED("sulfuric"), //comboven again
SULFURIC_ARC("sulfuric"), //alternate step
SULFURIC_WASHED("sulfuric"), //sulfuric endpoint
SOLVENT_BYPRODUCT("solvent"), //from centrifuging
SOLVENT_ROASTED("solvent"), //comboven again
SOLVENT_ARC("solvent"), //alternate step
SOLVENT_WASHED("solvent"), //solvent endpoint
RAD_BYPRODUCT("rad"), //from centrifuging
RAD_ROASTED("rad"), //comboven again
RAD_ARC("rad"), //alternate step
RAD_WASHED("rad"); //rad endpoint
public String prefix;
private BedrockOreGrade(String prefix) {
this.prefix = prefix;
}
}
public static ItemStack make(BedrockOreGrade grade, BedrockOreType type) {
return new ItemStack(ModItems.bedrock_ore, 1, grade.ordinal() << 4 | type.ordinal());
}
public BedrockOreGrade getGrade(int meta) {
return EnumUtil.grabEnumSafely(BedrockOreGrade.class, meta >> 4);
}
public BedrockOreType getType(int meta) {
return EnumUtil.grabEnumSafely(BedrockOreType.class, meta & 15);
}
}

View File

@ -254,7 +254,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.red_cable_paintable, 16), new Object[] { "WRW", "RIR", "WRW", 'W', STEEL.plate(), 'I', MINGRADE.ingot(), 'R', MINGRADE.wireFine() });
addRecipeAuto(new ItemStack(ModBlocks.cable_switch, 1), new Object[] { "S", "W", 'S', Blocks.lever, 'W', ModBlocks.red_wire_coated });
addRecipeAuto(new ItemStack(ModBlocks.cable_detector, 1), new Object[] { "S", "W", 'S', REDSTONE.dust(), 'W', ModBlocks.red_wire_coated });
addRecipeAuto(new ItemStack(ModBlocks.cable_diode, 1), new Object[] { " Q ", "CAC", " Q ", 'Q', NETHERQUARTZ.gem(), 'C', ModBlocks.red_cable, 'A', AL.ingot() });
addRecipeAuto(new ItemStack(ModBlocks.cable_diode, 1), new Object[] { " Q ", "CAC", " Q ", 'Q', SI.nugget(), 'C', ModBlocks.red_cable, 'A', AL.ingot() });
addRecipeAuto(new ItemStack(ModBlocks.machine_detector, 1), new Object[] { "IRI", "CTC", "IRI", 'I', ModItems.plate_polymer, 'R', REDSTONE.dust(), 'C', MINGRADE.wireFine(), 'T', ModItems.coil_tungsten });
addRecipeAuto(new ItemStack(ModBlocks.red_cable, 16), new Object[] { " W ", "RRR", " W ", 'W', ModItems.plate_polymer, 'R', MINGRADE.wireFine() });
addShapelessAuto(new ItemStack(ModBlocks.red_cable_classic, 1), new Object[] { ModBlocks.red_cable });

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 461 B