mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-02-21 14:11:45 +01:00
Fix for members can't withdraw or deposit from bank
This commit is contained in:
parent
e5ccded437
commit
4af09dd7a1
@ -64,7 +64,7 @@ public class Bank {
|
|||||||
executors.put(MenuClickRegistry.RegistryKey.fromLanguageFile("Menu.Bank.Item.Deposit.Displayname", CompatibleMaterial.DIRT), (inst, player, e) -> {
|
executors.put(MenuClickRegistry.RegistryKey.fromLanguageFile("Menu.Bank.Item.Deposit.Displayname", CompatibleMaterial.DIRT), (inst, player, e) -> {
|
||||||
inst.getSoundManager().playSound(player, CompatibleSound.ENTITY_BAT_TAKEOFF.getSound(), 1.0F, 1.0F);
|
inst.getSoundManager().playSound(player, CompatibleSound.ENTITY_BAT_TAKEOFF.getSound(), 1.0F, 1.0F);
|
||||||
//Deposit money
|
//Deposit money
|
||||||
Island island = islandManager.getIslandByPlayer(Bukkit.getOfflinePlayer(player.getUniqueId()));
|
Island island = islandManager.getIsland(player);
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
SelectInputMethod.getInstance().open(player, "Deposit", (action) -> {
|
SelectInputMethod.getInstance().open(player, "Deposit", (action) -> {
|
||||||
if (action == InputMethodSelectlistener.InputMethod.CANCELED) {
|
if (action == InputMethodSelectlistener.InputMethod.CANCELED) {
|
||||||
@ -96,18 +96,16 @@ public class Bank {
|
|||||||
executors.put(MenuClickRegistry.RegistryKey.fromLanguageFile("Menu.Bank.Item.Withdraw.Displayname", CompatibleMaterial.GLISTERING_MELON_SLICE), (inst, player, e) -> {
|
executors.put(MenuClickRegistry.RegistryKey.fromLanguageFile("Menu.Bank.Item.Withdraw.Displayname", CompatibleMaterial.GLISTERING_MELON_SLICE), (inst, player, e) -> {
|
||||||
inst.getSoundManager().playSound(player, CompatibleSound.ENTITY_BAT_TAKEOFF.getSound(), 1.0F, 1.0F);
|
inst.getSoundManager().playSound(player, CompatibleSound.ENTITY_BAT_TAKEOFF.getSound(), 1.0F, 1.0F);
|
||||||
//Withdraw money
|
//Withdraw money
|
||||||
Island island = null;
|
Island island;
|
||||||
island = islandManager.getIslandByPlayer(Bukkit.getOfflinePlayer(player.getUniqueId()));
|
island = islandManager.getIsland(player);
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
Island finalIsland = island;
|
|
||||||
SelectInputMethod.getInstance().open(player, "Withdraw", (action) -> {
|
SelectInputMethod.getInstance().open(player, "Withdraw", (action) -> {
|
||||||
if (action == InputMethodSelectlistener.InputMethod.CANCELED) {
|
if (action == InputMethodSelectlistener.InputMethod.CANCELED) {
|
||||||
Bukkit.getScheduler().runTask(skyblock, () -> {
|
Bukkit.getScheduler().runTask(skyblock, () -> {
|
||||||
this.open(player);
|
this.open(player);
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
} else if (action == InputMethodSelectlistener.InputMethod.ALL) {
|
} else if (action == InputMethodSelectlistener.InputMethod.ALL) {
|
||||||
withdraw(player, finalIsland, finalIsland.getBankBalance());
|
withdraw(player, island, island.getBankBalance());
|
||||||
} else {
|
} else {
|
||||||
ChatPrompt.showPrompt(skyblock, player, (event) -> {
|
ChatPrompt.showPrompt(skyblock, player, (event) -> {
|
||||||
if (event.getMessage().equals(""))
|
if (event.getMessage().equals(""))
|
||||||
@ -119,7 +117,7 @@ public class Bank {
|
|||||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Bank.Short4.Message"));
|
messageManager.sendMessage(player, configLoad.getString("Command.Island.Bank.Short4.Message"));
|
||||||
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1.0F, 1.0F);
|
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
withdraw(player, finalIsland, amount);
|
withdraw(player, island, amount);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user