• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SoundCategory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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);
    });
}
 
开发者ID:Project-Coalesce,项目名称:UHC,代码行数:36,代码来源:GameStart.java


示例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);
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:13,代码来源:PokkitPlayer.java


示例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);
        }
    });
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:10,代码来源:AsyncWorld.java


示例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);
}
 
开发者ID:Co0sh,项目名称:BetonQuest,代码行数:14,代码来源:PlaysoundEvent.java


示例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();
}
 
开发者ID:seeseemelk,项目名称:MockBukkit,代码行数:7,代码来源:WorldMock.java


示例6: stopSound

import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void stopSound(Sound sound, SoundCategory category)
{
	// TODO Auto-generated method stub
	throw new UnimplementedOperationException();
}
 
开发者ID:seeseemelk,项目名称:MockBukkit,代码行数:7,代码来源:PlayerMock.java


示例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;
}
 
开发者ID:EntryPointKR,项目名称:MCLibrary,代码行数:7,代码来源:SoundHolder.java


示例8: getCategory

import org.bukkit.SoundCategory; //导入依赖的package包/类
public SoundCategory getCategory() {
    return category;
}
 
开发者ID:EntryPointKR,项目名称:MCLibrary,代码行数:4,代码来源:SoundHolder.java


示例9: setCategory

import org.bukkit.SoundCategory; //导入依赖的package包/类
public void setCategory(SoundCategory category) {
    this.category = category;
}
 
开发者ID:EntryPointKR,项目名称:MCLibrary,代码行数:4,代码来源:SoundHolder.java


示例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

}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:6,代码来源:PokkitWorld.java


示例11: stopSound

import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void stopSound(Sound sound, SoundCategory category) {
	// Silently unsupported!
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:5,代码来源:PokkitPlayer.java


示例12: playSound

import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(Location arg0, Sound arg1, SoundCategory arg2, float arg3, float arg4) {
    throw new UnsupportedOperationException();
    
}
 
开发者ID:rutgerkok,项目名称:BlockLocker,代码行数:6,代码来源:TestPlayer.java


示例13: stopSound

import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void stopSound(Sound arg0, SoundCategory arg1) {
    throw new UnsupportedOperationException();

}
 
开发者ID:rutgerkok,项目名称:BlockLocker,代码行数:6,代码来源:TestPlayer.java


示例14: playSound

import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(Location arg0, Sound arg1, SoundCategory arg2, float arg3, float arg4) {
	
}
 
开发者ID:DevotedMC,项目名称:HiddenOre,代码行数:5,代码来源:FakePlayer.java


示例15: stopSound

import org.bukkit.SoundCategory; //导入依赖的package包/类
@Override
public void stopSound(Sound arg0, SoundCategory arg1) {
	
}
 
开发者ID:DevotedMC,项目名称:HiddenOre,代码行数:5,代码来源:FakePlayer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WorldGenBigMushroom类代码示例发布时间:2022-05-22
下一篇:
Java StubAdapter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap