mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-13 06:06:43 +01:00
Fixed world's not charging correctly. Fixes #893. Fixes #777. Possibly fixes #723. That's a 3fer, good buddy.
This commit is contained in:
parent
57da3df860
commit
78ac068a3f
@ -160,14 +160,22 @@ public class PermissionTools {
|
||||
if (!plugin.getVaultEconomy().has(teleporterPlayer.getName(), toWorld.getPrice())) {
|
||||
return false;
|
||||
} else if (pay) {
|
||||
plugin.getVaultEconomy().withdrawPlayer(teleporterPlayer.getName(), toWorld.getPrice());
|
||||
if (toWorld.getPrice() < 0D) {
|
||||
plugin.getVaultEconomy().depositPlayer(teleporterPlayer.getName(), toWorld.getPrice() * -1D);
|
||||
} else {
|
||||
plugin.getVaultEconomy().withdrawPlayer(teleporterPlayer.getName(), toWorld.getPrice());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GenericBank bank = plugin.getBank();
|
||||
if (!bank.hasEnough(teleporterPlayer, toWorld.getPrice(), toWorld.getCurrency(), errString)) {
|
||||
return false;
|
||||
} else if (pay) {
|
||||
bank.give(teleporterPlayer, toWorld.getPrice(), toWorld.getCurrency());
|
||||
if (toWorld.getPrice() < 0D) {
|
||||
bank.give(teleporterPlayer, toWorld.getPrice() * -1D, toWorld.getCurrency());
|
||||
} else {
|
||||
bank.take(teleporterPlayer, toWorld.getPrice(), toWorld.getCurrency());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user