net.minecraft.block.BlockTallGrass Java Examples

The following examples show how to use net.minecraft.block.BlockTallGrass. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GrassDropHandler.java    From AgriCraft with MIT License 5 votes vote down vote up
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void interceptGrassDrop(BlockEvent.HarvestDropsEvent event) {

    // Skip silk touch.
    if (event.isSilkTouching()) {
        return;
    }

    // Fetch the blockstate.
    final IBlockState state = event.getState();

    // Skip Air or Error
    if (state == null || state.getBlock() == null) {
        return;
    }

    // Fetch the world random.
    final Random rand = event.getWorld().rand;

    // Log
    // This line was oddly ignoring the debug settings...
    //AgriCore.getLogger("agricraft").debug("Intercepted! Block: {0}", state.getBlock());
    // Add grass drops if grass block.
    if (state.getBlock() instanceof BlockTallGrass) {
        // Wipe other drops, if needed.
        if (AgriCraftConfig.wipeGrassDrops) {
            event.getDrops().clear();
        }
        // Log
        // Commenented out to prevent spam.
        //AgriCore.getLogger("agricraft").debug("Inserting Drops!");
        // Add the drops.
        addGrassDrops(event.getDrops(), rand);
    }
}
 
Example #2
Source File: BiomeBambooForest.java    From Sakura_mod with MIT License 4 votes vote down vote up
public WorldGenerator getRandomWorldGenForGrass(Random rand)
{
    return rand.nextInt(4) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
}
 
Example #3
Source File: BiomeMiniJungle.java    From CommunityMod with GNU Lesser General Public License v2.1 4 votes vote down vote up
public WorldGenerator getRandomWorldGenForGrass(Random rand) {
    return rand.nextInt(4) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
}
 
Example #4
Source File: BiomeMiniJungle.java    From Traverse-Legacy-1-12-2 with MIT License 4 votes vote down vote up
public WorldGenerator getRandomWorldGenForGrass(Random rand) {
    return rand.nextInt(4) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
}