From 9e7629b1fe11eb1a1fd07dbee56bfa561fb86593 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Sun, 18 Oct 2015 00:21:01 -0500 Subject: [PATCH 1/3] Added 43k player chest benefit. Updated MOTD. --- .../src/mineplex/bungee/motd/MotdManager.java | 2 +- .../core/benefit/benefits/Players43k.java | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/benefit/benefits/Players43k.java diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java index 855d6fc95..c1cba124c 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -55,7 +55,7 @@ public class MotdManager implements Listener, Runnable //String motdLine = "§f§l◄ §c§lMaintenance§f§l ►"; //String motdLine = "§f§l◄ §a§lCarl the Creeper§f§l ►"; - String motdLine = " §2§l§n M O N S T E R M A Z E §f"; + String motdLine = " §2§l§n M O N S T E R M A Z E B E T A §f"; //String motdLine = " §f§l◄ §a§lCarl the Creeper§f§l ▬ §c§l75% OFF SALE§f§l ►"; //String motdLine = " §d§lRank Sale §a§l40% Off"); //String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►"); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/benefit/benefits/Players43k.java b/Plugins/Mineplex.Core/src/mineplex/core/benefit/benefits/Players43k.java new file mode 100644 index 000000000..1bfd155fe --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/benefit/benefits/Players43k.java @@ -0,0 +1,45 @@ +package mineplex.core.benefit.benefits; + +import mineplex.core.benefit.BenefitManager; +import mineplex.core.benefit.BenefitManagerRepository; +import mineplex.core.common.util.C; +import mineplex.core.common.util.Callback; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.inventory.InventoryManager; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +public class Players43k extends BenefitBase +{ + private InventoryManager _inventoryManager; + + public Players43k(BenefitManager plugin, BenefitManagerRepository repository, InventoryManager inventoryManager) + { + super(plugin, "Players43k", repository); + + _inventoryManager = inventoryManager; + } + + @Override + public void rewardPlayer(final Player player) + { + _inventoryManager.addItemToInventory(new Callback() + { + public void run(Boolean success) + { + if (success) + { + UtilPlayer.message(player, C.cGold + C.Strike + "============================================="); + UtilPlayer.message(player, ""); + UtilPlayer.message(player, "To celebrate hitting 43,000 players online,"); + UtilPlayer.message(player, "everyone receives a prize! You're awesome!"); + UtilPlayer.message(player, ""); + UtilPlayer.message(player, "You received 3 Ancient Chests!"); + UtilPlayer.message(player, ""); + UtilPlayer.message(player, C.cGold + C.Strike + "============================================="); + } + } + }, player, "Ancient Chest", 3); + } +} From 6d7f15cd6d8880ca0e04cb0b191acae54ba24160 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Sun, 18 Oct 2015 18:52:16 -0400 Subject: [PATCH 2/3] Fix hub time after light flicker --- .../src/mineplex/core/titangiveaway/LightFlicker.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/LightFlicker.java b/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/LightFlicker.java index 483df366d..dbebdb828 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/LightFlicker.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/LightFlicker.java @@ -31,6 +31,7 @@ public class LightFlicker extends BukkitRunnable { _world.setTime(_previousTime); cancel(); + return; } if (_ticks % 5 == 0) From 5e307da15a57f5d190846b63eeb6c3674fa9d383 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 19 Oct 2015 01:32:12 -0500 Subject: [PATCH 3/3] Fix for inventory failure. --- .../src/mineplex/core/benefit/BenefitManager.java | 2 +- .../src/mineplex/core/cosmetic/ui/page/PetTagPage.java | 1 - .../src/mineplex/core/inventory/InventoryManager.java | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/benefit/BenefitManager.java b/Plugins/Mineplex.Core/src/mineplex/core/benefit/BenefitManager.java index 0301e0225..a6caf2cdb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/benefit/BenefitManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/benefit/BenefitManager.java @@ -31,7 +31,7 @@ public class BenefitManager extends MiniDbClientPlugin //_benefits.add(new Christmas2014(plugin, _repository, inventoryManager)); //_benefits.add(new Thanksgiving2014(plugin, _repository, inventoryManager)); - //_benefits.add(new Players40k(this, _repository, inventoryManager)); + _benefits.add(new Players43k(this, _repository, inventoryManager)); } @EventHandler(priority = EventPriority.LOWEST) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java index bebe91708..7477a2492 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java @@ -110,7 +110,6 @@ public class PetTagPage extends ShopPageBase getPlugin().getPetManager().Get(getPlayer()).GetPets().put(_pet.GetPetType(), token.PetName); - getPlugin().getInventoryManager().addItemToInventory(null, getPlayer(), _pet.GetPetType().toString(), 1); getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), getPlayer())); } }, null, _petPurchase ? _pet : tag, CurrencyType.Coins, getPlayer())); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java index c7c76207a..2560f2891 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java @@ -89,11 +89,6 @@ public class InventoryManager extends MiniDbClientPlugin if (!success) { System.out.println("Add item to Inventory FAILED for " + player.getName()); - - if (_items.containsKey(item)) - { - Get(player).addItem(new ClientItem(_items.get(item), -count)); - } } if (callback != null)