Java 类org.bukkit.material.Diode 实例源码

项目:modules-extra    文件:UseRepeater.java   
@Override
public Text translateAction(User user)
{
    int oldTicks = this.oldBlock.as(Diode.class).getDelay();
    int newTicks = this.newBlock.as(Diode.class).getDelay();
    if (this.hasAttached())
    {
        UseRepeater action = (UseRepeater)this.getAttached().get(this.getAttached().size() - 1);
        newTicks = action.newBlock.as(Diode.class).getDelay();
    }
    if (oldTicks == newTicks)
    {
        return user.getTranslation(POSITIVE, "{user} fiddled around with the repeater but did not change anything",
                                   this.player.name);
    }
    return user.getTranslation(POSITIVE, "{user} set the repeater to {amount} ticks delay", this.player.name,
                               newTicks);
}
项目:Skellett    文件:ExprRepeaterDelay.java   
@Override
@Nullable
protected Number[] get(Event e) {
    MaterialData repeater = block.getSingle(e).getState().getData();
    if (repeater instanceof Diode) {
        return new Number[]{((Diode)repeater).getDelay()};
    }
    return null;
}
项目:Skellett    文件:ExprRepeaterDelay.java   
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
    if (mode == ChangeMode.SET) {
        BlockState state = block.getSingle(e).getState();
        MaterialData repeater = state.getData();
        if (repeater instanceof Diode) {
            Number delay = (Number)delta[0];
            ((Diode)repeater).setDelay(delay.intValue());
            state.setData(repeater);
            state.update(true);
        }
    }
}
项目:BedrockAPI    文件:Diode.java   
public Diode() {
}
项目:BedrockAPI    文件:Diode.java   
@Deprecated public Diode(int type) {
}
项目:BedrockAPI    文件:Diode.java   
public Diode(Material type) {
}
项目:BedrockAPI    文件:Diode.java   
@Deprecated public Diode(int type, byte data) {
}
项目:BedrockAPI    文件:Diode.java   
@Deprecated public Diode(Material type, byte data) {
}
项目:BedrockAPI    文件:Diode.java   
public Diode clone() {
    return null;
}