mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-28 05:35:44 +01:00
Added resetting money when joining/leaving island (untested)
This commit is contained in:
parent
b1320906b0
commit
0346ea8a23
@ -72,7 +72,7 @@ public class AdminDeleteCommand extends ConfirmableCommand {
|
||||
target.getPlayer().getInventory().clear();
|
||||
}
|
||||
if (getSettings().isUseEconomy() && getIWM().isOnLeaveResetMoney(getWorld())) {
|
||||
// TODO: needs Vault
|
||||
getPlugin().getVault().ifPresent(vault -> vault.getEconomy().withdrawPlayer(target.getPlayer(), vault.getEconomy().getBalance(target.getPlayer())));
|
||||
}
|
||||
}
|
||||
getIslands().deleteIsland(oldIsland, true);
|
||||
|
@ -82,7 +82,7 @@ public class IslandResetCommand extends ConfirmableCommand {
|
||||
user.getPlayer().getInventory().clear();
|
||||
}
|
||||
if (getSettings().isUseEconomy() && getIWM().isOnLeaveResetMoney(getWorld())) {
|
||||
// TODO: needs Vault
|
||||
getPlugin().getVault().ifPresent(vault -> vault.getEconomy().withdrawPlayer(user.getPlayer(), vault.getEconomy().getBalance(user.getPlayer())));
|
||||
}
|
||||
// Add a reset
|
||||
getPlayers().addReset(getWorld(), user.getUniqueId());
|
||||
|
@ -85,7 +85,7 @@ public class IslandTeamInviteAcceptCommand extends CompositeCommand {
|
||||
user.getPlayer().getInventory().clear();
|
||||
}
|
||||
if (getSettings().isUseEconomy() && (getIWM().isOnLeaveResetMoney(getWorld()) || getIWM().isOnJoinResetMoney(getWorld()))) {
|
||||
// TODO: needs Vault
|
||||
getPlugin().getVault().ifPresent(vault -> vault.getEconomy().withdrawPlayer(user.getPlayer(), vault.getEconomy().getBalance(user.getPlayer())));
|
||||
}
|
||||
// Add the player as a team member of the new island
|
||||
getIslands().setJoinTeam(teamIsland, playerUUID);
|
||||
|
@ -62,7 +62,8 @@ public class IslandTeamKickCommand extends ConfirmableCommand {
|
||||
}
|
||||
|
||||
private void kick(User user, UUID targetUUID) {
|
||||
User.getInstance(targetUUID).sendMessage("commands.island.team.kick.leader-kicked");
|
||||
User target = User.getInstance(targetUUID);
|
||||
target.sendMessage("commands.island.team.kick.leader-kicked");
|
||||
getIslands().removePlayer(getWorld(), targetUUID);
|
||||
// Remove money inventory etc.
|
||||
if (getIWM().isOnLeaveResetEnderChest(getWorld())) {
|
||||
@ -72,7 +73,7 @@ public class IslandTeamKickCommand extends ConfirmableCommand {
|
||||
user.getPlayer().getInventory().clear();
|
||||
}
|
||||
if (getSettings().isUseEconomy() && getIWM().isOnLeaveResetMoney(getWorld())) {
|
||||
// TODO: needs Vault
|
||||
getPlugin().getVault().ifPresent(vault -> vault.getEconomy().withdrawPlayer(target.getPlayer(), vault.getEconomy().getBalance(target.getPlayer())));
|
||||
}
|
||||
user.sendMessage("general.success");
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class IslandTeamLeaveCommand extends ConfirmableCommand {
|
||||
user.getPlayer().getInventory().clear();
|
||||
}
|
||||
if (getSettings().isUseEconomy() && getIWM().isOnLeaveResetMoney(getWorld())) {
|
||||
// TODO: needs Vault
|
||||
getPlugin().getVault().ifPresent(vault -> vault.getEconomy().withdrawPlayer(user.getPlayer(), vault.getEconomy().getBalance(user.getPlayer())));
|
||||
}
|
||||
user.sendMessage("general.success");
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ public class IslandsManager {
|
||||
user.getPlayer().getInventory().clear();
|
||||
}
|
||||
if (plugin.getSettings().isUseEconomy() && plugin.getIWM().isOnJoinResetMoney(world)) {
|
||||
// TODO: needs Vault
|
||||
plugin.getVault().ifPresent(vault -> vault.getEconomy().withdrawPlayer(user.getPlayer(), vault.getEconomy().getBalance(user.getPlayer())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user