Examples of PacketPlaySound


Examples of org.getspout.spoutapi.packet.PacketPlaySound

  public void playSoundEffect(SpoutPlayer target, SoundEffect effect, Location location, int distance, int volumePercent) {
    if (target.isSpoutCraftEnabled()) {
      SpoutCraftPlayer ccp = (SpoutCraftPlayer) target;
      if (location == null || ccp.getWorld().equals(location.getWorld())) {
        if (location == null) {
          ccp.sendPacket(new PacketPlaySound(effect, distance, volumePercent));
        } else {
          ccp.sendPacket(new PacketPlaySound(effect, location, distance, volumePercent));
        }
      }
    }
  }
View Full Code Here

Examples of org.getspout.spoutapi.packet.PacketPlaySound

      Bukkit.getServer().getPluginManager().callEvent(event);
      if (event.isCancelled()) {
        return;
      }

      ((SpoutCraftPlayer) target).sendPacket(new PacketPlaySound(music, event.getVolumePercent()));
    }
  }
View Full Code Here

Examples of pneumaticCraft.common.network.PacketPlaySound

    @SubscribeEvent
    public void quetziMoo(ServerChatEvent event){
        if(event.username.equals("Quetzz") && event.message.equals("m00")) {
            for(int i = 0; i < 4; i++)
                NetworkHandler.sendTo(new PacketPlaySound("mob.cow.say", event.player.posX, event.player.posY, event.player.posZ, 1, 1, true), event.player);
        }
    }
View Full Code Here

Examples of pneumaticCraft.common.network.PacketPlaySound

        if(!world.isRemote) {
            Block block = world.getBlock(x, y, z);
            if(block instanceof IPneumaticWrenchable && (((ItemPneumaticWrench)Itemss.pneumaticWrench).getPressure(stack) > 0 || !Config.rotateUseEnergy)) {
                if(((IPneumaticWrenchable)block).rotateBlock(world, player, x, y, z, ForgeDirection.getOrientation(side))) {
                    if(!player.capabilities.isCreativeMode && Config.rotateUseEnergy) ((ItemPneumaticWrench)Itemss.pneumaticWrench).addAir(stack, -PneumaticValues.USAGE_PNEUMATIC_WRENCH);
                    NetworkHandler.sendToAllAround(new PacketPlaySound(Sounds.PNEUMATIC_WRENCH, x, y, z, 1.0F, 1.0F, false), world);
                    return true;
                }
            } else if(block != null) {
                //rotating normal blocks doesn't cost energy.
                if(block.rotateBlock(world, x, y, z, ForgeDirection.getOrientation(side))) {
                    NetworkHandler.sendToAllAround(new PacketPlaySound(Sounds.PNEUMATIC_WRENCH, x, y, z, 1.0F, 1.0F, false), world);
                    return true;
                }
            }
            return false;
        } else {
View Full Code Here

Examples of pneumaticCraft.common.network.PacketPlaySound

    public boolean itemInteractionForEntity(ItemStack iStack, EntityPlayer player, EntityLivingBase entity){
        if(!player.worldObj.isRemote) {
            if(entity.isEntityAlive() && entity instanceof IPneumaticWrenchable && (((ItemPneumaticWrench)Itemss.pneumaticWrench).getPressure(iStack) > 0 || !Config.rotateUseEnergy)) {
                if(((IPneumaticWrenchable)entity).rotateBlock(entity.worldObj, player, 0, 0, 0, ForgeDirection.UNKNOWN)) {
                    if(!player.capabilities.isCreativeMode && Config.rotateUseEnergy) ((ItemPneumaticWrench)Itemss.pneumaticWrench).addAir(iStack, -PneumaticValues.USAGE_PNEUMATIC_WRENCH);
                    NetworkHandler.sendToAllAround(new PacketPlaySound(Sounds.PNEUMATIC_WRENCH, entity.posX, entity.posY, entity.posZ, 1.0F, 1.0F, false), entity.worldObj);
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of pneumaticCraft.common.network.PacketPlaySound

                world.spawnEntityInWorld(item);
                world.setBlock(x, y, z, this, world.getBlockMetadata(x, y, z) - 2, 3);
            }
        } else {
            world.setBlockMetadataWithNotify(x, y, z, 14, 3);
            NetworkHandler.sendToAllAround(new PacketPlaySound("creeper.primed", x + 0.5D, y + 0.5D, z + 0.5D, 1.0F, 1.0F, true), world);
            world.scheduleBlockUpdate(x, y, z, this, 60);
        }
    }
View Full Code Here

Examples of pneumaticCraft.common.network.PacketPlaySound

    @Override
    public void onUpdateNavigation(){
        if(isGoingToTeleport()) {
            if(teleportCounter == 0 || teleportCounter == 60) {
                NetworkHandler.sendToAllAround(new PacketPlaySound(Sounds.HUD_INIT, pathfindingEntity.posX, pathfindingEntity.posY, pathfindingEntity.posZ, 0.1F, teleportCounter == 0 ? 0.7F : 1F, true), pathfindingEntity.worldObj);
            }

            if(teleportCounter < TELEPORT_TICKS - 40) {
                Random rand = pathfindingEntity.getRNG();
                float f = (rand.nextFloat() - 0.5F) * 0.02F * teleportCounter;
 
View Full Code Here

Examples of pneumaticCraft.common.network.PacketPlaySound

        double motionX = side.offsetX;
        double motionY = side.offsetY;
        double motionZ = side.offsetZ;
        if(soundCounter <= 0) {
            soundCounter = 20;
            NetworkHandler.sendToAllAround(new PacketPlaySound(Sounds.LEAKING_GAS_SOUND, xCoord, yCoord, zCoord, 0.1F, 1.0F, true), worldObj);
        }

        if(getPressure(side) < 0) {
            double speed = getPressure(side) * 0.1F - 0.1F;
            NetworkHandler.sendToAllAround(new PacketSpawnParticle("smoke", xCoord + 0.5D + motionX / 2D, yCoord + 0.5D + motionY / 2D, zCoord + 0.5D + motionZ / 2D, motionX * speed, motionY * speed, motionZ * speed), worldObj);
View Full Code Here

Examples of pneumaticCraft.common.network.PacketPlaySound

                double velX = velocity[0] * 0.4D + (rand.nextGaussian() - 0.5D) * 0.05D;
                double velY = velocity[1] * 0.4D + (rand.nextGaussian() - 0.5D) * 0.05D;
                double velZ = velocity[2] * 0.4D + (rand.nextGaussian() - 0.5D) * 0.05D;
                NetworkHandler.sendToAllAround(new PacketSpawnParticle("largesmoke", xCoord + 0.5D, yCoord + 0.7D, zCoord + 0.5D, velX, velY, velZ), worldObj);
            }
            NetworkHandler.sendToAllAround(new PacketPlaySound(Sounds.CANNON_SOUND, xCoord, yCoord, zCoord, 1.0F, rand.nextFloat() / 4F + 0.75F, true), worldObj);
            return true;
        } else {
            return false;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.