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


Java Skript.isRunningMinecraft方法代码示例

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


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

示例1: onEnable

import ch.njol.skript.Skript; //导入方法依赖的package包/类
public void onEnable() {
      if (!Skript.isRunningMinecraft(1, 9)) {
          getLogger().log(Level.INFO, "Outdated Minecraft version ! Update to 1.9 or newer !");
          getServer().getPluginManager().disablePlugin(this);
      }
      /*
if (getSkriptRevision() < 26) {
	getLogger().log(Level.INFO, "Outdated Skript version ! Update to dev26 or newer ! Your current version is " + Skript.getInstance().getDescription().getVersion());
	getServer().getPluginManager().disablePlugin(this);
}
*/
      plugin = this;
      getLogger().log(Level.INFO, "Starting up Quarsk v" + getPlugin().getDescription().getVersion() + " !");
      normalRegister();
      if (Registration.generateFolder()) {
          getLogger().log(Level.INFO, "Created Quarsk's folder !");
      }
      if (Registration.generateSyntaxFile()) {
          getLogger().log(Level.INFO, "Generated Quarsk's syntax file !");
      }
      getLogger().log(Level.INFO, "Registered " + Registration.getEvents().size() + " events, " + Registration.getConditions().size() + " conditions, " + Registration.getEffects().size() + " effects and " + Registration.getExpressions().size() + " expressions ! Good game !");
  }
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:23,代码来源:QuarSk.java

示例2: init

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Expression<?>[] vars, final int matchedPattern, final Kleenean isDelayed, final ParseResult parser) {
	entities = (Expression<LivingEntity>) vars[0];
	types = (Expression<ItemType>) vars[1];
	if (Skript.isRunningMinecraft(1, 9)) {
		offTool = (matchedPattern == 2 || matchedPattern == 3 || matchedPattern == 6 || matchedPattern == 7);
		setNegated(matchedPattern >= 4);
	} else {
		offTool = false;
		setNegated(matchedPattern >= 2);
	}
	return true;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:15,代码来源:CondItemInHand.java

示例3: onInteract

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.HIGHEST)
public void onInteract(final PlayerInteractEvent e) {
	//TODO Check if it's needed to do one for off hand?
	if (Skript.isRunningMinecraft(1, 9)) {
		if (e.hasItem() && (e.getPlayer().getInventory().getItemInMainHand() == null || e.getPlayer().getInventory().getItemInMainHand().getType() == Material.AIR || e.getPlayer().getInventory().getItemInMainHand().getAmount() == 0))
			e.setUseItemInHand(Result.DENY);
	} else { //Compatibility reasons
		if (e.hasItem() && (e.getPlayer().getInventory().getItemInHand() == null || e.getPlayer().getInventory().getItemInHand().getType() == Material.AIR || e.getPlayer().getInventory().getItemInHand().getAmount() == 0))
			e.setUseItemInHand(Result.DENY);
	}
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:13,代码来源:Workarounds.java

示例4: init

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@Override
public boolean init(final Expression<?>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
	if (!Skript.isRunningMinecraft(1, 4)) {
		Skript.error("fly and walk speed can only be used in Minecraft 1.4 and newer");
		return false;
	}
	super.init(exprs, matchedPattern, isDelayed, parseResult);
	walk = parseResult.mark == 0;
	return true;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:11,代码来源:ExprSpeed.java

示例5: getFrom

import ch.njol.skript.Skript; //导入方法依赖的package包/类
String getFrom() {
	final StringBuilder b = new StringBuilder();
	for (int i = 0; i < types.length; i++) {
		if ((from & (1 << i)) == 0)
			continue;
		if ((1 << i) == ITEMSTACK && !Skript.isRunningMinecraft(1, 4, 5))
			continue;
		if ((1 << i) == ENTITY && !Skript.isRunningMinecraft(1, 5))
			continue;
		if (b.length() != 0)
			b.append("/");
		b.append(types[i]);
	}
	return "" + b;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:16,代码来源:ExprName.java

示例6: init

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Expression<?>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
	if (!Skript.isRunningMinecraft(1, 4, 5)) {
		Skript.error("Item names are only available in Minecraft 1.4.5+");
		return false;
	}
	setExpr((Expression<? extends ItemType>) exprs[0]);
	name = (Expression<String>) exprs[1];
	return true;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:12,代码来源:ExprNamed.java

示例7: init

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@Override
public boolean init(final Expression<?>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {
	if (!Skript.isRunningMinecraft(1, 4, 5)) {
		Skript.error("Skulls are only available in Bukkit 1.4.5+");
		return false;
	}
	return super.init(exprs, matchedPattern, isDelayed, parseResult);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:9,代码来源:ExprSkull.java

示例8: acceptChange

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@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,代码行数:13,代码来源:ExprMaxHealth.java

示例9: init

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@Override
public boolean init(final Literal<?>[] args, final int matchedPattern, final ParseResult parseResult) {
	if (!Skript.isRunningMinecraft(1, 4, 5)) {
		Skript.error("The experience spawn event can only be used in Minecraft 1.4.5 and later");
		return false;
	}
	return true;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:9,代码来源:EvtExperienceSpawn.java

示例10: init

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "null"})
@Override
public boolean init(final Expression<?>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parser) {
	force = matchedPattern <= 1 ? (Expression<Number>) exprs[0] : null;
	blockDamage = matchedPattern != 1;
	if (!blockDamage && !Skript.isRunningMinecraft(1, 4, 5)) {
		Skript.error("Explosions which do not destroy blocks are only available in Bukkit 1.4.5+");
		return false;
	}
	locations = Direction.combine((Expression<? extends Direction>) exprs[exprs.length - 2], (Expression<? extends Location>) exprs[exprs.length - 1]);
	return true;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:13,代码来源:EffExplosion.java

示例11: set

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void set(final EntityEquipment e, final @Nullable ItemStack item) {
	if (Skript.isRunningMinecraft(1, 9))
		e.setItemInMainHand(item);
	else
		e.setItemInHand(item); //Compatibility reasons
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:9,代码来源:EquipmentSlot.java

示例12: get

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
@Nullable
public ItemStack get(final EntityEquipment e) {
	return (Skript.isRunningMinecraft(1, 9) ? e.getItemInMainHand() : e.getItemInHand()); //Compatibility reasons
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:7,代码来源:EquipmentSlot.java


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