mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
fixed ore dict keys for recipes, fixed template folder terribleness
This commit is contained in:
parent
af123ec386
commit
10fc95c6ea
@ -23,8 +23,8 @@ public class ToolConfig {
|
||||
|
||||
final String CATEGORY_TOOLS = "11_tools";
|
||||
recursionDepth = CommonConfig.createConfigInt(config, CATEGORY_TOOLS, "11.00_recursionDepth", "Limits veinminer's recursive function. Usually not an issue, unless you're using bukkit which is especially sensitive for some reason.", 1000);
|
||||
recursiveStone = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.01_recursionDepth", "Determines whether veinminer can break stone", false);
|
||||
recursiveNetherrack = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.02_recursionDepth", "Determines whether veinminer can break netherrack", false);
|
||||
recursiveStone = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.01_recursionStone", "Determines whether veinminer can break stone", false);
|
||||
recursiveNetherrack = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.02_recursionNetherrack", "Determines whether veinminer can break netherrack", false);
|
||||
|
||||
abilityHammer = config.get(CATEGORY_TOOLS, "11.03_hammerAbility", true).getBoolean(true);
|
||||
abilityVein = config.get(CATEGORY_TOOLS, "11.04_abilityVein", true).getBoolean(true);
|
||||
|
||||
@ -91,9 +91,9 @@ public class MineralRecipes {
|
||||
addBillet(ModItems.billet_neptunium, ModItems.nugget_neptunium, "nuggetNeptunium237", "tinyNp237");
|
||||
addBillet(ModItems.billet_polonium, ModItems.nugget_polonium, "nuggetPolonium");
|
||||
addBillet(ModItems.billet_technetium, ModItems.nugget_technetium, "nuggetTechnetium");
|
||||
addBillet(ModItems.billet_au198, ModItems.nugget_au198);
|
||||
addBillet(ModItems.billet_schrabidium, ModItems.nugget_schrabidium);
|
||||
addBillet(ModItems.billet_solinium, ModItems.nugget_solinium);
|
||||
addBillet(ModItems.billet_au198, ModItems.nugget_au198, "nuggetGold198");
|
||||
addBillet(ModItems.billet_schrabidium, ModItems.nugget_schrabidium, "nuggetSchrabidium");
|
||||
addBillet(ModItems.billet_solinium, ModItems.nugget_solinium, "nuggetSolinium");
|
||||
addBillet(ModItems.billet_uranium_fuel, ModItems.nugget_uranium_fuel);
|
||||
addBillet(ModItems.billet_thorium_fuel, ModItems.nugget_thorium_fuel);
|
||||
addBillet(ModItems.billet_plutonium_fuel, ModItems.nugget_plutonium_fuel);
|
||||
@ -102,7 +102,7 @@ public class MineralRecipes {
|
||||
addBillet(ModItems.billet_les, ModItems.nugget_les);
|
||||
addBillet(ModItems.billet_schrabidium_fuel, ModItems.nugget_schrabidium_fuel);
|
||||
addBillet(ModItems.billet_hes, ModItems.nugget_hes);
|
||||
addBillet(ModItems.billet_australium, ModItems.nugget_australium);
|
||||
addBillet(ModItems.billet_australium, ModItems.nugget_australium, "nuggetAustralium");
|
||||
addBillet(ModItems.billet_australium_greater, ModItems.nugget_australium_greater);
|
||||
addBillet(ModItems.billet_australium_lesser, ModItems.nugget_australium_lesser);
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ public class PowderRecipes {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_semtex_mix, 3), new Object[] { ModItems.solid_fuel, ModItems.cordite, "dustSaltpeter" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_semtex_mix, 1), new Object[] { ModItems.solid_fuel, ModItems.ballistite, "dustSaltpeter" }));
|
||||
|
||||
//Desh
|
||||
//Desh //TODO: add ore dict for all these tiny powders
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.powder_desh_mix, 1), new Object[] { ModItems.powder_boron_tiny, ModItems.powder_boron_tiny, ModItems.powder_lanthanium_tiny, ModItems.powder_lanthanium_tiny, ModItems.powder_cerium_tiny, ModItems.powder_cobalt_tiny, ModItems.powder_lithium_tiny, ModItems.powder_neodymium_tiny, ModItems.powder_niobium_tiny });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.powder_desh_mix, 9), new Object[] { ModItems.powder_boron, ModItems.powder_boron, ModItems.powder_lanthanium, ModItems.powder_lanthanium, ModItems.powder_cerium, ModItems.powder_cobalt, ModItems.powder_lithium, ModItems.powder_neodymium, ModItems.powder_niobium });
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_desh_ready, 1), new Object[] { ModItems.powder_desh_mix, ModItems.nugget_mercury, ModItems.nugget_mercury, "dustCoal" }));
|
||||
@ -47,8 +47,8 @@ public class PowderRecipes {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_red_copper, 2), new Object[] { "dustRedstone", "dustCopper" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_steel, 2), new Object[] { "dustIron", "dustCoal" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { "dustSteel", "dustTungsten" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { "dustSteel", ModItems.powder_cobalt }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { "dustSteel", "dustCobalt" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { "dustIron", "dustCoal", "dustTungsten", "dustTungsten" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { "dustIron", "dustCoal", ModItems.powder_cobalt, ModItems.powder_cobalt }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { "dustIron", "dustCoal", "dustCobalt", "dustCobalt" }));
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("nuggetSchrabidium", ModItems.nugget_schrabidium);
|
||||
OreDictionary.registerOre("nuggetZirconium", ModItems.nugget_zirconium);
|
||||
OreDictionary.registerOre("nuggetRadium226", ModItems.nugget_ra226);
|
||||
OreDictionary.registerOre("nuggetGol198", ModItems.nugget_au198);
|
||||
OreDictionary.registerOre("nuggetGold198", ModItems.nugget_au198);
|
||||
OreDictionary.registerOre("tinyU233", ModItems.nugget_u233);
|
||||
OreDictionary.registerOre("tinyU235", ModItems.nugget_u235);
|
||||
OreDictionary.registerOre("tinyU238", ModItems.nugget_u238);
|
||||
@ -196,6 +196,7 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("plateIron", ModItems.plate_iron);
|
||||
OreDictionary.registerOre("plateGold", ModItems.plate_gold);
|
||||
OreDictionary.registerOre("plateAdvanced", ModItems.plate_advanced_alloy);
|
||||
OreDictionary.registerOre("plateAdvancedAlloy", ModItems.plate_advanced_alloy);
|
||||
OreDictionary.registerOre("plateSchrabidium", ModItems.plate_schrabidium);
|
||||
OreDictionary.registerOre("plateCMBSteel", ModItems.plate_combine_steel);
|
||||
OreDictionary.registerOre("plateSaturnite", ModItems.plate_saturnite);
|
||||
@ -264,6 +265,7 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("blockCopper", ModBlocks.block_copper);
|
||||
OreDictionary.registerOre("blockMingrade", ModBlocks.block_red_copper);
|
||||
OreDictionary.registerOre("blockAdvanced", ModBlocks.block_advanced_alloy);
|
||||
OreDictionary.registerOre("blockAdvancedAlloy", ModBlocks.block_advanced_alloy);
|
||||
OreDictionary.registerOre("blockTungsten", ModBlocks.block_tungsten);
|
||||
OreDictionary.registerOre("blockAluminum", ModBlocks.block_aluminium);
|
||||
OreDictionary.registerOre("blockFluorite", ModBlocks.block_fluorite);
|
||||
|
||||
@ -63,6 +63,21 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random rand, int i, int j) {
|
||||
|
||||
if(WorldConfig.oilcoalSpawn > 0 && rand.nextInt(WorldConfig.oilcoalSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 64, 32, 32, ModBlocks.ore_coal_oil);
|
||||
|
||||
if(WorldConfig.gasbubbleSpawn > 0 && rand.nextInt(WorldConfig.gasbubbleSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_flammable);
|
||||
|
||||
if(WorldConfig.explosivebubbleSpawn > 0 && rand.nextInt(WorldConfig.explosivebubbleSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_explosive);
|
||||
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_iron, rand, 24);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_titanium, rand, 32);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_tungsten, rand, 32);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_cinnebar, rand, 16);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_zirconium, rand, 16);
|
||||
|
||||
if(WorldConfig.overworldOre) {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 25, 6, 30, 10, ModBlocks.ore_gneiss_iron, ModBlocks.stone_gneiss);
|
||||
@ -95,21 +110,6 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.titaniumClusterSpawn, 6, 5, 30, ModBlocks.cluster_titanium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.aluminiumClusterSpawn, 6, 5, 40, ModBlocks.cluster_aluminium);
|
||||
|
||||
if(WorldConfig.oilcoalSpawn > 0 && rand.nextInt(WorldConfig.oilcoalSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 64, 32, 32, ModBlocks.ore_coal_oil);
|
||||
|
||||
if(WorldConfig.gasbubbleSpawn > 0 && rand.nextInt(WorldConfig.gasbubbleSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_flammable);
|
||||
|
||||
if(WorldConfig.explosivebubbleSpawn > 0 && rand.nextInt(WorldConfig.explosivebubbleSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_explosive);
|
||||
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_iron, rand, 24);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_titanium, rand, 32);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_tungsten, rand, 32);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_cinnebar, rand, 16);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_zirconium, rand, 16);
|
||||
|
||||
if(GeneralConfig.enable528ColtanSpawn) {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, GeneralConfig.coltanRate, 4, 15, 40, ModBlocks.ore_coltan);
|
||||
}
|
||||
@ -625,11 +625,11 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
|
||||
if(GeneralConfig.enablePlutoniumOre)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherPlutoniumSpawn, 4, 0, 127, ModBlocks.ore_nether_plutonium, Blocks.netherrack);
|
||||
|
||||
DepthDeposit.generateConditionNether(world, i, 0, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
|
||||
DepthDeposit.generateConditionNether(world, i, 125, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
|
||||
}
|
||||
|
||||
DepthDeposit.generateConditionNether(world, i, 0, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
|
||||
DepthDeposit.generateConditionNether(world, i, 125, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
|
||||
|
||||
for(int k = 0; k < 30; k++){
|
||||
int x = i + rand.nextInt(16);
|
||||
int z = j + rand.nextInt(16);
|
||||
|
||||
@ -60,17 +60,18 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.bolt_tungsten, 4), new Object[] { "D", "D", 'D', "ingotTungsten" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.bolt_compound, 1), new Object[] { "PDP", "PTP", "PDP", 'D', ModItems.bolt_dura_steel, 'T', ModItems.bolt_tungsten, 'P', "plateTitanium" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.pellet_coal, 1), new Object[] { "PFP", "FOF", "PFP", 'P', "dustCoal", 'F', Items.flint, 'O', ModBlocks.gravel_obsidian }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_polymer, 8), new Object[] { "DD", 'D', ModItems.ingot_polymer});
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_polymer, 8), new Object[] { "DD", 'D', "ingotPolymer" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_polymer, 16), new Object[] { "DD", 'D', ModItems.ingot_fiberglass});
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_polymer, 16), new Object[] { "DD", 'D', ModItems.ingot_asbestos});
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_polymer, 16), new Object[] { "DD", 'D', "ingotAsbestos"}));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_polymer, 4), new Object[] { "SWS", 'S', Items.string, 'W', Blocks.wool });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_polymer, 4), new Object[] { "BB", 'B', Items.brick });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_polymer, 4), new Object[] { "BB", 'B', "ingotBrick" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_polymer, 4), new Object[] { "BB", 'B', "ingotNetherBrick" }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.marker_structure, 1), new Object[] { "L", "G", "R", 'L', "dustLapis", 'G', Items.glowstone_dust, 'R', Blocks.redstone_torch }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.circuit_raw, 1), new Object[] { "A", "R", "S", 'S', "plateSteel", 'R', "dustRedstone", 'A', ModItems.wire_aluminium }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.circuit_bismuth_raw, 1), new Object[] { "RPR", "ABA", "RPR", 'R', "dustRedstone", 'P', "ingotPolymer", 'A', (GeneralConfig.enable528 ? ModItems.circuit_tantalium : "ingotAsbestos"), 'B', ModItems.ingot_bismuth }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.circuit_tantalium_raw, 1), new Object[] { "RWR", "PTP", "RWR", 'R', "dustRedstone", 'W', ModItems.wire_gold, 'P', "plateCopper", 'T', ModItems.nugget_tantalium }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.circuit_tantalium_raw, 1), new Object[] { "RWR", "PTP", "RWR", 'R', "dustRedstone", 'W', ModItems.wire_gold, 'P', "plateCopper", 'T', "nuggetTantalum" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.circuit_targeting_tier1, 1), new Object[] { "CPC", 'C', ModItems.circuit_aluminium, 'P', "dustRedstone" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.circuit_targeting_tier2, 1), new Object[] { "CPC", 'C', ModItems.circuit_copper, 'P', "dustNetherQuartz" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.circuit_targeting_tier3, 1), new Object[] { "CPC", 'C', ModItems.circuit_red_copper, 'P', "dustGold" }));
|
||||
@ -194,8 +195,8 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.shimmer_axe, 1), new Object[] { "H", "G", "G", 'G', ModItems.shimmer_handle, 'H', ModItems.shimmer_axe_head });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.definitelyfood, 1), new Object[] { "DDD", "SDS", "DDD", 'D', Blocks.dirt, 'S', "plateSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blade_tungsten, 2), new Object[] { "IP", "TP", "TI", 'P', "plateTitanium", 'T', "ingotTitanium", 'I', "ingotTungsten" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.turbine_tungsten, 1), new Object[] { "BBB", "BSB", "BBB", 'B', ModItems.blade_tungsten, 'S', ModItems.ingot_dura_steel });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ring_starmetal, 1), new Object[] { " S ", "S S", " S ", 'S', ModItems.ingot_starmetal });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.turbine_tungsten, 1), new Object[] { "BBB", "BSB", "BBB", 'B', ModItems.blade_tungsten, 'S', "ingotDuraSteel" });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ring_starmetal, 1), new Object[] { " S ", "S S", " S ", 'S', "ingotStarmetal" });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.flywheel_beryllium, 1), new Object[] { "BBB", "BTB", "BBB", 'B', "blockBeryllium", 'T', ModItems.bolt_compound }));
|
||||
|
||||
ItemStack infinity = new ItemStack(Items.enchanted_book);
|
||||
@ -237,7 +238,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_boiler_electric_off, 1), new Object[] { "SPS", "TFT", "SPS", 'S', "ingotDesh", 'P', ModItems.board_copper, 'T', ModItems.tank_steel, 'F', ModBlocks.machine_electric_furnace_off }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_turbine, 1), new Object[] { "PTP", "BMB", "PTP", 'P', "plateTitanium", 'T', ModItems.turbine_titanium, 'B', ModItems.tank_steel, 'M', ModItems.motor }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_converter_he_rf, 1), new Object[] { "SSS", "CRB", "SSS", 'S', "ingotSteel", 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus, 'B', "blockRedstone" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_converter_rf_he, 1), new Object[] { "SSS", "BRC", "SSS", 'S', ModItems.ingot_beryllium, 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus, 'B', "blockRedstone" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_converter_rf_he, 1), new Object[] { "SSS", "BRC", "SSS", 'S', "ingotBeryllium", 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus, 'B', "blockRedstone" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.crate_iron, 1), new Object[] { "PPP", "I I", "III", 'P', "plateIron", 'I', "ingotIron" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.crate_steel, 1), new Object[] { "PPP", "I I", "III", 'P', "plateSteel", 'I', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.crate_tungsten, 1), new Object[] { "BPB", "PCP", "BPB", 'B', "blockTungsten", 'P', ModItems.board_copper, 'C', ModBlocks.crate_steel }));
|
||||
@ -329,7 +330,7 @@ public class CraftingManager {
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.reinforced_stone, 4), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.cobblestone, 'B', Blocks.stone });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.brick_light, 4), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.fence, 'B', Blocks.brick_block });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.brick_asbestos, 2), new Object[] { " A ", "ABA", " A ", 'B', ModBlocks.brick_light, 'A', ModItems.ingot_asbestos });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.brick_asbestos, 2), new Object[] { " A ", "ABA", " A ", 'B', ModBlocks.brick_light, 'A', "ingotAsbestos" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.concrete, 4), new Object[] { "CC", "CC", 'C', ModBlocks.concrete_smooth });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.concrete_pillar, 8), new Object[] { "CBC", "CBC", "CBC", 'C', ModBlocks.concrete_smooth, 'B', Blocks.iron_bars });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.brick_concrete, 4), new Object[] { " C ", "CBC", " C ", 'C', ModBlocks.concrete_smooth, 'B', Items.clay_ball });
|
||||
@ -344,7 +345,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.meteor_brick_mossy, 8), new Object[] { "CCC", "CVC", "CCC", 'C', ModBlocks.meteor_brick, 'V', Blocks.vine });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.meteor_brick_cracked, 6), new Object[] { " C " , "C C", " C ", 'C', ModBlocks.meteor_brick });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.meteor_battery, 1), new Object[] { "MSM", "MWM", "MSM", 'M', ModBlocks.meteor_polished, 'S', ModBlocks.block_starmetal, 'W', ModItems.wire_schrabidium });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.tile_lab, 4), new Object[] { "CBC", "CBC", "CBC", 'C', Items.brick, 'B', ModItems.ingot_asbestos });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.tile_lab, 4), new Object[] { "CBC", "CBC", "CBC", 'C', Items.brick, 'B', "ingotAsbestos" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.tile_lab_cracked, 6), new Object[] { " C " , "C C", " C ", 'C', ModBlocks.tile_lab });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.tile_lab_broken, 6), new Object[] { " C " , "C C", " C ", 'C', ModBlocks.tile_lab_cracked });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.asphalt_light, 1), new Object[] { ModBlocks.asphalt, Items.glowstone_dust });
|
||||
@ -376,11 +377,11 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reinforced_lamp_off), 1), new Object[] { "FFF", "FBF", "FFF", 'F', Blocks.iron_bars, 'B', Blocks.redstone_lamp });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reinforced_sand), 4), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.iron_bars, 'B', Blocks.sandstone });
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.lamp_tritium_green_off, 1), new Object[] { "GPG", "1T2", "GPG", 'G', "blockGlass", 'P', ModItems.powder_fire, 'T', ModItems.cell_tritium, '1', "dustSulfur", '2', "dustCopper" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.lamp_tritium_blue_off, 1), new Object[] { "GPG", "1T2", "GPG", 'G', "blockGlass", 'P', ModItems.powder_fire, 'T', ModItems.cell_tritium, '1', "dustAluminum", '2', ModItems.powder_strontium }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.lamp_tritium_green_off, 1), new Object[] { "GPG", "1T2", "GPG", 'G', "blockGlass", 'P', "dustPhosphorus", 'T', ModItems.cell_tritium, '1', "dustSulfur", '2', "dustCopper" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.lamp_tritium_blue_off, 1), new Object[] { "GPG", "1T2", "GPG", 'G', "blockGlass", 'P',"dustPhosphorus", 'T', ModItems.cell_tritium, '1', "dustAluminum", '2', ModItems.powder_strontium }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.barbed_wire, 16), new Object[] { "AIA", "I I", "AIA", 'A', ModItems.wire_aluminium, 'I', "ingotIron" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.barbed_wire_fire, 8), new Object[] { "BBB", "BIB", "BBB", 'B', ModBlocks.barbed_wire, 'I', ModItems.powder_fire });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.barbed_wire_fire, 8), new Object[] { "BBB", "BIB", "BBB", 'B', ModBlocks.barbed_wire, 'I', "dustPhosphorus" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.barbed_wire_poison, 8), new Object[] { "BBB", "BIB", "BBB", 'B', ModBlocks.barbed_wire, 'I', ModItems.powder_poison });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.barbed_wire_acid, 8), new Object[] { "BBB", "BIB", "BBB", 'B', ModBlocks.barbed_wire, 'I', new ItemStack(ModItems.fluid_tank_full, 1, FluidType.ACID.getID()) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.barbed_wire_wither, 8), new Object[] { "BBB", "BIB", "BBB", 'B', ModBlocks.barbed_wire, 'I', new ItemStack(Items.skull, 1, 1) });
|
||||
@ -388,11 +389,11 @@ public class CraftingManager {
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.tape_recorder), 4), new Object[] { "TST", "SSS", 'T', "ingotTungsten", 'S', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_poles), 16), new Object[] { "S S", "SSS", "S S", 'S', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.pole_top), 1), new Object[] { "T T", "TRT", "BBB", 'T', "ingotTungsten", 'B', ModItems.ingot_beryllium, 'R', "ingotMingrade" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.pole_top), 1), new Object[] { "T T", "TRT", "BBB", 'T', "ingotTungsten", 'B', "ingotBeryllium", 'R', "ingotMingrade" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.pole_satellite_receiver), 1), new Object[] { "SS ", "SCR", "SS ", 'S', "ingotSteel", 'C', ModItems.circuit_red_copper, 'R', ModItems.wire_red_copper }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_beam), 8), new Object[] { "S", "S", "S", 'S', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_wall), 4), new Object[] { "SSS", "SSS", 'S', "ingotSteel" }));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_corner)), new Object[] { Item.getItemFromBlock(ModBlocks.steel_wall), Item.getItemFromBlock(ModBlocks.steel_wall) });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_corner)), new Object[] { ModBlocks.steel_wall, ModBlocks.steel_wall });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_roof), 2), new Object[] { "SSS", 'S', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_scaffold), 8), new Object[] { "SSS", " S ", "SSS", 'S', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_beam), 8), new Object[] { "S", "S", "S", 'S', ModBlocks.steel_scaffold });
|
||||
@ -410,7 +411,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_50, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_50 }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.sat_dock, 1), new Object[] { "SSS", "PCP", 'S', "ingotSteel", 'P', "ingotPolymer", 'C', ModBlocks.crate_iron }));
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.book_guide), 1), new Object[] { "IBI", "LBL", "IBI", 'B', Items.book, 'I', new ItemStack(Items.dye, 1, 0), 'L', new ItemStack(Items.dye, 1, 4) });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.book_guide, 1), new Object[] { "IBI", "LBL", "IBI", 'B', Items.book, 'I', "dyeBlack", 'L', "dyeBlue" }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.rail_highspeed), 16), new Object[] { "S S", "SIS", "S S", 'S', "ingotSteel", 'I', "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.rail_booster), 6), new Object[] { "S S", "CIC", "SRS", 'S', "ingotSteel", 'I', "plateIron", 'R', "ingotMingrade", 'C', ModItems.coil_copper }));
|
||||
@ -833,18 +834,18 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_lead, 4), new Object[] { "##", "##", '#', "ingotLead" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_steel, 4), new Object[] { "##", "##", '#', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_schrabidium, 4), new Object[] { "##", "##", '#', "ingotSchrabidium" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_advanced_alloy, 4), new Object[] { "##", "##", '#', ModItems.ingot_advanced_alloy });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_saturnite, 4), new Object[] { "##", "##", '#', ModItems.ingot_saturnite });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_combine_steel, 4), new Object[] { "##", "##", '#', ModItems.ingot_combine_steel });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_advanced_alloy, 4), new Object[] { "##", "##", '#', "ingotAdvancedAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_saturnite, 4), new Object[] { "##", "##", '#', "ingotSaturnite" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_combine_steel, 4), new Object[] { "##", "##", '#', "ingotCMBSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.neutron_reflector, 4), new Object[] { "##", "##", '#', "ingotTungsten" }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_aluminium, 16), new Object[] { "###", '#', "ingotAluminum" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_copper, 16), new Object[] { "###", '#', "ingotCopper" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_tungsten, 16), new Object[] { "###", '#', "ingotTungsten" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.wire_red_copper, 16), new Object[] { "###", '#', ModItems.ingot_red_copper });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.wire_advanced_alloy, 16), new Object[] { "###", '#', ModItems.ingot_advanced_alloy });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_red_copper, 16), new Object[] { "###", '#', "ingotMingrade" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_advanced_alloy, 16), new Object[] { "###", '#', "ingotAdvancedAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_gold, 16), new Object[] { "###", '#', "ingotGold" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.wire_schrabidium, 16), new Object[] { "###", '#', ModItems.ingot_schrabidium });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_schrabidium, 16), new Object[] { "###", '#', "ingotSchrabidium" }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.book_of_), new Object[] { "BGB", "GAG", "BGB", 'B', ModItems.egg_balefire_shard, 'G', "ingotGold", 'A', Items.book }));
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.items.machine.ItemAssemblyTemplate;
|
||||
import com.hbm.items.machine.ItemCassette;
|
||||
import com.hbm.items.machine.ItemChemistryTemplate;
|
||||
import com.hbm.items.machine.ItemFluidIdentifier;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
@ -45,6 +46,9 @@ public class ItemFolderPacket implements IMessage {
|
||||
|
||||
public static class Handler implements IMessageHandler<ItemFolderPacket, IMessage> {
|
||||
|
||||
/*
|
||||
* While it is still horrible, it is arguably less horrible than it was before.
|
||||
*/
|
||||
@Override
|
||||
public IMessage onMessage(ItemFolderPacket m, MessageContext ctx) {
|
||||
|
||||
@ -58,97 +62,117 @@ public class ItemFolderPacket implements IMessage {
|
||||
}
|
||||
|
||||
if(stack.getItem() instanceof ItemFluidIdentifier) {
|
||||
|
||||
if(p.inventory.hasItem(ModItems.plate_iron) && p.inventory.hasItem(Items.dye)) {
|
||||
p.inventory.consumeInventoryItem(ModItems.plate_iron);
|
||||
p.inventory.consumeInventoryItem(Items.dye);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
}
|
||||
tryMakeItem(p, stack, "plateIron", "dye");
|
||||
return null;
|
||||
}
|
||||
if(stack.getItem() instanceof ItemAssemblyTemplate) {
|
||||
|
||||
if(p.inventory.hasItem(Items.paper) && p.inventory.hasItem(Items.dye)) {
|
||||
p.inventory.consumeInventoryItem(Items.paper);
|
||||
p.inventory.consumeInventoryItem(Items.dye);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
}
|
||||
tryMakeItem(p, stack, Items.paper, "dye");
|
||||
return null;
|
||||
}
|
||||
if(stack.getItem() instanceof ItemChemistryTemplate) {
|
||||
|
||||
if(p.inventory.hasItem(Items.paper) && p.inventory.hasItem(Items.dye)) {
|
||||
p.inventory.consumeInventoryItem(Items.paper);
|
||||
p.inventory.consumeInventoryItem(Items.dye);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
}
|
||||
tryMakeItem(p, stack, Items.paper, "dye");
|
||||
return null;
|
||||
}
|
||||
if(stack.getItem() instanceof ItemCassette) {
|
||||
if(p.inventory.hasItem(ModItems.plate_polymer) && p.inventory.hasItem(ModItems.plate_steel)) {
|
||||
p.inventory.consumeInventoryItem(ModItems.plate_polymer);
|
||||
p.inventory.consumeInventoryItem(ModItems.plate_steel);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
}
|
||||
tryMakeItem(p, stack, ModItems.plate_polymer, "plateSteel");
|
||||
return null;
|
||||
}
|
||||
if(stack.getItem() == ModItems.stamp_stone_plate ||
|
||||
stack.getItem() == ModItems.stamp_stone_wire ||
|
||||
stack.getItem() == ModItems.stamp_stone_circuit) {
|
||||
if(p.inventory.hasItem(ModItems.stamp_stone_flat)) {
|
||||
p.inventory.consumeInventoryItem(ModItems.stamp_stone_flat);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
}
|
||||
tryConvert(p, ModItems.stamp_stone_flat, stack.getItem());
|
||||
return null;
|
||||
}
|
||||
if(stack.getItem() == ModItems.stamp_iron_plate ||
|
||||
stack.getItem() == ModItems.stamp_iron_wire ||
|
||||
stack.getItem() == ModItems.stamp_iron_circuit) {
|
||||
if(p.inventory.hasItem(ModItems.stamp_iron_flat)) {
|
||||
p.inventory.consumeInventoryItem(ModItems.stamp_iron_flat);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
tryConvert(p, ModItems.stamp_iron_flat, stack.getItem());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if(stack.getItem() == ModItems.stamp_steel_plate ||
|
||||
stack.getItem() == ModItems.stamp_steel_wire ||
|
||||
stack.getItem() == ModItems.stamp_steel_circuit) {
|
||||
if(p.inventory.hasItem(ModItems.stamp_steel_flat)) {
|
||||
p.inventory.consumeInventoryItem(ModItems.stamp_steel_flat);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
tryConvert(p, ModItems.stamp_steel_flat, stack.getItem());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if(stack.getItem() == ModItems.stamp_titanium_plate ||
|
||||
stack.getItem() == ModItems.stamp_titanium_wire ||
|
||||
stack.getItem() == ModItems.stamp_titanium_circuit) {
|
||||
if(p.inventory.hasItem(ModItems.stamp_titanium_flat)) {
|
||||
p.inventory.consumeInventoryItem(ModItems.stamp_titanium_flat);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
tryConvert(p, ModItems.stamp_titanium_flat, stack.getItem());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if(stack.getItem() == ModItems.stamp_obsidian_plate ||
|
||||
stack.getItem() == ModItems.stamp_obsidian_wire ||
|
||||
stack.getItem() == ModItems.stamp_obsidian_circuit) {
|
||||
if(p.inventory.hasItem(ModItems.stamp_obsidian_flat)) {
|
||||
p.inventory.consumeInventoryItem(ModItems.stamp_obsidian_flat);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
tryConvert(p, ModItems.stamp_obsidian_flat, stack.getItem());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if(stack.getItem() == ModItems.stamp_schrabidium_plate ||
|
||||
stack.getItem() == ModItems.stamp_schrabidium_wire ||
|
||||
stack.getItem() == ModItems.stamp_schrabidium_circuit) {
|
||||
if(p.inventory.hasItem(ModItems.stamp_schrabidium_flat)) {
|
||||
p.inventory.consumeInventoryItem(ModItems.stamp_schrabidium_flat);
|
||||
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||
tryConvert(p, ModItems.stamp_schrabidium_flat, stack.getItem());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void tryMakeItem(EntityPlayer player, ItemStack output, Object... ingredients) {
|
||||
|
||||
//check
|
||||
for(Object o : ingredients) {
|
||||
|
||||
if(o instanceof Item) {
|
||||
if(!player.inventory.hasItem((Item)o))
|
||||
return;
|
||||
}
|
||||
|
||||
if(o instanceof String) {
|
||||
if(InventoryUtil.hasOreDictMatches(player, (String)o, 1))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//consume
|
||||
for(Object o : ingredients) {
|
||||
|
||||
if(o instanceof Item) {
|
||||
if(!player.inventory.hasItem((Item)o))
|
||||
return;
|
||||
}
|
||||
|
||||
if(o instanceof String) {
|
||||
if(InventoryUtil.hasOreDictMatches(player, (String)o, 1))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!player.inventory.addItemStackToInventory(output))
|
||||
player.dropPlayerItemWithRandomChoice(output, true);
|
||||
}
|
||||
|
||||
private void tryConvert(EntityPlayer player, Item target, Item result) {
|
||||
|
||||
for(int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
|
||||
ItemStack stack = player.inventory.mainInventory[i];
|
||||
|
||||
if(stack != null && stack.getItem() == target) {
|
||||
stack = new ItemStack(result, stack.stackSize, stack.getItemDamage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.AnvilRecipes.AnvilOutput;
|
||||
@ -8,6 +9,7 @@ import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
//'t was about time
|
||||
public class InventoryUtil {
|
||||
@ -275,4 +277,57 @@ public class InventoryUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasOreDictMatches(EntityPlayer player, String dict, int count) {
|
||||
return countOreDictMatches(player, dict) >= count;
|
||||
}
|
||||
|
||||
public static int countOreDictMatches(EntityPlayer player, String dict) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
for(int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
|
||||
ItemStack stack = player.inventory.mainInventory[i];
|
||||
|
||||
if(stack != null) {
|
||||
|
||||
int[] ids = OreDictionary.getOreIDs(stack);
|
||||
List<String> dicts = new ArrayList();
|
||||
|
||||
for(int id : ids) {
|
||||
if(OreDictionary.getOreName(id).equals(dict)) {
|
||||
count += stack.stackSize;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
public static void consumeOreDictMatches(EntityPlayer player, String dict, int count) {
|
||||
|
||||
for(int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
|
||||
ItemStack stack = player.inventory.mainInventory[i];
|
||||
|
||||
if(stack != null) {
|
||||
|
||||
int[] ids = OreDictionary.getOreIDs(stack);
|
||||
List<String> dicts = new ArrayList();
|
||||
|
||||
for(int id : ids) {
|
||||
if(OreDictionary.getOreName(id).equals(dict)) {
|
||||
|
||||
int toConsume = Math.min(count, stack.stackSize);
|
||||
player.inventory.decrStackSize(i, toConsume);
|
||||
count -= toConsume;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user