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


Java ChangeMode.DELETE属性代码示例

本文整理汇总了Java中ch.njol.skript.classes.Changer.ChangeMode.DELETE属性的典型用法代码示例。如果您正苦于以下问题:Java ChangeMode.DELETE属性的具体用法?Java ChangeMode.DELETE怎么用?Java ChangeMode.DELETE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在ch.njol.skript.classes.Changer.ChangeMode的用法示例。


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

示例1: change

@Override
public void change(final Event e, final @Nullable Object[] delta, final ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.DELETE) {
		final LivingEntity target = delta == null ? null : (LivingEntity) delta[0];
		for (final LivingEntity entity : getExpr().getArray(e)) {
			if (getTime() >= 0 && e instanceof EntityTargetEvent && entity.equals(((EntityTargetEvent) e).getEntity()) && !Delay.isDelayed(e)) {
				((EntityTargetEvent) e).setTarget(target);
			} else {
				if (entity instanceof Creature)
					((Creature) entity).setTarget(target);
			}
		}
	} else {
		super.change(e, delta, mode);
	}
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:16,代码来源:ExprTarget.java

示例2: change

@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
	if (object.getSingle(e) instanceof Metadatable) {
		Metadatable metadata = (Metadatable)object.getSingle(e);
		if (mode == ChangeMode.SET) {
			if (metadata.hasMetadata(string.getSingle(e))) {
				metadata.removeMetadata(string.getSingle(e), Skellett.plugin);
			}
			metadata.setMetadata(string.getSingle(e), (MetadataValue)new FixedMetadataValue(Skellett.plugin, (Object)(delta[0])));
		} else if (mode == ChangeMode.RESET || mode == ChangeMode.DELETE) {
			if (metadata.hasMetadata(string.getSingle(e))) {
				metadata.removeMetadata(string.getSingle(e), Skellett.plugin);
			}
		}
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:16,代码来源:ExprMetadata.java

示例3: 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;
}
 
开发者ID:Pikachu920,项目名称:Ersatz,代码行数:7,代码来源:ExprResult.java

示例4: acceptChange

@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.DELETE || mode == ChangeMode.RESET || mode == ChangeMode.ADD) {
		return CollectionUtils.array(String.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprBookPage.java

示例5: 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;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:8,代码来源:ExprWeather.java

示例6: acceptChange

@SuppressWarnings("unchecked")
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.DELETE)
		return CollectionUtils.array(LivingEntity.class);
	return super.acceptChange(mode);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:8,代码来源:ExprTarget.java

示例7: acceptChange

@SuppressWarnings("unchecked")
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
	if (delay != Kleenean.FALSE) {
		Skript.error("Can't cancel the event anymore after it has already passed");
		return null;
	}
	if (mode == ChangeMode.SET || mode == ChangeMode.DELETE)
		return CollectionUtils.array(Boolean.class);
	return null;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:12,代码来源:ExprEventCancelled.java

示例8: acceptChange

@SuppressWarnings({"unchecked", "null"})
@Override
public Class<?>[] acceptChange(final ChangeMode mode) {
	if (mode == ChangeMode.ADD || mode == ChangeMode.SET || mode == ChangeMode.DELETE || mode == ChangeMode.REMOVE)
		return CollectionUtils.array(Player.class, Player[].class);
	return null;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:7,代码来源:ExprChatRecipients.java

示例9: 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;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:12,代码来源:ExprMaxHealth.java

示例10: acceptChange

@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
	if (mode == ChangeMode.DELETE || mode == ChangeMode.SET)
		return new Class[] {String.class};
	return null;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:7,代码来源:ExprSignText.java

示例11: acceptChange

@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.DELETE)
		return new Class[] {Location.class};
	return null;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:7,代码来源:ExprBed.java

示例12: 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);
		}
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:34,代码来源:ExprPlayerPoints.java

示例13: 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;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprPlayerPoints.java

示例14: change

@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
	String ID = variableString.toString(e);
	if (mode == ChangeMode.SET) {
		Sockets.send(new SkellettPacket(false, ID, (Object)delta[0], SkellettPacketType.NETWORKVARIABLE));
	} else if (mode == ChangeMode.RESET || mode == ChangeMode.DELETE) {
		Sockets.send(new SkellettPacket(false, ID, null, SkellettPacketType.NETWORKVARIABLEDELETE));
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:9,代码来源:ExprNetworkVariable.java

示例15: acceptChange

@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.RESET || mode == ChangeMode.DELETE) {
		return CollectionUtils.array(Object.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprMetadata.java


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