From 0039b7928189f98cb7cbc742eeb0599bbbe431fd Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Wed, 16 Nov 2016 20:23:14 -0500 Subject: [PATCH] Change Youtube Button Link (#275) * Fix possible NPE in Preferences * Change youtube button link --- .../src/mineplex/core/bonuses/gui/buttons/YoutubeButton.java | 4 ++-- .../src/mineplex/core/preferences/PreferencesManager.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/YoutubeButton.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/YoutubeButton.java index 477fa382d..cab491f83 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/YoutubeButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/YoutubeButton.java @@ -85,8 +85,8 @@ public class YoutubeButton implements GuiItem UtilPlayer.message(_player, C.cGold + C.Bold + C.Strike + "============================================="); UtilPlayer.message(_player, ""); - new JsonMessage(" " + C.Bold + "Click to Open in Web Browser and " + message).click(ClickEvent.OPEN_URL, "https://www.youtube.com/embed/RW3sOmkiEG-A?list=UU1MtBclG_aHPd0nLmUupCKg&controls=0&showinfo=0&autoplay=1").sendToPlayer(_player); - new JsonMessage( " " + C.cGreen + C.Line + "http://youtube.com/mineplexgamesofficial").click(ClickEvent.OPEN_URL, "https://www.youtube.com/embed/RW3sOmkiEG-A?list=UU1MtBclG_aHPd0nLmUupCKg&controls=0&showinfo=0&autoplay=1").sendToPlayer(_player); + new JsonMessage(" " + C.Bold + "Click to Open in Web Browser and " + message).click(ClickEvent.OPEN_URL, "http://file.mineplex.com/ads.php").sendToPlayer(_player); + new JsonMessage( " " + C.cGreen + C.Line + "http://youtube.com/mineplexgamesofficial").click(ClickEvent.OPEN_URL, "http://file.mineplex.com/ads.php").sendToPlayer(_player); UtilPlayer.message(_player, ""); UtilPlayer.message(_player, C.cGold + C.Bold + C.Strike + "============================================="); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java index ca98268ad..15a9d01ff 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java @@ -65,7 +65,8 @@ public class PreferencesManager extends MiniPlugin implements ILoginProcessor { Player player = event.getPlayer(); int accountId = _clientManager.getAccountId(player); - _repository.saveUserPreferences(_preferences.remove(accountId)); + UserPreferences p = _preferences.remove(accountId); + if (p != null) _repository.saveUserPreferences(p); } @EventHandler