diff --git a/Plugins/.idea/libraries/NoCheatPlus.xml b/Plugins/.idea/libraries/NoCheatPlus.xml new file mode 100644 index 000000000..92bd59440 --- /dev/null +++ b/Plugins/.idea/libraries/NoCheatPlus.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerStats/PlayerStatsRepository.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerStats/PlayerStatsRepository.java index 619c42a18..4c7c3b23c 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerStats/PlayerStatsRepository.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerStats/PlayerStatsRepository.java @@ -84,17 +84,8 @@ public class PlayerStatsRepository catch (Exception exception) { exception.printStackTrace(); - - try - { - Thread.sleep(10); - } - catch (InterruptedException e) - { - e.printStackTrace(); - } - - return addPlayer(playerName); + + return false; } finally { diff --git a/Plugins/Mineplex.Core/Mineplex.Core.iml b/Plugins/Mineplex.Core/Mineplex.Core.iml index d331f2503..1a3abf88d 100644 --- a/Plugins/Mineplex.Core/Mineplex.Core.iml +++ b/Plugins/Mineplex.Core/Mineplex.Core.iml @@ -19,5 +19,6 @@ + \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/database/RepositoryBase.java b/Plugins/Mineplex.Core/src/mineplex/core/database/RepositoryBase.java index fbaca419e..2e8507ee7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/database/RepositoryBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/database/RepositoryBase.java @@ -107,6 +107,10 @@ public abstract class RepositoryBase implements Listener if (callable != null) callable.processResultSet(preparedStatement.getGeneratedKeys()); } + catch (SQLException exception) + { + // exception.getSQLState() + } catch (Exception exception) { exception.printStackTrace(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java index 463224286..e93f556da 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java @@ -277,6 +277,8 @@ public class Treasure _rewards[_currentReward].giveReward("Treasure", _player); } + _currentReward = _rewards.length; + // Remove any extra blocks resetBlockInfo(_chestBlockInfo); resetBlockInfo(_openedChestBlockInfo); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java index 60571e757..8911e6d3a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java @@ -169,7 +169,7 @@ public class TreasureLocation implements Listener treasure.update(); - if (treasure.isFinished() && treasure.getFinishedTickCount() >= 80) + if (!treasure.getPlayer().isOnline() || (treasure.isFinished() && treasure.getFinishedTickCount() >= 80)) { treasure.cleanup(); @@ -191,24 +191,6 @@ public class TreasureLocation implements Listener } } - @EventHandler - public void preventGadgetBlockEvent(GadgetBlockEvent event) - { - if (isTreasureInProgress()) - { - List blocks = event.getBlocks(); - - for (Block block : blocks) - { - if (_currentTreasure.containsBlock(block)) - { - event.setCancelled(true); - return; - } - } - } - } - @EventHandler(priority = EventPriority.HIGH) public void interact(PlayerInteractEvent event) { @@ -237,6 +219,10 @@ public class TreasureLocation implements Listener @EventHandler public void inventoryOpen(InventoryOpenEvent event) { + // Ignore punish gui + if (event.getInventory().getTitle() != null && event.getInventory().getTitle().contains("Punish")) + return; + if (isTreasureInProgress() && event.getPlayer().equals(_currentTreasure.getPlayer())) { event.setCancelled(true); @@ -268,7 +254,7 @@ public class TreasureLocation implements Listener Location centerLocation = _currentTreasure.getCenterBlock().getLocation().add(0.5, 1.5, 0.5); double toDistanceFromCenter = centerLocation.distanceSquared(toLocation); - if (toDistanceFromCenter <= 16 && player.getVelocity().lengthSquared() < 10) + if (toDistanceFromCenter <= 16) { // Only cancel movement if they are moving towards the center double fromDistanceFromCenter = centerLocation.distanceSquared(fromLocation); @@ -276,7 +262,7 @@ public class TreasureLocation implements Listener { Location spawnLocation = new Location(player.getWorld(), 0, 64, 0); UtilAction.velocity(player, UtilAlg.getTrajectory(player.getLocation(), spawnLocation).multiply(-1), 1.5, true, 0.8, 0, 1.0, true); - event.setTo(event.getFrom()); +// event.setTo(event.getFrom()); } } } @@ -293,6 +279,29 @@ public class TreasureLocation implements Listener } } + @EventHandler + public void preventGadgetBlockEvent(GadgetBlockEvent event) + { + List blocks = event.getBlocks(); + + int x = _chestBlock.getX(); + int y = _chestBlock.getY(); + int z = _chestBlock.getZ(); + + for (Block block : blocks) + { + int dx = Math.abs(x - block.getX()); + int dy = Math.abs(y - block.getY()); + int dz = Math.abs(z - block.getZ()); + + if (dx <= 4 && dz <= 4 && dy <= 4) + { + event.setCancelled(true); + return; + } + } + } + @EventHandler public void quit(PlayerQuitEvent event) { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java index b2183b4c1..cf3f18f75 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java @@ -1,8 +1,8 @@ package mineplex.game.clans; import org.bukkit.plugin.java.JavaPlugin; - import net.minecraft.server.v1_7_R4.MinecraftServer; + import mineplex.core.account.CoreClientManager; import mineplex.core.antihack.AntiHack; import mineplex.core.blockrestore.BlockRestore; @@ -62,22 +62,24 @@ public class Clans extends JavaPlugin new ServerConfiguration(this); - PreferencesManager preferenceManager = new PreferencesManager(this, _clientManager, _donationManager); + PreferencesManager preferenceManager = new PreferencesManager(this, _clientManager, _donationManager); ServerStatusManager serverStatusManager = new ServerStatusManager(this, _clientManager, new LagMeter(this, _clientManager)); new Spawn(this, serverStatusManager.getCurrentServerName()); Teleport teleport = new Teleport(this); Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName()); - new MessageManager(this, _clientManager, preferenceManager, new IgnoreManager(this, _clientManager, preferenceManager, portal), null); new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion()); Punish punish = new Punish(this, webServerAddress, _clientManager); AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager); AntiHack.Instance.setKick(false); - + BlockRestore blockRestore = new BlockRestore(this); - + + IgnoreManager ignoreManager = new IgnoreManager(this, _clientManager, preferenceManager, portal); + new MessageManager(this, _clientManager, preferenceManager, ignoreManager, punish); + new MemoryFix(this); new Explosion(this, blockRestore); new FriendManager(this, _clientManager, preferenceManager, portal); diff --git a/Plugins/Mineplex.MapParser/Mineplex.MapParser.iml b/Plugins/Mineplex.MapParser/Mineplex.MapParser.iml index d4443f18f..86ec89ce9 100644 --- a/Plugins/Mineplex.MapParser/Mineplex.MapParser.iml +++ b/Plugins/Mineplex.MapParser/Mineplex.MapParser.iml @@ -9,6 +9,6 @@ + - - + \ No newline at end of file