Skip to content

Commit

Permalink
economy check would lock players into rtp state
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperRonanCraft committed Jun 13, 2023
1 parent de09261 commit 82b2225
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>me.SuperRonanCraft</groupId>
<artifactId>BetterRTP</artifactId>
<packaging>jar</packaging>
<version>3.6.9-1</version>
<version>3.6.9-2-DEV</version>

<!-- Upload patches to https://repo.ronanplugins.com/#/ -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import me.SuperRonanCraft.BetterRTP.references.customEvents.RTP_SettingUpEvent;
import me.SuperRonanCraft.BetterRTP.references.file.FileOther;
import me.SuperRonanCraft.BetterRTP.references.helpers.HelperRTP;
import me.SuperRonanCraft.BetterRTP.references.messages.MessagesCore;
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.PermissionGroup;
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.*;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -81,8 +82,14 @@ public void start(WorldPlayer pWorld) {
if (setup.isCancelled())
return;
// Second Economy check
if (!getPl().getEco().hasBalance(pWorld.getSendi(), pWorld))
if (!getPl().getEco().hasBalance(pWorld.getSendi(), pWorld)) {
MessagesCore.FAILED_PRICE.send(pWorld.getSendi());
return;
}
if (!getPl().getEco().hasHunger(pWorld.getSendi(), pWorld)) {
MessagesCore.FAILED_HUNGER.send(pWorld.getSendi());
return;
}
rtp(pWorld.getSendi(), pWorld, pWorld.getRtp_type());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ private void attempt(CommandSender sendi, Location loc) {
tpLoc.setPitch(player.getLocation().getPitch());
AsyncHandler.sync(() ->
settings.teleport.sendPlayer(sendi, player, tpLoc, worldPlayer, attempts, type));
} else {
getPl().getCooldowns().removeCooldown(player, worldPlayer.getWorld());
getPl().getpInfo().getRtping().put(player, false);
}
} else {
randomlyTeleport(sendi);
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/ideas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Add flags to `/rtp player <player>` command
ignore_cooldown: 'ignores current cooldown delay'
ignore_hunger: 'no hunger checks/charge'
ignore_economy: 'no price deducted from bank'

0 comments on commit 82b2225

Please sign in to comment.