All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.block.BlockCoralFanDead Maven / Gradle / Ivy

Go to download

A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.

There is a newer version: 1.6.0.1-PN
Show newest version
package cn.nukkit.block;

import cn.nukkit.level.Level;
import cn.nukkit.utils.BlockColor;

public class BlockCoralFanDead extends BlockCoralFan {
    public BlockCoralFanDead() {
        this(0);
    }
    
    public BlockCoralFanDead(int meta) {
        super(meta);
    }
    
    @Override
    public int getId() {
        return CORAL_FAN_DEAD;
    }
    
    @Override
    public String getName() {
        return "Dead " + super.getName();
    }
    
    @Override
    public BlockColor getColor() {
        return BlockColor.GRAY_BLOCK_COLOR;
    }
    
    @Override
    public boolean isDead() {
        return true;
    }
    
    @Override
    public int onUpdate(int type) {
        if (type == Level.BLOCK_UPDATE_NORMAL) {
            if (!getSide(getRootsFace()).isSolid()) {
                this.getLevel().useBreakOn(this);
            }
            return type;
        } else if (type == Level.BLOCK_UPDATE_RANDOM) {
            return super.onUpdate(type);
        }
        return 0;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy