本文整理汇总了Java中org.bukkit.SoundCategory类的典型用法代码示例。如果您正苦于以下问题:Java SoundCategory类的具体用法?Java SoundCategory怎么用?Java SoundCategory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SoundCategory类属于org.bukkit包,在下文中一共展示了SoundCategory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: gameStart
import org.bukkit.SoundCategory; //导入依赖的package包/类
public void gameStart(CommandContext context) {
if (UserManager.getInstance().getUser(context.asPlayer().getUniqueId())
.orElseThrow(() -> new RuntimeException("An offline player executed a command.")).getParticipation() != Participation.ADMIN) {
context.send(colour("&cInsufficient permissions."));
return;
}
if (!(context.getSender() instanceof Player)) {
context.send(colour("&cThis command is only accessible for players."));
return;
}
if (GameState.current() != GameState.LOBBY) {
context.send(colour("&cAlready started."));
return;
}
GameState.setGameWorld(((Player) context.getSender()).getWorld());
GameState.STARTING.setCurrent();
MainConfiguration configuration = UHC.getInstance().getMainConfig();
int time = configuration.getWorldBorderShrinkTime();
int size = configuration.getWorldBorderFinalShrinkSize();
List<String> toSend = Arrays.asList(
"&e---[ And the game begins! ]---",
"&bThere'll be a 10 minute grace period.",
"&bAttacking other players during that period is illegal.",
"&bThe world border will shrink for " + time + "min, until it is " + size + "x" + size + ".",
"&bCheck the rules by doing &a/rules&b.");
Bukkit.getServer().getOnlinePlayers().forEach(player -> {
toSend.forEach(curs -> player.sendMessage(UHC.getInstance().getFormatter().centerString(colour(curs))));
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BASEDRUM, SoundCategory.MASTER, 1f, 1f);
});
}
示例2: playSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch) {
if (location == null || sound == null) {
return;
}
cn.nukkit.level.sound.Sound nukkitSound = PokkitSound.toNukkit(location, sound, pitch);
if (nukkitSound == null) {
return;
}
nukkit.level.addSound(nukkitSound, nukkit);
}
示例3: playSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch) {
TaskManager.IMP.sync(new RunnableVal<Object>() {
@Override
public void run(Object value) {
parent.playSound(location, sound, category, volume, pitch);
}
});
}
示例4: PlaysoundEvent
import org.bukkit.SoundCategory; //导入依赖的package包/类
public PlaysoundEvent(Instruction instruction) throws InstructionParseException {
super(instruction);
sound = instruction.next();
location = instruction.getLocation(instruction.getOptional("location"));
String category = instruction.getOptional("category");
if (category != null) {
soundCategoty = instruction.getEnum(category, SoundCategory.class);
} else {
soundCategoty = SoundCategory.MASTER;
}
volume = (float) instruction.getDouble(instruction.getOptional("volume"), 1D);
pitch = (float) instruction.getDouble(instruction.getOptional("pitch"), 1D);
}
示例5: playSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch)
{
// TODO Auto-generated method stub
throw new UnimplementedOperationException();
}
示例6: stopSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void stopSound(Sound sound, SoundCategory category)
{
// TODO Auto-generated method stub
throw new UnimplementedOperationException();
}
示例7: SoundHolder
import org.bukkit.SoundCategory; //导入依赖的package包/类
public SoundHolder(Sound sound, SoundCategory category, float volume, float pitch) {
this.sound = sound;
this.category = category;
this.volume = volume;
this.pitch = pitch;
}
示例8: getCategory
import org.bukkit.SoundCategory; //导入依赖的package包/类
public SoundCategory getCategory() {
return category;
}
示例9: setCategory
import org.bukkit.SoundCategory; //导入依赖的package包/类
public void setCategory(SoundCategory category) {
this.category = category;
}
示例10: playSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch) {
// TODO Auto-generated method stub
}
示例11: stopSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void stopSound(Sound sound, SoundCategory category) {
// Silently unsupported!
}
示例12: playSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(Location arg0, Sound arg1, SoundCategory arg2, float arg3, float arg4) {
throw new UnsupportedOperationException();
}
示例13: stopSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void stopSound(Sound arg0, SoundCategory arg1) {
throw new UnsupportedOperationException();
}
示例14: playSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(Location arg0, Sound arg1, SoundCategory arg2, float arg3, float arg4) {
}
示例15: stopSound
import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void stopSound(Sound arg0, SoundCategory arg1) {
}