cn.nukkit.block.BlockDropper Maven / Gradle / Ivy
package cn.nukkit.block;
import cn.nukkit.api.PowerNukkitOnly;
import cn.nukkit.api.Since;
import cn.nukkit.blockentity.BlockEntity;
import cn.nukkit.blockentity.BlockEntityDropper;
import cn.nukkit.dispenser.DispenseBehavior;
import cn.nukkit.dispenser.DropperDispenseBehavior;
import cn.nukkit.item.Item;
import cn.nukkit.item.ItemTool;
import org.jetbrains.annotations.NotNull;
@PowerNukkitOnly
public class BlockDropper extends BlockDispenser {
@PowerNukkitOnly
public BlockDropper() {
this(0);
}
@PowerNukkitOnly
public BlockDropper(int meta) {
super(meta);
}
@Override
public String getName() {
return "Dropper";
}
@Override
public int getId() {
return DROPPER;
}
@Since("1.4.0.0-PN")
@PowerNukkitOnly
@NotNull
@Override
public Class extends BlockEntityDropper> getBlockEntityClass() {
return BlockEntityDropper.class;
}
@PowerNukkitOnly
@Since("1.4.0.0-PN")
@NotNull
@Override
public String getBlockEntityType() {
return BlockEntity.DROPPER;
}
@PowerNukkitOnly
@Override
public void dispense() {
super.dispense();
}
@PowerNukkitOnly
@Override
protected DispenseBehavior getDispenseBehavior(Item item) {
return new DropperDispenseBehavior();
}
@Override
public double getResistance() {
return 3.5;
}
@Override
public double getHardness() {
return 3.5;
}
@Override
public int getToolType() {
return ItemTool.TYPE_PICKAXE;
}
@Override
@PowerNukkitOnly
public int getToolTier() {
return ItemTool.TIER_WOODEN;
}
}