mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-20 22:41:39 +01:00
Use soundManager for everything
This commit is contained in:
parent
e3324a68ff
commit
59fc4f2bd9
@ -29,6 +29,7 @@ public class AdminBank extends SubCommand {
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
FileManager.Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
@ -37,7 +38,7 @@ public class AdminBank extends SubCommand {
|
||||
|
||||
if (!fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Bank.Enable")) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Bank.Disabled.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(player);
|
||||
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -88,12 +89,12 @@ public class AdminBank extends SubCommand {
|
||||
skyblock.getGuiManager().showGUI(player, new GuiBank(skyblock, island, null, true));
|
||||
} else {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Admin.Bank.NullIsland.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(player);
|
||||
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Admin.Bank.Unexpected.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(player);
|
||||
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,11 +70,11 @@ public class GuiSignatureEditor extends Gui {
|
||||
"Island.Visitor.Signature.Lines")
|
||||
|| gui.getInputText().length() > mainConfig.getFileConfiguration()
|
||||
.getInt("Island.Visitor.Signature.Length")) {
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(e.player);
|
||||
plugin.getSoundManager().playSound(e.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
} else {
|
||||
signatureMessage.add(gui.getInputText().trim());
|
||||
island.setMessage(IslandMessage.Signature, e.player.getName(), signatureMessage);
|
||||
CompatibleSound.BLOCK_NOTE_BLOCK_PLING.play(e.player);
|
||||
plugin.getSoundManager().playSound(e.player, CompatibleSound.BLOCK_NOTE_BLOCK_PLING.getSound(), 1f, 1f);
|
||||
}
|
||||
e.player.closeInventory();
|
||||
paint();
|
||||
@ -109,7 +109,7 @@ public class GuiSignatureEditor extends Gui {
|
||||
messageManager.sendMessage(player,
|
||||
configLoad.getString(
|
||||
"Command.Island.Settings.Owner.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(player);
|
||||
plugin.getSoundManager().playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
player.closeInventory();
|
||||
return false;
|
||||
} else if (!(island1.hasRole(IslandRole.Operator,
|
||||
@ -118,7 +118,7 @@ public class GuiSignatureEditor extends Gui {
|
||||
player.getUniqueId()))) {
|
||||
messageManager.sendMessage(player, configLoad
|
||||
.getString("Command.Island.Role.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(player);
|
||||
plugin.getSoundManager().playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
player.closeInventory();
|
||||
return false;
|
||||
} else if (!plugin.getFileManager()
|
||||
@ -129,7 +129,7 @@ public class GuiSignatureEditor extends Gui {
|
||||
messageManager.sendMessage(player,
|
||||
configLoad.getString(
|
||||
"Island.Settings.Visitor.Signature.Disabled.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(player);
|
||||
plugin.getSoundManager().playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -70,11 +70,11 @@ public class GuiWelcomeEditor extends Gui {
|
||||
"Island.Visitor.Welcome.Lines")
|
||||
|| gui.getInputText().length() > mainConfig.getFileConfiguration()
|
||||
.getInt("Island.Visitor.Welcome.Length")) {
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(e.player);
|
||||
plugin.getSoundManager().playSound(e.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f,1f);
|
||||
} else {
|
||||
welcomeMessage.add(gui.getInputText().trim());
|
||||
island.setMessage(IslandMessage.Welcome, e.player.getName(), welcomeMessage);
|
||||
CompatibleSound.BLOCK_NOTE_BLOCK_PLING.play(e.player);
|
||||
plugin.getSoundManager().playSound(e.player, CompatibleSound.BLOCK_NOTE_BLOCK_PLING.getSound(), 1f, 1f);
|
||||
}
|
||||
e.player.closeInventory();
|
||||
paint();
|
||||
@ -109,7 +109,7 @@ public class GuiWelcomeEditor extends Gui {
|
||||
messageManager.sendMessage(player,
|
||||
configLoad.getString(
|
||||
"Command.Island.Settings.Owner.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(player);
|
||||
plugin.getSoundManager().playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
player.closeInventory();
|
||||
return false;
|
||||
} else if (!(island1.hasRole(IslandRole.Operator,
|
||||
@ -118,7 +118,7 @@ public class GuiWelcomeEditor extends Gui {
|
||||
player.getUniqueId()))) {
|
||||
messageManager.sendMessage(player, configLoad
|
||||
.getString("Command.Island.Role.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(player);
|
||||
plugin.getSoundManager().playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
player.closeInventory();
|
||||
return false;
|
||||
} else if (!plugin.getFileManager()
|
||||
@ -129,7 +129,7 @@ public class GuiWelcomeEditor extends Gui {
|
||||
messageManager.sendMessage(player,
|
||||
configLoad.getString(
|
||||
"Island.Settings.Visitor.Welcome.Disabled.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(player);
|
||||
plugin.getSoundManager().playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -37,6 +37,7 @@ import java.util.stream.Collectors;
|
||||
public class GuiBank extends Gui {
|
||||
private final SkyBlock plugin;
|
||||
private final BankManager bankManager;
|
||||
private final SoundManager soundManager;
|
||||
private final Island island;
|
||||
private final FileConfiguration languageLoad;
|
||||
private final boolean admin;
|
||||
@ -45,6 +46,7 @@ public class GuiBank extends Gui {
|
||||
super(2, returnGui);
|
||||
this.plugin = plugin;;
|
||||
this.bankManager = plugin.getBankManager();
|
||||
this.soundManager = plugin.getSoundManager();
|
||||
this.island = island;
|
||||
this.admin = admin;
|
||||
this.languageLoad = plugin.getFileManager()
|
||||
@ -71,13 +73,13 @@ public class GuiBank extends Gui {
|
||||
|
||||
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Bank.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
event.player.closeInventory();
|
||||
});
|
||||
|
||||
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Bank.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
event.player.closeInventory();
|
||||
});
|
||||
|
||||
|
@ -11,6 +11,7 @@ import com.songoda.skyblock.SkyBlock;
|
||||
import com.songoda.skyblock.bank.BankManager;
|
||||
import com.songoda.skyblock.island.Island;
|
||||
import com.songoda.skyblock.message.MessageManager;
|
||||
import com.songoda.skyblock.sound.SoundManager;
|
||||
import com.songoda.skyblock.utils.NumberUtil;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -22,6 +23,7 @@ import java.util.Objects;
|
||||
public class GuiBankSelector extends Gui {
|
||||
private final SkyBlock plugin;
|
||||
private final BankManager bankManager;
|
||||
private final SoundManager soundManager;
|
||||
private final Island island;
|
||||
private final FileConfiguration languageLoad;
|
||||
private final Type type;
|
||||
@ -38,6 +40,7 @@ public class GuiBankSelector extends Gui {
|
||||
this.plugin = plugin;
|
||||
this.type = type;
|
||||
this.bankManager = plugin.getBankManager();
|
||||
this.soundManager = plugin.getSoundManager();
|
||||
this.island = island;
|
||||
this.returnGui = returnGui;
|
||||
this.admin = admin;
|
||||
@ -56,13 +59,13 @@ public class GuiBankSelector extends Gui {
|
||||
|
||||
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Input.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
event.player.closeInventory();
|
||||
});
|
||||
|
||||
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Input.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
event.player.closeInventory();
|
||||
});
|
||||
|
||||
@ -109,18 +112,18 @@ public class GuiBankSelector extends Gui {
|
||||
switch(response){
|
||||
case NOT_ENOUGH_MONEY:
|
||||
messageManager.sendMessage(event.player, languageLoad.getString("Command.Island.Bank.Short2.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
break;
|
||||
case DECIMALS_NOT_ALLOWED:
|
||||
messageManager.sendMessage(event.player, languageLoad.getString("Command.Island.Bank.Short6.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
break;
|
||||
case NEGATIVE_AMOUNT:
|
||||
messageManager.sendMessage(event.player, languageLoad.getString("Command.Island.Bank.Short5.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
break;
|
||||
case SUCCESS:
|
||||
CompatibleSound.ENTITY_EXPERIENCE_ORB_PICKUP.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.ENTITY_EXPERIENCE_ORB_PICKUP.getSound(), 1f, 1f);
|
||||
messageManager.sendMessage(event.player, Objects.requireNonNull(languageLoad.getString("Command.Island.Bank." + finalAction + ".Message")).replace(
|
||||
"%amount%", NumberUtil.formatNumberByDecimal(amount)));
|
||||
|
||||
@ -142,7 +145,7 @@ public class GuiBankSelector extends Gui {
|
||||
amount = Double.parseDouble(gui.getInputText().trim());
|
||||
} catch (NumberFormatException e1) {
|
||||
messageManager.sendMessage(e.player, languageLoad.getString("Command.Island.Bank.Short4.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(e.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -162,18 +165,18 @@ public class GuiBankSelector extends Gui {
|
||||
switch(response){
|
||||
case NOT_ENOUGH_MONEY:
|
||||
messageManager.sendMessage(e.player, languageLoad.getString("Command.Island.Bank.Short2.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(e.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
break;
|
||||
case DECIMALS_NOT_ALLOWED:
|
||||
messageManager.sendMessage(e.player, languageLoad.getString("Command.Island.Bank.Short6.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(e.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
break;
|
||||
case NEGATIVE_AMOUNT:
|
||||
messageManager.sendMessage(e.player, languageLoad.getString("Command.Island.Bank.Short5.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(e.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
break;
|
||||
case SUCCESS:
|
||||
CompatibleSound.ENTITY_EXPERIENCE_ORB_PICKUP.play(e.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.ENTITY_EXPERIENCE_ORB_PICKUP.getSound(), 1f, 1f);
|
||||
messageManager.sendMessage(e.player, Objects.requireNonNull(languageLoad.getString("Command.Island.Bank." + finalAction + ".Message")).replace(
|
||||
"%amount%", NumberUtil.formatNumberByDecimal(amount)));
|
||||
break;
|
||||
|
@ -10,6 +10,7 @@ import com.songoda.skyblock.bank.BankManager;
|
||||
import com.songoda.skyblock.bank.Transaction;
|
||||
import com.songoda.skyblock.config.FileManager;
|
||||
import com.songoda.skyblock.island.Island;
|
||||
import com.songoda.skyblock.sound.SoundManager;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
@ -22,6 +23,7 @@ import java.util.List;
|
||||
public class GuiBankTransaction extends Gui {
|
||||
private final SkyBlock plugin;
|
||||
private final BankManager bankManager;
|
||||
private final SoundManager soundManager;
|
||||
private final FileConfiguration languageLoad;
|
||||
private final FileManager.Config config;
|
||||
private final Gui returnGui;
|
||||
@ -33,6 +35,7 @@ public class GuiBankTransaction extends Gui {
|
||||
super(returnGui);
|
||||
this.plugin = plugin;
|
||||
this.bankManager = plugin.getBankManager();
|
||||
this.soundManager = plugin.getSoundManager();
|
||||
this.transactionList = bankManager.getTransactions(island.getOwnerUUID());
|
||||
this.transactions = this.transactionList.size();
|
||||
this.returnGui = returnGui;
|
||||
@ -61,13 +64,13 @@ public class GuiBankTransaction extends Gui {
|
||||
|
||||
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Bank.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
guiManager.showGUI(event.player, returnGui);
|
||||
});
|
||||
|
||||
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Bank.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
guiManager.showGUI(event.player, returnGui);
|
||||
});
|
||||
|
||||
|
@ -13,6 +13,7 @@ import com.songoda.skyblock.island.IslandRole;
|
||||
import com.songoda.skyblock.permission.BasicPermission;
|
||||
import com.songoda.skyblock.permission.PermissionManager;
|
||||
import com.songoda.skyblock.permission.PermissionType;
|
||||
import com.songoda.skyblock.sound.SoundManager;
|
||||
import com.songoda.skyblock.visit.Visit;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
@ -27,6 +28,7 @@ import java.util.stream.Collectors;
|
||||
public class GuiAdminPermissions extends Gui {
|
||||
|
||||
private final PermissionManager permissionManager;
|
||||
private final SoundManager soundManager;
|
||||
private final IslandRole role;
|
||||
private final FileConfiguration configLoad;
|
||||
private final FileManager.Config settingsConfig;
|
||||
@ -36,6 +38,7 @@ public class GuiAdminPermissions extends Gui {
|
||||
public GuiAdminPermissions(SkyBlock plugin, IslandRole role, Gui returnGui) {
|
||||
super(6, returnGui);
|
||||
this.permissionManager = plugin.getPermissionManager();
|
||||
this.soundManager = plugin.getSoundManager();
|
||||
this.role = role;
|
||||
this.returnGui = returnGui;
|
||||
this.configLoad = plugin.getFileManager()
|
||||
@ -55,13 +58,13 @@ public class GuiAdminPermissions extends Gui {
|
||||
|
||||
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE,
|
||||
TextUtils.formatText(configLoad.getString("Menu.Settings.Categories.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
guiManager.showGUI(event.player, returnGui);
|
||||
});
|
||||
|
||||
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE,
|
||||
TextUtils.formatText(configLoad.getString("Menu.Settings.Categories.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
guiManager.showGUI(event.player, returnGui);
|
||||
});
|
||||
|
||||
|
@ -15,6 +15,7 @@ import com.songoda.skyblock.island.IslandRole;
|
||||
import com.songoda.skyblock.permission.BasicPermission;
|
||||
import com.songoda.skyblock.permission.PermissionManager;
|
||||
import com.songoda.skyblock.permission.PermissionType;
|
||||
import com.songoda.skyblock.sound.SoundManager;
|
||||
import com.songoda.skyblock.visit.Visit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -28,6 +29,7 @@ public class GuiPermissions extends Gui {
|
||||
|
||||
private final SkyBlock plugin;
|
||||
private final PermissionManager permissionManager;
|
||||
private final SoundManager soundManager;
|
||||
private final IslandRole role;
|
||||
private final Island island;
|
||||
private final FileConfiguration configLoad;
|
||||
@ -38,6 +40,7 @@ public class GuiPermissions extends Gui {
|
||||
super(6, returnGui);
|
||||
this.plugin = plugin;
|
||||
this.permissionManager = plugin.getPermissionManager();
|
||||
this.soundManager = plugin.getSoundManager();
|
||||
this.role = role;
|
||||
this.island = island;
|
||||
this.returnGui = returnGui;
|
||||
@ -56,7 +59,7 @@ public class GuiPermissions extends Gui {
|
||||
|
||||
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE,
|
||||
TextUtils.formatText(configLoad.getString("Menu.Settings.Categories.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
guiManager.showGUI(event.player, returnGui);
|
||||
});
|
||||
|
||||
@ -94,10 +97,10 @@ public class GuiPermissions extends Gui {
|
||||
(event -> {
|
||||
if (island.isOpen()) {
|
||||
plugin.getIslandManager().closeIsland(island);
|
||||
CompatibleSound.BLOCK_WOODEN_DOOR_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_WOODEN_DOOR_CLOSE.getSound(), 1f, 1f);
|
||||
} else {
|
||||
island.setOpen(true);
|
||||
CompatibleSound.BLOCK_WOODEN_DOOR_OPEN.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_WOODEN_DOOR_OPEN.getSound(), 1f, 1f);
|
||||
}
|
||||
paint();
|
||||
}));
|
||||
@ -105,7 +108,7 @@ public class GuiPermissions extends Gui {
|
||||
|
||||
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE,
|
||||
TextUtils.formatText(configLoad.getString("Menu.Settings.Categories.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
guiManager.showGUI(event.player, returnGui);
|
||||
});
|
||||
|
||||
@ -144,7 +147,7 @@ public class GuiPermissions extends Gui {
|
||||
if (!hasPermission(island, event.player, role)) {
|
||||
plugin.getMessageManager().sendMessage(event.player, configLoad
|
||||
.getString("Command.Island.Settings.Permission.Change.Message"));
|
||||
CompatibleSound.BLOCK_ANVIL_LAND.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class GuiPermissionsSelector extends Gui {
|
||||
|
||||
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE,
|
||||
TextUtils.formatText(configLoad.getString("Menu." + admin + "Settings.Categories.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
plugin.getSoundManager().playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
event.player.closeInventory();
|
||||
});
|
||||
|
||||
|
@ -9,6 +9,7 @@ import com.songoda.skyblock.SkyBlock;
|
||||
import com.songoda.skyblock.ban.BanManager;
|
||||
import com.songoda.skyblock.island.Island;
|
||||
import com.songoda.skyblock.playerdata.PlayerDataManager;
|
||||
import com.songoda.skyblock.sound.SoundManager;
|
||||
import com.songoda.skyblock.utils.item.SkullUtil;
|
||||
import com.songoda.skyblock.utils.player.OfflinePlayer;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -27,6 +28,7 @@ public class GuiBans extends Gui {
|
||||
private final SkyBlock plugin;
|
||||
private final BanManager banManager;
|
||||
private final PlayerDataManager playerDataManager;
|
||||
private final SoundManager soundManager;
|
||||
private final Island island;
|
||||
private final FileConfiguration languageLoad;
|
||||
|
||||
@ -34,8 +36,8 @@ public class GuiBans extends Gui {
|
||||
super(returnGui);
|
||||
this.plugin = plugin;
|
||||
this.playerDataManager = plugin.getPlayerDataManager();
|
||||
;
|
||||
this.banManager = plugin.getBanManager();
|
||||
this.soundManager = plugin.getSoundManager();
|
||||
this.island = island;
|
||||
this.languageLoad = plugin.getFileManager()
|
||||
.getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration();
|
||||
@ -51,13 +53,13 @@ public class GuiBans extends Gui {
|
||||
|
||||
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Bans.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
event.player.closeInventory();
|
||||
});
|
||||
|
||||
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Bans.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
event.player.closeInventory();
|
||||
});
|
||||
|
||||
|
@ -75,13 +75,13 @@ public class GuiBiome extends Gui {
|
||||
|
||||
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Bans.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
event.player.closeInventory();
|
||||
});
|
||||
|
||||
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE, // Exit
|
||||
TextUtils.formatText(languageLoad.getString("Menu.Bans.Item.Exit.Displayname"))), (event) -> {
|
||||
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
|
||||
soundManager.playSound(event.player, CompatibleSound.BLOCK_CHEST_CLOSE.getSound(), 1f, 1f);
|
||||
event.player.closeInventory();
|
||||
});
|
||||
|
||||
|
@ -280,7 +280,7 @@ public class Interact implements Listener {
|
||||
if (skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"))
|
||||
.getFileConfiguration().getBoolean("Island.Block.Obsidian.Enable")) {
|
||||
|
||||
CompatibleSound.BLOCK_FIRE_EXTINGUISH.play(block.getWorld(), block.getLocation(), 1.0F, 1.0F);
|
||||
skyblock.getSoundManager().playSound(block.getLocation(), CompatibleSound.BLOCK_FIRE_EXTINGUISH.getSound(), 1.0F, 1.0F);
|
||||
block.setType(CompatibleMaterial.AIR.getBlockMaterial());
|
||||
|
||||
ItemUtils.takeActiveItem(player, CompatibleHand.getHand(event));
|
||||
@ -346,8 +346,8 @@ public class Interact implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CompatibleSound.ENTITY_CHICKEN_EGG.play(player, 10.0F, 10.0F);
|
||||
|
||||
skyblock.getSoundManager().playSound(player, CompatibleSound.ENTITY_CHICKEN_EGG.getSound(), 10.0F, 10.0F);
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
@ -88,7 +88,7 @@ public abstract class ListeningPermission extends BasicPermission {
|
||||
messageManager.sendMessage(player,
|
||||
plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"))
|
||||
.getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
CompatibleSound.ENTITY_VILLAGER_NO.play(player);
|
||||
plugin.getSoundManager().playSound(player, CompatibleSound.ENTITY_VILLAGER_NO.getSound(), 1f, 1f);
|
||||
}
|
||||
|
||||
protected void cancelAndMessage(Cancellable cancellable, Player player,
|
||||
|
Loading…
Reference in New Issue
Block a user