Merge branch 'clans-beta' of ssh://184.154.0.242:7999/min/Mineplex into clans-beta

This commit is contained in:
Cheese 2015-11-27 22:27:33 +11:00
commit 67b9755f0d
14 changed files with 59 additions and 40 deletions

View File

@ -373,13 +373,12 @@ public class CoreClientManager extends MiniPlugin
// Reserved Slot Check // Reserved Slot Check
if (Bukkit.getOnlinePlayers().size() >= Bukkit.getServer().getMaxPlayers()) 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))
// if (client.GetRank().Has(event.getPlayer(), Rank.ULTRA, false)) {
// { event.allow();
// event.allow(); event.setResult(PlayerLoginEvent.Result.ALLOWED);
// event.setResult(PlayerLoginEvent.Result.ALLOWED); return;
// return; }
// }
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "This server is full and no longer accepts players."); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "This server is full and no longer accepts players.");
} }

View File

@ -37,7 +37,6 @@ public class ServerConfiguration extends MiniPlugin
if (_serverGroup == null) if (_serverGroup == null)
return; return;
/*
try try
{ {
_playerListMaxPlayers = PlayerList.class.getDeclaredField("maxPlayers"); _playerListMaxPlayers = PlayerList.class.getDeclaredField("maxPlayers");
@ -50,9 +49,8 @@ public class ServerConfiguration extends MiniPlugin
} }
_plugin.getServer().setWhitelist(_serverGroup.getWhitelist()); _plugin.getServer().setWhitelist(_serverGroup.getWhitelist());
*/
((CraftServer)_plugin.getServer()).getServer().setPVP(_serverGroup.getPvp()); ((CraftServer)_plugin.getServer()).getServer().setPVP(_serverGroup.getPvp());
//((CraftServer)_plugin.getServer()).getServer().setTexturePack(_serverGroup.getResourcePack()); // ((CraftServer)_plugin.getServer()).getServer().setResourcePack(_serverGroup.getResourcePack());
} }
@EventHandler @EventHandler

View File

@ -4,6 +4,7 @@ import java.util.LinkedList;
import java.util.UUID; import java.util.UUID;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.teleport.command.LocateCommand; import mineplex.core.teleport.command.LocateCommand;
import mineplex.core.teleport.command.TeleportCommand; import mineplex.core.teleport.command.TeleportCommand;
import mineplex.core.teleport.event.MineplexTeleportEvent; 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<String, LinkedList<Location>> _tpHistory = new NautHashMap<String, LinkedList<Location>>();
private NautHashMap<UUID, BukkitRunnable> _failedRedisLocates = new NautHashMap<UUID, BukkitRunnable>(); private NautHashMap<UUID, BukkitRunnable> _failedRedisLocates = new NautHashMap<UUID, BukkitRunnable>();
private String _serverName; private String _serverName;
private CoreClientManager _clientManager;
public Teleport(JavaPlugin plugin) public Teleport(JavaPlugin plugin, CoreClientManager clientManager)
{ {
super("Teleport", plugin); super("Teleport", plugin);
_serverName = getPlugin().getConfig().getString("serverstatus.name"); _serverName = getPlugin().getConfig().getString("serverstatus.name");
_clientManager = clientManager;
RedisLocateHandler locateHandler = new RedisLocateHandler(this); RedisLocateHandler locateHandler = new RedisLocateHandler(this);
@ -295,4 +298,14 @@ public class Teleport extends MiniPlugin
{ {
return _tpHistory.get(player.getName()); return _tpHistory.get(player.getName());
} }
public String getServerName()
{
return _serverName;
}
public CoreClientManager getClientManager()
{
return _clientManager;
}
} }

View File

@ -6,13 +6,14 @@ import mineplex.core.command.MultiCommandBase;
import mineplex.core.common.Rank; import mineplex.core.common.Rank;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.status.ServerStatusManager;
import mineplex.core.teleport.Teleport; import mineplex.core.teleport.Teleport;
public class TeleportCommand extends MultiCommandBase<Teleport> public class TeleportCommand extends MultiCommandBase<Teleport>
{ {
public TeleportCommand(Teleport plugin) public TeleportCommand(Teleport plugin)
{ {
super(plugin, Rank.ADMIN, "tp", "teleport"); super(plugin, Rank.MODERATOR, "tp", "teleport");
AddCommand(new AllCommand(plugin)); AddCommand(new AllCommand(plugin));
AddCommand(new BackCommand(plugin)); AddCommand(new BackCommand(plugin));
@ -22,6 +23,12 @@ public class TeleportCommand extends MultiCommandBase<Teleport>
@Override @Override
protected void Help(Player caller, String[] args) 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 //Caller to Player
if (args.length == 1 && CommandCenter.GetClientManager().Get(caller).GetRank().has(caller, Rank.MODERATOR, true)) if (args.length == 1 && CommandCenter.GetClientManager().Get(caller).GetRank().has(caller, Rank.MODERATOR, true))
Plugin.playerToPlayer(caller, caller.getName(), args[0]); Plugin.playerToPlayer(caller, caller.getName(), args[0]);

View File

@ -48,7 +48,7 @@ import net.minecraft.server.v1_8_R3.MinecraftServer;
public class Clans extends JavaPlugin public class Clans extends JavaPlugin
{ {
public static final String VERSION = "0.13"; public static final String VERSION = "0.14";
private String WEB_CONFIG = "webServer"; private String WEB_CONFIG = "webServer";
// Modules // Modules
@ -91,7 +91,7 @@ public class Clans extends JavaPlugin
new Spawn(this, serverStatusManager.getCurrentServerName()); new Spawn(this, serverStatusManager.getCurrentServerName());
Give.Initialize(this); Give.Initialize(this);
Teleport teleport = new Teleport(this); Teleport teleport = new Teleport(this, _clientManager);
Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName()); Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName());
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion()); new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());

View File

@ -65,6 +65,7 @@ import mineplex.game.clans.clans.commands.ClanManagementCommand;
import mineplex.game.clans.clans.commands.ClansAllyChatCommand; import mineplex.game.clans.clans.commands.ClansAllyChatCommand;
import mineplex.game.clans.clans.commands.ClansChatCommand; import mineplex.game.clans.clans.commands.ClansChatCommand;
import mineplex.game.clans.clans.commands.ClansCommand; 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.KillCommand;
import mineplex.game.clans.clans.commands.MapCommand; import mineplex.game.clans.clans.commands.MapCommand;
import mineplex.game.clans.clans.commands.RegionsCommand; import mineplex.game.clans.clans.commands.RegionsCommand;
@ -244,7 +245,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
_explosion = new Explosion(plugin, blockRestore); _explosion = new Explosion(plugin, blockRestore);
// new ClansLoginManager(getPlugin(), clientManager, _serverName); new ClansLoginManager(getPlugin(), clientManager, _serverName);
_clanShop = new ClanShop(this, clientManager, donationManager); _clanShop = new ClanShop(this, clientManager, donationManager);
@ -950,16 +951,16 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
public void onJoin(PlayerLoginEvent event) public void onJoin(PlayerLoginEvent event)
{ {
Rank rank = _clientManager.Get(event.getPlayer()).GetRank(); 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("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.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans Alpha is full! Try again soon");
event.setKickMessage("Clans Pre-Alpha is full! Try again soon"); event.setKickMessage("Clans Alpha is full! Try again soon");
} }
} }

View File

@ -39,12 +39,13 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
@EventHandler @EventHandler
public void onPlayerJoin(PlayerLoginEvent event) 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.setKickMessage("This is not your Clans home server");
// event.setResult(PlayerLoginEvent.Result.KICK_OTHER); event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
_queue.remove(event.getPlayer().getName());
} }
_queue.remove(event.getPlayer().getName());
} }
private void kickPlayer(final String playerName, final String homeServer) private void kickPlayer(final String playerName, final String homeServer)
@ -54,11 +55,11 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
@Override @Override
public void run() public void run()
{ {
// Player player = UtilPlayer.searchExact(playerName); Player player = UtilPlayer.searchExact(playerName);
// if (player != null && player.isOnline()) if (player != null && player.isOnline() && !player.isOp())
// { {
// player.kickPlayer("This is not your home server. To play clans, connect to " + homeServer); player.kickPlayer("This is not your home server. To play clans, connect to " + homeServer);
// } }
} }
}, 20); }, 20);
} }
@ -74,7 +75,6 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
if (serverName != null) if (serverName != null)
{ {
System.out.println("Player " + playerName + " is from server: " + serverName);
if (!serverName.equals(_serverName)) if (!serverName.equals(_serverName))
{ {
_queue.add(playerName); _queue.add(playerName);

View File

@ -40,7 +40,7 @@ public class ClansRegions extends MiniPlugin
{ {
public final static String DEFAULT_WORLD_NAME = "world"; 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 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 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 final static int BORDERLANDS_RADIUS = 50; // Radius of borderlands claim area (measured in chunks)
public static final int BORDER_RADIUS = 768; public static final int BORDER_RADIUS = 768;

View File

@ -45,7 +45,7 @@ public class ClansScoreboardManager extends ScoreboardManager
ScoreboardData data = getData("default", true); 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.writeEmpty();
data.writeElement(new ScoreboardElementClan(_clansManager)); data.writeElement(new ScoreboardElementClan(_clansManager));
data.writeElement(new ScoreboardElementPlayer(_clansManager)); data.writeElement(new ScoreboardElementPlayer(_clansManager));

View File

@ -33,9 +33,10 @@ public class StuckCommand extends CommandBase<StuckManager>
return; return;
} }
if(ClansManager.getInstance().getClanUtility().getClaim(caller.getLocation()) != null && !ClansManager.getInstance().getClanUtility().getClaim(caller.getLocation()).Owner.equals("Borderlands")) if(ClansManager.getInstance().getClanUtility().getClaim(caller.getLocation()) != null && !ClansManager.getInstance().getClanUtility().getClaim(caller.getLocation()).Owner.equals("Borderlands") &&
!ClansManager.getInstance().getClanUtility().getClaim(caller.getLocation()).Owner.equals("Shops") && !ClansManager.getInstance().getClanUtility().getClaim(caller.getLocation()).Owner.equals("Spawn"))
{ {
UtilPlayer.message(caller, F.main("Clans", "You must be in the Wilderness/Borderlands to use this command.")); UtilPlayer.message(caller, F.main("Clans", "You must be in the Wilderness/Borderlands/Shops/Spawn to use this command."));
return; return;
} }

View File

@ -75,7 +75,7 @@ public enum ClansShopItem
NETHER_BRICK(50, 10, Material.NETHER_BRICK, 1), NETHER_BRICK(50, 10, Material.NETHER_BRICK, 1),
QUARTZ_BLOCK(75, 15, Material.QUARTZ_BLOCK, 1), QUARTZ_BLOCK(75, 15, Material.QUARTZ_BLOCK, 1),
CLAY(30, 6, Material.CLAY, 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 _buyPrice;
private int _sellPrice; private int _sellPrice;

View File

@ -42,7 +42,7 @@ public class TutorialGettingStarted extends Tutorial
_doScoreboard = true; _doScoreboard = true;
_ghostMode = true; _ghostMode = true;
_startOnJoin = false; _startOnJoin = true;
_goldReward = 5000; _goldReward = 5000;
_uniqueId = "GettingStartedTutorial"; _uniqueId = "GettingStartedTutorial";

View File

@ -166,7 +166,7 @@ public class Hub extends JavaPlugin implements IRelation
conditionManager.setDamageManager(damage); conditionManager.setDamageManager(damage);
Fire fire = new Fire(this, conditionManager, 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 energy = new Energy(this);
energy.setEnabled(false); energy.setEnabled(false);

View File

@ -112,7 +112,7 @@ public class Arcade extends JavaPlugin
Creature creature = new Creature(this); Creature creature = new Creature(this);
ServerStatusManager serverStatusManager = new ServerStatusManager(this, _clientManager, new LagMeter(this, _clientManager)); ServerStatusManager serverStatusManager = new ServerStatusManager(this, _clientManager, new LagMeter(this, _clientManager));
LeaderboardManager leaderboardManager = new LeaderboardManager(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()); Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName());
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion()); new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
PacketHandler packetHandler = new PacketHandler(this); PacketHandler packetHandler = new PacketHandler(this);