use of forestry.core.gadgets.MachineDefinition in project ForestryMC by ForestryMC.
the class PluginArboriculture method preInit.
@Override
public void preInit() {
super.preInit();
ForestryBlock.log1.registerBlock(new BlockLog(LogCat.CAT0), ItemWoodBlock.class, "log1");
ForestryBlock.log2.registerBlock(new BlockLog(LogCat.CAT1), ItemWoodBlock.class, "log2");
ForestryBlock.log3.registerBlock(new BlockLog(LogCat.CAT2), ItemWoodBlock.class, "log3");
ForestryBlock.log4.registerBlock(new BlockLog(LogCat.CAT3), ItemWoodBlock.class, "log4");
ForestryBlock.log5.registerBlock(new BlockLog(LogCat.CAT4), ItemWoodBlock.class, "log5");
ForestryBlock.log6.registerBlock(new BlockLog(LogCat.CAT5), ItemWoodBlock.class, "log6");
ForestryBlock.log7.registerBlock(new BlockLog(LogCat.CAT6), ItemWoodBlock.class, "log7");
ForestryBlock.log8.registerBlock(new BlockLog(LogCat.CAT7), ItemWoodBlock.class, "log8");
for (ForestryBlock log : logs) {
log.block().setHarvestLevel("axe", 0);
OreDictionary.registerOre("logWood", log.getWildcard());
}
ForestryBlock.fireproofLog1.registerBlock(new BlockFireproofLog(LogCat.CAT0), ItemWoodBlock.class, "fireproofLog1");
ForestryBlock.fireproofLog2.registerBlock(new BlockFireproofLog(LogCat.CAT1), ItemWoodBlock.class, "fireproofLog2");
ForestryBlock.fireproofLog3.registerBlock(new BlockFireproofLog(LogCat.CAT2), ItemWoodBlock.class, "fireproofLog3");
ForestryBlock.fireproofLog4.registerBlock(new BlockFireproofLog(LogCat.CAT3), ItemWoodBlock.class, "fireproofLog4");
ForestryBlock.fireproofLog5.registerBlock(new BlockFireproofLog(LogCat.CAT4), ItemWoodBlock.class, "fireproofLog5");
ForestryBlock.fireproofLog6.registerBlock(new BlockFireproofLog(LogCat.CAT5), ItemWoodBlock.class, "fireproofLog6");
ForestryBlock.fireproofLog7.registerBlock(new BlockFireproofLog(LogCat.CAT6), ItemWoodBlock.class, "fireproofLog7");
ForestryBlock.fireproofLog8.registerBlock(new BlockFireproofLog(LogCat.CAT7), ItemWoodBlock.class, "fireproofLog8");
for (ForestryBlock fireproofLog : fireproofLogs) {
fireproofLog.block().setHarvestLevel("axe", 0);
OreDictionary.registerOre("logWood", fireproofLog.getWildcard());
}
ForestryBlock.planks1.registerBlock(new BlockPlanks(PlankCat.CAT0), ItemWoodBlock.class, "planks");
ForestryBlock.planks2.registerBlock(new BlockPlanks(PlankCat.CAT1), ItemWoodBlock.class, "planks2");
for (ForestryBlock plank : planks) {
plank.block().setHarvestLevel("axe", 0);
OreDictionary.registerOre("plankWood", plank.getWildcard());
}
ForestryBlock.fireproofPlanks1.registerBlock(new BlockFireproofPlanks(PlankCat.CAT0), ItemWoodBlock.class, "fireproofPlanks1");
ForestryBlock.fireproofPlanks2.registerBlock(new BlockFireproofPlanks(PlankCat.CAT1), ItemWoodBlock.class, "fireproofPlanks2");
for (ForestryBlock plank : fireproofPlanks) {
plank.block().setHarvestLevel("axe", 0);
OreDictionary.registerOre("plankWood", plank.getWildcard());
}
ForestryBlock.slabs1.registerBlock(new BlockSlab(SlabCat.CAT0), ItemWoodBlock.class, "slabs1");
ForestryBlock.slabs2.registerBlock(new BlockSlab(SlabCat.CAT1), ItemWoodBlock.class, "slabs2");
ForestryBlock.slabs3.registerBlock(new BlockSlab(SlabCat.CAT2), ItemWoodBlock.class, "slabs3");
ForestryBlock.slabs4.registerBlock(new BlockSlab(SlabCat.CAT3), ItemWoodBlock.class, "slabs4");
for (ForestryBlock plank : slabs) {
plank.block().setHarvestLevel("axe", 0);
OreDictionary.registerOre("slabWood", plank.getWildcard());
}
// Fences
ForestryBlock.fences1.registerBlock(new BlockArbFence(FenceCat.CAT0), ItemWoodBlock.class, "fences");
ForestryBlock.fences2.registerBlock(new BlockArbFence(FenceCat.CAT1), ItemWoodBlock.class, "fences2");
for (ForestryBlock block : fences) {
block.block().setHarvestLevel("axe", 0);
OreDictionary.registerOre("fenceWood", block.getWildcard());
}
// Stairs
ForestryBlock.stairs.registerBlock(new BlockArbStairs(ForestryBlock.planks1.block(), 0), ItemStairs.class, "stairs");
ForestryBlock.stairs.block().setHarvestLevel("axe", 0);
// Saplings
ForestryBlock.saplingGE.registerBlock(new BlockSapling(), ItemForestryBlock.class, "saplingGE");
// Leaves
ForestryBlock.leaves.registerBlock(new ForestryBlockLeaves(), ItemLeavesBlock.class, "leaves");
OreDictionary.registerOre("treeLeaves", ForestryBlock.leaves.getWildcard());
// Pods
ForestryBlock.pods.registerBlock(new BlockFruitPod(), ItemForestryBlock.class, "pods");
// Machines
ForestryBlock.arboriculture.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "arboriculture");
ForestryBlock.arboriculture.block().setCreativeTab(Tabs.tabArboriculture);
definitionChest = ((BlockBase) ForestryBlock.arboriculture.block()).addDefinition(new MachineDefinition(Defaults.DEFINITION_ARBCHEST_META, "forestry.ArbChest", TileArboristChest.class, ShapedRecipeCustom.createShapedRecipe(ForestryBlock.arboriculture.getItemStack(1, Defaults.DEFINITION_ARBCHEST_META), " # ", "XYX", "XXX", '#', Blocks.glass, 'X', "treeSapling", 'Y', Blocks.chest)).setFaces(0, 1, 2, 3, 4, 4, 0, 7));
// Init rendering
proxy.initializeRendering();
// Register vanilla and forestry fence ids
validFences.add(ForestryBlock.fences1.block());
validFences.add(ForestryBlock.fences2.block());
validFences.add(Blocks.fence);
validFences.add(Blocks.fence_gate);
validFences.add(Blocks.nether_brick_fence);
// Commands
PluginCore.rootCommand.addChildCommand(new CommandTree());
// Create alleles
createAlleles();
createMutations();
registerTemplates();
registerErsatzGenomes();
}
use of forestry.core.gadgets.MachineDefinition in project ForestryMC by ForestryMC.
the class PluginFactory method preInit.
@Override
public void preInit() {
super.preInit();
ForestryBlock.factoryTESR.registerBlock(new BlockBase(Material.iron, true), ItemForestryBlock.class, "factory");
BlockBase factoryTESR = ((BlockBase) ForestryBlock.factoryTESR.block());
definitionBottler = factoryTESR.addDefinition(new MachineDefinition(Defaults.DEFINITION_BOTTLER_META, "forestry.Bottler", MachineBottler.class, Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/bottler_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryTESR.getItemStack(1, Defaults.DEFINITION_BOTTLER_META), "X#X", "#Y#", "X#X", '#', Blocks.glass, 'X', ForestryItem.canEmpty, 'Y', ForestryItem.sturdyCasing)));
definitionCarpenter = factoryTESR.addDefinition(new MachineDefinition(Defaults.DEFINITION_CARPENTER_META, "forestry.Carpenter", MachineCarpenter.class, Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/carpenter_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryTESR.getItemStack(1, Defaults.DEFINITION_CARPENTER_META), "X#X", "XYX", "X#X", '#', Blocks.glass, 'X', "ingotBronze", 'Y', ForestryItem.sturdyCasing)));
definitionCentrifuge = factoryTESR.addDefinition(new MachineDefinition(Defaults.DEFINITION_CENTRIFUGE_META, "forestry.Centrifuge", MachineCentrifuge.class, Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/centrifuge_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryTESR.getItemStack(1, Defaults.DEFINITION_CENTRIFUGE_META), "X#X", "XYX", "X#X", '#', Blocks.glass, 'X', "ingotCopper", 'Y', ForestryItem.sturdyCasing.getItemStack())));
definitionFermenter = factoryTESR.addDefinition(new MachineDefinition(Defaults.DEFINITION_FERMENTER_META, "forestry.Fermenter", MachineFermenter.class, Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/fermenter_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryTESR.getItemStack(1, Defaults.DEFINITION_FERMENTER_META), "X#X", "#Y#", "X#X", '#', Blocks.glass, 'X', "gearBronze", 'Y', ForestryItem.sturdyCasing)));
definitionMoistener = factoryTESR.addDefinition(new MachineDefinition(Defaults.DEFINITION_MOISTENER_META, "forestry.Moistener", MachineMoistener.class, Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/moistener_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryTESR.getItemStack(1, Defaults.DEFINITION_MOISTENER_META), "X#X", "#Y#", "X#X", '#', Blocks.glass, 'X', "gearCopper", 'Y', ForestryItem.sturdyCasing)));
definitionSqueezer = factoryTESR.addDefinition(new MachineDefinition(Defaults.DEFINITION_SQUEEZER_META, "forestry.Squeezer", MachineSqueezer.class, Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/squeezer_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryTESR.getItemStack(1, Defaults.DEFINITION_SQUEEZER_META), "X#X", "XYX", "X#X", '#', Blocks.glass, 'X', "ingotTin", 'Y', ForestryItem.sturdyCasing.getItemStack())));
definitionStill = factoryTESR.addDefinition(new MachineDefinition(Defaults.DEFINITION_STILL_META, "forestry.Still", MachineStill.class, Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/still_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryTESR.getItemStack(1, Defaults.DEFINITION_STILL_META), "X#X", "#Y#", "X#X", '#', Blocks.glass, 'X', Items.redstone, 'Y', ForestryItem.sturdyCasing)));
definitionRainmaker = factoryTESR.addDefinition(new MachineDefinition(Defaults.DEFINITION_RAINMAKER_META, "forestry.Rainmaker", MillRainmaker.class, Proxies.render.getRenderMill(Defaults.TEXTURE_PATH_BLOCKS + "/rainmaker_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryTESR.getItemStack(1, Defaults.DEFINITION_RAINMAKER_META), "X#X", "#Y#", "X#X", '#', Blocks.glass, 'X', "gearTin", 'Y', ForestryItem.hardenedCasing)));
ForestryBlock.factoryPlain.registerBlock(new BlockBase(Material.iron), ItemNBTTile.class, "factory2");
BlockBase factoryPlain = ((BlockBase) ForestryBlock.factoryPlain.block());
definitionFabricator = factoryPlain.addDefinition(new MachineNBTDefinition(Defaults.DEFINITION_FABRICATOR_META, "forestry.Fabricator", MachineFabricator.class, ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryPlain.getItemStack(1, Defaults.DEFINITION_FABRICATOR_META), "X#X", "#Y#", "XZX", '#', Blocks.glass, 'X', Items.gold_ingot, 'Y', ForestryItem.sturdyCasing, 'Z', Blocks.chest)).setFaces(0, 1, 2, 3, 4, 4));
definitionRaintank = factoryPlain.addDefinition(new MachineDefinition(Defaults.DEFINITION_RAINTANK_META, "forestry.Raintank", MachineRaintank.class, ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryPlain.getItemStack(1, Defaults.DEFINITION_RAINTANK_META), "X#X", "XYX", "X#X", '#', Blocks.glass, 'X', Items.iron_ingot, 'Y', ForestryItem.sturdyCasing)).setFaces(0, 1, 0, 0, 0, 0));
definitionWorktable = factoryPlain.addDefinition(new MachineNBTDefinition(Defaults.DEFINITION_WORKTABLE_META, "forestry.Worktable", TileWorktable.class, ShapedRecipeCustom.createShapedRecipe(ForestryBlock.factoryPlain.getItemStack(1, Defaults.DEFINITION_WORKTABLE_META), "B", "W", "C", 'B', Items.book, 'W', Blocks.crafting_table, 'C', Blocks.chest)).setFaces(0, 1, 2, 3, 4, 4));
}
use of forestry.core.gadgets.MachineDefinition in project ForestryMC by ForestryMC.
the class PluginIC2 method preInit.
@Override
@Optional.Method(modid = "IC2")
public void preInit() {
super.preInit();
definitionEngineTin = ((BlockBase) ForestryBlock.engine.block()).addDefinition(new EngineDefinition(Defaults.DEFINITION_ENGINETIN_META, "forestry.EngineTin", EngineTin.class, PluginEnergy.proxy.getRenderDefaultEngine(Defaults.TEXTURE_PATH_BLOCKS + "/engine_tin_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.engine.getItemStack(1, Defaults.DEFINITION_ENGINETIN_META), "###", " X ", "YVY", '#', "ingotTin", 'X', Blocks.glass, 'Y', "gearTin", 'V', Blocks.piston)));
definitionGenerator = ((BlockBase) ForestryBlock.engine.block()).addDefinition(new MachineDefinition(Defaults.DEFINITION_GENERATOR_META, "forestry.Generator", MachineGenerator.class, Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/generator_"), ShapedRecipeCustom.createShapedRecipe(ForestryBlock.engine.getItemStack(1, Defaults.DEFINITION_GENERATOR_META), "X#X", "XYX", "X#X", '#', Blocks.glass, 'X', Items.gold_ingot, 'Y', ForestryItem.sturdyCasing)));
emptyCell = IC2Items.getItem("cell");
if (emptyCell != null) {
lavaCell = IC2Items.getItem("lavaCell");
waterCell = IC2Items.getItem("waterCell");
} else {
Proxies.log.fine("IC2 empty cell could not be found. Skipped adding IC2 liquid containers.");
}
// rubber chain
treetap = IC2Items.getItem("treetap");
rubberwood = IC2Items.getItem("rubberWood");
resin = IC2Items.getItem("resin");
rubbersapling = IC2Items.getItem("rubberSapling");
rubberleaves = IC2Items.getItem("rubberLeaves");
// fermentation
plantBall = IC2Items.getItem("plantBall");
compressedPlantBall = IC2Items.getItem("compressedPlantBall");
// crated
resin = IC2Items.getItem("resin");
rubber = IC2Items.getItem("rubber");
scrap = IC2Items.getItem("scrap");
uuMatter = IC2Items.getItem("matter");
silver = IC2Items.getItem("silverIngot");
brass = IC2Items.getItem("bronzeIngot");
Circuit.farmRubberManual = new CircuitFarmLogic("manualRubber", FarmLogicRubber.class);
ICircuitLayout layoutEngineTin = new CircuitLayout("engine.tin");
ChipsetManager.circuitRegistry.registerLayout(layoutEngineTin);
ChipsetManager.circuitRegistry.registerLegacyMapping(CircuitId.ELECTRIC_CHOKE_I, "forestry.energyChoke1");
ChipsetManager.circuitRegistry.registerLegacyMapping(CircuitId.FIRE_DAMPENER_I, "forestry.energyDampener1");
ChipsetManager.circuitRegistry.registerLegacyMapping(CircuitId.ELECTRIC_EFFICIENCY_I, "forestry.energyEfficiency1");
ChipsetManager.circuitRegistry.registerLegacyMapping(CircuitId.ELECTRIC_BOOST_I, "forestry.energyBoost1");
ChipsetManager.circuitRegistry.registerLegacyMapping(CircuitId.ELECTRIC_BOOST_II, "forestry.energyBoost2");
}
use of forestry.core.gadgets.MachineDefinition in project ForestryMC by ForestryMC.
the class PluginApiculture method preInit.
@Override
public void preInit() {
super.preInit();
MinecraftForge.EVENT_BUS.register(this);
ForestryBlock.apiculture.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "apiculture");
ForestryBlock.apiculture.block().setCreativeTab(Tabs.tabApiculture);
ForestryBlock.apiculture.block().setHarvestLevel("axe", 0);
definitionApiary = ((BlockBase) ForestryBlock.apiculture.block()).addDefinition(new MachineDefinition(Defaults.DEFINITION_APIARY_META, "forestry.Apiary", TileApiary.class, ShapedRecipeCustom.createShapedRecipe(ForestryBlock.apiculture.getItemStack(1, Defaults.DEFINITION_APIARY_META), "XXX", "#C#", "###", 'X', "slabWood", '#', "plankWood", 'C', ForestryItem.impregnatedCasing)).setFaces(0, 1, 2, 2, 4, 4, 0, 7));
definitionChest = ((BlockBase) ForestryBlock.apiculture.block()).addDefinition(new MachineDefinition(Defaults.DEFINITION_APIARISTCHEST_META, "forestry.ApiaristChest", TileApiaristChest.class, ShapedRecipeCustom.createShapedRecipe(ForestryBlock.apiculture.getItemStack(1, Defaults.DEFINITION_APIARISTCHEST_META), " # ", "XYX", "XXX", '#', Blocks.glass, 'X', "beeComb", 'Y', Blocks.chest)).setFaces(0, 1, 2, 3, 4, 4));
definitionBeehouse = ((BlockBase) ForestryBlock.apiculture.block()).addDefinition(new MachineDefinition(Defaults.DEFINITION_BEEHOUSE_META, "forestry.Beehouse", TileBeehouse.class, ShapedRecipeCustom.createShapedRecipe(ForestryBlock.apiculture.getItemStack(1, Defaults.DEFINITION_BEEHOUSE_META), "XXX", "#C#", "###", 'X', "slabWood", '#', "plankWood", 'C', "beeComb")).setFaces(0, 1, 2, 2, 4, 4, 0, 7));
definitionAnalyzer = ((BlockBase) ForestryBlock.core.block()).addDefinition(new MachineDefinition(Defaults.DEFINITION_ANALYZER_META, "forestry.Analyzer", TileAnalyzer.class, PluginApiculture.proxy.getRendererAnalyzer(Defaults.TEXTURE_PATH_BLOCKS + "/analyzer_")));
ForestryBlock.beehives.registerBlock(new BlockBeehives(), ItemForestryBlock.class, "beehives");
// Candles
ForestryBlock.candle.registerBlock(new BlockCandle(), ItemCandleBlock.class, "candle");
ForestryBlock.stump.registerBlock(new BlockStump(), ItemForestryBlock.class, "stump");
// Alveary and Components
ForestryBlock.alveary.registerBlock(new BlockAlveary(), ItemAlvearyBlock.class, "alveary");
ForestryBlock.alveary.block().setHarvestLevel("axe", 0);
// Add triggers
if (PluginManager.Module.BUILDCRAFT_STATEMENTS.isEnabled()) {
ApicultureTriggers.initialize();
}
if (Config.enableVillager) {
// Register village components with the Structure registry.
VillageHandlerApiculture.registerVillageComponents();
}
// Commands
PluginCore.rootCommand.addChildCommand(new CommandBee());
}
use of forestry.core.gadgets.MachineDefinition in project ForestryMC by ForestryMC.
the class PluginLepidopterology method doInit.
@Override
public void doInit() {
config = new Configuration();
Property property = config.get("entities.spawn.limit", CONFIG_CATEGORY, spawnConstraint);
property.comment = "determines the global butterfly entity count above which natural spawning of butterflies ceases.";
spawnConstraint = Integer.parseInt(property.value);
property = config.get("entities.maximum.allowed", CONFIG_CATEGORY, entityConstraint);
property.comment = "determines the global butterfly entity count above which butterflies will stay in item form and will not take flight anymore.";
entityConstraint = Integer.parseInt(property.value);
property = config.get("entities.pollination.allowed", CONFIG_CATEGORY, allowPollination);
property.comment = "determines whether butterflies can pollinate leaves.";
allowPollination = Boolean.parseBoolean(property.value);
config.save();
PluginCore.rootCommand.addChildCommand(new CommandButterfly());
Utils.registerEntity(EntityButterfly.class, "butterflyGE", 0, 0x000000, 0xffffff, 50, 1, true);
proxy.initializeRendering();
registerTemplates();
BlockBase lepidopterology = ((BlockBase) ForestryBlock.lepidopterology.block());
definitionChest = lepidopterology.addDefinition((new MachineDefinition(Defaults.DEFINITION_LEPICHEST_META, "forestry.LepiChest", TileLepidopteristChest.class, ShapedRecipeCustom.createShapedRecipe(ForestryBlock.lepidopterology.getItemStack(1, Defaults.DEFINITION_LEPICHEST_META), " # ", "XYX", "XXX", '#', Blocks.glass, 'X', ForestryItem.butterflyGE.getItemStack(1, Defaults.WILDCARD), 'Y', Blocks.chest)).setFaces(0, 1, 2, 3, 4, 4, 0, 7)));
definitionChest.register();
((ITreeRoot) AlleleManager.alleleRegistry.getSpeciesRoot("rootTrees")).registerLeafTickHandler(new ButterflySpawner());
RecipeSorter.register("forestry:lepidopterologymating", MatingRecipe.class, RecipeSorter.Category.SHAPELESS, "before:minecraft:shapeless");
}
Aggregations