From f8421c09cfb7ed2527fed0a8ae4865e7241602d3 Mon Sep 17 00:00:00 2001 From: DroppingAnvil Date: Sat, 11 Apr 2020 14:51:57 -0500 Subject: [PATCH 1/2] Option to load chunk before /f wild teleport. --- src/main/java/com/massivecraft/factions/Conf.java | 2 ++ .../java/com/massivecraft/factions/cmd/wild/CmdWild.java | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/Conf.java b/src/main/java/com/massivecraft/factions/Conf.java index 39383305..1f3791fc 100644 --- a/src/main/java/com/massivecraft/factions/Conf.java +++ b/src/main/java/com/massivecraft/factions/Conf.java @@ -423,6 +423,8 @@ public class Conf { public static HashMap defaultFactionPermissions = new HashMap<>(); public static HashSet lockedPermissions = new HashSet<>(); + public static boolean wildLoadChunkBeforeTeleport = true; + private static transient Conf i = new Conf(); static { diff --git a/src/main/java/com/massivecraft/factions/cmd/wild/CmdWild.java b/src/main/java/com/massivecraft/factions/cmd/wild/CmdWild.java index 5d982b87..c5d06140 100644 --- a/src/main/java/com/massivecraft/factions/cmd/wild/CmdWild.java +++ b/src/main/java/com/massivecraft/factions/cmd/wild/CmdWild.java @@ -1,10 +1,7 @@ package com.massivecraft.factions.cmd.wild; -import com.massivecraft.factions.Board; -import com.massivecraft.factions.FLocation; -import com.massivecraft.factions.FPlayers; -import com.massivecraft.factions.FactionsPlugin; +import com.massivecraft.factions.*; import com.massivecraft.factions.cmd.Aliases; import com.massivecraft.factions.cmd.CommandContext; import com.massivecraft.factions.cmd.CommandRequirements; @@ -65,6 +62,7 @@ public class CmdWild extends FCommand implements WaitedTask { p.sendMessage(TL.GENERIC_NOTENOUGHMONEY.toString()); return; } + if (Conf.wildLoadChunkBeforeTeleport && !loc.getChunk().isLoaded()) loc.getChunk().load(); teleportPlayer(p, loc); break; } From 144798b2dda977e64a888cf8d088e4065003c137 Mon Sep 17 00:00:00 2001 From: DroppingAnvil Date: Sat, 11 Apr 2020 15:02:17 -0500 Subject: [PATCH 2/2] Fixed message given to WaitExecutor causing F Wild to constantly say "You are already teleporting somewhere" --- src/main/java/com/massivecraft/factions/cmd/wild/WildGUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/wild/WildGUI.java b/src/main/java/com/massivecraft/factions/cmd/wild/WildGUI.java index 05cb405f..0bb1b842 100644 --- a/src/main/java/com/massivecraft/factions/cmd/wild/WildGUI.java +++ b/src/main/java/com/massivecraft/factions/cmd/wild/WildGUI.java @@ -37,7 +37,7 @@ public class WildGUI implements FactionGUI { if (map.containsKey(slot)) { String zone = map.get(slot); if (fplayer.hasMoney(FactionsPlugin.getInstance().getConfig().getInt("Wild.Zones." + zone + ".Cost"))) { - WaitExecutor.taskMap.put(player, new WaitTask(FactionsPlugin.getInstance().getConfig().getInt("Wild.Wait"), TL.COMMAND_WILD_INPROGRESS, player, CmdWild.instance)); + WaitExecutor.taskMap.put(player, new WaitTask(FactionsPlugin.getInstance().getConfig().getInt("Wild.Wait"), TL.COMMAND_WILD_WAIT, player, CmdWild.instance)); CmdWild.teleportRange.put(player, zone); fplayer.msg(TL.COMMAND_WILD_WAIT, FactionsPlugin.getInstance().getConfig().getInt("Wild.Wait") + " Seconds"); player.closeInventory();