Address all the useful sentry errors

This commit is contained in:
Dan Mulloy 2017-11-12 23:37:10 -05:00 committed by Alexander Meech
parent 1b4f9227a7
commit f1e48ff90c
6 changed files with 52 additions and 19 deletions

View File

@ -59,7 +59,10 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown
UtilAction.velocity(item, player.getLocation().getDirection(),
1, false, 0, 0.2, 10, false);
Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, true,
// Breakpoints for a sentry error
Manager
.getProjectileManager()
.AddThrow(item, player, this, -1, true, true, true, true,
null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f);
//Inform

View File

@ -49,11 +49,11 @@ public class WinEffectPodium extends WinEffectGadget
@EventHandler
public void onUpdate(UpdateEvent event)
{
if (!isRunning()) return;
if (event.getType() == UpdateType.FASTER)
{
if (_npc != null)
_npc.sendHit();
}

View File

@ -1,5 +1,6 @@
package mineplex.serverdata;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import com.google.gson.Gson;
@ -165,7 +166,17 @@ public class Utility
try (Jedis jedis = pool.getResource())
{
currentTime = Long.parseLong(jedis.time().get(0));
// Try multiple times in case one isn't valid
// Addresses an error in sentry
List<String> times = jedis.time();
for (String time : times.subList(0, Math.min(5, times.size())))
{
try
{
currentTime = Long.parseLong(time);
break;
} catch (NumberFormatException ex) { }
}
}
_millisTimeDifference = (currentTime * 1000) - System.currentTimeMillis();

View File

@ -3,11 +3,14 @@ package nautilus.game.arcade.game.games.evolution.kits;
import mineplex.core.achievement.Achievement;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.core.combat.CombatComponent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.ProgressingKit;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@ -60,23 +63,34 @@ public class KitHealth extends ProgressingKit
{
return;
}
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
CombatComponent component = event.GetLog().GetKiller();
if (component == null)
{
return;
}
Player killer = Bukkit.getPlayer(component.getUniqueIdOfEntity());
if (killer == null || !killer.isOnline())
{
return;
}
if (!Manager.IsAlive(killer))
{
return;
}
if (UtilPlayer.isSpectator(killer))
{
return;
}
if (!HasKit(killer))
{
return;
}
UtilPlayer.health(killer, 9999);
}
}

View File

@ -922,6 +922,7 @@ public class GameFlagManager implements Listener
return;
if (game.HungerSet != -1)
{
for (Player player : game.GetPlayers(true))
{
if (Manager.GetCondition().HasCondition(player, ConditionType.ARCADE_HUNGER_DISABLE, null))
@ -930,11 +931,14 @@ public class GameFlagManager implements Listener
player.setFoodLevel(game.HungerSet);
player.setSaturation(1F);
}
}
if (game.HealthSet != -1)
{
for (Player player : game.GetPlayers(true))
{
player.setHealth(game.HealthSet);
player.setHealth(Math.min(game.HealthSet, player.getMaxHealth()));
}
}
}

View File

@ -119,6 +119,7 @@ public class GemHuntersTutorial extends Tutorial implements Listener
{
if (isInTutorial(player) && !player.isFlying())
{
player.setAllowFlight(true);
player.setFlying(true);
}
}