private static BlockSwapper swapperFromMeta(World world, BlockPos pos, int meta) { switch(meta) { case 1 : return new BlockSwapper(world, pos, Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL)); case 2 : return new BlockSwapper(world, pos, Blocks.MYCELIUM.getDefaultState()); case 3 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.DRY)); case 4 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.GOLDEN)); case 5 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.VIVID)); case 6 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.SCORCHED)); case 7 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.INFUSED)); case 8 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.MUTATED)); default : return new BlockSwapper(world, pos, Blocks.GRASS.getDefaultState()); } }
private static boolean convertToMycelium(World world, IBlockState blockState, BlockPos pos) { Block block = blockState.getBlock(); if (block == Blocks.GRASS || block == Blocks.DIRT && world.canBlockSeeSky(pos)) { world.setBlockState(pos, Blocks.MYCELIUM.getDefaultState()); return true; } return false; }
world.setBlockState(blockpos, Blocks.MYCELIUM.getDefaultState(), 2); } else { world.setBlockState(blockpos, Blocks.GRASS.getDefaultState(), 2);
worldIn.setBlockState(blockpos, Blocks.MYCELIUM.getDefaultState(), 2); else worldIn.setBlockState(blockpos, Blocks.GRASS.getDefaultState(), 2);
public boolean matchBlock(IBlockState block) { switch (this) { case GRASS: return block == Blocks.GRASS.getDefaultState() || block == Blocks.MYCELIUM.getDefaultState(); case DIRT: return block == Blocks.DIRT.getDefaultState(); case SAND: return block == Blocks.SAND.getDefaultState() || block == Blocks.SAND.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND); case MIXED: return block == Blocks.GRASS.getDefaultState() || block == Blocks.DIRT.getDefaultState() || block == Blocks.SAND.getDefaultState() || block == Blocks.SAND.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND); case UMBERSTONE: return block == ModBlocks.UMBERSTONE.getDefaultState(); case VOLCANIC_ROCK: return block == ModBlocks.VOLCANIC_ROCK.getDefaultState(); case DUST: return block == ModBlocks.DUST.getDefaultState(); default: return false; } } }
@Override public void recipes() { Modifiers.recipes.convertInput(new ItemStack(Items.SPIDER_EYE), ContentHelper.poisonousOreDict); Modifiers.recipes.excludeOutput(new ItemStack(Items.FERMENTED_SPIDER_EYE)); Modifiers.recipes.convertInput(new ItemStack(Items.FERMENTED_SPIDER_EYE), ContentHelper.fermentedOreDict); DropSpecifier dontDropWhenSilkTouching = new DropSpecifier(new ItemStack(falseMorel), 0.15f) { @Override public boolean shouldDrop(EntityPlayer harvester, int fortuneLevel, boolean isSilkTouching) { return !isSilkTouching && super.shouldDrop(harvester, fortuneLevel, isSilkTouching); } }; Modifiers.drops.addDropsToBlock(new BlockSpecifier(Blocks.MYCELIUM.getDefaultState()), dontDropWhenSilkTouching); GameRegistry.addShapelessRecipe(new ItemStack(falseMorelFermented), new ItemStack(falseMorel), new ItemStack(Blocks.BROWN_MUSHROOM), new ItemStack(Items.SUGAR)); }
public void addInteractions() { addInteraction(Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, DirtType.DIRT), Blocks.GRASS.getDefaultState(), false); addInteraction(Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, DirtType.COARSE_DIRT), Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, DirtType.PODZOL), false); addInteraction(Blocks.GLASS, Blocks.SAND); // addInteraction(Blocks.stained_glass, -1, Blocks.glass); // addInteraction(Blocks.diamond_ore, -1, TFBlocks.blockOre, 1); // addInteraction(Blocks.cauldron, -1, Blocks.carpet, 1); // addInteraction(Blocks.cactus, -1, Blocks.cake, 5); // addInteraction(Blocks.enchanting_table, -1, Blocks.brewing_stand, 0); // addInteraction(Blocks.bookshelf, 0, Blocks.chest, 0); // addInteraction(Blocks.ender_chest, -1, TFBlocks.blockFluidEnder, 1); // addInteraction(Blocks.dragon_egg, -1, Blocks.bedrock, 1); addInteraction(Blocks.REDSTONE_ORE.getDefaultState(), Blocks.LIT_REDSTONE_ORE.getDefaultState(), true); addInteraction(Blocks.LAPIS_ORE.getDefaultState(), Blocks.LAPIS_BLOCK.getDefaultState(), true); addInteraction(Blocks.FARMLAND.getDefaultState(), Blocks.MYCELIUM.getDefaultState(), true); // for (int i = 8; i-- > 0; ) { // addInteraction(Blocks.DOUBLE_STONE_SLAB.getStateFromMeta(i), Blocks.DOUBLE_STONE_SLAB.getStateFromMeta(i + 8), false); // } addInteraction(TFBlocks.blockOre.getDefaultState().withProperty(BlockOre.VARIANT, BlockOre.Type.SILVER), TFBlocks.blockOre.getDefaultState().withProperty(BlockOre.VARIANT, BlockOre.Type.MITHRIL)); addInteraction(TFBlocks.blockOre.getDefaultState().withProperty(BlockOre.VARIANT, BlockOre.Type.LEAD), Blocks.GOLD_ORE.getDefaultState()); addInteraction(TFBlocks.blockStorage.getDefaultState().withProperty(BlockStorage.VARIANT, BlockStorage.Type.SILVER), TFBlocks.blockStorage.getDefaultState().withProperty(BlockStorage.VARIANT, BlockStorage.Type.MITHRIL)); addInteraction(TFBlocks.blockStorage.getDefaultState().withProperty(BlockStorage.VARIANT, BlockStorage.Type.LEAD), Blocks.GOLD_BLOCK.getDefaultState()); }
mushroomFarm.registerSoil(new ItemStack(Blocks.MYCELIUM), Blocks.MYCELIUM.getDefaultState()); mushroomFarm.registerSoil(new ItemStack(Blocks.DIRT, 1, 2), Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL), true);