JK I found some more

This commit is contained in:
Dan Mulloy 2017-11-12 23:56:27 -05:00 committed by Alexander Meech
parent f1e48ff90c
commit 1944b2ecc9
6 changed files with 21 additions and 4 deletions

View File

@ -180,6 +180,7 @@ public abstract class TreasureAnimation implements Runnable
{ {
onFinish(); onFinish();
TreasureSession session = _treasureLocation.getSession(); TreasureSession session = _treasureLocation.getSession();
if (session != null)
UtilServer.CallEvent(new TreasureAnimationFinishEvent(session.getPlayer(), session, this)); UtilServer.CallEvent(new TreasureAnimationFinishEvent(session.getPlayer(), session, this));
} }
} }

View File

@ -29,6 +29,11 @@ public abstract class GameSummaryComponent<T>
public boolean sendMessage(Player player) public boolean sendMessage(Player player)
{ {
T result = _getFunction.apply(player); T result = _getFunction.apply(player);
if (result == null)
{
return false;
}
String mainText = getMainText(result); String mainText = getMainText(result);
List<String> hoverText = getHoverText(result); List<String> hoverText = getHoverText(result);

View File

@ -23,7 +23,7 @@ public class LevelUpSummaryComponent extends ExperienceSummaryComponent
@Override @Override
public String getMainText(Pair<AchievementLog, AchievementData> data) public String getMainText(Pair<AchievementLog, AchievementData> data)
{ {
if (!data.getLeft().LevelUp) if (data.getLeft() == null || !data.getLeft().LevelUp)
{ {
return null; return null;
} }

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade.kit.perks;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import mineplex.core.Managers;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
@ -141,6 +142,9 @@ public class PerkFletcher extends Perk
if (event.getType() != UpdateType.FAST) if (event.getType() != UpdateType.FAST)
return; return;
if (Manager.GetGame() == null)
return;
if (!UtilTime.elapsed(Manager.GetGame().getGameLiveTime(), _time * 1000) && !_instant) if (!UtilTime.elapsed(Manager.GetGame().getGameLiveTime(), _time * 1000) && !_instant)
{ {
return; return;

View File

@ -12,6 +12,7 @@ import nautilus.game.arcade.Arcade;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.kit.Kit;
/** /**
* WinQuestTracker * WinQuestTracker
@ -41,7 +42,13 @@ public class WinQuestTracker extends QuestTracker<Game>
for (Player player : winners) for (Player player : winners)
{ {
incrementQuests(player, 1, ((Arcade) UtilServer.getPlugin()).getServerConfig().getServerGroup().getPrefix(), getGame().GetKit(player).GetName() + "Kit"); Kit kit = getGame().GetKit(player);
if (kit != null)
{
incrementQuests(player, 1,
((Arcade) UtilServer.getPlugin()).getServerConfig().getServerGroup().getPrefix(),
kit.GetName() + "Kit");
}
} }
} }

View File

@ -46,7 +46,7 @@ public class KillPlayerQuest extends Quest
{ {
Player player = event.getPlayer(); Player player = event.getPlayer();
if (!isActive(player) || !event.getReason().startsWith("Killing")) if (!isActive(player) || event.getReason() == null || !event.getReason().startsWith("Killing"))
{ {
return; return;
} }