normalization

This commit is contained in:
SuperRonanCraft
2020-07-24 00:33:02 -04:00
parent 8320008118
commit bb90d6e347
4 changed files with 8 additions and 7 deletions

View File

@@ -14,8 +14,8 @@ import org.bukkit.event.player.PlayerMoveEvent;
class Delay implements Listener { class Delay implements Listener {
private int run; private int run;
private PlayerWorld pWorld; private final PlayerWorld pWorld;
private boolean cancelOnMove, cancelOnDamage; private final boolean cancelOnMove, cancelOnDamage;
Delay(CommandSender sendi, PlayerWorld pWorld, int delay, boolean cancelOnMove, boolean cancelOnDamage) { Delay(CommandSender sendi, PlayerWorld pWorld, int delay, boolean cancelOnMove, boolean cancelOnDamage) {
this.pWorld = pWorld; this.pWorld = pWorld;

View File

@@ -125,6 +125,7 @@ public class RTP {
world = p.getWorld().getName(); world = p.getWorld().getName();
if (overriden.containsKey(world)) if (overriden.containsKey(world))
world = overriden.get(world); world = overriden.get(world);
// Not forced and has 'betterrtp.world.<world>'
if (sendi == p && !pl.getPerms().getAWorld(sendi, world)) { if (sendi == p && !pl.getPerms().getAWorld(sendi, world)) {
pl.getCmd().cooldowns.remove(p.getUniqueId()); pl.getCmd().cooldowns.remove(p.getUniqueId());
pl.getText().getNoPermissionWorld(p, world); pl.getText().getNoPermissionWorld(p, world);
@@ -143,7 +144,7 @@ public class RTP {
return; return;
} }
PlayerWorld pWorld = new PlayerWorld(p, world); PlayerWorld pWorld = new PlayerWorld(p, world);
//Set all methods // Set all methods
if (customWorlds.containsKey(world)) { if (customWorlds.containsKey(world)) {
RTPWorld cWorld = customWorlds.get(pWorld.getWorld()); RTPWorld cWorld = customWorlds.get(pWorld.getWorld());
pWorld.setup(cWorld, cWorld.getPrice(), biomes); pWorld.setup(cWorld, cWorld.getPrice(), biomes);

View File

@@ -13,7 +13,7 @@ import java.util.UUID;
public class Commands { public class Commands {
private Main pl; private final Main pl;
public HashMap<UUID, Long> cooldowns = new HashMap<>(); public HashMap<UUID, Long> cooldowns = new HashMap<>();
public HashMap<UUID, Boolean> rtping = new HashMap<>(); public HashMap<UUID, Boolean> rtping = new HashMap<>();
private boolean cooldownTimer; private boolean cooldownTimer;
@@ -118,7 +118,7 @@ public class Commands {
} }
public void tp(Player player, CommandSender sendi, String world, List<String> biomes) { public void tp(Player player, CommandSender sendi, String world, List<String> biomes) {
if (canRtp(sendi, player)) { if (checkDelay(sendi, player)) {
boolean delay = false; boolean delay = false;
if (!pl.getPerms().getBypassDelay(player)) if (!pl.getPerms().getBypassDelay(player))
if (timer != 0) if (timer != 0)
@@ -128,7 +128,7 @@ public class Commands {
} }
} }
private boolean canRtp(CommandSender sendi, Player player) { private boolean checkDelay(CommandSender sendi, Player player) {
//Bypassing/Forced? //Bypassing/Forced?
if (sendi != player || pl.getPerms().getBypassCooldown(player)) if (sendi != player || pl.getPerms().getBypassCooldown(player))
return true; return true;

View File

@@ -15,7 +15,7 @@ public class CmdHelp implements RTPCommand {
if (pl.getPerms().getRtpOther(sendi)) if (pl.getPerms().getRtpOther(sendi))
pl.getText().getHelpPlayer(sendi, label); pl.getText().getHelpPlayer(sendi, label);
if (sendi instanceof Player) { if (sendi instanceof Player) {
if (pl.getPerms().getAWorld(sendi, null)) if (pl.getPerms().getWorld(sendi))
pl.getText().getHelpWorld(sendi, label); pl.getText().getHelpWorld(sendi, label);
} else } else
pl.getText().getHelpWorld(sendi, label); pl.getText().getHelpWorld(sendi, label);