mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-25 01:31:24 +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())) {
|
if (!plugin.getVaultEconomy().has(teleporterPlayer.getName(), toWorld.getPrice())) {
|
||||||
return false;
|
return false;
|
||||||
} else if (pay) {
|
} 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 {
|
} else {
|
||||||
GenericBank bank = plugin.getBank();
|
GenericBank bank = plugin.getBank();
|
||||||
if (!bank.hasEnough(teleporterPlayer, toWorld.getPrice(), toWorld.getCurrency(), errString)) {
|
if (!bank.hasEnough(teleporterPlayer, toWorld.getPrice(), toWorld.getCurrency(), errString)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (pay) {
|
} 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