Various fixes

This commit is contained in:
Shaun Bennett 2015-08-10 04:51:11 -05:00
parent b8b19ed4a5
commit 8745884153
3 changed files with 25 additions and 6 deletions

View File

@ -223,6 +223,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
{ {
if (data) if (data)
{ {
incrementVoteStreak(player);
addPendingExplosion(player, player.getName()); addPendingExplosion(player, player.getName());
awardBonus(player, getVoteBonusAmount(player)); awardBonus(player, getVoteBonusAmount(player));
UtilPlayer.message(player, F.main("Vote", "Thanks for your vote!")); UtilPlayer.message(player, F.main("Vote", "Thanks for your vote!"));
@ -493,6 +494,16 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
data.setMaxDailyStreak(data.getDailyStreak()); data.setMaxDailyStreak(data.getDailyStreak());
} }
public void incrementVoteStreak(Player player)
{
BonusClientData data = Get(player);
data.setVoteStreak(data.getVoteStreak() + 1);
if (data.getVoteStreak() > data.getMaxVoteStreak())
data.setMaxVoteStreak(data.getVoteStreak());
}
public boolean continueStreak(long localLastBonus, long extendTime) public boolean continueStreak(long localLastBonus, long extendTime)
{ {
long maxTime = localLastBonus + TIME_BETWEEN_BONUSES + extendTime; long maxTime = localLastBonus + TIME_BETWEEN_BONUSES + extendTime;
@ -884,7 +895,9 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
public void UnloadPlayer(final ClientUnloadEvent event) public void UnloadPlayer(final ClientUnloadEvent event)
{ {
final BonusClientData clientData = Get(event.GetName()); final BonusClientData clientData = Get(event.GetName());
clientData.getHologram().stop();
if (clientData.getHologram() != null)
clientData.getHologram().stop();
runAsync(new Runnable() runAsync(new Runnable()
{ {

View File

@ -25,6 +25,7 @@ import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
@ -66,12 +67,12 @@ import mineplex.core.gadget.event.GadgetActivateEvent;
import mineplex.core.gadget.event.GadgetCollideEntityEvent; import mineplex.core.gadget.event.GadgetCollideEntityEvent;
import mineplex.core.hologram.HologramManager; import mineplex.core.hologram.HologramManager;
import mineplex.core.inventory.InventoryManager; import mineplex.core.inventory.InventoryManager;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.message.PrivateMessageEvent; import mineplex.core.message.PrivateMessageEvent;
import mineplex.core.mount.MountManager; import mineplex.core.mount.MountManager;
import mineplex.core.mount.event.MountActivateEvent; import mineplex.core.mount.event.MountActivateEvent;
import mineplex.core.notifier.NotificationManager; import mineplex.core.notifier.NotificationManager;
import mineplex.core.npc.NpcManager; import mineplex.core.npc.NpcManager;
import mineplex.core.packethandler.PacketHandler;
import mineplex.core.party.Party; import mineplex.core.party.Party;
import mineplex.core.party.PartyManager; import mineplex.core.party.PartyManager;
import mineplex.core.personalServer.PersonalServerManager; import mineplex.core.personalServer.PersonalServerManager;
@ -86,6 +87,7 @@ import mineplex.core.treasure.TreasureManager;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.bonuses.BonusManager; import mineplex.core.bonuses.BonusManager;
import mineplex.hub.commands.DisguiseCommand;
import mineplex.hub.commands.ForcefieldRadius; import mineplex.hub.commands.ForcefieldRadius;
import mineplex.hub.commands.GadgetToggle; import mineplex.hub.commands.GadgetToggle;
import mineplex.hub.commands.GameModeCommand; import mineplex.hub.commands.GameModeCommand;
@ -93,8 +95,10 @@ import mineplex.hub.commands.NewsCommand;
import mineplex.hub.modules.ForcefieldManager; import mineplex.hub.modules.ForcefieldManager;
import mineplex.hub.modules.HubVisibilityManager; import mineplex.hub.modules.HubVisibilityManager;
import mineplex.hub.modules.JumpManager; import mineplex.hub.modules.JumpManager;
import mineplex.hub.modules.KothManager;
import mineplex.hub.modules.NewsManager; import mineplex.hub.modules.NewsManager;
import mineplex.hub.modules.ParkourManager; import mineplex.hub.modules.ParkourManager;
import mineplex.hub.modules.SoccerManager;
import mineplex.hub.modules.TextManager; import mineplex.hub.modules.TextManager;
import mineplex.hub.modules.WorldManager; import mineplex.hub.modules.WorldManager;
import mineplex.core.poll.PollManager; import mineplex.core.poll.PollManager;
@ -102,6 +106,8 @@ import mineplex.hub.profile.gui.GUIProfile;
import mineplex.hub.tutorial.TutorialManager; import mineplex.hub.tutorial.TutorialManager;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent; 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.condition.ConditionManager;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
@ -151,7 +157,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
//Admin //Admin
private boolean _gadgetsEnabled = true; private boolean _gadgetsEnabled = true;
public HubManager(JavaPlugin plugin, BlockRestore blockRestore, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DisguiseManager disguiseManager, TaskManager taskManager, Portal portal, PartyManager partyManager, PreferencesManager preferences, PetManager petManager, PollManager pollManager, StatsManager statsManager, AchievementManager achievementManager, HologramManager hologramManager, NpcManager npcManager, PersonalServerManager personalServerManager) public HubManager(JavaPlugin plugin, BlockRestore blockRestore, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DisguiseManager disguiseManager, TaskManager taskManager, Portal portal, PartyManager partyManager, PreferencesManager preferences, PetManager petManager, PollManager pollManager, StatsManager statsManager, AchievementManager achievementManager, HologramManager hologramManager, NpcManager npcManager, PersonalServerManager personalServerManager, PacketHandler packetHandler)
{ {
super("Hub Manager", plugin); super("Hub Manager", plugin);
@ -182,7 +188,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
_mountManager = new MountManager(_plugin, clientManager, donationManager, blockRestore, _disguiseManager); _mountManager = new MountManager(_plugin, clientManager, donationManager, blockRestore, _disguiseManager);
_inventoryManager = new InventoryManager(plugin, clientManager); _inventoryManager = new InventoryManager(plugin, clientManager);
new BenefitManager(plugin, clientManager, _inventoryManager); new BenefitManager(plugin, clientManager, _inventoryManager);
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin)); _gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager);
RewardManager rewardManager = new RewardManager(clientManager, donationManager, _inventoryManager, petManager, statsManager, RewardManager rewardManager = new RewardManager(clientManager, donationManager, _inventoryManager, petManager, statsManager,
100, 250, 100, 250,
@ -984,7 +990,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
@EventHandler @EventHandler
public void openProfile(PlayerInteractEvent event) public void openProfile(PlayerInteractEvent event)
{ {
if(event.getItem().getType() != Material.SKULL_ITEM) if(event.getItem() == null || event.getItem().getType() != Material.SKULL_ITEM)
return; return;
new GUIProfile(getPlugin(), event.getPlayer(), _preferences, _achievementManager, _personalServerManager).openInventory();; new GUIProfile(getPlugin(), event.getPlayer(), _preferences, _achievementManager, _personalServerManager).openInventory();;

View File

@ -105,7 +105,7 @@ public class VotifierManager extends MiniPlugin
// Currently we just notify all servers, and the server with the player on it can deal with it // Currently we just notify all servers, and the server with the player on it can deal with it
notifyServer(playerName, false); notifyServer(playerName, false);
notifyServer(playerName, true); // notifyServer(playerName, true);
} }
private void notifyServer(String playerName, boolean eu) private void notifyServer(String playerName, boolean eu)