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

Java SoundCategory类代码示例

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

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



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

示例1: onChat

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Listener
public void onChat(MessageChannelEvent.Chat event) {
    String message = event.getRawMessage().toPlain();
    for (Player p : Sponge.getServer().getOnlinePlayers()) {
        if (message.contains(p.getName())) {
            ModuleConfig config = Modules.POKE.get().getConfig().get();
            CommentedConfigurationNode node = config.get();
            String soundname = node.getNode("sound", "sound").getString();
            String categoryname = node.getNode("sound", "category").getString();
            Double volume = node.getNode("sound", "volume").getDouble();
            Double pitch = node.getNode("sound", "pitch").getDouble();
            Double minVolume = node.getNode("sound", "minVolume").getDouble();
            SoundType type = Sponge.getRegistry().getType(CatalogTypes.SOUND_TYPE, soundname.toUpperCase()).get();
            //TODO wait for CatalogTypes.SOUND_CATEGORY to be added
            SoundCategory category;
            try {
                category = Sponge.getRegistry().getType(CatalogTypes.SOUND_CATEGORY, categoryname.toUpperCase()).get();
            } catch (Error ex) {
                category = SoundCategories.PLAYER;
            }
            p.playSound(type, category, p.getLocation().getPosition(), volume, pitch, minVolume);
        }
    }
}
 
开发者ID:Bammerbom,项目名称:UltimateCore,代码行数:25,代码来源:PokeListener.java


示例2: playSound

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(SoundType sound, SoundCategory category, Vector3d position, double volume, double pitch, double minVolume) {
    checkNotNull(sound, "sound");
    checkNotNull(position, "position");
    checkNotNull(category, "category");
    this.broadcast(() -> ((LanternSoundType) sound).createMessage(position,
            category, (float) Math.max(minVolume, volume), (float) pitch));
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:LanternWorld.java


示例3: playSound

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(SoundType sound, SoundCategory category, Vector3d position, double volume, double pitch, double minVolume) {
    checkNotNull(sound, "sound");
    checkNotNull(position, "position");
    checkNotNull(category, "category");
    this.session.send(((LanternSoundType) sound).createMessage(position,
            category, (float) Math.max(minVolume, volume), (float) pitch));
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:LanternPlayer.java


示例4: createMessage

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
public MessagePlayOutSoundEffectBase createMessage(Vector3d position, SoundCategory soundCategory,
        float volume, float pitch) {
    checkNotNull(soundCategory, "soundCategory");
    checkNotNull(position, "position");
    if (this.eventId != -1) {
        return new MessagePlayOutSoundEffect(this.eventId, position, soundCategory, volume, pitch);
    } else {
        return new MessagePlayOutNamedSoundEffect(getName(), position, soundCategory, volume, pitch);
    }
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:11,代码来源:LanternSoundType.java


示例5: getCategory

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override
public SoundCategory getCategory() {
    return (SoundCategory)(Object)category;
}
 
开发者ID:Guichaguri,项目名称:PacketControl,代码行数:5,代码来源:MixinPacketCustomSound.java


示例6: setCategory

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override
public void setCategory(SoundCategory cat) {
    category = (net.minecraft.util.SoundCategory)(Object)cat;
}
 
开发者ID:Guichaguri,项目名称:PacketControl,代码行数:5,代码来源:MixinPacketCustomSound.java


示例7: playSound

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(Location location, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch) {
    if (!Sponge.isServerAvailable()) return;
    Optional<Player> optionalP = Sponge.getServer().getPlayer(this.getUniqueId());
    optionalP.ifPresent(p -> p.playSound(SoundType.builder().build(sound.name()), new Vector3d(location.getX(), location.getY(), location.getZ()), volume, pitch));
}
 
开发者ID:Proximyst,项目名称:Bukkit2Sponge,代码行数:7,代码来源:LinkedPlayer.java


示例8: stopSound

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override
public void stopSound(Sound sound, org.bukkit.SoundCategory category) {
    if (!Sponge.isServerAvailable()) return;
    Optional<Player> optionalP = Sponge.getServer().getPlayer(this.getUniqueId());
    optionalP.ifPresent(p -> performCommand("stopsound "+this.getName()+" "+sound.name())); //TODO: Is there a better way to do this? On github there was an issue that was never answered
}
 
开发者ID:Proximyst,项目名称:Bukkit2Sponge,代码行数:7,代码来源:LinkedPlayer.java


示例9: playSound

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override
public void playSound(SoundType sound, SoundCategory category, Vector3d position, double volume) {
	this.player.playSound(sound, position, volume);
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:5,代码来源:PlayerSponge.java


示例10: stopSounds

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override
public void stopSounds(SoundCategory category) {
    stopSounds0(null, checkNotNull(category, "category"));
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:LanternWorld.java


示例11: stopSounds0

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
private void stopSounds0(@Nullable SoundType sound, @Nullable SoundCategory category) {
    broadcast(() -> new MessagePlayOutStopSounds(sound == null ? null : sound.getName(), category));
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:LanternWorld.java


示例12: stopSounds0

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
private void stopSounds0(@Nullable SoundType sound, @Nullable SoundCategory category) {
    this.session.send(new MessagePlayOutStopSounds(sound == null ? null : sound.getName(), category));
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:LanternPlayer.java


示例13: MessagePlayOutSoundEffect

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
public MessagePlayOutSoundEffect(int type, Vector3d position, SoundCategory category, float volume, float pitch) {
    super(type, position, category, volume, pitch);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:MessagePlayOutSoundEffect.java


示例14: MessagePlayOutStopSounds

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
public MessagePlayOutStopSounds(@Nullable String sound, @Nullable SoundCategory category) {
    this.soundCategory = category;
    this.sound = sound;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:MessagePlayOutStopSounds.java


示例15: getCategory

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Nullable
public SoundCategory getCategory() {
    return this.soundCategory;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:MessagePlayOutStopSounds.java


示例16: getCategory

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
public SoundCategory getCategory() {
    return this.category;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:MessagePlayOutSoundEffectBase.java


示例17: MessagePlayOutNamedSoundEffect

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
public MessagePlayOutNamedSoundEffect(String type, Vector3d position, SoundCategory category, float volume, float pitch) {
    super(type, position, category, volume, pitch);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:MessagePlayOutNamedSoundEffect.java


示例18: playSound

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override
default void playSound(SoundType sound, SoundCategory category, Vector3d position, double volume) {
    playSound(sound, category, position, volume, 1.0);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:AbstractViewer.java


示例19: MessagePlayOutSoundEffectBase

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
/**
 * Creates a new sound effect message.
 *
 * @param type The effect type
 * @param position The position
 * @param category the sound category
 * @param volume The volume
 * @param pitch The pitch value
 */
public MessagePlayOutSoundEffectBase(T type, Vector3d position, SoundCategory category, float volume, float pitch) {
    this.position = checkNotNull(position, "position");
    this.category = checkNotNull(category, "category");
    this.type = checkNotNull(type, "type");
    this.volume = volume;
    this.pitch = pitch;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:17,代码来源:MessagePlayOutSoundEffectBase.java


示例20: playSound

import org.spongepowered.api.effect.sound.SoundCategory; //导入依赖的package包/类
@Override public void playSound(SoundType sound, SoundCategory category, Vector3d position, double volume) {

    }
 
开发者ID:InspireNXE,项目名称:Pulse,代码行数:4,代码来源:ServerWorld.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java R类代码示例发布时间:2022-05-22
下一篇:
Java MavenRunConfiguration类代码示例发布时间: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