Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
espidev committed Apr 21, 2019
1 parent 8526a69 commit b6b778b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Aliases in case of command conflicts: /ps, /protectionstone, /protectionstones,
protectionstones.home - Access to the /ps home command.
protectionstones.sethome - Access to /ps sethome.
protectionstones.tp - Access to /ps tp command.
protectionstones.tp.bypasswait - Bypass the wait time set in the config for /ps home
protectionstones.tp.bypasswait - Bypass the wait time set in the config for /ps home and /ps tp
protectionstones.tp.bypassprevent - Bypass prevent_teleport_in option in config
protectionstones.priority - Allows players to set their region's priority.
protectionstones.owners - Allows players to add or remove region owners. Allows players to use /ps info owners command.
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/me/vik1395/ProtectionStones/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public class Config {
Boolean uuidupdated;
@Path("placing_cooldown")
int placingCooldown;
@Path("allow_dangerous_commands")
Boolean allowDangerousCommands;
@Path("base_command")
String baseCommand;
//@Path("allow_dangerous_commands")
//Boolean allowDangerousCommands;
//@Path("base_command")
//String baseCommand;


public static void initConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public void onPistonRetract(BlockPistonRetractEvent e) {
public void onPlayerTeleport(PlayerTeleportEvent event) {
if (event.getCause() == TeleportCause.ENDER_PEARL || event.getCause() == TeleportCause.CHORUS_FRUIT) return;

if (event.getPlayer().hasPermission("protectionstones.tp.bypasswait")) return;
if (event.getPlayer().hasPermission("protectionstones.tp.bypassprevent")) return;

WorldGuardPlugin wg = (WorldGuardPlugin) ProtectionStones.wgd;
RegionManager rgm = WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(event.getTo().getWorld()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ public static boolean argumentAdmin(CommandSender p, String[] args) {
case "lastlogons":
return ArgAdminLastlogon.argumentAdminLastLogons(p, args);
case "fixregions":
Bukkit.getScheduler().runTaskAsynchronously(ProtectionStones.getPlugin(), () -> {
p.sendMessage(ChatColor.YELLOW + "Fixing...");
ProtectionStones.upgradeRegions();
p.sendMessage(ChatColor.YELLOW + "Done!");
});
p.sendMessage(ChatColor.YELLOW + "Fixing...");
ProtectionStones.upgradeRegions();
p.sendMessage(ChatColor.YELLOW + "Done!");
break;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public static boolean argumentGet(Player p, String[] args) {
return true;
}

if (!cp.permission.equals("") && !p.hasPermission(cp.permission)) {
p.sendMessage(PSL.NO_PERMISSION_GET.msg());
return true;
}

// check if player has enough money
if (ProtectionStones.isVaultEnabled && !ProtectionStones.vaultEconomy.has(p, cp.price)) {
p.sendMessage(PSL.NOT_ENOUGH_MONEY.msg().replace("%price%", String.format("%.2f", cp.price)));
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/block1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ worlds = [

[player]
# Whether or not to prevent teleporting into a protected region if the player doesn't own it (except with ender pearl and chorus fruit)
# Bypass with protectionstones.tp.bypasstp
prevent_teleport_in = false

# Can't move for x seconds before teleporting with /ps home or /ps tp. Can be disabled with 0.
Expand Down

0 comments on commit b6b778b

Please sign in to comment.