From 1eaa6446af88627968fc05f9b382cab5fc545031 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Fri, 14 Aug 2015 21:14:34 -0500 Subject: [PATCH] Fix double hologram and hopefully NPE --- .../src/mineplex/core/bonuses/BonusManager.java | 7 +++++-- .../Mineplex.Core/src/mineplex/core/hologram/Hologram.java | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java index 747bc2307..4156d6974 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java @@ -278,7 +278,7 @@ public class BonusManager extends MiniClientPlugin implements I return _voteStreak; } - public void handleVote(final Player player, final int gemsRecieved) + public void handleVote(final Player player, final int gemsReceived) { final int accountId = _clientManager.getAccountId(player); @@ -297,11 +297,14 @@ public class BonusManager extends MiniClientPlugin implements I @Override public void run() { + BonusClientData oldData = Get(player); + if (oldData != null) data.setHologram(oldData.getHologram()); Set(player, data); + _statsManager.incrementStat(player, "Global.DailyVote", 1); addPendingExplosion(player, player.getName()); UtilPlayer.message(player, F.main("Carl", "Thanks for voting for Mineplex!")); - UtilPlayer.message(player, F.main("Carl", "You received " + F.elem(gemsRecieved + " Gems") + " and " + F.elem("1 Carl Spinner Ticket") + "!")); + UtilPlayer.message(player, F.main("Carl", "You received " + F.elem(gemsReceived + " Gems") + " and " + F.elem("1 Carl Spinner Ticket") + "!")); } }); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/hologram/Hologram.java b/Plugins/Mineplex.Core/src/mineplex/core/hologram/Hologram.java index 7b470f779..fd5311707 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/hologram/Hologram.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/hologram/Hologram.java @@ -532,8 +532,6 @@ public class Hologram if (newText.equals(_hologramText)) return this; - _makeSpawnPackets = true; - if (isInUse()) { int[] destroy1_7 = new int[0]; @@ -632,6 +630,7 @@ public class Hologram } _hologramText = newText; + makeSpawnPackets(); return this; }