From 5a7de8ef3d26f881e21e35675616b0f804515712 Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Sun, 9 Aug 2015 17:21:56 +0200 Subject: [PATCH] hub fixes --- .../src/mineplex/core/mount/MountManager.java | 8 + .../src/mineplex/core/pet/PetManager.java | 6 + .../mineplex/core/reward/RewardManager.java | 3 +- .../src/mineplex/hub/HubManager.java | 147 +----------------- .../src/mineplex/hub/modules/KothManager.java | 5 +- .../mineplex/hub/modules/SoccerManager.java | 5 +- 6 files changed, 32 insertions(+), 142 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java index 00dcd9fdb..38152a878 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java @@ -115,6 +115,12 @@ public class MountManager extends MiniPlugin mount.Disable(player); } + public void DisableAll(Player player) + { + for (Mount mount : _types) + mount.Disable(player); + } + @EventHandler public void quit(PlayerQuitEvent event) { @@ -161,4 +167,6 @@ public class MountManager extends MiniPlugin { return _disguiseManager; } + + } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index b50fc27b4..a95bcb150 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -401,9 +401,15 @@ public class PetManager extends MiniClientPlugin for (Player player : UtilServer.getPlayers()) RemovePet(player, true); } + + public void DisableAll(Player player) + { + RemovePet(player, true); + } public Collection getPets() { return _activePetOwners.values(); } + } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java index 775ab3cd5..539e9e124 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java @@ -22,6 +22,7 @@ import mineplex.core.reward.rewards.InventoryReward; import mineplex.core.reward.rewards.PetReward; import mineplex.core.reward.rewards.RankReward; import mineplex.core.reward.rewards.UnknownPackageReward; +import mineplex.core.timing.TimingManager; public class RewardManager { @@ -269,7 +270,7 @@ public class RewardManager new ItemStack(Material.INK_SACK, 1, (short) 0, (byte) 4), rarity, 13)); addReward(new UnknownPackageReward(donationManager, "Blood Helix Particles", "Blood Helix", new ItemStack(Material.REDSTONE), rarity, 10)); - addReward(new UnknownPackageReward(donationManager, "Emerald Twirl Particles", "Green Ring", + addReward(new UnknownPackageReward(donationManager, "Green Rings Particles", "Green Ring", new ItemStack(Material.EMERALD), rarity, 8)); addReward(new UnknownPackageReward(donationManager, "Flame Fairy Particles", "Flame Fairy", new ItemStack(Material.APPLE), rarity, 4)); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 65e2ae685..e1cf08feb 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -65,6 +65,8 @@ import mineplex.hub.poll.PollManager; import mineplex.hub.tutorial.TutorialManager; import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent; +import mineplex.minecraft.game.core.combat.DeathMessageType; +import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.condition.ConditionManager; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -137,11 +139,8 @@ public class HubManager extends MiniClientPlugin private HashMap _scoreboards = new HashMap(); - private String _pigStacker = "0 - Nobody"; private String _serverName = ""; - private ItemStack _ruleBook = null; - private boolean _shuttingDown; private HashMap _portalTime = new HashMap(); @@ -208,141 +207,8 @@ public class HubManager extends MiniClientPlugin // NotificationManager notificationManager = new NotificationManager(plugin, clientManager, donationManager); // new MailManager(_plugin, notificationManager); - _ruleBook = ItemStackFactory.Instance.CreateStack(Material.WRITTEN_BOOK, (byte)0, 1, ChatColor.GREEN + "Rule Book", new String[] { }); - BookMeta meta = (BookMeta)_ruleBook.getItemMeta(); _serverName = getPlugin().getConfig().getString("serverstatus.name"); _serverName = _serverName.substring(0, Math.min(16, _serverName.length())); - - meta.addPage("§m-------------------§r\n" - + "Welcome to §6§lMineplex§r\n" - + "§r§0§l§r§m§0§m-------------------§r§0\n" - + "\n" - + "§2Please §0take a moment to read through this book!\n" - + "\n" - + "\n" - + "Part 1 - Rules\n" - + "\n" - + "Part 2 - FAQ\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l1.§§§r §4No§r spamming.\n" - + "\n" - + "§0This is sending too many messages and/or repeating the same message in a short period of time.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l2.§m§r §4No§0 use of excessive caps.\n" - + "\n" - + "This is sending messages with an excessive amount of capital letters.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l3.§r §4No§0 hacking or use of any unapproved mods.\n" - + "\n" - + "This means we do not tolerate any sort of hacked client or any unapproved mods, such as fly hacks.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l4.§r §4No§0 advertising non-Mineplex related links.\n" - + "\n" - + "This is when a link is sent in chat which directs others to non-Mineplex related content.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l5.§r §4No§0 trolling or use of any exploits.\n" - + "\n" - + "This means that abuse of bugs/glitches is not tolerated. You also may not do things such as teamkilling and/or blocking spawns.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l6.§r §2Be§0 respectful to others, yourself, and the environment around you.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§rPlease report any bugs, exploits, and/or rule breakers on our forums with evidence.\n" - + "§omineplex.com/forums\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lWhat is stacker and how do you play it?\n" - + "\n" - + "§rStacker is a hub game where you can stack & throw players/mobs.\n" - + "\n" - + "§9Right-Click: pick up\n" - + "Left-Click: throw\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lHow do I get §bUltra§l, §5Hero§l, or §aLegend§l?\n" - + "\n" - + "§r§0You are able to purchase these ranks through our shop on our website at:\n" - + "\n" - + "§owww.mineplex.com/shop\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lWhy hasn't my rank been applied yet?\n" - + "\n" - + "§m§rYour rank may take a while to be applied. If it has been over 24 hours please contact:\n" - + "\n" - + "§omineplex.com/support\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lWhat do I do if I was wrongfully punished?\n" - + "\n" - + "§0If you believe you were wrongfully punished, please submit an appeal at:\n" - + "\n" - + "§omineplex.com/appeals\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lHow do I apply for Trainee?\n" - + "\n" - + "§rYou may only apply for Trainee if you have §bUltra§0, §5Hero§0, or §aLegend§0.\n" - + "Apply at:\n" - + "§omineplex.com/application\n"); - - meta.addPage("§m-------------------\n" - + "§r §6§lThank you for \n" - + " reading!§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "Remember to visit our website §2mineplex.com§0 for important news & updates!\n" - + "\n" - + "\n" - + "§c§lH§6§lA§a§lV§9§lE §c§lF§6§lU§a§lN§9§l!\n"); - - // These are needed or 1.8 clients will not show book correctly - meta.setTitle("Rule Book"); - meta.setAuthor("Mineplex"); - - _ruleBook.setItemMeta(meta); } @Override @@ -555,9 +421,6 @@ public class HubManager extends MiniClientPlugin //Health player.setHealth(20); - - //Rules - player.getInventory().setItem(2, _ruleBook); //Scoreboard Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard(); @@ -736,6 +599,12 @@ public class HubManager extends MiniClientPlugin event.getEntity().setHealth(20); event.getEntity().teleport(GetSpawn()); } + + @EventHandler + public void combatDeath(CombatDeathEvent event) + { + event.SetBroadcastType(DeathMessageType.None); + } @EventHandler public void FoodHealthUpdate(UpdateEvent event) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java index bacb4156a..cd465fce0 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java @@ -12,6 +12,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerVelocityEvent; import mineplex.core.MiniPlugin; import mineplex.core.common.util.C; @@ -196,6 +197,8 @@ public class KothManager extends MiniPlugin outfit.add("PvP Sword"); Manager.GetGadget().DisableAll(player, outfit); + Manager.GetMount().DisableAll(player); + Manager.getPetManager().DisableAll(player); } else { @@ -209,7 +212,7 @@ public class KothManager extends MiniPlugin { return _active.contains(player); } - + @EventHandler public void disableGadgets(GadgetActivateEvent event) { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java index d737d65d3..bafd2df86 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java @@ -15,6 +15,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.util.Vector; import mineplex.core.MiniPlugin; @@ -449,6 +450,8 @@ public class SoccerManager extends MiniPlugin outfit.add("Team Boots"); Manager.GetGadget().DisableAll(player, outfit); + Manager.GetMount().DisableAll(player); + Manager.getPetManager().DisableAll(player); } else { @@ -461,7 +464,7 @@ public class SoccerManager extends MiniPlugin { return _active.contains(player); } - + @EventHandler public void disableGadgets(GadgetActivateEvent event) {