本文整理汇总了Java中cn.nukkit.level.sound.NoteBoxSound类的典型用法代码示例。如果您正苦于以下问题:Java NoteBoxSound类的具体用法?Java NoteBoxSound怎么用?Java NoteBoxSound使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NoteBoxSound类属于cn.nukkit.level.sound包,在下文中一共展示了NoteBoxSound类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getInstrument
import cn.nukkit.level.sound.NoteBoxSound; //导入依赖的package包/类
public int getInstrument() {
Block below = this.down();
switch (below.getId()) {
case WOODEN_PLANK:
case NOTEBLOCK:
case CRAFTING_TABLE:
return NoteBoxSound.INSTRUMENT_BASS;
case SAND:
case SANDSTONE:
case SOUL_SAND:
return NoteBoxSound.INSTRUMENT_TABOUR;
case GLASS:
case GLASS_PANEL:
case GLOWSTONE_BLOCK:
return NoteBoxSound.INSTRUMENT_CLICK;
case COAL_ORE:
case DIAMOND_ORE:
case EMERALD_ORE:
case GLOWING_REDSTONE_ORE:
case GOLD_ORE:
case IRON_ORE:
case LAPIS_ORE:
case REDSTONE_ORE:
return NoteBoxSound.INSTRUMENT_BASS_DRUM;
default:
return NoteBoxSound.INSTRUMENT_PIANO;
}
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:29,代码来源:BlockNoteblock.java
示例2: emitSound
import cn.nukkit.level.sound.NoteBoxSound; //导入依赖的package包/类
public void emitSound() {
BlockEventPacket pk = new BlockEventPacket();
pk.x = (int) this.x;
pk.y = (int) this.y;
pk.z = (int) this.z;
pk.case1 = this.getInstrument();
pk.case2 = this.getStrength();
this.getLevel().addChunkPacket((int) this.x >> 4, (int) this.z >> 4, pk);
this.getLevel().addSound(new NoteBoxSound(this, this.getInstrument(), this.getStrength()));
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:12,代码来源:BlockNoteblock.java
示例3: sendTo
import cn.nukkit.level.sound.NoteBoxSound; //导入依赖的package包/类
@Override
public void sendTo(Player player, Vector3 vec){
Block block = player.level.getBlock(vec);
if(block.getId() == Block.NOTEBLOCK){
player.level.addSound(new NoteBoxSound(block, this.instrument, this.pitch), player);
}else{
player.level.sendBlocks(new Player[]{player}, new Vector3[]{Block.get(Block.NOTEBLOCK, 0, block)});
player.level.addSound(new NoteBoxSound(block, this.instrument, this.pitch), player);
player.level.sendBlocks(new Player[]{player}, new Vector3[]{block});
}
}
开发者ID:if-Team,项目名称:Nukkit-Plugins,代码行数:12,代码来源:NoteSound.java
示例4: getInstrument
import cn.nukkit.level.sound.NoteBoxSound; //导入依赖的package包/类
public int getInstrument() {
Block below = this.getSide(Vector3.SIDE_DOWN);
switch (below.getId()) {
case WOODEN_PLANK:
case NOTEBLOCK:
case CRAFTING_TABLE:
return NoteBoxSound.INSTRUMENT_BASS;
case SAND:
case SANDSTONE:
case SOUL_SAND:
return NoteBoxSound.INSTRUMENT_TABOUR;
case GLASS:
case GLASS_PANEL:
case GLOWSTONE_BLOCK:
return NoteBoxSound.INSTRUMENT_CLICK;
case COAL_ORE:
case DIAMOND_ORE:
case EMERALD_ORE:
case GLOWING_REDSTONE_ORE:
case GOLD_ORE:
case IRON_ORE:
case LAPIS_ORE:
case REDSTONE_ORE:
return NoteBoxSound.INSTRUMENT_BASS_DRUM;
default:
return NoteBoxSound.INSTRUMENT_PIANO;
}
}
开发者ID:Creeperface01,项目名称:NukkitGT,代码行数:29,代码来源:BlockNoteblock.java
示例5: onActivate
import cn.nukkit.level.sound.NoteBoxSound; //导入依赖的package包/类
public boolean onActivate(Item item, Player player) {
Block up = this.getSide(Vector3.SIDE_UP);
if (up.getId() == Block.AIR) {
this.getLevel().addSound(new NoteBoxSound(this, this.getInstrument(), this.getStrength()));
return true;
} else {
return false;
}
}
开发者ID:Creeperface01,项目名称:NukkitGT,代码行数:10,代码来源:BlockNoteblock.java
注:本文中的cn.nukkit.level.sound.NoteBoxSound类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论