当前位置: 首页>>代码示例>>Java>>正文


Java Diode类代码示例

本文整理汇总了Java中org.bukkit.material.Diode的典型用法代码示例。如果您正苦于以下问题:Java Diode类的具体用法?Java Diode怎么用?Java Diode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Diode类属于org.bukkit.material包,在下文中一共展示了Diode类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: translateAction

import org.bukkit.material.Diode; //导入依赖的package包/类
@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);
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:19,代码来源:UseRepeater.java

示例2: get

import org.bukkit.material.Diode; //导入依赖的package包/类
@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;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:10,代码来源:ExprRepeaterDelay.java

示例3: change

import org.bukkit.material.Diode; //导入依赖的package包/类
@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);
		}
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:14,代码来源:ExprRepeaterDelay.java

示例4: Diode

import org.bukkit.material.Diode; //导入依赖的package包/类
public Diode() {
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:3,代码来源:Diode.java

示例5: clone

import org.bukkit.material.Diode; //导入依赖的package包/类
public Diode clone() {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:Diode.java


注:本文中的org.bukkit.material.Diode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。