Set a world for /f wild
This commit is contained in:
parent
144798b2dd
commit
00cb78fd9b
@ -11,6 +11,7 @@ import com.massivecraft.factions.util.wait.WaitedTask;
|
|||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
@ -21,10 +22,14 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DroppingAnvil
|
||||||
|
*/
|
||||||
public class CmdWild extends FCommand implements WaitedTask {
|
public class CmdWild extends FCommand implements WaitedTask {
|
||||||
public static HashMap<Player, String> teleportRange;
|
public static HashMap<Player, String> teleportRange;
|
||||||
public static HashSet<Player> teleporting;
|
public static HashSet<Player> teleporting;
|
||||||
public static CmdWild instance;
|
public static CmdWild instance;
|
||||||
|
public static final String tpWorld = FactionsPlugin.getInstance().getConfig().getString("Wild.World", "World");
|
||||||
|
|
||||||
public CmdWild() {
|
public CmdWild() {
|
||||||
super();
|
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");
|
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()) {
|
if (Board.getInstance().getFactionAt(new FLocation(p.getWorld().getName(), x, z)).isWilderness()) {
|
||||||
success = true;
|
success = true;
|
||||||
FLocation loc = new FLocation(p.getWorld().getName(), x, z);
|
FLocation loc = new FLocation(tpWorld, x, z);
|
||||||
teleportRange.remove(p);
|
teleportRange.remove(p);
|
||||||
if (!FPlayers.getInstance().getByPlayer(p).takeMoney(c.getInt("Cost"))) {
|
if (!FPlayers.getInstance().getByPlayer(p).takeMoney(c.getInt("Cost"))) {
|
||||||
p.sendMessage(TL.GENERIC_NOTENOUGHMONEY.toString());
|
p.sendMessage(TL.GENERIC_NOTENOUGHMONEY.toString());
|
||||||
|
@ -20,6 +20,9 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DroppingAnvil
|
||||||
|
*/
|
||||||
public class WildGUI implements FactionGUI {
|
public class WildGUI implements FactionGUI {
|
||||||
Player player;
|
Player player;
|
||||||
FPlayer fplayer;
|
FPlayer fplayer;
|
||||||
|
@ -8,9 +8,7 @@ import org.bukkit.entity.Player;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factions - Developed by Driftay.
|
* @author DroppingAnvil
|
||||||
* All rights reserved 2020.
|
|
||||||
* Creation Date: 4/4/2020
|
|
||||||
*/
|
*/
|
||||||
public class WaitExecutor {
|
public class WaitExecutor {
|
||||||
public static ConcurrentHashMap<Player, WaitTask> taskMap = new ConcurrentHashMap<>();
|
public static ConcurrentHashMap<Player, WaitTask> taskMap = new ConcurrentHashMap<>();
|
||||||
|
@ -1434,6 +1434,8 @@ Wild:
|
|||||||
Enabled: true
|
Enabled: true
|
||||||
# Time to wait in seconds #
|
# Time to wait in seconds #
|
||||||
Wait: 5
|
Wait: 5
|
||||||
|
# World players will be teleported to #
|
||||||
|
World: 'World'
|
||||||
# General GUI Settings #
|
# General GUI Settings #
|
||||||
GUI:
|
GUI:
|
||||||
Name: 'Teleporter'
|
Name: 'Teleporter'
|
||||||
|
Loading…
Reference in New Issue
Block a user