本文整理汇总了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);
}
示例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;
}
示例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);
}
}
}
示例4: Diode
import org.bukkit.material.Diode; //导入依赖的package包/类
public Diode() {
}
示例5: clone
import org.bukkit.material.Diode; //导入依赖的package包/类
public Diode clone() {
return null;
}