mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-18 11:19:28 +00:00
Close #1212 Use OreDictionary to choose a type of Copper/Tin/Bronze
This commit is contained in:
1 parent
502160011b
commit
55c32a8280
20 files changed
+268
-159
No files matched your search
@@ -56,7 +56,8 @@ import forestry.plugins.PluginManager;
|
||||
+ "after:BiomesOPlenty;"
|
||||
+ "after:IC2@[2.3.235,);"
|
||||
+ "after:Natura@[2.2.0,);"
|
||||
+ "after:HardcoreEnderExpansion;")
|
||||
+ "after:HardcoreEnderExpansion;"
|
||||
+ "after:basemetals;")
|
||||
public class Forestry {
|
||||
|
||||
@Mod.Instance(Constants.MOD_ID)
|
||||
|
||||
@@ -5,32 +5,28 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.storage;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Makes a new crate, registers it with the game registry,
|
||||
* and creates crating and uncrating recipes for the Carpenter.
|
||||
* The icon is rendered automatically from the contained item.
|
||||
* If an oreDictName is specified, it will make recipes using that.
|
||||
*
|
||||
* Can only be called during the Init stage.
|
||||
*/
|
||||
public interface ICrateRegistry {
|
||||
|
||||
/**
|
||||
* Makes a new crate, registers it with the game registry,
|
||||
* and creates crating and uncrating recipes for the Carpenter.
|
||||
* The icon is rendered automatically from the contained item.
|
||||
*
|
||||
* Can only be called during the Init stage.
|
||||
*/
|
||||
void registerCrate(Item item);
|
||||
void registerCrate(@Nonnull Item item);
|
||||
|
||||
void registerCrate(Block block);
|
||||
void registerCrate(@Nonnull Block block);
|
||||
|
||||
void registerCrate(ItemStack stack);
|
||||
void registerCrate(@Nonnull ItemStack stack);
|
||||
|
||||
/**
|
||||
* Same as the above, but uses the ore dictionary for inputs in the Carpenter crating recipe.
|
||||
*/
|
||||
void registerCrateUsingOreDict(Item item);
|
||||
|
||||
void registerCrateUsingOreDict(Block block);
|
||||
|
||||
void registerCrateUsingOreDict(ItemStack stack);
|
||||
void registerCrate(@Nonnull String oreDictName);
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import forestry.core.items.ItemForestry;
|
||||
import forestry.core.items.ItemOverlay;
|
||||
import forestry.core.items.ItemRegistry;
|
||||
import forestry.core.items.ItemScoop;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
|
||||
public class ItemRegistryApiculture extends ItemRegistry {
|
||||
public final ItemBeeGE beeQueenGE;
|
||||
@@ -71,24 +72,24 @@ public class ItemRegistryApiculture extends ItemRegistry {
|
||||
|
||||
// / BEE RESOURCES
|
||||
honeyDrop = registerItem(new ItemOverlay(Tabs.tabApiculture, EnumHoneyDrop.VALUES), "honeyDrop");
|
||||
OreDictionary.registerOre("dropHoney", honeyDrop);
|
||||
OreDictionary.registerOre(OreDictUtil.DROP_HONEY, honeyDrop);
|
||||
|
||||
pollenCluster = registerItem(new ItemPollenCluster(), "pollen");
|
||||
OreDictionary.registerOre("itemPollen", pollenCluster);
|
||||
OreDictionary.registerOre(OreDictUtil.ITEM_POLLEN, pollenCluster);
|
||||
|
||||
propolis = registerItem(new ItemPropolis(), "propolis");
|
||||
|
||||
honeydew = registerItem(new ItemForestry(Tabs.tabApiculture), "honeydew");
|
||||
OreDictionary.registerOre("dropHoneydew", honeydew);
|
||||
OreDictionary.registerOre(OreDictUtil.DROP_HONEYDEW, honeydew);
|
||||
|
||||
royalJelly = registerItem(new ItemForestry(Tabs.tabApiculture), "royalJelly");
|
||||
OreDictionary.registerOre("dropRoyalJelly", royalJelly);
|
||||
OreDictionary.registerOre(OreDictUtil.DROP_ROYAL_JELLY, royalJelly);
|
||||
|
||||
waxCast = registerItem(new ItemWaxCast(), "waxCast");
|
||||
|
||||
// / BEE COMBS
|
||||
beeComb = registerItem(new ItemHoneyComb(), "beeCombs");
|
||||
OreDictionary.registerOre("beeComb", beeComb.getWildcard());
|
||||
OreDictionary.registerOre(OreDictUtil.BEE_COMB, beeComb.getWildcard());
|
||||
|
||||
// / APIARIST'S CLOTHES
|
||||
apiaristHat = registerItem(new ItemArmorApiarist(EntityEquipmentSlot.HEAD), "apiaristHelmet");
|
||||
|
||||
@@ -29,6 +29,7 @@ import forestry.arboriculture.items.ItemBlockWoodDoor;
|
||||
import forestry.arboriculture.items.ItemBlockWoodSlab;
|
||||
import forestry.core.blocks.BlockRegistry;
|
||||
import forestry.core.items.ItemBlockForestry;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
|
||||
public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
public final List<BlockArbLog> logs;
|
||||
@@ -60,25 +61,25 @@ public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
logs = BlockArbLog.create(false);
|
||||
for (BlockArbLog block : logs) {
|
||||
registerBlock(block, new ItemBlockWood(block), "logs." + block.getBlockNumber());
|
||||
registerOreDictWildcard("logWood", block);
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
}
|
||||
|
||||
logsFireproof = BlockArbLog.create(true);
|
||||
for (BlockArbLog block : logsFireproof) {
|
||||
registerBlock(block, new ItemBlockWood(block), "logs.fireproof." + block.getBlockNumber());
|
||||
registerOreDictWildcard("logWood", block);
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
}
|
||||
|
||||
planks = BlockArbPlanks.create(false);
|
||||
for (BlockArbPlanks block : planks) {
|
||||
registerBlock(block, new ItemBlockWood(block), "planks." + block.getBlockNumber());
|
||||
registerOreDictWildcard("plankWood", block);
|
||||
registerOreDictWildcard(OreDictUtil.PLANK_WOOD, block);
|
||||
}
|
||||
|
||||
planksFireproof = BlockArbPlanks.create(true);
|
||||
for (BlockArbPlanks block : planksFireproof) {
|
||||
registerBlock(block, new ItemBlockWood(block), "planks.fireproof." + block.getBlockNumber());
|
||||
registerOreDictWildcard("plankWood", block);
|
||||
registerOreDictWildcard(OreDictUtil.PLANK_WOOD, block);
|
||||
}
|
||||
|
||||
slabs = BlockArbSlab.create(false, false);
|
||||
@@ -88,7 +89,7 @@ public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
BlockArbSlab slabDouble = slabsDouble.get(i);
|
||||
registerBlock(slab, new ItemBlockWoodSlab(slab, slab, slabDouble), "slabs." + slab.getBlockNumber());
|
||||
registerBlock(slabDouble, new ItemBlockWoodSlab(slabDouble, slab, slabDouble), "slabs.double." + slabDouble.getBlockNumber());
|
||||
registerOreDictWildcard("slabWood", slab);
|
||||
registerOreDictWildcard(OreDictUtil.SLAB_WOOD, slab);
|
||||
}
|
||||
|
||||
slabsFireproof = BlockArbSlab.create(true, false);
|
||||
@@ -98,19 +99,19 @@ public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
BlockArbSlab slabDouble = slabsDoubleFireproof.get(i);
|
||||
registerBlock(slab, new ItemBlockWoodSlab(slab, slab, slabDouble), "slabs.fireproof." + slab.getBlockNumber());
|
||||
registerBlock(slabDouble, new ItemBlockWoodSlab(slabDouble, slab, slabDouble), "slabs.double.fireproof." + slabDouble.getBlockNumber());
|
||||
registerOreDictWildcard("slabWood", slab);
|
||||
registerOreDictWildcard(OreDictUtil.SLAB_WOOD, slab);
|
||||
}
|
||||
|
||||
fences = BlockArbFence.create(false);
|
||||
for (BlockArbFence block : fences) {
|
||||
registerBlock(block, new ItemBlockWood(block), "fences." + block.getBlockNumber());
|
||||
registerOreDictWildcard("fenceWood", block);
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_WOOD, block);
|
||||
}
|
||||
|
||||
fencesFireproof = BlockArbFence.create(true);
|
||||
for (BlockArbFence block : fencesFireproof) {
|
||||
registerBlock(block, new ItemBlockWood(block), "fences.fireproof." + block.getBlockNumber());
|
||||
registerOreDictWildcard("fenceWood", block);
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_WOOD, block);
|
||||
}
|
||||
|
||||
fenceGates = new ArrayList<>();
|
||||
@@ -118,12 +119,12 @@ public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
for (EnumWoodType woodType : EnumWoodType.VALUES) {
|
||||
BlockArbFenceGate fenceGate = new BlockArbFenceGate(false, woodType);
|
||||
registerBlock(fenceGate, new ItemBlockWood(fenceGate), "fence.gates." + woodType);
|
||||
registerOreDictWildcard("fenceGateWood", fenceGate);
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_GATE_WOOD, fenceGate);
|
||||
fenceGates.add(fenceGate);
|
||||
|
||||
BlockArbFenceGate fenceGateFireproof = new BlockArbFenceGate(true, woodType);
|
||||
registerBlock(fenceGateFireproof, new ItemBlockWood(fenceGateFireproof), "fence.gates.fireproof." + woodType);
|
||||
registerOreDictWildcard("fenceGateWood", fenceGateFireproof);
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_GATE_WOOD, fenceGateFireproof);
|
||||
fenceGatesFireproof.add(fenceGateFireproof);
|
||||
}
|
||||
|
||||
@@ -135,7 +136,7 @@ public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
|
||||
BlockArbStairs stair = new BlockArbStairs(false, blockState, woodType);
|
||||
registerBlock(stair, new ItemBlockWood(stair), "stairs." + woodType);
|
||||
registerOreDictWildcard("stairWood", stair);
|
||||
registerOreDictWildcard(OreDictUtil.STAIR_WOOD, stair);
|
||||
stairs.add(stair);
|
||||
}
|
||||
}
|
||||
@@ -148,7 +149,7 @@ public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
|
||||
BlockArbStairs stair = new BlockArbStairs(true, blockState, woodType);
|
||||
registerBlock(stair, new ItemBlockWood(stair), "stairs.fireproof." + woodType);
|
||||
registerOreDictWildcard("stairWood", stair);
|
||||
registerOreDictWildcard(OreDictUtil.STAIR_WOOD, stair);
|
||||
stairsFireproof.add(stair);
|
||||
}
|
||||
}
|
||||
@@ -157,7 +158,7 @@ public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
for (EnumWoodType woodType : EnumWoodType.VALUES) {
|
||||
BlockArbDoor door = new BlockArbDoor(woodType);
|
||||
registerBlock(door, new ItemBlockWoodDoor(door), "doors." + woodType);
|
||||
registerOreDictWildcard("doorWood", door);
|
||||
registerOreDictWildcard(OreDictUtil.DOOR_WOOD, door);
|
||||
doors.add(door);
|
||||
}
|
||||
|
||||
@@ -165,18 +166,18 @@ public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
TreeDefinition.preInit();
|
||||
saplingGE = new BlockSapling();
|
||||
registerBlock(saplingGE, new ItemBlockForestry(saplingGE), "saplingGE");
|
||||
registerOreDictWildcard("treeSapling", saplingGE);
|
||||
registerOreDictWildcard(OreDictUtil.TREE_SAPLING, saplingGE);
|
||||
|
||||
// Leaves
|
||||
leaves = new BlockForestryLeaves();
|
||||
registerBlock(leaves, new ItemBlockLeaves(leaves), "leaves");
|
||||
registerOreDictWildcard("treeLeaves", leaves);
|
||||
registerOreDictWildcard(OreDictUtil.TREE_LEAVES, leaves);
|
||||
|
||||
leavesDecorative = BlockDecorativeLeaves.create();
|
||||
speciesToLeavesDecorative = new HashMap<>();
|
||||
for (BlockDecorativeLeaves leaves : leavesDecorative) {
|
||||
registerBlock(leaves, new ItemBlockDecorativeLeaves(leaves), "leaves.decorative." + leaves.getBlockNumber());
|
||||
registerOreDictWildcard("treeLeaves", leaves);
|
||||
registerOreDictWildcard(OreDictUtil.TREE_LEAVES, leaves);
|
||||
|
||||
for (IBlockState state : leaves.getBlockState().getValidStates()) {
|
||||
TreeDefinition treeDefinition = state.getValue(leaves.getVariant());
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
import forestry.core.items.ItemRegistry;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
|
||||
public class ItemRegistryArboriculture extends ItemRegistry {
|
||||
public final ItemGermlingGE sapling;
|
||||
@@ -23,7 +24,7 @@ public class ItemRegistryArboriculture extends ItemRegistry {
|
||||
|
||||
public ItemRegistryArboriculture() {
|
||||
sapling = registerItem(new ItemGermlingGE(EnumGermlingType.SAPLING), "sapling");
|
||||
OreDictionary.registerOre("treeSapling", sapling.getWildcard());
|
||||
OreDictionary.registerOre(OreDictUtil.TREE_SAPLING, sapling.getWildcard());
|
||||
|
||||
pollenFertile = registerItem(new ItemGermlingGE(EnumGermlingType.POLLEN), "pollenFertile");
|
||||
grafter = registerItem(new ItemGrafter(4), "grafter");
|
||||
|
||||
@@ -150,29 +150,29 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
crateRegistry.registerCrate(items.mulch);
|
||||
crateRegistry.registerCrate(items.phosphor);
|
||||
crateRegistry.registerCrate(items.ash);
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotTin);
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotCopper);
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotBronze);
|
||||
crateRegistry.registerCrate("ingotTin");
|
||||
crateRegistry.registerCrate("ingotCopper");
|
||||
crateRegistry.registerCrate("ingotBronze");
|
||||
|
||||
// forestry blocks
|
||||
crateRegistry.registerCrate(blocks.humus);
|
||||
crateRegistry.registerCrate(blocks.bogEarth.get(BlockBogEarth.SoilType.BOG_EARTH, 1));
|
||||
|
||||
// vanilla items
|
||||
crateRegistry.registerCrate(Items.WHEAT);
|
||||
crateRegistry.registerCrate("cropWheat");
|
||||
crateRegistry.registerCrate(Items.COOKIE);
|
||||
crateRegistry.registerCrate(Items.REDSTONE);
|
||||
crateRegistry.registerCrate("dustRedstone");
|
||||
crateRegistry.registerCrate(new ItemStack(Items.DYE, 1, 4));
|
||||
crateRegistry.registerCrate(Items.REEDS);
|
||||
crateRegistry.registerCrate("sugarcane");
|
||||
crateRegistry.registerCrate(Items.CLAY_BALL);
|
||||
crateRegistry.registerCrate(Items.GLOWSTONE_DUST);
|
||||
crateRegistry.registerCrate("dustGlowstone");
|
||||
crateRegistry.registerCrate(Items.APPLE);
|
||||
crateRegistry.registerCrate(new ItemStack(Items.NETHER_WART));
|
||||
crateRegistry.registerCrate(new ItemStack(Items.COAL, 1, 1));
|
||||
crateRegistry.registerCrate(new ItemStack(Items.COAL, 1, 0));
|
||||
crateRegistry.registerCrate(Items.WHEAT_SEEDS);
|
||||
crateRegistry.registerCrate(Items.POTATO);
|
||||
crateRegistry.registerCrate(Items.CARROT);
|
||||
crateRegistry.registerCrate("cropPotato");
|
||||
crateRegistry.registerCrate("cropCarrot");
|
||||
|
||||
// vanilla blocks
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.LOG, 1, 0));
|
||||
@@ -181,27 +181,27 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.LOG, 1, 3));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.LOG2, 1, 0));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.LOG2, 1, 1));
|
||||
crateRegistry.registerCrate(Blocks.COBBLESTONE);
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.DIRT, 1, 0));
|
||||
crateRegistry.registerCrate("cobblestone");
|
||||
crateRegistry.registerCrate("dirt");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.DIRT, 1, 2));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.STONE, 1, 0));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.STONE, 1, 1));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.STONE, 1, 3));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.STONE, 1, 5));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.PRISMARINE, 1, 0));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.PRISMARINE, 1, 1));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.PRISMARINE, 1, 2));
|
||||
crateRegistry.registerCrate("stone");
|
||||
crateRegistry.registerCrate("stoneGranite");
|
||||
crateRegistry.registerCrate("stoneDiorite");
|
||||
crateRegistry.registerCrate("stoneAndesite");
|
||||
crateRegistry.registerCrate("blockPrismarine");
|
||||
crateRegistry.registerCrate("blockPrismarineBrick");
|
||||
crateRegistry.registerCrate("blockPrismarineDark");
|
||||
crateRegistry.registerCrate(Blocks.BRICK_BLOCK);
|
||||
crateRegistry.registerCrate(Blocks.CACTUS);
|
||||
crateRegistry.registerCrate("blockCactus");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.SAND, 1, 0));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.SAND, 1, 1));
|
||||
crateRegistry.registerCrate(Blocks.OBSIDIAN);
|
||||
crateRegistry.registerCrate(Blocks.NETHERRACK);
|
||||
crateRegistry.registerCrate("obsidian");
|
||||
crateRegistry.registerCrate("netherrack");
|
||||
crateRegistry.registerCrate(Blocks.SOUL_SAND);
|
||||
crateRegistry.registerCrate(Blocks.SANDSTONE);
|
||||
crateRegistry.registerCrate(Blocks.NETHER_BRICK);
|
||||
crateRegistry.registerCrate(Blocks.MYCELIUM);
|
||||
crateRegistry.registerCrate(Blocks.GRAVEL);
|
||||
crateRegistry.registerCrate("gravel");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.SAPLING, 1, 0));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.SAPLING, 1, 1));
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.SAPLING, 1, 2));
|
||||
@@ -221,7 +221,9 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
|
||||
/* BRONZE INGOTS */
|
||||
if (Config.isCraftingBronzeEnabled()) {
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotBronze, 4), "ingotTin", "ingotCopper", "ingotCopper", "ingotCopper");
|
||||
ItemStack ingotBronze = items.ingotBronze.copy();
|
||||
ingotBronze.stackSize = 4;
|
||||
RecipeUtil.addShapelessRecipe(ingotBronze, "ingotTin", "ingotCopper", "ingotCopper", "ingotCopper");
|
||||
}
|
||||
|
||||
/* STURDY MACHINE */
|
||||
@@ -352,13 +354,20 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.apatite, 9), "blockApatite");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(EnumResourceType.COPPER), "###", "###", "###", '#', "ingotCopper");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotCopper, 9), "blockCopper");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(EnumResourceType.TIN), "###", "###", "###", '#', "ingotTin");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotTin, 9), "blockTin");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(EnumResourceType.BRONZE), "###", "###", "###", '#', "ingotBronze");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotBronze, 9), "blockBronze");
|
||||
|
||||
ItemStack ingotCopper = items.ingotCopper.copy();
|
||||
ingotCopper.stackSize = 9;
|
||||
RecipeUtil.addShapelessRecipe(ingotCopper, "blockCopper");
|
||||
|
||||
ItemStack ingotTin = items.ingotTin.copy();
|
||||
ingotTin.stackSize = 9;
|
||||
RecipeUtil.addShapelessRecipe(ingotTin, "blockTin");
|
||||
|
||||
ItemStack ingotBronze = items.ingotBronze.copy();
|
||||
ingotBronze.stackSize = 9;
|
||||
RecipeUtil.addShapelessRecipe(ingotBronze, "blockBronze");
|
||||
|
||||
// alternate recipes
|
||||
if (!ForestryAPI.enabledPlugins.contains(ForestryPluginUids.APICULTURE)) {
|
||||
|
||||
@@ -119,7 +119,7 @@ public class PluginFluids extends BlankForestryPlugin {
|
||||
}
|
||||
|
||||
if (RecipeManagers.squeezerManager != null) {
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(10, items.canEmpty.getItemStack(), PluginCore.items.ingotTin.getItemStack(), 0.05f);
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(10, items.canEmpty.getItemStack(), PluginCore.items.ingotTin.copy(), 0.05f);
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(10, items.waxCapsuleEmpty.getItemStack(), PluginCore.items.beeswax.getItemStack(), 0.10f);
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(10, items.refractoryEmpty.getItemStack(), PluginCore.items.refractoryWax.getItemStack(), 0.10f);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.core.items.ItemBlockForestry;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
|
||||
public class BlockRegistryCore extends BlockRegistry {
|
||||
public final BlockCore analyzer;
|
||||
@@ -42,19 +43,19 @@ public class BlockRegistryCore extends BlockRegistry {
|
||||
resources = new BlockResourceOre();
|
||||
registerBlock(resources, new ItemBlockForestry(resources), "resources");
|
||||
resources.setHarvestLevel("pickaxe", 1);
|
||||
OreDictionary.registerOre("oreApatite", resources.get(EnumResourceType.APATITE, 1));
|
||||
OreDictionary.registerOre("oreCopper", resources.get(EnumResourceType.COPPER, 1));
|
||||
OreDictionary.registerOre("oreTin", resources.get(EnumResourceType.TIN, 1));
|
||||
OreDictionary.registerOre(OreDictUtil.ORE_APATITE, resources.get(EnumResourceType.APATITE, 1));
|
||||
OreDictionary.registerOre(OreDictUtil.ORE_COPPER, resources.get(EnumResourceType.COPPER, 1));
|
||||
OreDictionary.registerOre(OreDictUtil.ORE_TIN, resources.get(EnumResourceType.TIN, 1));
|
||||
|
||||
resourceStorage = new BlockResourceStorage();
|
||||
registerBlock(resourceStorage, new ItemBlockForestry(resourceStorage), "resourceStorage");
|
||||
resourceStorage.setHarvestLevel("pickaxe", 0);
|
||||
OreDictionary.registerOre("blockApatite", resourceStorage.get(EnumResourceType.APATITE));
|
||||
OreDictionary.registerOre("blockCopper", resourceStorage.get(EnumResourceType.COPPER));
|
||||
OreDictionary.registerOre("blockTin", resourceStorage.get(EnumResourceType.TIN));
|
||||
OreDictionary.registerOre("blockBronze", resourceStorage.get(EnumResourceType.BRONZE));
|
||||
OreDictionary.registerOre(OreDictUtil.BLOCK_APATITE, resourceStorage.get(EnumResourceType.APATITE));
|
||||
OreDictionary.registerOre(OreDictUtil.BLOCK_COPPER, resourceStorage.get(EnumResourceType.COPPER));
|
||||
OreDictionary.registerOre(OreDictUtil.BLOCK_TIN, resourceStorage.get(EnumResourceType.TIN));
|
||||
OreDictionary.registerOre(OreDictUtil.BLOCK_BRONZE, resourceStorage.get(EnumResourceType.BRONZE));
|
||||
|
||||
// register some common oreDict names for our recipes
|
||||
OreDictionary.registerOre("craftingTableWood", Blocks.CRAFTING_TABLE);
|
||||
OreDictionary.registerOre(OreDictUtil.CRAFTING_TABLE_WOOD, Blocks.CRAFTING_TABLE);
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,7 @@ import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.core.CreativeTabForestry;
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
|
||||
public class BlockResourceOre extends Block implements IItemModelRegister, IBlockWithMeta {
|
||||
public static final PropertyEnum<EnumResourceType> ORE_RESOURCES = PropertyEnum.create("resource", EnumResourceType.class, new Predicate<EnumResourceType>(){
|
||||
@@ -79,20 +80,28 @@ public class BlockResourceOre extends Block implements IItemModelRegister, IBloc
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
List<ItemStack> drops = new ArrayList<>();
|
||||
EnumResourceType metadata = state.getValue(ORE_RESOURCES);
|
||||
EnumResourceType type = state.getValue(ORE_RESOURCES);
|
||||
switch (type) {
|
||||
case APATITE: {
|
||||
int fortuneModifier = RANDOM.nextInt(fortune + 2) - 1;
|
||||
if (fortuneModifier < 0) {
|
||||
fortuneModifier = 0;
|
||||
}
|
||||
|
||||
if (metadata == EnumResourceType.APATITE) {
|
||||
int fortuneModifier = RANDOM.nextInt(fortune + 2) - 1;
|
||||
if (fortuneModifier < 0) {
|
||||
fortuneModifier = 0;
|
||||
int amount = (2 + RANDOM.nextInt(5)) * (fortuneModifier + 1);
|
||||
if (amount > 0) {
|
||||
drops.add(PluginCore.items.apatite.getItemStack(amount));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
int amount = (2 + RANDOM.nextInt(5)) * (fortuneModifier + 1);
|
||||
if (amount > 0) {
|
||||
drops.add(PluginCore.items.apatite.getItemStack(amount));
|
||||
case TIN: {
|
||||
drops.add(OreDictUtil.getFirstSuitableOre(OreDictUtil.ORE_TIN));
|
||||
break;
|
||||
}
|
||||
case COPPER: {
|
||||
drops.add(OreDictUtil.getFirstSuitableOre(OreDictUtil.ORE_COPPER));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
drops.add(new ItemStack(this, 1, metadata.getMeta()));
|
||||
}
|
||||
|
||||
return drops;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.items;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.color.ItemColors;
|
||||
@@ -31,23 +33,26 @@ import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.Translator;
|
||||
|
||||
public class ItemCrated extends ItemForestry implements IColoredItem {
|
||||
|
||||
@Nullable
|
||||
private final ItemStack contained;
|
||||
private final boolean usesOreDict;
|
||||
@Nullable
|
||||
private final String oreDictName;
|
||||
|
||||
public ItemCrated(ItemStack contained, boolean usesOreDict) {
|
||||
public ItemCrated(@Nullable ItemStack contained, @Nullable String oreDictName) {
|
||||
this.contained = contained;
|
||||
this.usesOreDict = usesOreDict;
|
||||
}
|
||||
|
||||
public boolean usesOreDict() {
|
||||
return usesOreDict;
|
||||
this.oreDictName = oreDictName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ItemStack getContained() {
|
||||
return contained;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getOreDictName() {
|
||||
return oreDictName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) {
|
||||
if (!worldIn.isRemote) {
|
||||
|
||||
@@ -22,11 +22,19 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
|
||||
public class ItemFruit extends ItemForestryFood {
|
||||
|
||||
public enum EnumFruit {
|
||||
CHERRY("cropCherry"), WALNUT("cropWalnut"), CHESTNUT("cropChestnut"), LEMON("cropLemon"), PLUM("cropPlum"), DATES("cropDate"), PAPAYA("cropPapaya");//, COCONUT("cropCoconut");
|
||||
CHERRY(OreDictUtil.CROP_CHERRY),
|
||||
WALNUT(OreDictUtil.CROP_WALNUT),
|
||||
CHESTNUT(OreDictUtil.CROP_CHESTNUT),
|
||||
LEMON(OreDictUtil.CROP_LEMON),
|
||||
PLUM(OreDictUtil.CROP_PLUM),
|
||||
DATES(OreDictUtil.CROP_DATE),
|
||||
PAPAYA(OreDictUtil.CROP_PAPAYA);
|
||||
//, COCONUT("cropCoconut");
|
||||
public static final EnumFruit[] VALUES = values();
|
||||
|
||||
private final String oreDict;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.items;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -17,6 +19,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
public abstract class ItemRegistry {
|
||||
@@ -33,4 +36,12 @@ public abstract class ItemRegistry {
|
||||
protected static void registerOreDict(String oreDictName, ItemStack itemStack) {
|
||||
OreDictionary.registerOre(oreDictName, itemStack);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static ItemStack createItemForOreName(String oreName) {
|
||||
Item oreItem = registerItem(new ItemForestry(), oreName);
|
||||
OreDictionary.registerOre(oreName, oreItem);
|
||||
return OreDictUtil.getFirstSuitableOre(oreName);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,9 +32,9 @@ public class ItemRegistryCore extends ItemRegistry {
|
||||
public final ItemAlyzer portableAlyzer;
|
||||
|
||||
/* Ingots */
|
||||
public final ItemForestry ingotCopper;
|
||||
public final ItemForestry ingotTin;
|
||||
public final ItemForestry ingotBronze;
|
||||
public final ItemStack ingotCopper;
|
||||
public final ItemStack ingotTin;
|
||||
public final ItemStack ingotBronze;
|
||||
|
||||
/* Tools */
|
||||
public final ItemWrench wrench;
|
||||
@@ -53,9 +53,9 @@ public class ItemRegistryCore extends ItemRegistry {
|
||||
public final ItemForestry sturdyCasing;
|
||||
public final ItemForestry hardenedCasing;
|
||||
public final ItemForestry impregnatedCasing;
|
||||
public final ItemForestry gearBronze;
|
||||
public final ItemForestry gearCopper;
|
||||
public final ItemForestry gearTin;
|
||||
public final ItemStack gearBronze;
|
||||
public final ItemStack gearCopper;
|
||||
public final ItemStack gearTin;
|
||||
|
||||
/* Soldering */
|
||||
public final ItemSolderingIron solderingIron;
|
||||
@@ -98,14 +98,9 @@ public class ItemRegistryCore extends ItemRegistry {
|
||||
|
||||
portableAlyzer = registerItem(new ItemAlyzer(), "portableAlyzer");
|
||||
|
||||
ingotCopper = registerItem(new ItemForestry(), "ingotCopper");
|
||||
OreDictionary.registerOre("ingotCopper", ingotCopper);
|
||||
|
||||
ingotTin = registerItem(new ItemForestry(), "ingotTin");
|
||||
OreDictionary.registerOre("ingotTin", ingotTin);
|
||||
|
||||
ingotBronze = registerItem(new ItemForestry(), "ingotBronze");
|
||||
OreDictionary.registerOre("ingotBronze", ingotBronze);
|
||||
ingotCopper = createItemForOreName("ingotCopper");
|
||||
ingotTin = createItemForOreName("ingotTin");
|
||||
ingotBronze = createItemForOreName("ingotBronze");
|
||||
|
||||
wrench = registerItem(new ItemWrench(), "wrench");
|
||||
pipette = registerItem(new ItemPipette(), "pipette");
|
||||
@@ -126,12 +121,9 @@ public class ItemRegistryCore extends ItemRegistry {
|
||||
|
||||
bituminousPeat = registerItem(new ItemForestry(), "bituminousPeat");
|
||||
|
||||
gearBronze = registerItem(new ItemForestry(), "gearBronze");
|
||||
OreDictionary.registerOre("gearBronze", gearBronze);
|
||||
gearCopper = registerItem(new ItemForestry(), "gearCopper");
|
||||
OreDictionary.registerOre("gearCopper", gearCopper);
|
||||
gearTin = registerItem(new ItemForestry(), "gearTin");
|
||||
OreDictionary.registerOre("gearTin", gearTin);
|
||||
gearBronze = createItemForOreName("gearBronze");
|
||||
gearCopper = createItemForOreName("gearCopper");
|
||||
gearTin = createItemForOreName("gearTin");
|
||||
|
||||
circuitboards = registerItem(new ItemCircuitBoard(), "chipsets");
|
||||
|
||||
@@ -193,4 +185,5 @@ public class ItemRegistryCore extends ItemRegistry {
|
||||
OreDictionary.registerOre(def.getOreDict(), fruit);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package forestry.core.utils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class OreDictUtil {
|
||||
public static final String ORE_COPPER = "oreCopper";
|
||||
public static final String ORE_TIN = "oreTin";
|
||||
public static final String ORE_APATITE = "oreApatite";
|
||||
public static final String BLOCK_APATITE = "blockApatite";
|
||||
public static final String BLOCK_COPPER = "blockCopper";
|
||||
public static final String BLOCK_TIN = "blockTin";
|
||||
public static final String BLOCK_BRONZE = "blockBronze";
|
||||
|
||||
public static final String CRAFTING_TABLE_WOOD = "craftingTableWood";
|
||||
|
||||
public static final String BEE_COMB = "beeComb";
|
||||
public static final String DROP_ROYAL_JELLY = "dropRoyalJelly";
|
||||
public static final String DROP_HONEYDEW = "dropHoneydew";
|
||||
public static final String ITEM_POLLEN = "itemPollen";
|
||||
public static final String DROP_HONEY = "dropHoney";
|
||||
|
||||
public static final String TREE_SAPLING = "treeSapling";
|
||||
public static final String LOG_WOOD = "logWood";
|
||||
public static final String PLANK_WOOD = "plankWood";
|
||||
public static final String SLAB_WOOD = "slabWood";
|
||||
public static final String FENCE_WOOD = "fenceWood";
|
||||
public static final String FENCE_GATE_WOOD = "fenceGateWood";
|
||||
public static final String STAIR_WOOD = "stairWood";
|
||||
public static final String DOOR_WOOD = "doorWood";
|
||||
public static final String TREE_LEAVES = "treeLeaves";
|
||||
|
||||
public static final String EMPTIED_LETTER_ORE_DICT = "emptiedLetter";
|
||||
|
||||
public static final String CROP_CHERRY = "cropCherry";
|
||||
public static final String CROP_WALNUT = "cropWalnut";
|
||||
public static final String CROP_CHESTNUT = "cropChestnut";
|
||||
public static final String CROP_LEMON = "cropLemon";
|
||||
public static final String CROP_PLUM = "cropPlum";
|
||||
public static final String CROP_DATE = "cropDate";
|
||||
public static final String CROP_PAPAYA = "cropPapaya";
|
||||
|
||||
/**
|
||||
* Used for ores and metals where conflicts are common.
|
||||
* This way, Forestry can choose whatever is first in the oreDictionary instead of its own metals.
|
||||
* If more mods do this, they will automatically unify on one set of metals.
|
||||
*/
|
||||
@Nullable
|
||||
public static ItemStack getFirstSuitableOre(String oreName) {
|
||||
if (OreDictionary.doesOreNameExist(oreName)) {
|
||||
List<ItemStack> ores = OreDictionary.getOres(oreName);
|
||||
for (ItemStack ore : ores) {
|
||||
if (ore != null && ore.getItem() != null && ore.getMetadata() != OreDictionary.WILDCARD_VALUE) {
|
||||
ItemStack oreCopy = ore.copy();
|
||||
oreCopy.stackSize = 1;
|
||||
return oreCopy;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -413,9 +413,13 @@ public class PluginFactory extends BlankForestryPlugin {
|
||||
new Object[]{" # ", " X ", " X ", '#', "ingotBronze", 'X', "stickWood"});
|
||||
|
||||
// Reclamation
|
||||
RecipeManagers.carpenterManager.addRecipe(null, PluginCore.items.ingotBronze.getItemStack(2),
|
||||
"#", '#', PluginCore.items.brokenBronzePickaxe);
|
||||
RecipeManagers.carpenterManager.addRecipe(null, PluginCore.items.ingotBronze.getItemStack(), "#", '#', PluginCore.items.brokenBronzeShovel);
|
||||
ItemStack ingotBronze = PluginCore.items.ingotBronze.copy();
|
||||
ingotBronze.stackSize = 2;
|
||||
RecipeManagers.carpenterManager.addRecipe(null, ingotBronze, "#", '#', PluginCore.items.brokenBronzePickaxe);
|
||||
|
||||
ingotBronze = ingotBronze.copy();
|
||||
ingotBronze.stackSize = 1;
|
||||
RecipeManagers.carpenterManager.addRecipe(null, ingotBronze, "#", '#', PluginCore.items.brokenBronzeShovel);
|
||||
|
||||
// Crating and uncrating
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.STORAGE)) {
|
||||
|
||||
@@ -31,6 +31,7 @@ import forestry.core.fluids.Fluids;
|
||||
import forestry.core.items.EnumElectronTube;
|
||||
import forestry.core.network.IPacketRegistry;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
import forestry.mail.blocks.BlockRegistryMail;
|
||||
import forestry.mail.commands.CommandMail;
|
||||
import forestry.mail.items.EnumStampDefinition;
|
||||
@@ -129,7 +130,7 @@ public class PluginMail extends BlankForestryPlugin {
|
||||
}
|
||||
|
||||
// Recycling
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.PAPER), "###", '#', ItemRegistryMail.emptiedLetterOreDict);
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.PAPER), "###", '#', OreDictUtil.EMPTIED_LETTER_ORE_DICT);
|
||||
|
||||
// Carpenter
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(250), null, items.letters.getItemStack(), "###", "###", '#', PluginCore.items.woodPulp);
|
||||
|
||||
@@ -13,10 +13,9 @@ package forestry.mail.items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.core.items.ItemRegistry;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
|
||||
public class ItemRegistryMail extends ItemRegistry {
|
||||
public static final String emptiedLetterOreDict = "emptiedLetter";
|
||||
|
||||
public final ItemStamps stamps;
|
||||
public final ItemLetter letters;
|
||||
public final ItemCatalogue catalogue;
|
||||
@@ -27,7 +26,7 @@ public class ItemRegistryMail extends ItemRegistry {
|
||||
catalogue = registerItem(new ItemCatalogue(), "catalogue");
|
||||
|
||||
for (ItemStack itemStack : letters.getEmptiedLetters()) {
|
||||
registerOreDict(emptiedLetterOreDict, itemStack);
|
||||
registerOreDict(OreDictUtil.EMPTIED_LETTER_ORE_DICT, itemStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.storage;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -21,51 +24,53 @@ import forestry.core.items.ItemCrated;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
|
||||
public class CrateRegistry implements ICrateRegistry {
|
||||
|
||||
private static void registerCrate(ItemStack stack, boolean useOreDict) {
|
||||
private static void registerCrate(@Nonnull ItemStack stack, @Nullable String oreDictName) {
|
||||
if (stack == null || stack.getItem() == null) {
|
||||
Log.warning("Tried to make a crate without an item");
|
||||
return;
|
||||
}
|
||||
|
||||
String itemName = ItemStackUtil.getStringForItemStack(stack).replace(':', '.');
|
||||
String crateName = "crated." + itemName;
|
||||
ItemCrated crate = new ItemCrated(stack, useOreDict);
|
||||
String crateName;
|
||||
if (oreDictName != null) {
|
||||
crateName = "crated." + oreDictName;
|
||||
} else {
|
||||
String itemName = ItemStackUtil.getStringForItemStack(stack).replace(':', '.');
|
||||
crateName = "crated." + itemName;
|
||||
}
|
||||
|
||||
ItemCrated crate = new ItemCrated(stack, oreDictName);
|
||||
crate.setUnlocalizedName(crateName);
|
||||
GameRegistry.registerItem(crate, crateName);
|
||||
crate.setRegistryName(crateName);
|
||||
|
||||
GameRegistry.register(crate);
|
||||
Proxies.common.registerItem(crate);
|
||||
PluginStorage.registerCrate(crate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrate(Item item) {
|
||||
registerCrate(new ItemStack(item), false);
|
||||
public void registerCrate(@Nonnull String oreDictName) {
|
||||
ItemStack stack = OreDictUtil.getFirstSuitableOre(oreDictName);
|
||||
if (stack != null) {
|
||||
registerCrate(stack, oreDictName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrateUsingOreDict(Item item) {
|
||||
registerCrate(new ItemStack(item), true);
|
||||
public void registerCrate(@Nonnull Block block) {
|
||||
registerCrate(new ItemStack(block), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrate(Block block) {
|
||||
registerCrate(new ItemStack(block), false);
|
||||
public void registerCrate(@Nonnull Item item) {
|
||||
registerCrate(new ItemStack(item), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrateUsingOreDict(Block block) {
|
||||
registerCrate(new ItemStack(block), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrate(ItemStack stack) {
|
||||
registerCrate(stack, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrateUsingOreDict(ItemStack stack) {
|
||||
registerCrate(stack, true);
|
||||
public void registerCrate(@Nonnull ItemStack stack) {
|
||||
registerCrate(stack, null);
|
||||
}
|
||||
}
|
||||
@@ -386,26 +386,24 @@ public class PluginStorage extends BlankForestryPlugin {
|
||||
for (ItemCrated crate : crates) {
|
||||
ItemStack crateStack = new ItemStack(crate);
|
||||
ItemStack uncrated = crate.getContained();
|
||||
if (crate.usesOreDict()) {
|
||||
int[] oreIds = OreDictionary.getOreIDs(uncrated);
|
||||
for (int oreId : oreIds) {
|
||||
String oreName = OreDictionary.getOreName(oreId);
|
||||
addCrating(crateStack, oreName);
|
||||
if (uncrated != null) {
|
||||
if (crate.getOreDictName() != null) {
|
||||
addCrating(crateStack, crate.getOreDictName());
|
||||
} else {
|
||||
addCrating(crateStack, uncrated);
|
||||
}
|
||||
} else {
|
||||
addCrating(crateStack, uncrated);
|
||||
addUncrating(crateStack, uncrated);
|
||||
}
|
||||
addUncrating(crateStack, uncrated);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addCrating(ItemStack crateStack, Object uncrated) {
|
||||
private static void addCrating(@Nonnull ItemStack crateStack, @Nonnull Object uncrated) {
|
||||
FluidStack water = Fluids.WATER.getFluid(Constants.CARPENTER_CRATING_LIQUID_QUANTITY);
|
||||
ItemStack box = items.crate.getItemStack();
|
||||
RecipeManagers.carpenterManager.addRecipe(Constants.CARPENTER_CRATING_CYCLES, water, box, crateStack, "###", "###", "###", '#', uncrated);
|
||||
}
|
||||
|
||||
private static void addUncrating(ItemStack crateStack, ItemStack uncrated) {
|
||||
private static void addUncrating(@Nonnull ItemStack crateStack, @Nonnull ItemStack uncrated) {
|
||||
ItemStack product = new ItemStack(uncrated.getItem(), 9, uncrated.getItemDamage());
|
||||
RecipeManagers.carpenterManager.addRecipe(Constants.CARPENTER_UNCRATING_CYCLES, null, product, "#", '#', crateStack);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ItemRegistryStorage extends ItemRegistry {
|
||||
|
||||
public ItemRegistryStorage() {
|
||||
// CRATE
|
||||
crate = registerItem(new ItemCrated(null, false), "crate");
|
||||
crate = registerItem(new ItemCrated(null, null), "crate");
|
||||
|
||||
// BACKPACKS
|
||||
IBackpackDefinition definition;
|
||||
|
||||
Reference in new issue
Block a user