Use CompatibleSound for sound in 1.8.8

This commit is contained in:
Fabrizio La Rosa 2020-06-16 21:54:21 +02:00
parent 1fe0777645
commit 8514c0233e
3 changed files with 4 additions and 16 deletions

View File

@ -337,11 +337,7 @@ public class Block implements Listener {
witherSkeleton) { witherSkeleton) {
if(block.getRelative(event.getFace().getOppositeFace()).getType().equals(Material.WATER)){ if(block.getRelative(event.getFace().getOppositeFace()).getType().equals(Material.WATER)){
event.setCancelled(true); event.setCancelled(true);
if(NMSUtil.getVersionNumber() > 8){ event.getToBlock().getWorld().playSound(block.getLocation(), CompatibleSound.BLOCK_FIRE_EXTINGUISH.getSound(), 1f, 1f);
event.getToBlock().getWorld().playSound(block.getLocation(), Sound.BLOCK_FIRE_EXTINGUISH, 1f, 1f);
} else {
// TODO Find a sound for 1.8
}
event.getToBlock().getWorld().playEffect(block.getLocation(), Effect.SMOKE, 1); event.getToBlock().getWorld().playEffect(block.getLocation(), Effect.SMOKE, 1);
} }
break; break;

View File

@ -122,12 +122,7 @@ public class Interact implements Listener {
if(configLoad.getBoolean("Island.Nether.AllowNetherWater", false)){ if(configLoad.getBoolean("Island.Nether.AllowNetherWater", false)){
event.setCancelled(true); event.setCancelled(true);
block.setType(Material.WATER, true); block.setType(Material.WATER, true);
if(NMSUtil.getVersionNumber() > 8){ block.getWorld().playSound(block.getLocation(), CompatibleSound.ITEM_BUCKET_EMPTY.getSound(), 1f, 1f);
block.getWorld().playSound(block.getLocation(), Sound.ITEM_BUCKET_EMPTY, 1f, 1f);
} else {
//block.getWorld().playSound(block.getLocation(), Sound.SPLASH, 1f, 1f);
// TODO Find a sound for 1.8
}
if(!event.getPlayer().getGameMode().equals(GameMode.CREATIVE)){ if(!event.getPlayer().getGameMode().equals(GameMode.CREATIVE)){
event.getItem().setType(Material.BUCKET); event.getItem().setType(Material.BUCKET);
} }

View File

@ -1,5 +1,6 @@
package com.songoda.skyblock.tasks; package com.songoda.skyblock.tasks;
import com.songoda.core.compatibility.CompatibleSound;
import com.songoda.core.utils.TextUtils; import com.songoda.core.utils.TextUtils;
import com.songoda.skyblock.SkyBlock; import com.songoda.skyblock.SkyBlock;
import com.songoda.skyblock.config.FileManager; import com.songoda.skyblock.config.FileManager;
@ -80,11 +81,7 @@ public class MobNetherWaterTask extends BukkitRunnable {
private void removeWater(World world, Block block) { private void removeWater(World world, Block block) {
if (block.getType().equals(Material.WATER)) { if (block.getType().equals(Material.WATER)) {
block.setType(Material.AIR, true); block.setType(Material.AIR, true);
if(NMSUtil.getVersionNumber() > 8){ block.getWorld().playSound(block.getLocation(), CompatibleSound.BLOCK_FIRE_EXTINGUISH.getSound(), 1f, 1f);
world.playSound(block.getLocation(), Sound.BLOCK_FIRE_EXTINGUISH, 1f, 1f);
} else {
// TODO Find a sound for 1.8
}
world.playEffect(block.getLocation(), Effect.SMOKE, 1); world.playEffect(block.getLocation(), Effect.SMOKE, 1);
} }
} }