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


Java Note类代码示例

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


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

示例1: tellMembers

import org.bukkit.Note; //导入依赖的package包/类
public void tellMembers(FancyMessage message) {
	if (leader != null) {
		Player l = leader.getPlayer().getPlayer();
		message.send(l);
		l.playNote(l.getLocation(), Instrument.PIANO, Note.natural(1, Tone.C));
		l.playNote(l.getLocation(), Instrument.PIANO, Note.natural(1, Tone.G));
		l.playNote(l.getLocation(), Instrument.PIANO, Note.natural(1, Tone.E));
	}
	if (members.isEmpty()) {
		return;
	}
	for (QuestPlayer qp : members) {
		if (!qp.getPlayer().isOnline()) {
			continue;
		}
		Player p = qp.getPlayer().getPlayer();
		message.send(qp.getPlayer().getPlayer());
		p.playNote(p.getLocation(), Instrument.PIANO, Note.natural(1, Tone.C));
		p.playNote(p.getLocation(), Instrument.PIANO, Note.natural(1, Tone.G));
		p.playNote(p.getLocation(), Instrument.PIANO, Note.natural(1, Tone.E));
	}
}
 
开发者ID:Dove-Bren,项目名称:QuestManager,代码行数:23,代码来源:Party.java

示例2: play

import org.bukkit.Note; //导入依赖的package包/类
@Override
public boolean play(Instrument instrument, Note note) {
    Block block = getBlock();

    if (block.getType() == Material.NOTE_BLOCK) {
        world.getHandle().addBlockEvent(getX(), getY(), getZ(), CraftMagicNumbers.getBlock(block), instrument.getType(), note.getId());
        return true;
    } else {
        return false;
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:12,代码来源:CraftNoteBlock.java

示例3: translateMusicFileToNotes

import org.bukkit.Note; //导入依赖的package包/类
public static List<Note> translateMusicFileToNotes(String file, int line) {
	ArrayList<Note> notes = new ArrayList<Note>();
	for (String s : readMusicFile(file).get(line).split(" ")) {
		//System.out.println(s);
		//System.out.println(Integer.valueOf(String.valueOf(s.charAt(1))));
		notes.add(Note.natural(Integer.valueOf(String.valueOf(s.charAt(1))), Tone.valueOf(String.valueOf(s.charAt(0)))));
	}
	return notes;
}
 
开发者ID:GigaGamma,项目名称:SuperiorCraft,代码行数:10,代码来源:MusicPlayer.java

示例4: getEmerald

import org.bukkit.Note; //导入依赖的package包/类
@EventHandler
public void getEmerald(PlayerPickupItemEvent e){
	Player p = e.getPlayer();
	String uuid = p.getUniqueId().toString();
	if(e.getItem().getItemStack().getType().equals(Material.EMERALD)){
		e.setCancelled(true);
		int amount = e.getItem().getItemStack().getAmount();
		e.getItem().remove();
		setEmeralds(uuid, getEmeralds(uuid)+amount);
		p.playNote(p.getLocation(), Instrument.PIANO, Note.natural(1, Tone.A));
	}
}
 
开发者ID:OverloadedCore,项目名称:kaosEssentials,代码行数:13,代码来源:Core.java

示例5: init

import org.bukkit.Note; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
    noteExpression = (Expression<Note>) expressions[0];
    instrumentExpression = (Expression<Instrument>) expressions[1];
    blockExpression = (Expression<Block>) expressions[2];
    return true;
}
 
开发者ID:MundoSK,项目名称:MundoSK,代码行数:8,代码来源:EffPlayNoteBlock.java

示例6: updateCompass

import org.bukkit.Note; //导入依赖的package包/类
public static void updateCompass(QuestPlayer qp, boolean silent) {
	if (!qp.getPlayer().isOnline()) {
		return;
	}
	
	if (!QuestManagerPlugin.questManagerPlugin.getPluginConfiguration().getCompassEnabled()) {
		return;
	}
	
	if (!hasCompass(qp.getPlayer().getPlayer().getInventory())) {
		return;
	}
	
	Player player = qp.getPlayer().getPlayer();
	
	Location targ = qp.getCompassTarget();
	if (targ == null) {
		player.setCompassTarget(player.getWorld().getBlockAt(0, 0, 0).getLocation().add(RESET_VECTOR));
	} else {
		player.setCompassTarget(qp.getCompassTarget());
	}
	
	if (!silent) {
		player.sendMessage(ChatColor.GRAY + "Your compass has been updated" + ChatColor.RESET);
		player.playNote(player.getLocation(), Instrument.PIANO, Note.natural(0, Tone.E));
		player.playNote(player.getLocation(), Instrument.PIANO, Note.natural(0, Tone.G));
		player.playNote(player.getLocation(), Instrument.PIANO, Note.natural(0, Tone.B));
	}
}
 
开发者ID:Dove-Bren,项目名称:QuestManager,代码行数:30,代码来源:Compass.java

示例7: onAction

import org.bukkit.Note; //导入依赖的package包/类
@Override
public void onAction() {
	// TODO Auto-generated method stub
	if (leader.getParty() == null) {
		Party party = leader.createParty();
		other.joinParty(party);
	} else {
		other.joinParty(leader.getParty());
	}
	Player p = other.getPlayer().getPlayer();
	p.playNote(p.getLocation(), Instrument.PIANO, Note.natural(1, Tone.C));
	p.playNote(p.getLocation(), Instrument.PIANO, Note.natural(1, Tone.G));
	p.playNote(p.getLocation(), Instrument.PIANO, Note.natural(1, Tone.E));
}
 
开发者ID:Dove-Bren,项目名称:QuestManager,代码行数:15,代码来源:JoinPartyAction.java

示例8: parseNote

import org.bukkit.Note; //导入依赖的package包/类
public static Note parseNote(String note) {
    Matcher matcher = NOTE_PARSER.matcher(note.toUpperCase());
    if (matcher.matches()) {
        Note.Tone tone = Note.Tone.valueOf(matcher.group(1));
        boolean sharped = !matcher.group(2).isEmpty();
        int octave = matcher.group(3).length();
        try {
            return new Note(octave, tone, sharped);
        } catch (IllegalArgumentException e) {
            throw new LuaError("Invalid note: " + note + ", " + e.getMessage());
        }
    }
    throw new LuaError("Invalid note: " + note);
}
 
开发者ID:leMaik,项目名称:RpgPlus,代码行数:15,代码来源:Sound.java

示例9: play

import org.bukkit.Note; //导入依赖的package包/类
@Override
public boolean play(Instrument instrument, Note note) {
    Block block = getBlock();

    if (block.getType() == Material.NOTE_BLOCK) {
        world.getHandle().playBlockAction(getX(), getY(), getZ(), CraftMagicNumbers.getBlock(block), instrument.getType(), note.getId());
        return true;
    } else {
        return false;
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:12,代码来源:CraftNoteBlock.java

示例10: natural

import org.bukkit.Note; //导入依赖的package包/类
/**
 * Plays a natural note
 *
 * @param player  player
 * @param tone    note
 * @param octave  octave
 * @param instrum instrument
 * @param delay   delay
 */
public void natural(Player player, Tone tone, int octave, Instrument instrum, long delay) {
    final Player play = player;
    final Instrument inst = instrum;
    final Note note = Note.natural(octave, tone);
    final BukkitScheduler scheduler = MoneyThief.plugin.getServer().getScheduler();
    scheduler.scheduleSyncDelayedTask(MoneyThief.plugin, new Runnable() {

        @Override
        public void run() {
            play.playNote(play.getLocation(), inst, note);
        }

    }, delay);
}
 
开发者ID:Ratismal,项目名称:MoneyThief,代码行数:24,代码来源:FanfarePlayer.java

示例11: sharp

import org.bukkit.Note; //导入依赖的package包/类
/**
 * Plays a sharp note
 *
 * @param player  player
 * @param tone    note
 * @param octave  octave
 * @param instrum instrument
 * @param delay   delay
 */
public void sharp(Player player, Tone tone, int octave, Instrument instrum, long delay) {
    final Player play = player;
    final Instrument inst = instrum;
    final Note note = Note.sharp(octave, tone);
    final BukkitScheduler scheduler = MoneyThief.plugin.getServer().getScheduler();
    scheduler.scheduleSyncDelayedTask(MoneyThief.plugin, new Runnable() {

        @Override
        public void run() {
            play.playNote(play.getLocation(), inst, note);
        }

    }, delay);
}
 
开发者ID:Ratismal,项目名称:MoneyThief,代码行数:24,代码来源:FanfarePlayer.java

示例12: flat

import org.bukkit.Note; //导入依赖的package包/类
/**
 * Plays a flat note
 *
 * @param player  player
 * @param tone    note
 * @param octave  octave
 * @param instrum instrument
 * @param delay   delay
 */
public void flat(Player player, Tone tone, int octave, Instrument instrum, long delay) {
    final Player play = player;
    final Instrument inst = instrum;
    final Note note = Note.flat(octave, tone);
    final BukkitScheduler scheduler = MoneyThief.plugin.getServer().getScheduler();
    scheduler.scheduleSyncDelayedTask(MoneyThief.plugin, new Runnable() {

        @Override
        public void run() {
            play.playNote(play.getLocation(), inst, note);
        }

    }, delay);
}
 
开发者ID:Ratismal,项目名称:MoneyThief,代码行数:24,代码来源:FanfarePlayer.java

示例13: play

import org.bukkit.Note; //导入依赖的package包/类
@Override
public boolean play(Instrument instrument, Note note) {
    Block block = getBlock();

    if (block.getType() == Material.NOTE_BLOCK) {
        world.getHandle().playBlockAction(new BlockPosition(getX(), getY(), getZ()), CraftMagicNumbers.getBlock(block), instrument.getType(), note.getId());
        return true;
    } else {
        return false;
    }
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:12,代码来源:CraftNoteBlock.java

示例14: play

import org.bukkit.Note; //导入依赖的package包/类
public boolean play(Instrument instrument, Note note) {
    Block block = getBlock();

    if (block.getType() == Material.NOTE_BLOCK) {
        world.getHandle().playNote(getX(), getY(), getZ(), block.getTypeId(), instrument.getType(), note.getId());
        return true;
    } else {
        return false;
    }
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:11,代码来源:CraftNoteBlock.java

示例15: fromNode

import org.bukkit.Note; //导入依赖的package包/类
@Override
public Note fromNode(Node node) throws ConversionException
{
    if (node instanceof ByteNode)
    {
        return new Note(((ByteNode)node).getValue().intValue());
    }
    throw ConversionException.of(this, node, "Note is not a ByteNode!");
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:10,代码来源:NoteConverter.java


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