cn.nukkit.block.BlockBeetroot Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.block;
import cn.nukkit.item.Item;
import cn.nukkit.item.ItemSeedsBeetroot;
/**
* @author xtypr
* @since 2015/11/22
*/
public class BlockBeetroot extends BlockCrops {
public BlockBeetroot() {
this(0);
}
public BlockBeetroot(int meta) {
super(meta);
}
@Override
public int getId() {
return BEETROOT_BLOCK;
}
@Override
public String getName() {
return "Beetroot Block";
}
@Override
public Item toItem() {
return new ItemSeedsBeetroot();
}
@Override
public Item[] getDrops(Item item) {
if (this.getDamage() >= 0x07) {
return new Item[]{
Item.get(Item.BEETROOT, 0, 1),
Item.get(Item.BEETROOT_SEEDS, 0, (int) (4d * Math.random()))
};
} else {
return new Item[]{
Item.get(Item.BEETROOT_SEEDS, 0, 1)
};
}
}
}