本文整理汇总了Java中org.bukkit.Note.Tone类的典型用法代码示例。如果您正苦于以下问题:Java Tone类的具体用法?Java Tone怎么用?Java Tone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Tone类属于org.bukkit.Note包,在下文中一共展示了Tone类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: tellMembers
import org.bukkit.Note.Tone; //导入依赖的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: identifyTone
import org.bukkit.Note.Tone; //导入依赖的package包/类
/**
* Identifies which note to play
*
* @param toneS The note's ID
* @return The note to play
*/
public Tone identifyTone(String toneS) {
Tone tone = null;
if (toneS.equals("A")) {
tone = Tone.A;
} else if (toneS.equals("B")) {
tone = Tone.B;
} else if (toneS.equals("C")) {
tone = Tone.C;
} else if (toneS.equals("D")) {
tone = Tone.D;
} else if (toneS.equals("E")) {
tone = Tone.E;
} else if (toneS.equals("F")) {
tone = Tone.F;
} else if (toneS.equals("G")) {
tone = Tone.G;
} else {
log.info("Improper tone " + toneS + ", defaulting to A");
tone = Tone.A;
}
return tone;
}
开发者ID:Ratismal,项目名称:MoneyThief,代码行数:29,代码来源:FanfarePlayer.java
示例3: translateMusicFileToNotes
import org.bukkit.Note.Tone; //导入依赖的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.Tone; //导入依赖的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: updateCompass
import org.bukkit.Note.Tone; //导入依赖的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
示例6: onAction
import org.bukkit.Note.Tone; //导入依赖的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
示例7: songOne
import org.bukkit.Note.Tone; //导入依赖的package包/类
/**
* Plays song1 to player
*
* @param player player
*/
public void songOne(Player player) {
song1 = MoneyThief.plugin.getSongOne();
song2 = MoneyThief.plugin.getSongTwo();
song3 = MoneyThief.plugin.getSongThree();
int i = 0;
int octave;
int type;
String toneS;
long time;
String instrum;
Tone tone;
Instrument instrument;
while (song1.get("" + i) != null) {
octave = song1.getInt(i + ".octave");
type = song1.getInt(i + ".type");
toneS = song1.getString(i + ".tone");
time = song1.getLong(i + ".time");
instrum = song1.getString(i + ".instrum");
tone = identifyTone(toneS);
instrument = identifyInstrum(instrum);
if (type == 0) {
natural(player, tone, octave, instrument, time);
} else if (type == 1) {
sharp(player, tone, octave, instrument, time);
} else if (type == 2) {
flat(player, tone, octave, instrument, time);
}
i++;
}
}
开发者ID:Ratismal,项目名称:MoneyThief,代码行数:36,代码来源:FanfarePlayer.java
示例8: songTwo
import org.bukkit.Note.Tone; //导入依赖的package包/类
/**
* Plays song2 to player
*
* @param player player
*/
public void songTwo(Player player) {
song1 = MoneyThief.plugin.getSongOne();
song2 = MoneyThief.plugin.getSongTwo();
song3 = MoneyThief.plugin.getSongThree();
int i = 0;
int octave;
int type;
String toneS;
long time;
String instrum;
Tone tone;
Instrument instrument;
while (song2.get("" + i) != null) {
octave = song2.getInt(i + ".octave");
type = song2.getInt(i + ".type");
toneS = song2.getString(i + ".tone");
time = song2.getLong(i + ".time");
instrum = song2.getString(i + ".instrum");
tone = identifyTone(toneS);
instrument = identifyInstrum(instrum);
if (type == 0) {
natural(player, tone, octave, instrument, time);
} else if (type == 1) {
sharp(player, tone, octave, instrument, time);
} else if (type == 2) {
flat(player, tone, octave, instrument, time);
}
i++;
}
}
开发者ID:Ratismal,项目名称:MoneyThief,代码行数:36,代码来源:FanfarePlayer.java
示例9: songThree
import org.bukkit.Note.Tone; //导入依赖的package包/类
/**
* Plays song3 to player
*
* @param player player
*/
public void songThree(Player player) {
song1 = MoneyThief.plugin.getSongOne();
song2 = MoneyThief.plugin.getSongTwo();
song3 = MoneyThief.plugin.getSongThree();
int i = 0;
int octave;
int type;
String toneS;
long time;
String instrum;
Tone tone;
Instrument instrument;
while (song3.get("" + i) != null) {
octave = song3.getInt(i + ".octave");
type = song3.getInt(i + ".type");
toneS = song3.getString(i + ".tone");
time = song3.getLong(i + ".time");
instrum = song3.getString(i + ".instrum");
tone = identifyTone(toneS);
instrument = identifyInstrum(instrum);
if (type == 0) {
natural(player, tone, octave, instrument, time);
} else if (type == 1) {
sharp(player, tone, octave, instrument, time);
} else if (type == 2) {
flat(player, tone, octave, instrument, time);
}
i++;
}
}
开发者ID:Ratismal,项目名称:MoneyThief,代码行数:36,代码来源:FanfarePlayer.java
示例10: natural
import org.bukkit.Note.Tone; //导入依赖的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.Tone; //导入依赖的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.Tone; //导入依赖的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: pstp
import org.bukkit.Note.Tone; //导入依赖的package包/类
private void pstp(Player p){
p.playNote(p.getLocation(), Instrument.PIANO, Note.sharp(1, Tone.F));
}
开发者ID:OverloadedCore,项目名称:kaosEssentials,代码行数:4,代码来源:Core.java
示例14: onAction
import org.bukkit.Note.Tone; //导入依赖的package包/类
@Override
public void onAction() {
if (!other.getPlayer().isOnline() || !leader.getPlayer().isOnline()) {
return;
}
if (other.getParty() != null) {
leader.getPlayer().getPlayer().sendMessage(PartyInviteAction.DENY_MESSAGE);
return;
}
if (leader.getPlayer().getUniqueId().equals(other.getPlayer().getUniqueId())) {
leader.getPlayer().getPlayer().sendMessage(PartyInviteAction.SAME_MESSAGE);
return;
}
MenuAction join = new JoinPartyAction(leader, other);
ChatMenuOption joinOpt = new ChatMenuOption(new PlainMessage("Accept"), join);
MenuAction deny = new ShowChatMenuAction(new SimpleChatMenu(
new FancyMessage(other.getPlayer().getName())
.color(ChatColor.DARK_BLUE)
.then(" refused your invitation.")), leader.getPlayer().getPlayer());
ChatMenuOption denyOpt = new ChatMenuOption(new PlainMessage("Deny"), deny);
PlainMessage body = new PlainMessage(
new FancyMessage(leader.getPlayer().getName())
.color(ChatColor.DARK_BLUE)
.then(" invited you to join their party!")
);
ChatMenu menu = new MultioptionChatMenu(body, joinOpt, denyOpt);
Player op = other.getPlayer().getPlayer();
menu.show(op);
op.playNote(op.getLocation(), Instrument.PIANO, Note.natural(1, Tone.C));
op.playNote(op.getLocation(), Instrument.PIANO, Note.natural(1, Tone.G));
op.playNote(op.getLocation(), Instrument.PIANO, Note.natural(1, Tone.E));
ChatMenu myMenu = new SimpleChatMenu(new FancyMessage("Your invitation has been sent."));
myMenu.show(leader.getPlayer().getPlayer());
}
开发者ID:Dove-Bren,项目名称:QuestManager,代码行数:42,代码来源:PartyInviteAction.java
示例15: Note
import org.bukkit.Note.Tone; //导入依赖的package包/类
public Note(int octave, Note.Tone tone, boolean sharped) {
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:3,代码来源:Note.java
示例16: flat
import org.bukkit.Note.Tone; //导入依赖的package包/类
public static Note flat(int octave, Note.Tone tone) {
return null;
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:Note.java
示例17: sharp
import org.bukkit.Note.Tone; //导入依赖的package包/类
public static Note sharp(int octave, Note.Tone tone) {
return null;
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:Note.java
示例18: natural
import org.bukkit.Note.Tone; //导入依赖的package包/类
public static Note natural(int octave, Note.Tone tone) {
return null;
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:Note.java
示例19: getTone
import org.bukkit.Note.Tone; //导入依赖的package包/类
public Note.Tone getTone() {
return null;
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:Note.java
示例20: getById
import org.bukkit.Note.Tone; //导入依赖的package包/类
@Deprecated public static Tone getById(byte id) {
return null;
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:Note.java
注:本文中的org.bukkit.Note.Tone类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论