use of forestry.lepidopterology.blocks.BlockRegistryLepidopterology in project ForestryMC by ForestryMC.
the class ModuleLepidopterology method doInit.
@Override
public void doInit() {
BlockRegistryLepidopterology blocks = getBlocks();
GameRegistry.registerTileEntity(TileCocoon.class, "forestry.Cocoon");
ModuleCore.rootCommand.addChildCommand(new CommandButterfly());
ResourceLocation butterflyResourceLocation = new ResourceLocation(Constants.MOD_ID, "butterflyGE");
EntityUtil.registerEntity(butterflyResourceLocation, EntityButterfly.class, "butterflyGE", 0, 0x000000, 0xffffff, 50, 1, true);
MothDefinition.initMoths();
ButterflyDefinition.initButterflies();
ButterflyAlleles.createLoot();
MinecraftForge.EVENT_BUS.post(new AlleleSpeciesRegisterEvent(ButterflyManager.butterflyRoot, IAlleleButterflySpecies.class));
blocks.butterflyChest.init();
if (spawnButterflysFromLeaves) {
TreeManager.treeRoot.registerLeafTickHandler(new ButterflySpawner());
}
RecipeSorter.register("forestry:lepidopterologymating", MatingRecipe.class, RecipeSorter.Category.SHAPELESS, "before:minecraft:shapeless");
}
use of forestry.lepidopterology.blocks.BlockRegistryLepidopterology in project ForestryMC by ForestryMC.
the class ModuleLepidopterology method getHiddenItems.
@Override
public void getHiddenItems(List<ItemStack> hiddenItems) {
BlockRegistryLepidopterology blocks = getBlocks();
// cocoon itemBlock is different from the normal item
hiddenItems.add(new ItemStack(blocks.cocoon));
hiddenItems.add(new ItemStack(blocks.solidCocoon));
}
use of forestry.lepidopterology.blocks.BlockRegistryLepidopterology in project ForestryMC by ForestryMC.
the class ModuleLepidopterology method registerItemsAndBlocks.
@Override
public void registerItemsAndBlocks() {
items = new ItemRegistryLepidopterology();
blocks = new BlockRegistryLepidopterology();
}
use of forestry.lepidopterology.blocks.BlockRegistryLepidopterology in project ForestryMC by ForestryMC.
the class ModuleBackpacks method registerRecipes.
@Override
public void registerRecipes() {
ItemRegistryBackpacks items = getItems();
if (items.apiaristBackpack != null && ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.APICULTURE))) {
BlockRegistryApiculture beeBlocks = ModuleApiculture.getBlocks();
addBackpackRecipe("bee", items.apiaristBackpack, "stickWood", beeBlocks.beeChest);
}
if (items.lepidopteristBackpack != null && ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.LEPIDOPTEROLOGY))) {
BlockRegistryLepidopterology butterflyBlocks = ModuleLepidopterology.getBlocks();
ItemStack chest = new ItemStack(butterflyBlocks.butterflyChest);
addBackpackRecipe("butterfly", items.lepidopteristBackpack, "stickWood", chest);
}
addBackpackRecipe("mining", items.minerBackpack, "ingotIron");
addBackpackRecipe("digging", items.diggerBackpack, "stone");
addBackpackRecipe("foresting", items.foresterBackpack, "logWood");
addBackpackRecipe("hunting", items.hunterBackpack, Items.FEATHER);
addBackpackRecipe("adventuring", items.adventurerBackpack, Items.BONE);
addBackpackRecipe("building", items.builderBackpack, Items.CLAY_BALL);
// / CARPENTER
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FACTORY))) {
// / BACKPACKS WOVEN
addT2BackpackRecipe(items.minerBackpack, items.minerBackpackT2);
addT2BackpackRecipe(items.diggerBackpack, items.diggerBackpackT2);
addT2BackpackRecipe(items.foresterBackpack, items.foresterBackpackT2);
addT2BackpackRecipe(items.hunterBackpack, items.hunterBackpackT2);
addT2BackpackRecipe(items.adventurerBackpack, items.adventurerBackpackT2);
addT2BackpackRecipe(items.builderBackpack, items.builderBackpackT2);
}
}
use of forestry.lepidopterology.blocks.BlockRegistryLepidopterology in project ForestryMC by ForestryMC.
the class ButterflyRoot method plantCocoon.
@Override
public BlockPos plantCocoon(World world, BlockPos coordinates, IButterfly caterpillar, GameProfile owner, int age, boolean createNursery) {
if (caterpillar == null) {
return BlockPos.ORIGIN;
}
BlockRegistryLepidopterology blocks = ModuleLepidopterology.getBlocks();
BlockPos pos = getValidCocoonPos(world, coordinates, caterpillar, owner, createNursery);
if (pos == BlockPos.ORIGIN) {
return pos;
}
IBlockState state = blocks.cocoon.getDefaultState();
boolean placed = world.setBlockState(pos, state);
if (!placed) {
return BlockPos.ORIGIN;
}
Block block = world.getBlockState(pos).getBlock();
if (blocks.cocoon != block) {
return BlockPos.ORIGIN;
}
TileCocoon cocoon = TileUtil.getTile(world, pos, TileCocoon.class);
if (cocoon == null) {
world.setBlockToAir(pos);
return BlockPos.ORIGIN;
}
cocoon.setCaterpillar(caterpillar);
cocoon.getOwnerHandler().setOwner(owner);
cocoon.setAge(age);
return pos;
}
Aggregations