fixed an NPE that was causing games not to end in MS
This commit is contained in:
parent
be910cced9
commit
97a144150b
@ -1,6 +1,7 @@
|
|||||||
package mineplex.core.recharge;
|
package mineplex.core.recharge;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -218,6 +219,26 @@ public class Recharge extends MiniPlugin
|
|||||||
{
|
{
|
||||||
_recharge.put(player.getName(), new NautHashMap<String, RechargeData>());
|
_recharge.put(player.getName(), new NautHashMap<String, RechargeData>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Reset(Player player, String stringContains)
|
||||||
|
{
|
||||||
|
NautHashMap<String, RechargeData> data = _recharge.get(player.getName());
|
||||||
|
|
||||||
|
if (data == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<String> rechargeIter = data.keySet().iterator();
|
||||||
|
|
||||||
|
while (rechargeIter.hasNext())
|
||||||
|
{
|
||||||
|
String key = rechargeIter.next();
|
||||||
|
|
||||||
|
if (key.toLowerCase().contains(stringContains.toLowerCase()))
|
||||||
|
{
|
||||||
|
rechargeIter.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void debug(Player player, String ability)
|
public void debug(Player player, String ability)
|
||||||
{
|
{
|
||||||
|
@ -1927,14 +1927,7 @@ public class MineStrike extends TeamGame
|
|||||||
{
|
{
|
||||||
player.playSound(player.getLocation(), Sound.LEVEL_UP, 1f, 1f);
|
player.playSound(player.getLocation(), Sound.LEVEL_UP, 1f, 1f);
|
||||||
|
|
||||||
//Clear reloading things
|
Recharge.Instance.Reset(player, "reload");
|
||||||
for (String recharge : Recharge.Instance.Get(player).keySet())
|
|
||||||
{
|
|
||||||
if (!recharge.toLowerCase().contains("reload"))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Recharge.Instance.recharge(player, recharge);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UtilTextMiddle.display(null, winnerLine, 20, 120, 20);
|
UtilTextMiddle.display(null, winnerLine, 20, 120, 20);
|
||||||
|
Loading…
Reference in New Issue
Block a user