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


Java MessageUtil类代码示例

本文整理汇总了Java中us.zingalicio.cordstone.util.MessageUtil的典型用法代码示例。如果您正苦于以下问题:Java MessageUtil类的具体用法?Java MessageUtil怎么用?Java MessageUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onRangedUse

import us.zingalicio.cordstone.util.MessageUtil; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void onRangedUse(Player player, ItemStack item, Action action)
  {
    Block targetBlock = player.getTargetBlock(null, this.plugin.getToolManager().getRange());

    if (player.isSneaking())
    {
      if (targetBlock.getType() != Material.AIR)
      {
        if ((action == Action.LEFT_CLICK_AIR) || (action == Action.LEFT_CLICK_BLOCK))
        {
          breakBlock(Boolean.valueOf(true), targetBlock, player);
          return;
        }

        breakBlock(Boolean.valueOf(false), targetBlock, player);
        return;
      }

      MessageUtil.sendMessage(plugin, player, "Block out of range.");
      return;
    }
  }
 
开发者ID:Zingalicious,项目名称:ToolmanSponge,代码行数:24,代码来源:Breaker.java

示例2: onCommand

import us.zingalicio.cordstone.util.MessageUtil; //导入依赖的package包/类
@Override
public boolean onCommand(CommandSender sender, Command command, String label,
		String[] args) 
{
	if(args.length == 0)
	{
		return false;
	}
	switch(args[0])
	{
		case "reload":
			return reload(sender, args);
		case "version":
			MessageUtil.sendMessage(plugin, sender, plugin.getDescription().getVersion());
			return true;
		default:
			return false;
	}
}
 
开发者ID:Zingalicious,项目名称:Songlantern,代码行数:20,代码来源:SonglanternCommand.java

示例3: reload

import us.zingalicio.cordstone.util.MessageUtil; //导入依赖的package包/类
public boolean reload(CommandSender sender, String[] args)
{
	try
	{
		if(PermissionsUtil.checkPermission(sender, "songlantern.reload", false))
		{
			ConfigUtil.loadYaml(plugin.getConfig(), plugin.getConfigFile());
			ConfigUtil.loadYaml(plugin.getMaterials(), plugin.getMaterialFile());
			ConfigUtil.loadYaml(plugin.getItems(), plugin.getItemFile());
			PluginManager pluginManager = Bukkit.getPluginManager();
			pluginManager.disablePlugin(plugin);
			pluginManager.enablePlugin(plugin);
			MessageUtil.sendMessage(plugin, sender, "Reloaded.");
		}
		return true;
	}
	catch(Throwable t)
	{
		MessageUtil.sendError(plugin, sender, "Failed to reload.");
		return false;
	}
}
 
开发者ID:Zingalicious,项目名称:Songlantern,代码行数:23,代码来源:SonglanternCommand.java

示例4: onCloseUse

import us.zingalicio.cordstone.util.MessageUtil; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void onCloseUse(Block clickedBlock, BlockFace blockFace, Player player, ItemStack item, Action action)
  {
    Block newBlock = clickedBlock.getRelative(blockFace);
    Block newBlockO = clickedBlock.getRelative(blockFace.getOppositeFace());

    Material mat = clickedBlock.getType();
    byte data = clickedBlock.getData();

    Material newMat = newBlock.getType();
    Material newMatO = newBlockO.getType();

    if ((action == Action.LEFT_CLICK_AIR) || (action == Action.LEFT_CLICK_BLOCK))
    {
      if ((newBlockO != null) && (mat != Material.AIR))
      {
        if (player.isSneaking())
        {
          if (newMatO != Material.AIR)
          {
            changeBlock(Boolean.valueOf(true), newBlockO, mat, data, player, item);
            return;
          }
          placeBlock(Boolean.valueOf(true), newBlockO, mat, data, player, item);
          return;
        }
        if (newMatO == Material.AIR)
        {
          placeBlock(Boolean.valueOf(true), newBlockO, mat, data, player, item);
          return;
        }

        MessageUtil.sendMessage(plugin, player, "Sneak to overwrite blocks.");
      }

    }
    else if ((newBlock != null) && (mat != Material.AIR))
    {
      if (player.isSneaking())
      {
        if (newMat != Material.AIR)
        {
          changeBlock(Boolean.valueOf(true), newBlock, mat, data, player, item);
          return;
        }
        placeBlock(Boolean.valueOf(true), newBlock, mat, data, player, item);
        return;
      }
      if (newMat == Material.AIR)
      {
        placeBlock(Boolean.valueOf(true), newBlock, mat, data, player, item);
        return;
      }

      MessageUtil.sendMessage(plugin, player, "Sneak to overwrite blocks.");
      return;
    }
  }
 
开发者ID:Zingalicious,项目名称:ToolmanSponge,代码行数:59,代码来源:Pliers.java


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