Merge branch 'master' of ssh://dev1.mineplex.com:7999/min/mineplex
This commit is contained in:
commit
a7888b0c02
BIN
Maps/Dragons/Dragons_BalloonTown.zip
Normal file
BIN
Maps/Dragons/Dragons_BalloonTown.zip
Normal file
Binary file not shown.
Binary file not shown.
BIN
Maps/Runner/Runner_Eclipse.zip
Normal file
BIN
Maps/Runner/Runner_Eclipse.zip
Normal file
Binary file not shown.
BIN
Maps/Survival Games/SG_ElvenCitadel.zip
Normal file
BIN
Maps/Survival Games/SG_ElvenCitadel.zip
Normal file
Binary file not shown.
Binary file not shown.
@ -1,5 +1,8 @@
|
||||
package mineplex.core.chat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mineplex.core.MiniClientPlugin;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -8,9 +11,12 @@ import mineplex.core.account.CoreClientManager;
|
||||
//import mineplex.core.account.event.RetrieveClientInformationEvent;
|
||||
import mineplex.core.chat.command.BroadcastCommand;
|
||||
import mineplex.core.chat.command.SilenceCommand;
|
||||
import mineplex.core.chat.repository.ChatMessage;
|
||||
import mineplex.core.chat.repository.ChatRepository;
|
||||
//import mineplex.core.chat.repository.ChatRepository;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
@ -20,21 +26,27 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Chat extends MiniClientPlugin<ChatClient>
|
||||
{
|
||||
private static Object _messageLock = new Object();
|
||||
private CoreClientManager _clientManager;
|
||||
//private ChatRepository _repository;
|
||||
private ChatRepository _repository;
|
||||
|
||||
private List<ChatMessage> _messages = new ArrayList<ChatMessage>();
|
||||
|
||||
private long _silenced = 0;
|
||||
|
||||
public Chat(JavaPlugin plugin, CoreClientManager clientManager)
|
||||
private NautHashMap<String, String> _playerLastMessage = new NautHashMap<String, String>();
|
||||
|
||||
public Chat(JavaPlugin plugin, CoreClientManager clientManager, String serverName)
|
||||
{
|
||||
super("Chat", plugin);
|
||||
|
||||
_clientManager = clientManager;
|
||||
//_repository = new ChatRepository(plugin);
|
||||
_repository = new ChatRepository(serverName, plugin.getConfig().getBoolean("serverstatus.us"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -150,12 +162,29 @@ public class Chat extends MiniClientPlugin<ChatClient>
|
||||
UtilPlayer.message(sender, F.main("Chat", "You are sending messages too fast."));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
else if (_playerLastMessage.containsKey(sender.getName()) && _playerLastMessage.get(sender.getName()).equalsIgnoreCase(event.getMessage()))
|
||||
{
|
||||
UtilPlayer.message(sender, F.main("Chat", "You can't repeat the same message."));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_playerLastMessage.put(sender.getName(), event.getMessage());
|
||||
|
||||
_repository.saveChatMessage(sender.getName(), event.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public long Silenced()
|
||||
{
|
||||
return _silenced;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void playerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
_playerLastMessage.remove(event.getPlayer().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ChatClient AddPlayer(String player)
|
||||
|
@ -1,9 +1,11 @@
|
||||
package mineplex.core.chat.repository;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -11,26 +13,62 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.mysql.AccountPreferenceRepository;
|
||||
|
||||
public class ChatRepository extends AccountPreferenceRepository
|
||||
{
|
||||
private static String ALTER_ACCOUNT_PREFERENCE_TABLE = "SET @s = (SELECT IF((SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'accountPreferences' AND table_schema = DATABASE() AND column_name = 'filterChat') > 0, 'SELECT 1', 'ALTER TABLE accountPreferences ADD filterChat BOOL')); PREPARE stmt FROM @s; EXECUTE stmt;";
|
||||
public class ChatRepository
|
||||
{
|
||||
private String _connectionString = "jdbc:mysql://sqlstats.mineplex.com:3306/PlayerStats?autoReconnect=true&failOverReadOnly=false&maxReconnects=10";
|
||||
private String _userName = "root";
|
||||
private String _password = "tAbechAk3wR7tuTh";
|
||||
|
||||
// private static String ALTER_ACCOUNT_PREFERENCE_TABLE = "SET @s = (SELECT IF((SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'accountPreferences' AND table_schema = DATABASE() AND column_name = 'filterChat') > 0, 'SELECT 1', 'ALTER TABLE accountPreferences ADD filterChat BOOL')); PREPARE stmt FROM @s; EXECUTE stmt;";
|
||||
|
||||
private static String CREATE_FILTERED_TABLE = "CREATE TABLE IF NOT EXISTS filteredWords (id INT NOT NULL AUTO_INCREMENT, word VARCHAR(256), PRIMARY KEY (id));";
|
||||
private static String RETRIEVE_FILTERED_WORDS = "SELECT word FROM filteredWords;";
|
||||
private static String SAVE_FILTER_VALUE = "REPLACE INTO accountPreferences (filterChat) VALUES (?) WHERE playerName = ?;";
|
||||
private static String CREATE_CHATLOG_TABLE = "CREATE TABLE IF NOT EXISTS chatLog (id INT NOT NULL AUTO_INCREMENT, serverName VARCHAR(255), playerName VARCHAR(16), message VARCHAR(255), day VARCHAR(100), PRIMARY KEY (id));";
|
||||
private static String INSERT_CHATWORDS = "INSERT INTO chatLog (serverName, playerName, message, day) VALUES (?, ?, ?, now());";
|
||||
//private static String SAVE_FILTER_VALUE = "REPLACE INTO accountPreferences (filterChat) VALUES (?) WHERE playerName = ?;";
|
||||
|
||||
public ChatRepository(JavaPlugin plugin)
|
||||
{
|
||||
super(plugin);
|
||||
}
|
||||
private Connection _connection = null;
|
||||
|
||||
protected void initialize()
|
||||
private String _serverName;
|
||||
|
||||
public ChatRepository(String serverName, boolean us)
|
||||
{
|
||||
super.initialize();
|
||||
initialize();
|
||||
|
||||
executeQuery(CREATE_FILTERED_TABLE);
|
||||
_serverName = (us ? "US " : "EU ") + serverName;
|
||||
}
|
||||
|
||||
public void initialize()
|
||||
{
|
||||
PreparedStatement preparedStatement = null;
|
||||
|
||||
try
|
||||
{
|
||||
_connection = DriverManager.getConnection(_connectionString, _userName, _password);
|
||||
|
||||
// Create table
|
||||
preparedStatement = _connection.prepareStatement(CREATE_CHATLOG_TABLE);
|
||||
preparedStatement.execute();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (preparedStatement != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
preparedStatement.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
protected void update()
|
||||
{
|
||||
super.update();
|
||||
@ -160,4 +198,43 @@ public class ChatRepository extends AccountPreferenceRepository
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
*/
|
||||
|
||||
public void saveChatMessage(String playerName, String message)
|
||||
{
|
||||
PreparedStatement preparedStatement = null;
|
||||
|
||||
try
|
||||
{
|
||||
if (_connection.isClosed())
|
||||
{
|
||||
_connection = DriverManager.getConnection(_connectionString, _userName, _password);
|
||||
}
|
||||
|
||||
preparedStatement = _connection.prepareStatement(INSERT_CHATWORDS, Statement.RETURN_GENERATED_KEYS);
|
||||
preparedStatement.setString(1, _serverName);
|
||||
preparedStatement.setString(2, playerName);
|
||||
preparedStatement.setString(3, message);
|
||||
|
||||
preparedStatement.executeUpdate();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (preparedStatement != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
preparedStatement.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.server.ServerListPingEvent;
|
||||
@ -53,6 +55,11 @@ public class FileUpdater extends MiniPlugin
|
||||
|
||||
if (!restartEvent.isCancelled())
|
||||
{
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
player.sendMessage(F.main("Updater", "Server is restarting for an update."));
|
||||
}
|
||||
|
||||
GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable()
|
||||
{
|
||||
public void run()
|
||||
|
@ -34,7 +34,6 @@ import mineplex.minecraft.game.classcombat.Class.ClassManager;
|
||||
import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
import mineplex.minecraft.game.classcombat.shop.ClassCombatCustomBuildShop;
|
||||
import mineplex.minecraft.game.classcombat.shop.ClassCombatPurchaseShop;
|
||||
import mineplex.minecraft.game.classcombat.shop.ClassCombatShop;
|
||||
import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
|
||||
import mineplex.minecraft.game.core.IRelation;
|
||||
@ -85,8 +84,9 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
|
||||
PacketHandler packetHandler = new PacketHandler(this);
|
||||
PartyManager partyManager = new PartyManager(this, clientManager);
|
||||
HubManager hubManager = new HubManager(this, new BlockRestore(this), clientManager, donationManager, new ConditionManager(this), new DisguiseManager(this, packetHandler), new TaskManager(this, GetWebServerAddress()), portal, partyManager);
|
||||
new ServerManager(this, clientManager, donationManager, portal, partyManager, new ServerStatusManager(this, new LagMeter(this, clientManager)), hubManager, new StackerManager(hubManager));
|
||||
new Chat(this, clientManager);
|
||||
ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, clientManager));
|
||||
new ServerManager(this, clientManager, donationManager, portal, partyManager, serverStatusManager, hubManager, new StackerManager(hubManager));
|
||||
new Chat(this, clientManager, serverStatusManager.getCurrentServerName());
|
||||
new MemoryFix(this);
|
||||
new FileUpdater(this, portal);
|
||||
|
||||
@ -103,9 +103,7 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
|
||||
ClassManager classManager = new ClassManager(this, clientManager, donationManager, skillManager, GetWebServerAddress());
|
||||
|
||||
ClassShopManager shopManager = new ClassShopManager(this, classManager, skillManager, null);
|
||||
new ClassCombatShop(shopManager, clientManager, donationManager, "Select Class Here");
|
||||
new ClassCombatPurchaseShop(shopManager, clientManager, donationManager, "Class Shop");
|
||||
new ClassCombatCustomBuildShop(shopManager, clientManager, donationManager, "Class Setup");
|
||||
new ClassCombatCustomBuildShop(shopManager, clientManager, donationManager, "Class Shop");
|
||||
|
||||
//Updates
|
||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
|
||||
|
@ -34,8 +34,9 @@ public class NewsManager extends MiniPlugin
|
||||
_news = new String[]
|
||||
{
|
||||
"New SSM Kit: " + C.cYellow + C.Bold + "Skeletal Horse",
|
||||
"New Game: " + C.cYellow + C.Bold + "Sheep Quest",
|
||||
"Beta Servers Live! " + C.cPurple + C.Bold + "ULTRA ONLY",
|
||||
"Beta Game: " + C.cYellow + C.Bold + "Sheep Quest",
|
||||
"Beta Game: " + C.cYellow + C.Bold + "Gravity",
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="Dominate,CaptureThePig,PvP,"/>
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="Dominate,CaptureThePig,PvP,"/>
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="CaptureThePig,PvP,Dominate,"/>
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="Dominate,"/>
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="Dominate,"/>
|
||||
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="Dominate,"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
|
||||
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
|
||||
|
@ -132,10 +132,6 @@ public class ClientClass
|
||||
|
||||
public void SaveActiveCustomBuild()
|
||||
{
|
||||
if (GetGameClass() == null)
|
||||
return;
|
||||
|
||||
_savingCustomBuild.PvpClassId = GetGameClass().GetSalesPackageId();
|
||||
_savingCustomBuild.PlayerName = _client.GetPlayerName();
|
||||
|
||||
ISkill swordSkill = GetSkillByType(SkillType.Sword);
|
||||
@ -190,6 +186,8 @@ public class ClientClass
|
||||
public void SetSavingCustomBuild(IPvpClass pvpClass, CustomBuildToken customBuild)
|
||||
{
|
||||
_savingCustomBuild = customBuild;
|
||||
_savingCustomBuild.PvpClassId = pvpClass.GetSalesPackageId();
|
||||
|
||||
_customBuilds.get(pvpClass).put(_savingCustomBuild.CustomBuildNumber, _savingCustomBuild);
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.shop.ShopBase;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
import mineplex.minecraft.game.classcombat.shop.page.ArmorPage;
|
||||
|
||||
public class ClassCombatCustomBuildShop extends ClassCombatShop
|
||||
{
|
||||
@ -17,6 +18,6 @@ public class ClassCombatCustomBuildShop extends ClassCombatShop
|
||||
@Override
|
||||
protected ShopPageBase<ClassShopManager, ? extends ShopBase<ClassShopManager>> BuildPagesFor(Player player)
|
||||
{
|
||||
return null;
|
||||
return new ArmorPage(Plugin, this, ClientManager, DonationManager, player, true);
|
||||
}
|
||||
}
|
||||
|
@ -14,9 +14,6 @@ import mineplex.minecraft.game.classcombat.shop.page.CustomBuildPage;
|
||||
|
||||
public abstract class ClassCombatShop extends ShopBase<ClassShopManager>
|
||||
{
|
||||
private NautHashMap<String, ItemStack[]> _inventoryStorage = new NautHashMap<String, ItemStack[]>();
|
||||
private NautHashMap<String, ItemStack[]> _armorStorage = new NautHashMap<String, ItemStack[]>();
|
||||
|
||||
public ClassCombatShop(ClassShopManager plugin, CoreClientManager clientManager, DonationManager donationManager, String name)
|
||||
{
|
||||
super(plugin, clientManager, donationManager, name, CurrencyType.Gems);
|
||||
@ -51,9 +48,6 @@ public abstract class ClassCombatShop extends ShopBase<ClassShopManager>
|
||||
@Override
|
||||
protected void OpenShopForPlayer(Player player)
|
||||
{
|
||||
_inventoryStorage.put(player.getName(), player.getInventory().getContents());
|
||||
_armorStorage.put(player.getName(), player.getInventory().getArmorContents());
|
||||
|
||||
player.getInventory().clear();
|
||||
player.getInventory().setArmorContents(new ItemStack[4]);
|
||||
|
||||
@ -67,18 +61,7 @@ public abstract class ClassCombatShop extends ShopBase<ClassShopManager>
|
||||
|
||||
if (clientClass != null && clientClass.IsSavingCustomBuild())
|
||||
{
|
||||
clientClass.SaveActiveCustomBuild();
|
||||
clientClass.SaveActiveCustomBuild();
|
||||
}
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
player.getInventory().setContents(_inventoryStorage.get(player.getName()));
|
||||
player.getInventory().setArmorContents(_armorStorage.get(player.getName()));
|
||||
|
||||
((CraftPlayer)player).getHandle().updateInventory(((CraftPlayer)player).getHandle().defaultContainer);
|
||||
}
|
||||
|
||||
_inventoryStorage.remove(player.getName());
|
||||
_armorStorage.remove(player.getName());
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +0,0 @@
|
||||
package mineplex.minecraft.game.classcombat.shop.button;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
|
||||
import mineplex.minecraft.game.classcombat.shop.page.CustomBuildPage;
|
||||
|
||||
public class EditAndDontSaveCustomBuildButton implements IButton
|
||||
{
|
||||
private CustomBuildPage _page;
|
||||
private CustomBuildToken _customBuild;
|
||||
|
||||
public EditAndDontSaveCustomBuildButton(CustomBuildPage page, CustomBuildToken customBuild)
|
||||
{
|
||||
_page = page;
|
||||
_customBuild = customBuild;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Clicked(Player player)
|
||||
{
|
||||
_page.EditAndDontSaveCustomBuild(_customBuild);
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ public class ArmorPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
|
||||
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, .6f);
|
||||
|
||||
if (_purchasing)
|
||||
Shop.OpenPageForPlayer(Player, new SkillPage(Plugin, Shop, ClientManager, DonationManager, Player, pvpClass, true));
|
||||
Shop.OpenPageForPlayer(Player, new SkillPage(Plugin, Shop, ClientManager, DonationManager, Player, pvpClass));
|
||||
else
|
||||
{
|
||||
ClientClass clientClass = Plugin.GetClassManager().Get(player);
|
||||
|
@ -11,7 +11,6 @@ import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildTok
|
||||
import mineplex.minecraft.game.classcombat.shop.ClassCombatShop;
|
||||
import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
|
||||
import mineplex.minecraft.game.classcombat.shop.button.DeleteCustomBuildButton;
|
||||
import mineplex.minecraft.game.classcombat.shop.button.EditAndDontSaveCustomBuildButton;
|
||||
import mineplex.minecraft.game.classcombat.shop.button.EditAndSaveCustomBuildButton;
|
||||
import mineplex.minecraft.game.classcombat.shop.button.SelectCustomBuildButton;
|
||||
|
||||
@ -138,23 +137,7 @@ public class CustomBuildPage extends ShopPageBase<ClassShopManager, ClassCombatS
|
||||
clientClass.EquipCustomBuild(customBuild, false);
|
||||
clientClass.SetSavingCustomBuild(_pvpClass, customBuild);
|
||||
|
||||
Shop.OpenPageForPlayer(Player, new SkillPage(Plugin, Shop, ClientManager, DonationManager, Player, _pvpClass, false));
|
||||
}
|
||||
|
||||
public void EditAndDontSaveCustomBuild(CustomBuildToken customBuild)
|
||||
{
|
||||
ClientClass clientClass = Plugin.GetClassManager().Get(Player);
|
||||
clientClass.SetActiveCustomBuild(_pvpClass, customBuild);
|
||||
|
||||
ClassSetupEvent event = new ClassSetupEvent(Player, SetupType.EditCustomBuild, _pvpClass.GetType(), customBuild.CustomBuildNumber + 1, customBuild);
|
||||
Plugin.GetPlugin().getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.IsCancelled())
|
||||
return;
|
||||
|
||||
clientClass.EquipCustomBuild(customBuild, false);
|
||||
|
||||
Shop.OpenPageForPlayer(Player, new SkillPage(Plugin, Shop, ClientManager, DonationManager, Player, _pvpClass, false));
|
||||
Shop.OpenPageForPlayer(Player, new SkillPage(Plugin, Shop, ClientManager, DonationManager, Player, _pvpClass));
|
||||
}
|
||||
|
||||
public void SelectCustomBuild(CustomBuildToken customBuild)
|
||||
@ -170,9 +153,6 @@ public class CustomBuildPage extends ShopPageBase<ClassShopManager, ClassCombatS
|
||||
|
||||
clientClass.EquipCustomBuild(customBuild);
|
||||
|
||||
if (saveActiveCustomBuild)
|
||||
clientClass.SetSavingCustomBuild(_pvpClass, customBuild);
|
||||
|
||||
Player.closeInventory();
|
||||
}
|
||||
|
||||
|
@ -28,14 +28,12 @@ import org.bukkit.entity.Player;
|
||||
public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
|
||||
{
|
||||
private IPvpClass _pvpClass;
|
||||
private boolean _purchasing;
|
||||
|
||||
public SkillPage(ClassShopManager plugin, ClassCombatShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player, IPvpClass pvpClass, boolean purchasing)
|
||||
public SkillPage(ClassShopManager plugin, ClassCombatShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player, IPvpClass pvpClass)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, " Select Skills", player);
|
||||
|
||||
_pvpClass = pvpClass;
|
||||
_purchasing = purchasing;
|
||||
|
||||
BuildPage();
|
||||
}
|
||||
@ -129,7 +127,9 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
|
||||
{
|
||||
List<String> skillLore = new ArrayList<String>();
|
||||
|
||||
if (_purchasing)
|
||||
boolean locked = isSkillLocked(skill.GetSalesPackageId(), skill);
|
||||
|
||||
if (locked)
|
||||
{
|
||||
skillLore.add(C.cYellow + skill.GetCost() + " Gems");
|
||||
skillLore.add(C.cBlack);
|
||||
@ -142,23 +142,12 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
|
||||
skillLore.set(i, C.cGray + skillLore.get(i));
|
||||
}
|
||||
|
||||
boolean locked = isSkillLocked(skill.GetSalesPackageId(), skill);
|
||||
ShopItem skillItem = new ShopItem(locked ? Material.BOOK_AND_QUILL : ((skill.GetUsers().contains(Player) || _purchasing) ? Material.WRITTEN_BOOK : Material.BOOK), (locked ? ChatColor.RED + skill.GetName() + " (Locked)" : skill.GetName()), skillLore.toArray(new String[skillLore.size()]), 1, locked, true);
|
||||
|
||||
if (_purchasing)
|
||||
{
|
||||
if (locked)
|
||||
AddButton(slotNumber, skillItem, new PurchaseSkillButton(this, skill));
|
||||
else
|
||||
AddItem(slotNumber, skillItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (locked)
|
||||
AddItem(slotNumber, skillItem);
|
||||
else
|
||||
AddButton(slotNumber, skillItem, new SelectSkillButton(this, skill));
|
||||
}
|
||||
ShopItem skillItem = new ShopItem(locked ? Material.BOOK_AND_QUILL : (skill.GetUsers().contains(Player) ? Material.WRITTEN_BOOK : Material.BOOK), (locked ? ChatColor.RED + skill.GetName() + " (Locked)" : skill.GetName()), skillLore.toArray(new String[skillLore.size()]), 1, locked, true);
|
||||
|
||||
if (locked)
|
||||
AddButton(slotNumber, skillItem, new PurchaseSkillButton(this, skill));
|
||||
else
|
||||
AddButton(slotNumber, skillItem, new SelectSkillButton(this, skill));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -99,7 +99,7 @@ public class Arcade extends JavaPlugin implements INautilusPlugin
|
||||
Spawn spawn = new Spawn(this);
|
||||
Teleport teleport = new Teleport(this, _clientManager, spawn);
|
||||
new FileUpdater(this, new Portal(this));
|
||||
new ServerStatusManager(this, new LagMeter(this, _clientManager));
|
||||
ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, _clientManager));
|
||||
|
||||
PacketHandler packetHandler = new PacketHandler(this);
|
||||
DisguiseManager disguiseManager = new DisguiseManager(this, packetHandler);
|
||||
@ -109,7 +109,7 @@ public class Arcade extends JavaPlugin implements INautilusPlugin
|
||||
Portal portal = new Portal(this);
|
||||
|
||||
//Arcade Manager
|
||||
_gameManager = new ArcadeManager(this, ReadServerConfig(), _clientManager, _donationManager, conditionManager, _damageManager, disguiseManager, creature, teleport, new Blood(this), antistack, portal, packetHandler, GetWebServerAddress());
|
||||
_gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, conditionManager, _damageManager, disguiseManager, creature, teleport, new Blood(this), antistack, portal, packetHandler, GetWebServerAddress());
|
||||
|
||||
Punish punish = new Punish(this, GetWebServerAddress(), _clientManager);
|
||||
AntiHack.Initialize(this, punish, portal);
|
||||
|
@ -62,6 +62,7 @@ import mineplex.core.explosion.Explosion;
|
||||
import mineplex.core.portal.Portal;
|
||||
import mineplex.core.projectile.ProjectileManager;
|
||||
import mineplex.core.stats.StatsManager;
|
||||
import mineplex.core.status.ServerStatusManager;
|
||||
import mineplex.core.teleport.Teleport;
|
||||
|
||||
public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
@ -106,7 +107,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
//Games
|
||||
private Game _game;
|
||||
|
||||
public ArcadeManager(Arcade plugin, GameServerConfig serverConfig, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DamageManager damageManager, DisguiseManager disguiseManager, Creature creature, Teleport teleport, Blood blood, AntiStack antistack, Portal portal, PacketHandler packetHandler, String webAddress)
|
||||
public ArcadeManager(Arcade plugin, ServerStatusManager serverStatusManager, GameServerConfig serverConfig, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DamageManager damageManager, DisguiseManager disguiseManager, Creature creature, Teleport teleport, Blood blood, AntiStack antistack, Portal portal, PacketHandler packetHandler, String webAddress)
|
||||
{
|
||||
super("Game Manager", plugin);
|
||||
|
||||
@ -126,7 +127,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
_clientManager = clientManager;
|
||||
|
||||
_chat = new Chat(plugin, _clientManager);
|
||||
_chat = new Chat(plugin, _clientManager, serverStatusManager.getCurrentServerName());
|
||||
|
||||
_creature = creature;
|
||||
|
||||
|
@ -420,7 +420,8 @@ public class GameManager implements Listener
|
||||
{
|
||||
if (player.isDead())
|
||||
{
|
||||
player.kickPlayer("Kicked for being AFK");
|
||||
player.sendMessage(F.main("Afk Monitor", "You are being sent to the Lobby for being AFK."));
|
||||
Manager.GetPortal().SendPlayerToServer(player, "Lobby");
|
||||
}
|
||||
else if (!game.IsPlaying(player))
|
||||
{
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user