Fix 1.11 oddity

This commit is contained in:
NovaFox161 2018-05-13 18:27:43 -05:00
parent cf9b31bb66
commit 11cebfc4a7
2 changed files with 10 additions and 11 deletions

View File

@ -27,6 +27,7 @@ public final class EpicHoppers extends JavaPlugin implements Listener {
public static CommandSender console = Bukkit.getConsoleSender();
public boolean v1_12 = Bukkit.getServer().getClass().getPackage().getName().contains("1_12");
public boolean v1_11 = Bukkit.getServer().getClass().getPackage().getName().contains("1_11");
public boolean v1_10 = Bukkit.getServer().getClass().getPackage().getName().contains("1_10");
public boolean v1_9 = Bukkit.getServer().getClass().getPackage().getName().contains("1_9");
public boolean v1_7 = Bukkit.getServer().getClass().getPackage().getName().contains("1_7");

View File

@ -5,10 +5,7 @@ import com.songoda.epichoppers.EpicHoppers;
import com.songoda.epichoppers.Utils.Debugger;
import com.songoda.epichoppers.Utils.Methods;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
@ -409,16 +406,17 @@ public class Hopper {
if (instance.getConfig().getBoolean("Main.Sounds Enabled")) {
if (instance.getLevelManager().getHighestLevel() != level) {
if (!instance.v1_8 && !instance.v1_7) {
player.playSound(player.getLocation(), org.bukkit.Sound.ENTITY_PLAYER_LEVELUP, 0.6F, 15.0F);
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 0.6F, 15.0F);
} else {
player.playSound(player.getLocation(), org.bukkit.Sound.valueOf("LEVEL_UP"), 2F, 15.0F);
player.playSound(player.getLocation(), Sound.valueOf("LEVEL_UP"), 2F, 15.0F);
}
} else {
if (!instance.v1_10 && !instance.v1_9 && !instance.v1_8 && !instance.v1_7) {
player.playSound(player.getLocation(), org.bukkit.Sound.ENTITY_PLAYER_LEVELUP, 2F, 25.0F);
player.playSound(player.getLocation(), org.bukkit.Sound.BLOCK_NOTE_CHIME, 2F, 25.0F);
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.playSound(player.getLocation(), org.bukkit.Sound.BLOCK_NOTE_CHIME, 1.2F, 35.0F), 5L);
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.playSound(player.getLocation(), org.bukkit.Sound.BLOCK_NOTE_CHIME, 1.8F, 35.0F), 10L);
if (!instance.v1_11 && !instance.v1_10 && !instance.v1_9 && !instance.v1_8 && !instance.v1_7) {
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 25.0F);
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_CHIME, 2F, 25.0F);
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.playSound(player.getLocation(), Sound.BLOCK_NOTE_CHIME, 1.2F, 35.0F), 5L);
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.playSound(player.getLocation(), Sound.BLOCK_NOTE_CHIME, 1.8F, 35.0F), 10L);
} else {
player.playSound(player.getLocation(), org.bukkit.Sound.valueOf("LEVEL_UP"), 2F, 25.0F);
}