本文整理汇总了Java中ch.njol.skript.classes.Changer.ChangeMode.REMOVE_ALL属性的典型用法代码示例。如果您正苦于以下问题:Java ChangeMode.REMOVE_ALL属性的具体用法?Java ChangeMode.REMOVE_ALL怎么用?Java ChangeMode.REMOVE_ALL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ch.njol.skript.classes.Changer.ChangeMode
的用法示例。
在下文中一共展示了ChangeMode.REMOVE_ALL属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acceptChange
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
if (mode == ChangeMode.REMOVE_ALL)
return null;
if (ScriptLoader.isCurrentEvent(PlayerRespawnEvent.class) && !ScriptLoader.hasDelayBefore.isTrue()) {
Skript.error("Cannot change a player's level in a respawn event. Add a delay of 1 tick or change the 'new level' in a death event.");
return null;
}
if (ScriptLoader.isCurrentEvent(PlayerDeathEvent.class) && getTime() == 0 && getExpr().isDefault() && !ScriptLoader.hasDelayBefore.isTrue()) {
Skript.warning("Changing the player's level in a death event will change the player's level before he dies. " +
"Use either 'past level of player' or 'new level of player' to clearly state whether to change the level before or after he dies.");
}
if (getTime() == -1 && !ScriptLoader.isCurrentEvent(PlayerDeathEvent.class))
return null;
return new Class[] {Number.class};
}
示例2: acceptChange
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
if (mode == ChangeMode.REMOVE_ALL)
return null;
return new Class[] {Number.class};
}
示例3: acceptChange
@SuppressWarnings("unchecked")
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
if (mode == ChangeMode.REMOVE_ALL)
return null;
return CollectionUtils.array(Number.class);
}
示例4: acceptChange
@SuppressWarnings("unchecked")
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
if (delay != Kleenean.FALSE) {
Skript.error("Can't change the damage anymore after the event has already passed");
return null;
}
if (mode == ChangeMode.REMOVE_ALL)
return null;
return CollectionUtils.array(Number.class);
}
示例5: acceptChange
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
if(!Skript.isRunningMinecraft(1, 5, 2)) {
Skript.error("The max health of an entity can only be changed in Minecraft 1.6 and later");
return null;
}
if (mode != ChangeMode.DELETE && mode != ChangeMode.REMOVE_ALL)
return new Class[] {Number.class};
return null;
}
示例6: acceptChange
@SuppressWarnings("unchecked")
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
if (mode == ChangeMode.REMOVE_ALL)
return null;
if (Slot.class.isAssignableFrom(getExpr().getReturnType()) || getExpr().isSingle() && ChangerUtils.acceptsChange(getExpr(), ChangeMode.SET, ItemStack.class, ItemType.class))
return CollectionUtils.array(Number.class);
return null;
}
示例7: acceptChange
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
if (mode == ChangeMode.REMOVE_ALL)
return null;
return new Class[] {Money.class, Number.class};
}
示例8: change
@SuppressWarnings("deprecation")
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
UUID uniqueId = null;
try {
uniqueId = UUID.fromString(player.getSingle(e));
} catch (IllegalArgumentException ex) {}
Number amount = (Number)delta[0];
if (mode == ChangeMode.SET) {
if (uniqueId != null) {
Skellett.playerPoints.getAPI().set(uniqueId, amount.intValue());
} else {
Skellett.playerPoints.getAPI().set(player.getSingle(e), amount.intValue());
}
} else if (mode == ChangeMode.ADD) {
if (uniqueId != null) {
Skellett.playerPoints.getAPI().give(uniqueId, amount.intValue());
} else {
Skellett.playerPoints.getAPI().give(player.getSingle(e), amount.intValue());
}
} else if (mode == ChangeMode.REMOVE) {
if (uniqueId != null) {
Skellett.playerPoints.getAPI().take(uniqueId, amount.intValue());
} else {
Skellett.playerPoints.getAPI().take(player.getSingle(e), amount.intValue());
}
} else if (mode == ChangeMode.REMOVE_ALL || mode == ChangeMode.RESET || mode == ChangeMode.DELETE) {
if (uniqueId != null) {
Skellett.playerPoints.getAPI().reset(uniqueId);
} else {
Skellett.playerPoints.getAPI().reset(player.getSingle(e), 0);
}
}
}
示例9: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET || mode == ChangeMode.ADD || mode == ChangeMode.REMOVE || mode == ChangeMode.RESET || mode == ChangeMode.REMOVE_ALL || mode == ChangeMode.DELETE) {
return CollectionUtils.array(Number.class);
}
return null;
}
示例10: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET || mode == ChangeMode.DELETE || mode == ChangeMode.REMOVE || mode == ChangeMode.REMOVE_ALL || mode == ChangeMode.RESET) {
return CollectionUtils.array(Location.class);
}
return null;
}
示例11: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET || mode == ChangeMode.RESET || mode == ChangeMode.REMOVE_ALL) {
return CollectionUtils.array(Boolean.class);
}
return null;
}
示例12: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET || mode == ChangeMode.RESET || mode == ChangeMode.REMOVE || mode == ChangeMode.ADD || mode == ChangeMode.DELETE || mode == ChangeMode.REMOVE_ALL) {
return CollectionUtils.array(Number.class);
}
return null;
}
示例13: acceptChange
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET || mode == ChangeMode.REMOVE || mode == ChangeMode.REMOVE_ALL || mode == ChangeMode.RESET || mode == ChangeMode.DELETE) {
return CollectionUtils.array(ItemType.class);
}
return null;
}