Compare commits

..

4 Commits

Author SHA1 Message Date
Driftay
8f343a5344 FIXED MASSIVE BUG WITH SAVING 2020-04-21 21:39:28 -04:00
Driftay
8665d92476 FIXED MASSIVE BUG WITH SAVING 2020-04-21 20:25:44 -04:00
droppinganvil
b89db7b082 Merge remote-tracking branch 'origin/1.6.x' into 1.6.x 2020-04-21 16:04:39 -05:00
DroppingAnvil
00cb78fd9b Set a world for /f wild 2020-04-21 16:04:18 -05:00
6 changed files with 17 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
<groupId>com.massivecraft</groupId>
<artifactId>Factions</artifactId>
<version>1.6.9.5-2.3.4-RC</version>
<version>1.6.9.5-2.3.5-RC</version>
<packaging>jar</packaging>
<name>SaberFactions</name>

View File

@@ -184,8 +184,10 @@ public class FactionsPlugin extends MPlugin {
Metrics metrics = new Metrics(this, pluginId);
if (!preEnable()) return;
this.loadSuccessful = false;
if (!preEnable()) {
this.loadSuccessful = false;
return;
}
if (!new File(this.getDataFolder() + "/config.yml").exists()) {
this.saveResource("config.yml", false);

View File

@@ -11,6 +11,7 @@ import com.massivecraft.factions.util.wait.WaitedTask;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent;
@@ -21,10 +22,14 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
/**
* @author DroppingAnvil
*/
public class CmdWild extends FCommand implements WaitedTask {
public static HashMap<Player, String> teleportRange;
public static HashSet<Player> teleporting;
public static CmdWild instance;
public static final String tpWorld = FactionsPlugin.getInstance().getConfig().getString("Wild.World", "World");
public CmdWild() {
super();
@@ -56,7 +61,7 @@ public class CmdWild extends FCommand implements WaitedTask {
int z = new Random().nextInt((c.getInt("Range.MaxZ") - c.getInt("Range.MinZ")) + 1) + c.getInt("Range.MinZ");
if (Board.getInstance().getFactionAt(new FLocation(p.getWorld().getName(), x, z)).isWilderness()) {
success = true;
FLocation loc = new FLocation(p.getWorld().getName(), x, z);
FLocation loc = new FLocation(tpWorld, x, z);
teleportRange.remove(p);
if (!FPlayers.getInstance().getByPlayer(p).takeMoney(c.getInt("Cost"))) {
p.sendMessage(TL.GENERIC_NOTENOUGHMONEY.toString());

View File

@@ -20,6 +20,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Objects;
/**
* @author DroppingAnvil
*/
public class WildGUI implements FactionGUI {
Player player;
FPlayer fplayer;

View File

@@ -8,9 +8,7 @@ import org.bukkit.entity.Player;
import java.util.concurrent.ConcurrentHashMap;
/**
* Factions - Developed by Driftay.
* All rights reserved 2020.
* Creation Date: 4/4/2020
* @author DroppingAnvil
*/
public class WaitExecutor {
public static ConcurrentHashMap<Player, WaitTask> taskMap = new ConcurrentHashMap<>();

View File

@@ -1438,6 +1438,8 @@ Wild:
Enabled: true
# Time to wait in seconds #
Wait: 5
# World players will be teleported to #
World: 'World'
# General GUI Settings #
GUI:
Name: 'Teleporter'