Fixes for release
This commit is contained in:
parent
ec0e2d2d64
commit
a5ebf9b059
@ -373,13 +373,12 @@ public class CoreClientManager extends MiniPlugin
|
||||
// Reserved Slot Check
|
||||
if (Bukkit.getOnlinePlayers().size() >= Bukkit.getServer().getMaxPlayers())
|
||||
{
|
||||
// TODO: REMOVE THIS RESTRICTION FROM CLANS-BRANCH, USED TO PREVENT ULTRA FROM JOINING CLANS
|
||||
// if (client.GetRank().Has(event.getPlayer(), Rank.ULTRA, false))
|
||||
// {
|
||||
// event.allow();
|
||||
// event.setResult(PlayerLoginEvent.Result.ALLOWED);
|
||||
// return;
|
||||
// }
|
||||
if (client.GetRank().has(event.getPlayer(), Rank.ULTRA, false))
|
||||
{
|
||||
event.allow();
|
||||
event.setResult(PlayerLoginEvent.Result.ALLOWED);
|
||||
return;
|
||||
}
|
||||
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "This server is full and no longer accepts players.");
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ public class ServerConfiguration extends MiniPlugin
|
||||
if (_serverGroup == null)
|
||||
return;
|
||||
|
||||
/*
|
||||
try
|
||||
{
|
||||
_playerListMaxPlayers = PlayerList.class.getDeclaredField("maxPlayers");
|
||||
@ -50,9 +49,8 @@ public class ServerConfiguration extends MiniPlugin
|
||||
}
|
||||
|
||||
_plugin.getServer().setWhitelist(_serverGroup.getWhitelist());
|
||||
*/
|
||||
((CraftServer)_plugin.getServer()).getServer().setPVP(_serverGroup.getPvp());
|
||||
//((CraftServer)_plugin.getServer()).getServer().setTexturePack(_serverGroup.getResourcePack());
|
||||
// ((CraftServer)_plugin.getServer()).getServer().setResourcePack(_serverGroup.getResourcePack());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -4,6 +4,7 @@ import java.util.LinkedList;
|
||||
import java.util.UUID;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.teleport.command.LocateCommand;
|
||||
import mineplex.core.teleport.command.TeleportCommand;
|
||||
import mineplex.core.teleport.event.MineplexTeleportEvent;
|
||||
@ -40,12 +41,14 @@ public class Teleport extends MiniPlugin
|
||||
private NautHashMap<String, LinkedList<Location>> _tpHistory = new NautHashMap<String, LinkedList<Location>>();
|
||||
private NautHashMap<UUID, BukkitRunnable> _failedRedisLocates = new NautHashMap<UUID, BukkitRunnable>();
|
||||
private String _serverName;
|
||||
private CoreClientManager _clientManager;
|
||||
|
||||
public Teleport(JavaPlugin plugin)
|
||||
public Teleport(JavaPlugin plugin, CoreClientManager clientManager)
|
||||
{
|
||||
super("Teleport", plugin);
|
||||
|
||||
_serverName = getPlugin().getConfig().getString("serverstatus.name");
|
||||
_clientManager = clientManager;
|
||||
|
||||
RedisLocateHandler locateHandler = new RedisLocateHandler(this);
|
||||
|
||||
@ -295,4 +298,14 @@ public class Teleport extends MiniPlugin
|
||||
{
|
||||
return _tpHistory.get(player.getName());
|
||||
}
|
||||
|
||||
public String getServerName()
|
||||
{
|
||||
return _serverName;
|
||||
}
|
||||
|
||||
public CoreClientManager getClientManager()
|
||||
{
|
||||
return _clientManager;
|
||||
}
|
||||
}
|
||||
|
@ -6,13 +6,14 @@ import mineplex.core.command.MultiCommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.status.ServerStatusManager;
|
||||
import mineplex.core.teleport.Teleport;
|
||||
|
||||
public class TeleportCommand extends MultiCommandBase<Teleport>
|
||||
{
|
||||
public TeleportCommand(Teleport plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "tp", "teleport");
|
||||
super(plugin, Rank.MODERATOR, "tp", "teleport");
|
||||
|
||||
AddCommand(new AllCommand(plugin));
|
||||
AddCommand(new BackCommand(plugin));
|
||||
@ -22,6 +23,12 @@ public class TeleportCommand extends MultiCommandBase<Teleport>
|
||||
@Override
|
||||
protected void Help(Player caller, String[] args)
|
||||
{
|
||||
if (Plugin.getServerName().contains("Clans") && !Plugin.getClientManager().hasRank(caller, Rank.ADMIN) && !caller.isOp())
|
||||
{
|
||||
caller.sendMessage(F.main("Clans", "You cannot use /tp in clans!"));
|
||||
return;
|
||||
}
|
||||
|
||||
//Caller to Player
|
||||
if (args.length == 1 && CommandCenter.GetClientManager().Get(caller).GetRank().has(caller, Rank.MODERATOR, true))
|
||||
Plugin.playerToPlayer(caller, caller.getName(), args[0]);
|
||||
|
@ -48,7 +48,7 @@ import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||
|
||||
public class Clans extends JavaPlugin
|
||||
{
|
||||
public static final String VERSION = "0.13";
|
||||
public static final String VERSION = "0.14";
|
||||
private String WEB_CONFIG = "webServer";
|
||||
|
||||
// Modules
|
||||
@ -91,7 +91,7 @@ public class Clans extends JavaPlugin
|
||||
new Spawn(this, serverStatusManager.getCurrentServerName());
|
||||
Give.Initialize(this);
|
||||
|
||||
Teleport teleport = new Teleport(this);
|
||||
Teleport teleport = new Teleport(this, _clientManager);
|
||||
Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName());
|
||||
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
|
||||
|
||||
|
@ -65,6 +65,7 @@ import mineplex.game.clans.clans.commands.ClanManagementCommand;
|
||||
import mineplex.game.clans.clans.commands.ClansAllyChatCommand;
|
||||
import mineplex.game.clans.clans.commands.ClansChatCommand;
|
||||
import mineplex.game.clans.clans.commands.ClansCommand;
|
||||
import mineplex.game.clans.clans.commands.ClansLoginManager;
|
||||
import mineplex.game.clans.clans.commands.KillCommand;
|
||||
import mineplex.game.clans.clans.commands.MapCommand;
|
||||
import mineplex.game.clans.clans.commands.RegionsCommand;
|
||||
@ -244,7 +245,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
|
||||
_explosion = new Explosion(plugin, blockRestore);
|
||||
|
||||
// new ClansLoginManager(getPlugin(), clientManager, _serverName);
|
||||
new ClansLoginManager(getPlugin(), clientManager, _serverName);
|
||||
|
||||
_clanShop = new ClanShop(this, clientManager, donationManager);
|
||||
|
||||
@ -950,16 +951,16 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
public void onJoin(PlayerLoginEvent event)
|
||||
{
|
||||
Rank rank = _clientManager.Get(event.getPlayer()).GetRank();
|
||||
if (!event.getPlayer().isWhitelisted() || !rank.has(Rank.EVENT))
|
||||
if (!event.getPlayer().isWhitelisted() && !rank.has(Rank.LEGEND))
|
||||
{
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans is currently in Legend+ only Alpha!");
|
||||
// event.setKickMessage("This server is whitelisted!");
|
||||
event.setKickMessage("Clans is currently in staff only Pre-Alpha!");
|
||||
event.setKickMessage("Clans is currently in Legend+ only Alpha!");
|
||||
}
|
||||
else if (UtilServer.getPlayers().length >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted())
|
||||
else if (UtilServer.getPlayers().length >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp())
|
||||
{
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
event.setKickMessage("Clans Pre-Alpha is full! Try again soon");
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans Alpha is full! Try again soon");
|
||||
event.setKickMessage("Clans Alpha is full! Try again soon");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,12 +39,13 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerLoginEvent event)
|
||||
{
|
||||
if (_queue.contains(event.getPlayer().getName()))
|
||||
if (_queue.contains(event.getPlayer().getName()) && !event.getPlayer().isOp())
|
||||
{
|
||||
// event.setKickMessage("This is not your Clans home server");
|
||||
// event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
_queue.remove(event.getPlayer().getName());
|
||||
event.setKickMessage("This is not your Clans home server");
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
}
|
||||
|
||||
_queue.remove(event.getPlayer().getName());
|
||||
}
|
||||
|
||||
private void kickPlayer(final String playerName, final String homeServer)
|
||||
@ -54,11 +55,11 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
// Player player = UtilPlayer.searchExact(playerName);
|
||||
// if (player != null && player.isOnline())
|
||||
// {
|
||||
// player.kickPlayer("This is not your home server. To play clans, connect to " + homeServer);
|
||||
// }
|
||||
Player player = UtilPlayer.searchExact(playerName);
|
||||
if (player != null && player.isOnline() && !player.isOp())
|
||||
{
|
||||
player.kickPlayer("This is not your home server. To play clans, connect to " + homeServer);
|
||||
}
|
||||
}
|
||||
}, 20);
|
||||
}
|
||||
@ -74,7 +75,6 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
|
||||
|
||||
if (serverName != null)
|
||||
{
|
||||
System.out.println("Player " + playerName + " is from server: " + serverName);
|
||||
if (!serverName.equals(_serverName))
|
||||
{
|
||||
_queue.add(playerName);
|
||||
|
@ -40,7 +40,7 @@ public class ClansRegions extends MiniPlugin
|
||||
{
|
||||
public final static String DEFAULT_WORLD_NAME = "world";
|
||||
public final static int SPAWN_RADIUS = 3; // Radius of spawn claim area (measured in chunks)
|
||||
public final static int SHOP_RADIUS = 4; // Radius of shop claim area (measured in chunks)
|
||||
public final static int SHOP_RADIUS = 7; // Radius of shop claim area (measured in chunks)
|
||||
public final static int FIELDS_RADIUS = 7; // Radius of fields claim area (measured in chunks)
|
||||
public final static int BORDERLANDS_RADIUS = 50; // Radius of borderlands claim area (measured in chunks)
|
||||
public static final int BORDER_RADIUS = 768;
|
||||
|
@ -45,7 +45,7 @@ public class ClansScoreboardManager extends ScoreboardManager
|
||||
|
||||
ScoreboardData data = getData("default", true);
|
||||
|
||||
data.write(C.cGreen + "Clans Pre-Alpha " + Clans.VERSION);
|
||||
data.write(C.cGreen + "Clans Alpha " + Clans.VERSION);
|
||||
data.writeEmpty();
|
||||
data.writeElement(new ScoreboardElementClan(_clansManager));
|
||||
data.writeElement(new ScoreboardElementPlayer(_clansManager));
|
||||
|
@ -75,7 +75,7 @@ public enum ClansShopItem
|
||||
NETHER_BRICK(50, 10, Material.NETHER_BRICK, 1),
|
||||
QUARTZ_BLOCK(75, 15, Material.QUARTZ_BLOCK, 1),
|
||||
CLAY(30, 6, Material.CLAY, 1),
|
||||
GOLD_TOKEN(5000, 5000, Material.GOLD_RECORD, 1, (byte) 0, "Gold Token");
|
||||
GOLD_TOKEN(50000, 50000, Material.GOLD_RECORD, 1, (byte) 0, "Gold Token");
|
||||
|
||||
private int _buyPrice;
|
||||
private int _sellPrice;
|
||||
|
@ -166,7 +166,7 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
conditionManager.setDamageManager(damage);
|
||||
|
||||
Fire fire = new Fire(this, conditionManager, damage);
|
||||
Teleport teleport = new Teleport(this);
|
||||
Teleport teleport = new Teleport(this, clientManager);
|
||||
Energy energy = new Energy(this);
|
||||
energy.setEnabled(false);
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class Arcade extends JavaPlugin
|
||||
Creature creature = new Creature(this);
|
||||
ServerStatusManager serverStatusManager = new ServerStatusManager(this, _clientManager, new LagMeter(this, _clientManager));
|
||||
LeaderboardManager leaderboardManager = new LeaderboardManager(this, _clientManager);
|
||||
Teleport teleport = new Teleport(this);
|
||||
Teleport teleport = new Teleport(this, _clientManager);
|
||||
Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName());
|
||||
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
|
||||
PacketHandler packetHandler = new PacketHandler(this);
|
||||
|
Loading…
Reference in New Issue
Block a user