diff --git a/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java b/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java index a85a90b73..2fc50f4a6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java @@ -50,7 +50,7 @@ public class Chat extends MiniPlugin private PreferencesManager _preferences; private String _filterUrl = "https://mp9wbhy6.pottymouthfilter.com/v1/"; - private String _apiKey = "38SMwIOeymi8V3r2MVtJ"; + private String _apiKey = "oUywMpwZcIzZO5AWnfDx"; private String _authName = ""; private String _serverName; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java index bd7a5d5fc..e8a219c49 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java @@ -80,7 +80,7 @@ public class PreferencesManager extends MiniClientPlugin if (event.getType() != UpdateType.SLOW) return; - NautHashMap bufferCopy = new NautHashMap(); + final NautHashMap bufferCopy = new NautHashMap(); for (Entry entry : _saveBuffer.entrySet()) { @@ -89,7 +89,13 @@ public class PreferencesManager extends MiniClientPlugin _saveBuffer.clear(); - _repository.saveUserPreferences(bufferCopy); + GetPlugin().getServer().getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable() + { + public void run() + { + _repository.saveUserPreferences(bufferCopy); + } + }); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/simpleStats/SimpleStats.java b/Plugins/Mineplex.Core/src/mineplex/core/simpleStats/SimpleStats.java index fd1719fad..d676cbc24 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/simpleStats/SimpleStats.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/simpleStats/SimpleStats.java @@ -23,13 +23,14 @@ public class SimpleStats extends MiniPlugin _repository.initialize(); } + /* public NautHashMap getEntries() { synchronized (_transferLock) { return _entries; } - } + }*/ @EventHandler public void storeStatsUpdate(final UpdateEvent updateEvent) @@ -65,4 +66,22 @@ public class SimpleStats extends MiniPlugin } }); } + + public NautHashMap getStat(String statName) + { + final String statNameFinal = statName; + + Bukkit.getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable() + { + public void run() + { + synchronized (_transferLock) + { + _entries = _repository.retrieveStat(statNameFinal); + } + } + }); + + return _entries; + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/simpleStats/SimpleStatsRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/simpleStats/SimpleStatsRepository.java index 9040c014c..bcc091054 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/simpleStats/SimpleStatsRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/simpleStats/SimpleStatsRepository.java @@ -17,8 +17,9 @@ public class SimpleStatsRepository private String _password = "tAbechAk3wR7tuTh"; //try to obfuscate this in the future! private static String CREATE_STATS_TABLE = "CREATE TABLE IF NOT EXISTS simpleStats (id INT NOT NULL AUTO_INCREMENT, statName VARCHAR(64), statValue VARCHAR(64), PRIMARY KEY (id));"; - private static String RETRIEVE_STATS_RECORDS = "SELECT statName.*, statValue.* FROM simpleStats;"; - private static String STORE_STATS_RECORD = "INSERT INTO simpleStats (statName,statValue) VALUES("; + private static String RETRIEVE_STATS_RECORDS = "SELECT simpleStats.statName, simpleStats.statValue FROM simpleStats;"; + private static String STORE_STATS_RECORD = "INSERT INTO simpleStats (statName,statValue) VALUES(?,?);"; + private static String RETRIEVE_STAT_RECORD = "SELECT simpleStats.statName, simpleStats.statValue FROM simpleStats WHERE statName = '?';"; private Connection _connection = null; @@ -127,8 +128,10 @@ public class SimpleStatsRepository { _connection = DriverManager.getConnection(_connectionString, _userName, _password); } - - preparedStatement = _connection.prepareStatement(STORE_STATS_RECORD + statName + "," + statValue + ");"); + + preparedStatement = _connection.prepareStatement(STORE_STATS_RECORD); + preparedStatement.setString(1, statName); + preparedStatement.setString(2, statValue); preparedStatement.executeUpdate(); } @@ -152,4 +155,64 @@ public class SimpleStatsRepository } } } + + public NautHashMap retrieveStat(String statName) + { + ResultSet resultSet = null; + PreparedStatement preparedStatement = null; + NautHashMap statRecords = new NautHashMap(); + + try + { + synchronized (_connectionLock) + { + if (_connection.isClosed()) + { + _connection = DriverManager.getConnection(_connectionString, _userName, _password); + } + + preparedStatement = _connection.prepareStatement(RETRIEVE_STAT_RECORD); + preparedStatement.setString(1, statName); + + resultSet = preparedStatement.executeQuery(); + + while (resultSet.next()) + { + statRecords.put(resultSet.getString(1), resultSet.getString(2)); + } + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + finally + { + if (preparedStatement != null) + { + try + { + preparedStatement.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + + if (resultSet != null) + { + try + { + resultSet.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + } + + return statRecords; + } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/tutorial/types/WelcomeTutorial.java b/Plugins/Mineplex.Hub/src/mineplex/hub/tutorial/types/WelcomeTutorial.java index 65fb72d71..f18e136d1 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/tutorial/types/WelcomeTutorial.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/tutorial/types/WelcomeTutorial.java @@ -53,12 +53,13 @@ public class WelcomeTutorial extends Tutorial "Survival", new String[] { - "This is the " + _elem + "The Bridges" + _main + " game mode.", - "This is a great team combat game.", - "You get 10 minutes to prepare for battle,", - "then the bridges drop, and you fight to the death!", + "Here are the " + _elem + "Survival" + _main + " game modes.", "", - _elem + "Hunger Games" + _main + " will be added here soon!" + _elem + "The Bridges" + _main + ", you get 10 minutes to prepare", + "then the Bridges drop, and battle starts!", + "", + _elem + "Survival Games" + _main + " puts you into a dangerous", + "battle for survival against 23 other tributes!" } )); @@ -84,11 +85,15 @@ public class WelcomeTutorial extends Tutorial { "Here, you can play our " + _elem + "Classics" + _main + " game modes.", "", - _elem + "MineKart" + _main + " is an exciting racing game.", - "Complete with weapons, drifting and more!", - "", "In " + _elem + "Super Smash Mobs" + _main + " you become a monster,", - "then fight to the death with other players, using fun skills!" + "then fight to the death with other players, using fun skills!", + "", + _elem + "Draw My Thing" + _main + " is a drawing game where players", + "take turns at drawing and guessing the word.", + //"", + //"In " + _elem + "Block Hunt" + _main + " you turn into a block", + //"and hide from the Hunters until the time is up!", + } )); @@ -120,7 +125,7 @@ public class WelcomeTutorial extends Tutorial "The easiest way is to walk through the portal.", "This will join the best available server!", "", - "Click the " + _elem + "Wither Skeleton" + _main + " to open the " + _elem + "Server Menu" + _main + ".", + "Click the " + _elem + "Game NPC" + _main + " to open the " + _elem + "Server Menu" + _main + ".", "Here, you can manually pick which server to join!", } )); diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java index e0726f71c..f8d9b82e8 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java @@ -266,7 +266,7 @@ public class DamageManager extends MiniPlugin event.GetCause() == DamageCause.PROJECTILE || event.GetCause() == DamageCause.CUSTOM ))// && event.GetDamage() > 2) - bruteBonus = Math.min(8, event.GetDamage()); + bruteBonus = Math.min(8, event.GetDamage()*2); //Do Damage HandleDamage(event.GetDamageeEntity(), event.GetDamagerEntity(true), event.GetCause(), (float)(event.GetDamage() + bruteBonus), event.IgnoreArmor()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java index 9aa766f43..02f6069f8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -80,7 +80,6 @@ public class Arcade extends JavaPlugin implements INautilusPlugin PreferencesManager preferenceManager = new PreferencesManager(this, _clientManager, _donationManager); new MessageManager(this, _clientManager, preferenceManager); - AntiStack antistack = new AntiStack(this); Creature creature = new Creature(this);