Search in sources :

Example 1 with ButterflySpawner

use of forestry.lepidopterology.ButterflySpawner 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");
}
Also used : MachineDefinition(forestry.core.gadgets.MachineDefinition) Configuration(forestry.core.config.Configuration) BlockBase(forestry.core.gadgets.BlockBase) ButterflySpawner(forestry.lepidopterology.ButterflySpawner) ITreeRoot(forestry.api.arboriculture.ITreeRoot) Property(forestry.core.config.Property) CommandButterfly(forestry.lepidopterology.commands.CommandButterfly)

Aggregations

ITreeRoot (forestry.api.arboriculture.ITreeRoot)1 Configuration (forestry.core.config.Configuration)1 Property (forestry.core.config.Property)1 BlockBase (forestry.core.gadgets.BlockBase)1 MachineDefinition (forestry.core.gadgets.MachineDefinition)1 ButterflySpawner (forestry.lepidopterology.ButterflySpawner)1 CommandButterfly (forestry.lepidopterology.commands.CommandButterfly)1