From 67bdc6832f3fd73797e0fb38184bb5efaea4d836 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 24 Dec 2015 07:40:49 +1300 Subject: [PATCH 1/9] Tentative beginnings for clans resource packs --- .../Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java index d27dab663..67f785054 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java @@ -29,6 +29,7 @@ import mineplex.core.portal.Portal; import mineplex.core.preferences.PreferencesManager; import mineplex.core.punish.Punish; import mineplex.core.recharge.Recharge; +import mineplex.core.resourcepack.ResourcePackManager; import mineplex.core.serverConfig.ServerConfiguration; import mineplex.core.spawn.Spawn; import mineplex.core.stats.StatsManager; @@ -114,7 +115,8 @@ public class Clans extends JavaPlugin new Explosion(this, blockRestore); new FriendManager(this, _clientManager, preferenceManager, portal); new InventoryManager(this, _clientManager); - + new ResourcePackManager(this, portal); + // Enable custom-gear related managers PacketHandler packetHandler = new PacketHandler(this); new CustomTagFix(this, packetHandler); From 1d4a5e58040564e86bfa9a81d0f81cde1a038fa9 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 24 Dec 2015 07:47:05 +1300 Subject: [PATCH 2/9] Clean up imports, set resource pack on clans. --- .../src/mineplex/game/clans/Clans.java | 3 ++- .../src/nautilus/game/arcade/ArcadeManager.java | 13 ------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java index 67f785054..fd1887256 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java @@ -115,7 +115,8 @@ public class Clans extends JavaPlugin new Explosion(this, blockRestore); new FriendManager(this, _clientManager, preferenceManager, portal); new InventoryManager(this, _clientManager); - new ResourcePackManager(this, portal); + ResourcePackManager resourcePackManager = new ResourcePackManager(this, portal); + resourcePackManager.setResourcePack("http://file.mineplex.com/ResClans.zip", true); // Enable custom-gear related managers PacketHandler packetHandler = new PacketHandler(this); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 9403f9d7f..91616f58a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -3,15 +3,11 @@ package nautilus.game.arcade; import java.io.File; import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; -import java.util.Map.Entry; - import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.OfflinePlayer; -import org.bukkit.Sound; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Entity; @@ -31,14 +27,10 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.event.player.PlayerResourcePackStatusEvent; -import org.bukkit.event.player.PlayerResourcePackStatusEvent.Status; import org.bukkit.event.server.ServerListPingEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.util.Vector; -import com.google.common.base.Objects; - import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClientManager; import mineplex.core.achievement.AchievementManager; @@ -47,18 +39,14 @@ import mineplex.core.blood.Blood; import mineplex.core.bonuses.BonusManager; import mineplex.core.chat.Chat; import mineplex.core.common.Rank; -import mineplex.core.common.jsonchat.ClickEvent; -import mineplex.core.common.jsonchat.JsonMessage; import mineplex.core.common.util.C; import mineplex.core.common.util.Callback; import mineplex.core.common.util.F; -import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.creature.Creature; import mineplex.core.customdata.CustomDataManager; @@ -91,7 +79,6 @@ import mineplex.core.task.TaskManager; import mineplex.core.teleport.Teleport; import mineplex.core.timing.TimingManager; import mineplex.core.titangiveaway.TitanGiveawayManager; -import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.classcombat.Class.ClassManager; import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; From d08cfa0c4cec2a742c2c62bbf0e66dd2612330b1 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Fri, 25 Dec 2015 01:51:36 -0600 Subject: [PATCH 3/9] Holiday Gifts --- .../mineplex/core/common/weight}/Weight.java | 2 +- .../core/common/weight}/WeightSet.java | 2 +- .../game/clans/clans/loot/LootManager.java | 2 +- .../game/clans/gameplay/Gameplay.java | 4 +- .../game/clans/items/GearManager.java | 5 +- .../mineplex/game/clans/items/ItemType.java | 6 - .../src/mineplex/game/clans/spawn/Spawn.java | 4 +- .../src/mineplex/hub/HubManager.java | 3 + .../hub/modules/HolidayGiftManager.java | 118 ++++++++++++++++++ .../hub/modules/holidaygift/GemGift.java | 37 ++++++ .../hub/modules/holidaygift/GiftReward.java | 5 + .../hub/modules/holidaygift/HolidayGift.java | 10 ++ 12 files changed, 181 insertions(+), 17 deletions(-) rename Plugins/{Mineplex.Game.Clans/src/mineplex/game/clans/items/generation => Mineplex.Core.Common/src/mineplex/core/common/weight}/Weight.java (84%) rename Plugins/{Mineplex.Game.Clans/src/mineplex/game/clans/items/generation => Mineplex.Core.Common/src/mineplex/core/common/weight}/WeightSet.java (97%) create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/modules/HolidayGiftManager.java create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GemGift.java create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GiftReward.java create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/HolidayGift.java diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/generation/Weight.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/weight/Weight.java similarity index 84% rename from Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/generation/Weight.java rename to Plugins/Mineplex.Core.Common/src/mineplex/core/common/weight/Weight.java index 108347832..72c2a5fb3 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/generation/Weight.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/weight/Weight.java @@ -1,4 +1,4 @@ -package mineplex.game.clans.items.generation; +package mineplex.core.common.weight; public class Weight { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/generation/WeightSet.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/weight/WeightSet.java similarity index 97% rename from Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/generation/WeightSet.java rename to Plugins/Mineplex.Core.Common/src/mineplex/core/common/weight/WeightSet.java index 7af1d76a7..08327f982 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/generation/WeightSet.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/weight/WeightSet.java @@ -1,4 +1,4 @@ -package mineplex.game.clans.items.generation; +package mineplex.core.common.weight; import java.util.Collection; import java.util.HashSet; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/loot/LootManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/loot/LootManager.java index 73832f6ec..0ce0bc9e1 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/loot/LootManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/loot/LootManager.java @@ -6,7 +6,7 @@ import org.bukkit.inventory.ItemStack; import mineplex.game.clans.economy.GoldManager; import mineplex.game.clans.items.GearManager; -import mineplex.game.clans.items.generation.WeightSet; +import mineplex.core.common.weight.WeightSet; public class LootManager { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java index fb578a210..e5c4b62b9 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java @@ -60,8 +60,8 @@ import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.game.clans.clans.ClansManager; -import mineplex.game.clans.items.generation.Weight; -import mineplex.game.clans.items.generation.WeightSet; +import mineplex.core.common.weight.Weight; +import mineplex.core.common.weight.WeightSet; import mineplex.minecraft.game.classcombat.Class.ClientClass; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Skill.event.BlockTossEvent; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/GearManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/GearManager.java index c3a3acc07..1c30244f5 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/GearManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/GearManager.java @@ -53,8 +53,8 @@ import mineplex.game.clans.items.attributes.weapon.JaggedAttribute; import mineplex.game.clans.items.attributes.weapon.SharpAttribute; import mineplex.game.clans.items.commands.GearCommand; import mineplex.game.clans.items.economy.GoldToken; -import mineplex.game.clans.items.generation.Weight; -import mineplex.game.clans.items.generation.WeightSet; +import mineplex.core.common.weight.Weight; +import mineplex.core.common.weight.WeightSet; import mineplex.game.clans.items.legendaries.AlligatorsTooth; import mineplex.game.clans.items.legendaries.GiantsBroadsword; import mineplex.game.clans.items.legendaries.HyperAxe; @@ -67,7 +67,6 @@ import mineplex.serverdata.serialization.RuntimeTypeAdapterFactory; import net.minecraft.server.v1_8_R3.NBTTagCompound; import net.minecraft.server.v1_8_R3.Packet; -import net.minecraft.server.v1_8_R3.PacketPlayOutChat; import net.minecraft.server.v1_8_R3.PacketPlayOutSetSlot; import net.minecraft.server.v1_8_R3.PacketPlayOutWindowItems; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/ItemType.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/ItemType.java index e4b52a9b2..4d854879a 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/ItemType.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/ItemType.java @@ -1,11 +1,5 @@ package mineplex.game.clans.items; -import com.google.common.collect.Sets; - -import mineplex.game.clans.items.generation.WeightSet; -import mineplex.game.clans.items.legendaries.AlligatorsTooth; -import mineplex.game.clans.items.legendaries.WindBlade; - public enum ItemType { LEGENDARY, diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java index 118c483ea..53ef5e8a1 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java @@ -16,7 +16,6 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.block.BlockFromToEvent; @@ -33,7 +32,6 @@ import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.MiniPlugin; -import mineplex.core.common.Rank; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; @@ -44,7 +42,7 @@ import mineplex.core.common.util.UtilTime.TimeUnit; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.game.clans.clans.ClansManager; -import mineplex.game.clans.items.generation.WeightSet; +import mineplex.core.common.weight.WeightSet; import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; import mineplex.minecraft.game.classcombat.item.event.WebTossEvent; import mineplex.minecraft.game.core.condition.Condition.ConditionType; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 738c79422..55d00076d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -74,6 +74,7 @@ import mineplex.hub.commands.GadgetToggle; import mineplex.hub.commands.GameModeCommand; import mineplex.hub.commands.NewsCommand; import mineplex.hub.modules.ForcefieldManager; +import mineplex.hub.modules.HolidayGiftManager; import mineplex.hub.modules.HubVisibilityManager; import mineplex.hub.modules.JumpManager; import mineplex.hub.modules.KothManager; @@ -246,6 +247,8 @@ public class HubManager extends MiniClientPlugin new BonusManager(plugin, clientManager, serverStatusManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager, giveawayManager); // _halloweenManager = new HalloweenSpookinessManager(this); + + new HolidayGiftManager(plugin, clientManager, donationManager, inventoryManager, taskManager); // NotificationManager notificationManager = new NotificationManager(plugin, clientManager, donationManager); // new MailManager(_plugin, notificationManager); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HolidayGiftManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HolidayGiftManager.java new file mode 100644 index 000000000..6fa903565 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HolidayGiftManager.java @@ -0,0 +1,118 @@ +package mineplex.hub.modules; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.entity.Villager; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.MiniPlugin; +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.weight.WeightSet; +import mineplex.core.donation.DonationManager; +import mineplex.core.inventory.InventoryManager; +import mineplex.core.recharge.Recharge; +import mineplex.core.reward.Reward; +import mineplex.core.reward.RewardRarity; +import mineplex.core.reward.RewardType; +import mineplex.core.reward.rewards.GemReward; +import mineplex.core.reward.rewards.InventoryReward; +import mineplex.core.task.TaskManager; +import mineplex.core.treasure.TreasureType; + +public class HolidayGiftManager extends MiniPlugin +{ + private final String IDENTIFIER = "the elf"; + + private boolean _enabled = true; + private WeightSet _rewards; + private TaskManager _taskManager; + + public HolidayGiftManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, TaskManager taskManager) + { + super("Holiday Gift", plugin); + + _taskManager = taskManager; + + _rewards = new WeightSet<>(); + _rewards.add(100, new GemReward(donationManager, 50, 300, 1, 1, RewardRarity.UNCOMMON)); + _rewards.add(100, new InventoryReward(inventoryManager, "Coal", "Coal", 10, 50, new ItemStack(Material.COAL), RewardRarity.UNCOMMON, 10, 0)); + _rewards.add(50, new InventoryReward(inventoryManager, "Old Chest", TreasureType.OLD.getItemName(), 1, 1, new ItemStack(Material.CHEST), RewardRarity.RARE, 1, 1)); + _rewards.add(50, new InventoryReward(inventoryManager, "Ancient Chest", TreasureType.ANCIENT.getItemName(), 1, 1, new ItemStack(Material.CHEST), RewardRarity.RARE, 1, 1)); + _rewards.add(20, new InventoryReward(inventoryManager, "Winter Holiday Chest", TreasureType.CHRISTMAS.getItemName(), 1, 1, new ItemStack(Material.CHEST), RewardRarity.RARE, 1, 1)); + _rewards.add(20, new InventoryReward(inventoryManager, "Mythical Chest", TreasureType.MYTHICAL.getItemName(), 1, 1, new ItemStack(Material.CHEST), RewardRarity.RARE, 1, 1)); + } + + @EventHandler + public void onInteract(PlayerInteractEntityEvent event) + { + if (!_enabled) + return; + + if (!(event.getRightClicked() instanceof Villager)) + return; + + Villager villager = ((Villager) event.getRightClicked()); + String colorLess = ChatColor.stripColor(villager.getCustomName()); + String parsedName = colorLess.toLowerCase(); + String elfName = parsedName.split(" ")[0]; + + if (!parsedName.endsWith(IDENTIFIER)) + return; + + if (!Recharge.Instance.use(event.getPlayer(), parsedName, 2000, false, false)) + return; + + String taskName = getTaskName(elfName); + + if (taskName == null) + return; + + if (!_taskManager.hasCompletedTask(event.getPlayer(), taskName)) + { + _taskManager.completedTask(completed -> { + if (completed) + { + Reward reward = _rewards.generateRandom(); + + reward.giveReward(RewardType.GameLoot, event.getPlayer(), rewardData -> { + UtilPlayer.message(event.getPlayer(), F.main("Gift", F.elem(colorLess) + " searches for your gift...")); + UtilPlayer.message(event.getPlayer(), F.main("Gift", "You received " + rewardData.getFriendlyName() + C.mBody + "!")); + }); + } + else + { + UtilPlayer.message(event.getPlayer(), F.main("Gift", F.elem(colorLess) + " had trouble finding a gift for you")); + UtilPlayer.message(event.getPlayer(), F.main("Gift", "Please try again later!")); + } + }, event.getPlayer(), taskName); + } + else + { + UtilPlayer.message(event.getPlayer(), F.main("Gift", F.elem(colorLess) + " has no more gifts for you!")); + } + } + + private String getTaskName(String elfName) + { + if (elfName == null || elfName.length() == 0) + return null; + + return "ChristmasGift.2015." + elfName; + } + + public boolean isEnabled() + { + return _enabled; + } + + public void setEnabled(boolean enabled) + { + _enabled = enabled; + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GemGift.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GemGift.java new file mode 100644 index 000000000..c0826fc15 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GemGift.java @@ -0,0 +1,37 @@ +package mineplex.hub.modules.holidaygift; + +import java.util.Random; + +import org.bukkit.entity.Player; + +import mineplex.core.donation.DonationManager; + +public class GemGift implements HolidayGift +{ + private Random _random; + private DonationManager _donationManager; + private int _min; + private int _max; + + public GemGift(DonationManager donationManager, int min, int max) + { + _random = new Random(); + _donationManager = donationManager; + _min = min; + _max = max; + } + + @Override + public boolean canGive(Player player) + { + return false; + } + + @Override + public String give(Player player) + { + int gems = _random.nextInt(_max - _min) + _min; + _donationManager.RewardGemsLater("HolidayManager", player, gems); + return gems + " Gems"; + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GiftReward.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GiftReward.java new file mode 100644 index 000000000..11e7edd96 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GiftReward.java @@ -0,0 +1,5 @@ +package mineplex.hub.modules.holidaygift; + +public class GiftReward +{ +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/HolidayGift.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/HolidayGift.java new file mode 100644 index 000000000..188a6621a --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/HolidayGift.java @@ -0,0 +1,10 @@ +package mineplex.hub.modules.holidaygift; + +import org.bukkit.entity.Player; + +public interface HolidayGift +{ + public boolean canGive(Player player); + + public String give(Player player); +} From 25d36b546a307b8d8a6ec796f0862ae24f8b7044 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Fri, 25 Dec 2015 01:53:00 -0600 Subject: [PATCH 4/9] Remove unnecessary files --- .../hub/modules/holidaygift/GemGift.java | 37 ------------------- .../hub/modules/holidaygift/GiftReward.java | 5 --- .../hub/modules/holidaygift/HolidayGift.java | 10 ----- 3 files changed, 52 deletions(-) delete mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GemGift.java delete mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GiftReward.java delete mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/HolidayGift.java diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GemGift.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GemGift.java deleted file mode 100644 index c0826fc15..000000000 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GemGift.java +++ /dev/null @@ -1,37 +0,0 @@ -package mineplex.hub.modules.holidaygift; - -import java.util.Random; - -import org.bukkit.entity.Player; - -import mineplex.core.donation.DonationManager; - -public class GemGift implements HolidayGift -{ - private Random _random; - private DonationManager _donationManager; - private int _min; - private int _max; - - public GemGift(DonationManager donationManager, int min, int max) - { - _random = new Random(); - _donationManager = donationManager; - _min = min; - _max = max; - } - - @Override - public boolean canGive(Player player) - { - return false; - } - - @Override - public String give(Player player) - { - int gems = _random.nextInt(_max - _min) + _min; - _donationManager.RewardGemsLater("HolidayManager", player, gems); - return gems + " Gems"; - } -} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GiftReward.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GiftReward.java deleted file mode 100644 index 11e7edd96..000000000 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/GiftReward.java +++ /dev/null @@ -1,5 +0,0 @@ -package mineplex.hub.modules.holidaygift; - -public class GiftReward -{ -} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/HolidayGift.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/HolidayGift.java deleted file mode 100644 index 188a6621a..000000000 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/holidaygift/HolidayGift.java +++ /dev/null @@ -1,10 +0,0 @@ -package mineplex.hub.modules.holidaygift; - -import org.bukkit.entity.Player; - -public interface HolidayGift -{ - public boolean canGive(Player player); - - public String give(Player player); -} From dd8e91e4635967544de2e418bd4f196eb8bd7225 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Fri, 25 Dec 2015 03:03:53 -0600 Subject: [PATCH 5/9] Update MOTD --- .../src/mineplex/bungee/motd/MotdManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 daeb8bae3..6cd314fd3 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -56,7 +56,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 B E T A §f"; - String motdLine = " §f❄ §2§lNew Game §f❄ §2§lType Wars §f❄"; + String motdLine = " §f❄ §2§lMerry Christmas §f❄ §2§lElf Presents §f❄"; //String motdLine = " §d§lRank Sale §a§l40% Off"); //String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►"); From c680d91b564cd05f454bce24d0f6b88e84222c66 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Fri, 25 Dec 2015 03:12:04 -0600 Subject: [PATCH 6/9] Nerf TypeWars gems (again) --- .../game/arcade/game/games/typewars/MinionSize.java | 6 +++--- .../nautilus/game/arcade/game/games/typewars/TypeWars.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/MinionSize.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/MinionSize.java index af5f91434..00e17a8a9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/MinionSize.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/MinionSize.java @@ -10,9 +10,9 @@ import org.bukkit.inventory.ItemStack; public enum MinionSize { - EASY("Easy", 2, ItemStackFactory.Instance.CreateStack(Material.MONSTER_EGG, (byte) 0, 1, (short) 55, "", new String[]{}), 1, 1), - MEDIUM("Medium", 4, ItemStackFactory.Instance.CreateStack(Material.MONSTER_EGG, (byte) 0, 1, (short) 61, "", new String[]{}), 1, 2), - HARD("Hard", 6, ItemStackFactory.Instance.CreateStack(Material.MONSTER_EGG, (byte) 0, 1, (short) 52, "", new String[]{}), 1, 4), + EASY("Easy", 2, ItemStackFactory.Instance.CreateStack(Material.MONSTER_EGG, (byte) 0, 1, (short) 55, "", new String[]{}), 1, 0), + MEDIUM("Medium", 4, ItemStackFactory.Instance.CreateStack(Material.MONSTER_EGG, (byte) 0, 1, (short) 61, "", new String[]{}), 1, 1), + HARD("Hard", 6, ItemStackFactory.Instance.CreateStack(Material.MONSTER_EGG, (byte) 0, 1, (short) 52, "", new String[]{}), 1, 2), FREAK("Freak", 10000, new ItemStack(Material.MONSTER_EGG), 1, 999999), BOSS("Boss", 10000, new ItemStack(Material.MONSTER_EGG), 7, 999999999); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/TypeWars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/TypeWars.java index 0f0d7e6c5..e8786ddbc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/TypeWars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/TypeWars.java @@ -957,7 +957,7 @@ public class TypeWars extends TeamGame for(MinionSize size : MinionSize.values()) { - if(size == MinionSize.BOSS || size == MinionSize.FREAK) + if(size == MinionSize.BOSS || size == MinionSize.FREAK || size == MinionSize.EASY) continue; AddGems(player, getSpawnedMinions(player, size) * size.getGemReward(), getSpawnedMinions(player, size) + " " + size.getDisplayName() + " Minions spawned", false, true); From 7104f1363afec001af955b902a816fe5ecf044c2 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 29 Dec 2015 00:34:18 -0600 Subject: [PATCH 7/9] Give YT rank access to extra preferences --- .../mineplex/core/preferences/ui/ExclusivePreferencesPage.java | 2 +- .../src/mineplex/core/preferences/ui/PreferencesPage.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/ExclusivePreferencesPage.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/ExclusivePreferencesPage.java index 272b5fe38..79afa7b23 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/ExclusivePreferencesPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/ExclusivePreferencesPage.java @@ -124,7 +124,7 @@ public class ExclusivePreferencesPage extends ShopPageBase Date: Tue, 29 Dec 2015 00:50:20 -0600 Subject: [PATCH 8/9] Show Host Rank in private servers --- .../src/mineplex/hub/server/ServerInfo.java | 4 +++- .../mineplex/hub/server/ServerManager.java | 20 ++++++++++++++++++- .../mineplex/hub/server/ui/ServerNpcPage.java | 6 +++--- .../nautilus/game/arcade/ArcadeManager.java | 4 ++-- .../game/arcade/managers/GameHostManager.java | 2 ++ 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerInfo.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerInfo.java index 235b7c99b..f3ebc2e5d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerInfo.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerInfo.java @@ -1,5 +1,7 @@ package mineplex.hub.server; +import mineplex.core.common.Rank; + public class ServerInfo { public String Name; @@ -9,7 +11,7 @@ public class ServerInfo public String Map; public String ServerType; public String Game; - public boolean HostedByStaff; + public Rank HostRank = Rank.ALL; public int getAvailableSlots() { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index a80aa4503..0b54138c0 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -435,7 +435,25 @@ public class ServerManager extends MiniPlugin serverInfo.MOTD = args.length > 0 ? args[0] : serverStatus.getMotd(); serverInfo.CurrentPlayers = serverStatus.getPlayerCount(); serverInfo.MaxPlayers = serverStatus.getMaxPlayerCount(); - serverInfo.HostedByStaff = serverStatus.getMotd().contains("StaffHosted"); + + for (String arg : args) + { + if (arg != null && arg.startsWith("HostRank.") && arg.length() > "HostRank.".length()) + { + String rankEnum = arg.split("\\.")[1]; + + try + { + serverInfo.HostRank = Rank.valueOf(rankEnum); + } + catch (Exception e) + { + // Ignore + } + + break; + } + } if (args.length > 1) serverInfo.ServerType = args[1]; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index 5bc9aa8fa..34ce492a1 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -237,7 +237,7 @@ public class ServerNpcPage extends ShopPageInventory Date: Tue, 29 Dec 2015 02:52:53 -0600 Subject: [PATCH 9/9] Add maintenance line --- .../src/mineplex/bungee/motd/MotdManager.java | 1 + 1 file changed, 1 insertion(+) 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 6cd314fd3..324da4b52 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -57,6 +57,7 @@ public class MotdManager implements Listener, Runnable //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 B E T A §f"; String motdLine = " §f❄ §2§lMerry Christmas §f❄ §2§lElf Presents §f❄"; +// String motdLine = " §f❄ §2§lServer Maintenance §f❄ §2§lBe Back Soon §f❄"; //String motdLine = " §d§lRank Sale §a§l40% Off"); //String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►");