Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.tristanvo.mod;
- import java.util.ArrayList;
- import net.minecraft.block.BlockLeavesBase;
- import net.minecraft.block.material.Material;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.renderer.texture.IIconRegister;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.IIcon;
- import net.minecraft.world.IBlockAccess;
- import net.minecraftforge.common.IShearable;
- public class mangoLeaf extends BlockLeavesBase implements IShearable {
- protected IIcon icon1;
- protected IIcon icon2;
- protected mangoLeaf(Material material) {
- super(material, false);
- this.setStepSound(this.soundTypeGrass);
- this.setHardness(0.2F);
- }
- @Override
- public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) {
- return true;
- }
- @Override
- public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) {
- ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
- drops.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3));
- return drops;
- }
- public void registerBlockIcons(IIconRegister icon)
- {
- if(Minecraft.isFancyGraphicsEnabled())
- {
- icon1 = icon.registerIcon("moem:mangoleaf_sidefancy");
- }
- else
- {
- icon2 = icon.registerIcon("moem:mangoleaf_sidefast");
- }
- }
- public IIcon getIcon(int side, int meta)
- {
- if(Minecraft.isFancyGraphicsEnabled())
- {
- return icon1;
- }
- else
- {
- return icon2;
- }
- }
- public boolean isOpaqueCube()
- {
- if(Minecraft.isFancyGraphicsEnabled())
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment