net.minecraft.world.World.playBroadcastSound()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中net.minecraft.world.World.playBroadcastSound()方法的一些代码示例,展示了World.playBroadcastSound()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.playBroadcastSound()方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:playBroadcastSound

World.playBroadcastSound介绍

暂无

代码示例

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. public void playBroadcastSound(int id, @Nonnull BlockPos pos, int data) {
  3. wrapped.playBroadcastSound(id, pos, data);
  4. }

代码示例来源:origin: amadornes/MCMultiPart

  1. @Override
  2. public void playBroadcastSound(int id, BlockPos pos, int data) {
  3. getActualWorld().playBroadcastSound(id, pos, data);
  4. }

代码示例来源:origin: CyclopsMC/IntegratedDynamics

  1. public static void playBreakSound(World world, BlockPos pos, IBlockState blockState) {
  2. world.playBroadcastSound(2001, pos, Block.getStateId(blockState));
  3. }

代码示例来源:origin: CyclopsMC/EvilCraft

  1. @Override
  2. protected void onImpact(RayTraceResult movingobjectposition) {
  3. if (movingobjectposition.typeOfHit == RayTraceResult.Type.BLOCK) {
  4. ItemStack stack = getItemStack();
  5. WeatherContainer.WeatherContainerTypes containerType = WeatherContainer.getWeatherContainerType(stack);
  6. containerType.onUse(world, stack);
  7. playImpactSounds(world);
  8. // Play sound and show particles of splash potion of harming
  9. // TODO: make custom particles for this
  10. this.world.playBroadcastSound(2002, getPosition(), 16428);
  11. setDead();
  12. }
  13. }

代码示例来源:origin: CyclopsMC/EvilCraft

  1. @Override
  2. public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos blockPos, EnumHand hand, EnumFacing side, float coordX, float coordY, float coordZ) {
  3. ItemStack itemStack = player.getHeldItem(hand);
  4. boolean done = false;
  5. int attempts = 0;
  6. while (attempts < 2) {
  7. done = ItemDye.applyBonemeal(itemStack.copy(), world, blockPos, player, hand) | done;
  8. attempts++;
  9. }
  10. if (done) {
  11. itemStack.shrink(1);
  12. if (!world.isRemote) {
  13. world.playBroadcastSound(2005, blockPos, 0);
  14. }
  15. return EnumActionResult.SUCCESS;
  16. }
  17. return super.onItemUse(player, world, blockPos, hand, side, coordX, coordY, coordZ);
  18. }

代码示例来源:origin: CyclopsMC/EvilCraft

  1. @Override
  2. public void onUpdateReceived() {
  3. // If we receive an update from the server and our new state is the
  4. // finished processing item state, show the corresponding effect
  5. if (world.isRemote && state == EnvironmentalAccumulator.STATE_FINISHED_PROCESSING_ITEM) {
  6. // Show an effect indicating the item finished processing.
  7. IEAProcessingFinishedEffect effect = (recipe == null) ? null : recipe.getProperties().getFinishedProcessingEffect();
  8. if (effect == null) // fall back to default case
  9. this.world.playBroadcastSound(2002, getPos().add(0, WEATHER_CONTAINER_SPAWN_HEIGHT, 0), 16428);
  10. else
  11. effect.executeEffect(this, recipe);
  12. }
  13. // Change the beam colors if we receive an update
  14. setBeamColor(state);
  15. }

代码示例来源:origin: Esteemed-Innovation/Esteemed-Innovation

  1. world.playBroadcastSound(1029, pos, 0);
  2. } else {
  3. world.setBlockState(pos, state.withProperty(BlockAnvil.DAMAGE, l), 2);
  4. world.playBroadcastSound(1030, pos, 0);
  5. world.playBroadcastSound(1030, pos, 0);

代码示例来源:origin: CyclopsMC/EvilCraft

  1. this.world.playBroadcastSound(2002, getPosition(), 16428);

代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition

  1. entity.enablePersistence();
  2. addSpawnedAndroid(entity);
  3. world.playBroadcastSound(2004, getPos(), 0);
  4. ScorePlayerTeam team = getTeam();
  5. if (team != null) {

代码示例来源:origin: CyclopsMC/EvilCraft

  1. @Override
  2. public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos blockPos, EnumHand hand, EnumFacing side, float coordX, float coordY, float coordZ) {
  3. ItemStack itemStack = player.getHeldItem(hand);
  4. Block block = world.getBlockState(blockPos).getBlock();
  5. if(player.isSneaking()) {
  6. boolean done = false;
  7. int attempts = 0;
  8. while(attempts < ExcrementPileConfig.effectiveness) {
  9. done = ItemDye.applyBonemeal(itemStack.copy(), world, blockPos, player, hand) | done;
  10. attempts++;
  11. }
  12. if(done) {
  13. itemStack.shrink(1);
  14. if (!world.isRemote) {
  15. world.playBroadcastSound(2005, blockPos, 0);
  16. }
  17. return EnumActionResult.SUCCESS;
  18. }
  19. } else {
  20. if (block == ExcrementPile.getInstance() && !itemStack.isEmpty()) {
  21. if(ExcrementPile.getInstance().canHeightenPileAt(world, blockPos)) {
  22. ExcrementPile.getInstance().heightenPileAt(world, blockPos);
  23. itemStack.shrink(1);
  24. return EnumActionResult.SUCCESS;
  25. }
  26. return EnumActionResult.PASS;
  27. }
  28. }
  29. return super.onItemUse(player, world, blockPos, hand, side, coordX, coordY, coordZ);
  30. }

代码示例来源:origin: CyclopsMC/EvilCraft

  1. world.playBroadcastSound(2001, pos, Block.getStateId(blockState));
  2. if(block.removedByPlayer(blockState, world, pos, player, true)) {
  3. block.onBlockDestroyedByPlayer(world, pos, blockState);

代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition

  1. world.playBroadcastSound(2001, pos, Block.getIdFromBlock(blockState.getBlock()));
  2. world.setBlockToAir(pos);
  3. return true;
  4. world.playBroadcastSound(2001, pos, Block.getIdFromBlock(blockState.getBlock()));

相关文章

World类方法