![JAR search and dependency download from the Maven repository](/logo.png)
cn.nukkit.block.BlockPotato 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.ItemPotato;
import java.util.Random;
/**
* @author Pub4Game
* @since 15.01.2016
*/
public class BlockPotato extends BlockCrops {
public BlockPotato(int meta) {
super(meta);
}
public BlockPotato() {
this(0);
}
@Override
public String getName() {
return "Potato Block";
}
@Override
public int getId() {
return POTATO_BLOCK;
}
@Override
public Item toItem() {
return new ItemPotato();
}
@Override
public Item[] getDrops(Item item) {
if (getDamage() >= 0x07) {
return new Item[]{
new ItemPotato(0, new Random().nextInt(3) + 1)
};
} else {
return new Item[]{
new ItemPotato()
};
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy