本文整理汇总了Java中ch.njol.skript.classes.Changer.ChangeMode.SET属性的典型用法代码示例。如果您正苦于以下问题:Java ChangeMode.SET属性的具体用法?Java ChangeMode.SET怎么用?Java ChangeMode.SET使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ch.njol.skript.classes.Changer.ChangeMode
的用法示例。
在下文中一共展示了ChangeMode.SET属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: change
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
if (inventory == null) {
return;
}
Number num = (Number)delta[0];
Number numNow = inventory.getSingle(e).getHolder().getFuelLevel();
if (mode == ChangeMode.SET) {
inventory.getSingle(e).getHolder().setFuelLevel(num.intValue());
} else if (mode == ChangeMode.RESET) {
inventory.getSingle(e).getHolder().setFuelLevel(0);
} else if (mode == ChangeMode.ADD) {
inventory.getSingle(e).getHolder().setFuelLevel(numNow.intValue() + num.intValue());
} else if (mode == ChangeMode.REMOVE) {
inventory.getSingle(e).getHolder().setFuelLevel(numNow.intValue() - num.intValue());
}
}
示例2: acceptChange
@Override
public Class<?>[] acceptChange(final ChangeMode mode) {
if (mode == ChangeMode.SET || mode == ChangeMode.DELETE || mode == ChangeMode.RESET) {
return CollectionUtils.array(String.class);
}
return null;
}
示例3: change
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode) {
if (mode == ChangeMode.SET) {
ItemType item = (ItemType)delta[0];
ItemStack m = item.getRandom();
((InventoryClickEvent)e).setCurrentItem(m);
}
}
示例4: acceptChange
@SuppressWarnings("unchecked")
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET) {
return CollectionUtils.array(ItemType.class);
}
return null;
}
示例5: acceptChange
@SuppressWarnings("unchecked")
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET) {
return CollectionUtils.array(String.class);
}
return null;
}
示例6: change
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
if (mode == ChangeMode.SET) {
((BlockDamageEvent)e).setInstaBreak(((Boolean)delta[0]));
}
if (mode == ChangeMode.RESET) {
((BlockDamageEvent)e).setInstaBreak(((BlockDamageEvent)e).getInstaBreak());
}
}
示例7: change
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
if (entity != null) {
Number distance = (Number)delta[0];
Number distanceNow = entity.getSingle(e).getFallDistance();
if (mode == ChangeMode.SET) {
entity.getSingle(e).setFallDistance(distance.floatValue());
} else if (mode == ChangeMode.ADD) {
entity.getSingle(e).setFallDistance(distanceNow.floatValue() + distance.floatValue());
} else if (mode == ChangeMode.REMOVE) {
entity.getSingle(e).setFallDistance(distanceNow.floatValue() - distance.floatValue());
}
}
}
示例8: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET) {
return CollectionUtils.array(Number.class);
}
return null;
}
示例9: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET || mode == ChangeMode.RESET) {
return CollectionUtils.array(Boolean.class);
}
return null;
}
示例10: change
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
if (mode == ChangeMode.SET) {
Number level = (Number)delta[0];
me.baks.rpl.api.API.setPlayerLevel(player.getSingle(e), level.intValue());
}
}
示例11: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET || mode == ChangeMode.RESET) {
return CollectionUtils.array(ItemType.class);
}
return null;
}
示例12: acceptChange
@SuppressWarnings("unchecked")
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
if (mode == ChangeMode.DELETE || mode == ChangeMode.SET)
return CollectionUtils.array(WeatherType.class);
return null;
}
示例13: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET) {
return CollectionUtils.array(String.class);
}
return null;
}
示例14: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET) {
return CollectionUtils.array(Location.class);
}
return null;
}
示例15: change
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
BookMeta book = (BookMeta) item.getSingle(e).getItemMeta();
if (mode == ChangeMode.SET) {
book.setAuthor((String)delta[0]);
}
item.getSingle(e).setItemMeta(book);
}