Merge pull request #45 from Alex-The-Coder/master

HUGE SOUND OVERHAUL
This commit is contained in:
MistPhizzle 2014-09-28 10:18:04 -04:00
commit 319f67cf96
24 changed files with 108 additions and 10 deletions

View file

@ -52,6 +52,7 @@ public class AvatarState {
}
}
new Flight(player);
Methods.playAvatarSound(player.getLocation());
instances.put(player, this);
if (cooldown != 0) {
cooldowns.put(player.getName(), System.currentTimeMillis());

View file

@ -1490,8 +1490,7 @@ public class Methods {
}
moveEarthBlock(block, affectedblock);
block.getWorld().playEffect(block.getLocation(),
Effect.GHAST_SHOOT, 0, 4);
playEarthbendingSound(block.getLocation());
for (double i = 1; i < chainlength; i++) {
affectedblock = location
@ -1979,10 +1978,34 @@ public class Methods {
loc.getWorld().playSound(loc, Sound.FIRE, 1, 10);
}
public static void playCombustionSound(Location loc) {
loc.getWorld().playSound(loc, Sound.FIREWORK_BLAST, 1, -1);
}
public static void playEarthbendingSound(Location loc) {
loc.getWorld().playEffect(loc, Effect.GHAST_SHOOT, 0, 10);
}
public static void playMetalbendingSound(Location loc) {
loc.getWorld().playSound(loc, Sound.IRONGOLEM_HIT, 1, 10);
}
public static void playWaterbendingSound(Location loc) {
loc.getWorld().playSound(loc, Sound.WATER, 1, 10);
}
public static void playIcebendingSound(Location loc) {
loc.getWorld().playSound(loc, Sound.FIRE_IGNITE, 10, 4);
}
public static void playAirbendingSound(Location loc) {
loc.getWorld().playSound(loc, Sound.CREEPER_HISS, 1, 5);
}
public static void playAvatarSound(Location loc) {
loc.getWorld().playSound(loc, Sound.ANVIL_LAND, 1, 10);
}
public static Block getTopBlock(Location loc, int range){
return getTopBlock(loc,range,range);
}

View file

@ -205,6 +205,9 @@ public class AirBlast {
private void advanceLocation() {
Methods.playAirbendingParticles(location, 10);
if (Methods.rand.nextInt(4) == 0) {
Methods.playAirbendingSound(location);
}
location = location.add(direction.clone().multiply(speedfactor));
}

View file

@ -116,6 +116,9 @@ public class AirScooter {
player.setSprinting(false);
player.removePotionEffect(PotionEffectType.SPEED);
player.setVelocity(velocity);
if (Methods.rand.nextInt(4) == 0) {
Methods.playAirbendingSound(player.getLocation());
}
}
private void spinScooter() {

View file

@ -116,8 +116,13 @@ public class AirShield {
Location effect = new Location(origin.getWorld(), x, y, z);
if (!Methods.isRegionProtectedFromBuild(player, "AirShield",
effect))
effect)) {
Methods.playAirbendingParticles(effect, 10);
if (Methods.rand.nextInt(4) == 0) {
Methods.playFirebendingSound(effect);
}
}
// origin.getWorld().playEffect(effect, Effect.SMOKE, 4,
// (int) AirBlast.defaultrange);

View file

@ -59,6 +59,9 @@ public class AirSpout {
}
player.setFallDistance(0);
player.setSprinting(false);
if (Methods.rand.nextInt(4) == 0) {
Methods.playAirbendingSound(player.getLocation());
}
Block block = getGround();
if (block != null) {
double dy = player.getLocation().getY() - block.getY();

View file

@ -143,6 +143,9 @@ public class Suffocate {
for(Location airsphere : Methods.getCircle(entity.getLocation(), 3, 3, false, true, 0)) {
Methods.playAirbendingParticles(airsphere, 1);
if (Methods.rand.nextInt(4) == 0) {
Methods.playAirbendingSound(airsphere);
}
}
entity.setFallDistance(0);
new TempPotionEffect((LivingEntity) entity, slow);

View file

@ -182,8 +182,12 @@ public class Tornado {
z = origin.getZ() + timefactor * factor * radius * Math.sin(angle);
Location effect = new Location(origin.getWorld(), x, y, z);
if (!Methods.isRegionProtectedFromBuild(player, "AirBlast", effect))
if (!Methods.isRegionProtectedFromBuild(player, "AirBlast", effect)) {
Methods.playAirbendingParticles(effect, 20);
if (Methods.rand.nextInt(4) == 0) {
Methods.playAirbendingSound(effect);
}
}
// origin.getWorld().playEffect(effect, Effect.SMOKE, 4, (int) AirBlast.defaultrange);
angles.put(i, angles.get(i) + 25 * (int) speedfactor);

View file

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
@ -83,6 +84,7 @@ public class Catapult {
distance = source.distance;
time = source.time;
instances.put(player.getEntityId(), this);
Methods.playEarthbendingSound(player.getLocation());
fly();
}

View file

@ -174,9 +174,7 @@ public class EarthBlast {
destination = null;
} else {
progressing = true;
sourceblock.getWorld().playEffect(
sourceblock.getLocation(), Effect.GHAST_SHOOT, 0,
10);
Methods.playEarthbendingSound(sourceblock.getLocation());
// direction = getDirection().normalize();
if (sourcetype != Material.SAND
&& sourcetype != Material.GRAVEL) {

View file

@ -159,9 +159,9 @@ public class Combustion {
private void advanceLocation() {
ParticleEffect.FIREWORKS_SPARK.display(location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 5);
ParticleEffect.FLAME.display(location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 2);
if (Methods.rand.nextInt(4) == 0) {
Methods.playFirebendingSound(location);
}
//if (Methods.rand.nextInt(4) == 0) {
Methods.playCombustionSound(location);
//}
location = location.add(direction.clone().multiply(speedfactor));
}

View file

@ -149,6 +149,10 @@ public class WallOfFire {
for (Block block : blocks) {
block.getWorld().playEffect(block.getLocation(),
Effect.MOBSPAWNER_FLAMES, 0, 15);
if(Methods.rand.nextInt(4) <= 2) {
Methods.playFirebendingSound(block.getLocation());
}
}
}

View file

@ -53,6 +53,7 @@ public class FreezeMelt {
return;
byte data = block.getData();
block.setType(Material.ICE);
Methods.playIcebendingSound(block.getLocation());
frozenblocks.put(block, data);
}

View file

@ -299,6 +299,9 @@ public class IceBlast {
ParticleEffect.SNOWBALL_POOF.display(location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 100);
ParticleEffect.SNOW_SHOVEL.display(location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 100);
if (Methods.rand.nextInt(4) == 0) {
Methods.playFirebendingSound(location);
}
location = location.add(direction.clone());
} else if (prepared) {

View file

@ -218,6 +218,7 @@ public class IceSpike {
}
}
affectedblock.setType(Material.ICE);
Methods.playIcebendingSound(block.getLocation());
loadAffectedBlocks();
if (location.distance(origin) >= height) {

View file

@ -272,6 +272,10 @@ public class IceSpike2 {
returnWater();
}
}
if (Methods.rand.nextInt(4) == 0) {
Methods.playIcebendingSound(location);
}
if (!progressing) {
cancel();

View file

@ -173,6 +173,10 @@ public class OctopusForm {
remove();
return;
}
if (Methods.rand.nextInt(4) == 0) {
Methods.playWaterbendingSound(player.getLocation());
}
if (System.currentTimeMillis() > time + interval) {
time = System.currentTimeMillis();

View file

@ -47,6 +47,9 @@ public class SpikeField {
.getBlock().getX() && testblock.getZ() == p
.getEyeLocation().getBlock().getZ())) {
iceblocks.add(testblock);
for(Block iceblockforsound : iceblocks) {
Methods.playIcebendingSound(iceblockforsound.getLocation());
}
}
}
}

View file

@ -86,6 +86,7 @@ public class Torrent {
if (Methods.isTransparentToEarthbending(player, block) && block.getType() != Material.ICE) {
TempBlock tblock = new TempBlock(block, Material.ICE, (byte) 0);
frozenblocks.put(tblock, player);
Methods.playIcebendingSound(block.getLocation());
}
}
}
@ -113,6 +114,10 @@ public class Torrent {
returnWater(location);
return;
}
if (Methods.rand.nextInt(4) == 0) {
Methods.playWaterbendingSound(location);
}
if (System.currentTimeMillis() > time + interval) {
time = System.currentTimeMillis();

View file

@ -151,6 +151,12 @@ public class TorrentBurst {
}
}
}
for(Block sound : torrentblocks) {
if (Methods.rand.nextInt(4) == 0) {
Methods.playWaterbendingSound(sound.getLocation());
}
}
}
if (angles.isEmpty())
heights.remove(id);

View file

@ -304,6 +304,10 @@ public class WaterManipulation {
} else {
Methods.removeSpouts(location, player);
if (Methods.rand.nextInt(4) == 0) {
Methods.playWaterbendingSound(location);
}
double radius = FireBlast.affectingradius;
Player source = player;

View file

@ -119,6 +119,9 @@ public class WaterSpout {
player.setFallDistance(0);
player.setSprinting(false);
if (Methods.rand.nextInt(4) == 0) {
Methods.playWaterbendingSound(player.getLocation());
}
// if (player.getVelocity().length() > threshold) {
// // Methods.verbose("Too fast!");
// player.setVelocity(player.getVelocity().clone().normalize()

View file

@ -124,6 +124,7 @@ public class WaterWall {
for (Block block : wallblocks.keySet()) {
if (wallblocks.get(block) == player) {
new TempBlock(block, Material.ICE, (byte) 0);
Methods.playIcebendingSound(block.getLocation());
}
}
}
@ -238,6 +239,11 @@ public class WaterWall {
returnWater();
return false;
}
if (Methods.rand.nextInt(4) == 0) {
Methods.playWaterbendingSound(location);
}
if (System.currentTimeMillis() - time >= interval) {
time = System.currentTimeMillis();

View file

@ -248,6 +248,10 @@ public class Wave {
blocks.add(block);
FireBlast.removeFireBlastsAroundPoint(block.getLocation(), 2);
}
if (Methods.rand.nextInt(4) == 0) {
Methods.playWaterbendingSound(location);
}
// if (!blocks.contains(block)
// && (Methods.isPlant(block) && block.getType() !=
// Material.LEAVES)) {
@ -432,6 +436,11 @@ public class Wave {
new TempBlock(block, Material.ICE, (byte) 0);
frozenblocks.put(block, block);
}
for(Block sound : frozenblocks.keySet()) {
if (Methods.rand.nextInt(4) == 0) {
Methods.playWaterbendingSound(sound.getLocation());
}
}
}
}