本文整理了Java中net.minecraft.world.World.playBroadcastSound()
方法的一些代码示例,展示了World.playBroadcastSound()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.playBroadcastSound()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:playBroadcastSound
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void playBroadcastSound(int id, @Nonnull BlockPos pos, int data) {
wrapped.playBroadcastSound(id, pos, data);
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public void playBroadcastSound(int id, BlockPos pos, int data) {
getActualWorld().playBroadcastSound(id, pos, data);
}
代码示例来源:origin: CyclopsMC/IntegratedDynamics
public static void playBreakSound(World world, BlockPos pos, IBlockState blockState) {
world.playBroadcastSound(2001, pos, Block.getStateId(blockState));
}
代码示例来源:origin: CyclopsMC/EvilCraft
@Override
protected void onImpact(RayTraceResult movingobjectposition) {
if (movingobjectposition.typeOfHit == RayTraceResult.Type.BLOCK) {
ItemStack stack = getItemStack();
WeatherContainer.WeatherContainerTypes containerType = WeatherContainer.getWeatherContainerType(stack);
containerType.onUse(world, stack);
playImpactSounds(world);
// Play sound and show particles of splash potion of harming
// TODO: make custom particles for this
this.world.playBroadcastSound(2002, getPosition(), 16428);
setDead();
}
}
代码示例来源:origin: CyclopsMC/EvilCraft
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos blockPos, EnumHand hand, EnumFacing side, float coordX, float coordY, float coordZ) {
ItemStack itemStack = player.getHeldItem(hand);
boolean done = false;
int attempts = 0;
while (attempts < 2) {
done = ItemDye.applyBonemeal(itemStack.copy(), world, blockPos, player, hand) | done;
attempts++;
}
if (done) {
itemStack.shrink(1);
if (!world.isRemote) {
world.playBroadcastSound(2005, blockPos, 0);
}
return EnumActionResult.SUCCESS;
}
return super.onItemUse(player, world, blockPos, hand, side, coordX, coordY, coordZ);
}
代码示例来源:origin: CyclopsMC/EvilCraft
@Override
public void onUpdateReceived() {
// If we receive an update from the server and our new state is the
// finished processing item state, show the corresponding effect
if (world.isRemote && state == EnvironmentalAccumulator.STATE_FINISHED_PROCESSING_ITEM) {
// Show an effect indicating the item finished processing.
IEAProcessingFinishedEffect effect = (recipe == null) ? null : recipe.getProperties().getFinishedProcessingEffect();
if (effect == null) // fall back to default case
this.world.playBroadcastSound(2002, getPos().add(0, WEATHER_CONTAINER_SPAWN_HEIGHT, 0), 16428);
else
effect.executeEffect(this, recipe);
}
// Change the beam colors if we receive an update
setBeamColor(state);
}
代码示例来源:origin: Esteemed-Innovation/Esteemed-Innovation
world.playBroadcastSound(1029, pos, 0);
} else {
world.setBlockState(pos, state.withProperty(BlockAnvil.DAMAGE, l), 2);
world.playBroadcastSound(1030, pos, 0);
world.playBroadcastSound(1030, pos, 0);
代码示例来源:origin: CyclopsMC/EvilCraft
this.world.playBroadcastSound(2002, getPosition(), 16428);
代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition
entity.enablePersistence();
addSpawnedAndroid(entity);
world.playBroadcastSound(2004, getPos(), 0);
ScorePlayerTeam team = getTeam();
if (team != null) {
代码示例来源:origin: CyclopsMC/EvilCraft
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos blockPos, EnumHand hand, EnumFacing side, float coordX, float coordY, float coordZ) {
ItemStack itemStack = player.getHeldItem(hand);
Block block = world.getBlockState(blockPos).getBlock();
if(player.isSneaking()) {
boolean done = false;
int attempts = 0;
while(attempts < ExcrementPileConfig.effectiveness) {
done = ItemDye.applyBonemeal(itemStack.copy(), world, blockPos, player, hand) | done;
attempts++;
}
if(done) {
itemStack.shrink(1);
if (!world.isRemote) {
world.playBroadcastSound(2005, blockPos, 0);
}
return EnumActionResult.SUCCESS;
}
} else {
if (block == ExcrementPile.getInstance() && !itemStack.isEmpty()) {
if(ExcrementPile.getInstance().canHeightenPileAt(world, blockPos)) {
ExcrementPile.getInstance().heightenPileAt(world, blockPos);
itemStack.shrink(1);
return EnumActionResult.SUCCESS;
}
return EnumActionResult.PASS;
}
}
return super.onItemUse(player, world, blockPos, hand, side, coordX, coordY, coordZ);
}
代码示例来源:origin: CyclopsMC/EvilCraft
world.playBroadcastSound(2001, pos, Block.getStateId(blockState));
if(block.removedByPlayer(blockState, world, pos, player, true)) {
block.onBlockDestroyedByPlayer(world, pos, blockState);
代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition
world.playBroadcastSound(2001, pos, Block.getIdFromBlock(blockState.getBlock()));
world.setBlockToAir(pos);
return true;
world.playBroadcastSound(2001, pos, Block.getIdFromBlock(blockState.getBlock()));
内容来源于网络,如有侵权,请联系作者删除!