mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
More AdminWorld tweaks.
This commit is contained in:
parent
c636ee043a
commit
4b91de7414
@ -12,9 +12,16 @@ public class Command_adminworld extends TFM_Command
|
|||||||
@Override
|
@Override
|
||||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
{
|
{
|
||||||
playerMsg("Going to world: adminworld");
|
if (sender_p.getWorld() == TFM_AdminWorld.getInstance().getAdminWorld())
|
||||||
TFM_AdminWorld.getInstance().sendToAdminWorld(sender_p);
|
{
|
||||||
|
playerMsg("Going to the main world.");
|
||||||
|
sender_p.teleport(server.getWorlds().get(0).getSpawnLocation());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
playerMsg("Going to the AdminWorld.");
|
||||||
|
TFM_AdminWorld.getInstance().sendToAdminWorld(sender_p);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,9 @@ import org.bukkit.WorldCreator;
|
|||||||
import org.bukkit.WorldType;
|
import org.bukkit.WorldType;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.block.Sign;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.material.MaterialData;
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
public class TFM_AdminWorld
|
public class TFM_AdminWorld
|
||||||
@ -74,6 +72,11 @@ public class TFM_AdminWorld
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public World getAdminWorld()
|
||||||
|
{
|
||||||
|
return adminWorld;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean cachedIsUserSuperadmin(CommandSender user)
|
private boolean cachedIsUserSuperadmin(CommandSender user)
|
||||||
{
|
{
|
||||||
long currentTimeMillis = System.currentTimeMillis();
|
long currentTimeMillis = System.currentTimeMillis();
|
||||||
@ -107,12 +110,11 @@ public class TFM_AdminWorld
|
|||||||
|
|
||||||
Block welcomeSignBlock = adminWorld.getBlockAt(0, 50, 0);
|
Block welcomeSignBlock = adminWorld.getBlockAt(0, 50, 0);
|
||||||
welcomeSignBlock.setType(Material.SIGN_POST);
|
welcomeSignBlock.setType(Material.SIGN_POST);
|
||||||
Sign welcomeSign = (Sign) welcomeSignBlock.getState();
|
org.bukkit.block.Sign welcomeSign = (org.bukkit.block.Sign) welcomeSignBlock.getState();
|
||||||
|
|
||||||
org.bukkit.material.Sign signData = new org.bukkit.material.Sign(Material.SIGN_POST);
|
org.bukkit.material.Sign signData = (org.bukkit.material.Sign) welcomeSign.getData();
|
||||||
signData.setFacingDirection(BlockFace.NORTH);
|
signData.setFacingDirection(BlockFace.NORTH);
|
||||||
welcomeSign.setData(signData);
|
|
||||||
|
|
||||||
welcomeSign.setLine(0, ChatColor.GREEN + "AdminWorld");
|
welcomeSign.setLine(0, ChatColor.GREEN + "AdminWorld");
|
||||||
welcomeSign.setLine(1, ChatColor.DARK_GRAY + "---");
|
welcomeSign.setLine(1, ChatColor.DARK_GRAY + "---");
|
||||||
welcomeSign.setLine(2, ChatColor.YELLOW + "Spawn Point");
|
welcomeSign.setLine(2, ChatColor.YELLOW + "Spawn Point");
|
||||||
|
Loading…
Reference in New Issue
Block a user