hub fixes

This commit is contained in:
Mini-Chiss 2015-08-09 17:21:56 +02:00
parent b974fcf838
commit 5a7de8ef3d
6 changed files with 32 additions and 142 deletions

View File

@ -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;
}
}

View File

@ -402,8 +402,14 @@ public class PetManager extends MiniClientPlugin<PetClient>
RemovePet(player, true);
}
public void DisableAll(Player player)
{
RemovePet(player, true);
}
public Collection<Creature> getPets()
{
return _activePetOwners.values();
}
}

View File

@ -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));

View File

@ -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<HubClient>
private HashMap<Player, Scoreboard> _scoreboards = new HashMap<Player, Scoreboard>();
private String _pigStacker = "0 - Nobody";
private String _serverName = "";
private ItemStack _ruleBook = null;
private boolean _shuttingDown;
private HashMap<String, Long> _portalTime = new HashMap<String, Long>();
@ -208,141 +207,8 @@ public class HubManager extends MiniClientPlugin<HubClient>
// 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
@ -556,9 +422,6 @@ public class HubManager extends MiniClientPlugin<HubClient>
//Health
player.setHealth(20);
//Rules
player.getInventory().setItem(2, _ruleBook);
//Scoreboard
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
player.setScoreboard(board);
@ -737,6 +600,12 @@ public class HubManager extends MiniClientPlugin<HubClient>
event.getEntity().teleport(GetSpawn());
}
@EventHandler
public void combatDeath(CombatDeathEvent event)
{
event.SetBroadcastType(DeathMessageType.None);
}
@EventHandler
public void FoodHealthUpdate(UpdateEvent event)
{

View File

@ -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
{

View File

@ -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
{