From 2b18d62f0fd4b8d42edb9968be32ec20f9ebbebe Mon Sep 17 00:00:00 2001 From: LCastr0 Date: Fri, 3 Mar 2017 21:50:16 -0300 Subject: [PATCH] Added icons and lores Added floor for the chest Fixed little copy paste error in BuyChestButton Reduced amount of gold in the costume --- .../stpatricks/OutfitStPatricksSuit.java | 37 ++++++++----------- .../gadget/gadgets/taunts/RainbowTaunt.java | 5 ++- .../mount/types/MountStPatricksHorse.java | 7 ++-- .../src/mineplex/core/pet/PetType.java | 2 +- .../animation/BlockChangeAnimation.java | 10 +++++ .../core/treasure/gui/BuyChestButton.java | 12 +----- 6 files changed, 34 insertions(+), 39 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/stpatricks/OutfitStPatricksSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/stpatricks/OutfitStPatricksSuit.java index dd3adc971..48cd96acb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/stpatricks/OutfitStPatricksSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/stpatricks/OutfitStPatricksSuit.java @@ -8,7 +8,6 @@ import org.bukkit.Material; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -31,7 +30,7 @@ public class OutfitStPatricksSuit extends OutfitGadget public OutfitStPatricksSuit(GadgetManager manager, String name, int cost, OutfitGadget.ArmorSlot slot, Material mat, byte data) { - super(manager, name, UtilText.splitLinesToArray(new String[]{C.cGray + "Placeholder"}, LineFormat.LORE), cost, slot, mat, data); + super(manager, name, UtilText.splitLinesToArray(new String[]{C.cGray + "Wherever a Leprechaun goes he leaves behind a trail of gold and a hint of spring."}, LineFormat.LORE), cost, slot, mat, data); setColor(Color.fromRGB(0, 153, 0)); ItemStack displayItem = new ItemStack(mat, 1, data); if (displayItem.getItemMeta() instanceof LeatherArmorMeta) @@ -55,26 +54,6 @@ public class OutfitStPatricksSuit extends OutfitGadget removeArmor(player, message); } - @EventHandler - public void onPlayerMove(PlayerMoveEvent event) - { - // Prevents event running 4 times - if (getSlot() != ArmorSlot.HELMET) - return; - - if (!setActive(event.getPlayer())) - return; - - // Drops gold - ItemStack itemStack = new ItemStack(Material.GOLD_INGOT); - ItemMeta itemMeta = itemStack.getItemMeta(); - itemMeta.setDisplayName("DROPPED" + System.currentTimeMillis() + UtilMath.random.nextInt()); - itemStack.setItemMeta(itemMeta); - Item gold = event.getPlayer().getWorld().dropItem(event.getPlayer().getLocation().add(0.5, 1.5, 0.5), itemStack); - _items.add(gold); - gold.setVelocity(new Vector((Math.random()-0.5)*0.3, Math.random()-0.4, (Math.random()-0.5)*0.3)); - } - @EventHandler public void onUpdate(UpdateEvent event) { @@ -84,6 +63,20 @@ public class OutfitStPatricksSuit extends OutfitGadget if (event.getType() == UpdateType.TICK) cleanItems(); + + if (event.getType() == UpdateType.FASTER) + { + for (Player player : getActive()) + { + ItemStack itemStack = new ItemStack(Material.GOLD_INGOT); + ItemMeta itemMeta = itemStack.getItemMeta(); + itemMeta.setDisplayName(player.getName() + "DROPPED" + System.currentTimeMillis() + UtilMath.random.nextInt()); + itemStack.setItemMeta(itemMeta); + Item gold = player.getWorld().dropItem(player.getLocation().add(0.5, 1.5, 0.5), itemStack); + _items.add(gold); + gold.setVelocity(new Vector((Math.random() - 0.5) * 0.3, Math.random() - 0.4, (Math.random() - 0.5) * 0.3)); + } + } } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/RainbowTaunt.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/RainbowTaunt.java index 25e6f8557..16e94cd67 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/RainbowTaunt.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/RainbowTaunt.java @@ -19,10 +19,11 @@ public class RainbowTaunt extends TauntGadget public RainbowTaunt(GadgetManager manager) { - super(manager, "Rainbow Taunt", UtilText.splitLinesToArray(new String[]{C.cGray + "Placeholder"}, - LineFormat.LORE), -18, Material.GLASS, (byte) 0); + super(manager, "Rainbow Taunt", UtilText.splitLinesToArray(new String[]{C.cGray + "At the end of every Rainbow they say there is a pot of Gold.", C.cWhite + "Type /taunt in game to use this taunt."}, + LineFormat.LORE), -18, Material.WOOL, (byte) 11); setCanPlayWithPvp(false); setPvpCooldown(PVP_COOLDOWN); + setShouldPlay(false); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountStPatricksHorse.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountStPatricksHorse.java index 7129556b8..0558f1644 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountStPatricksHorse.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountStPatricksHorse.java @@ -7,7 +7,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Horse; import org.bukkit.entity.Item; @@ -17,6 +16,7 @@ import org.bukkit.event.entity.HorseJumpEvent; import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.inventory.ItemStack; +import mineplex.core.common.util.C; import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilText; import mineplex.core.mount.HorseMount; @@ -36,9 +36,8 @@ public class MountStPatricksHorse extends HorseMount public MountStPatricksHorse(MountManager manager) { super(manager, "St Patrick's Mount", - UtilText.splitLineToArray(UtilText.colorWords("The British might be coming, but with this impressive mount you have nothing to fear.", - ChatColor.RED, ChatColor.WHITE, ChatColor.BLUE), LineFormat.LORE), - Material.FIREWORK, (byte) 0, -7, Horse.Color.WHITE, Horse.Style.WHITE, Horse.Variant.HORSE, 1, null); + UtilText.splitLinesToArray(new String[]{C.cGray + "You know the cow that jumped over the moon? Total show off."}, LineFormat.LORE), + Material.CAULDRON, (byte) 0, -7, Horse.Color.WHITE, Horse.Style.WHITE, Horse.Variant.HORSE, 1, null); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetType.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetType.java index 52d953443..e5453d7fe 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetType.java @@ -33,7 +33,7 @@ public enum PetType GINGERBREAD_MAN("Gingerbread Man", EntityType.ZOMBIE, -16, "Looks like you can catch him after all."), CUPID_PET("Cupid", EntityType.ZOMBIE, -17, "Sometimes you need a little extra help finding true Love. Why not have Cupid help you out?", Material.BOW, (byte) 0), TRUE_LOVE_PET("True Love", EntityType.ZOMBIE, -14, "Sometimes love means chasing the person of your dreams until you catch them.", Material.APPLE, YearMonth.of(2017, Month.FEBRUARY)), - LEPRECHAUN("Leprechaun", EntityType.ZOMBIE, -18, "Placeholder", SkinData.LEPRECHAUN.getSkull()) + LEPRECHAUN("Leprechaun", EntityType.ZOMBIE, -18, "Apparently this little guy lost his Pot of Gold in the war.", SkinData.LEPRECHAUN.getSkull()) // TODO CHECK IF LOBBY IS 1.9+ // Not in this update //SHULKER("Shulker Pet", EntityType.BAT, 0, "Is it a turtle or an alien? Either way its shot can be really UPLIFTING.") diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java index f98716e24..f2629eb1f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java @@ -94,6 +94,11 @@ public class BlockChangeAnimation extends Animation mat = Material.WOOL; data = 6; } + else if (getTreasure().getTreasureType() == TreasureType.ST_PATRICKS) + { + mat = Material.WOOL; + data = 13; + } else continue; @@ -141,6 +146,11 @@ public class BlockChangeAnimation extends Animation mat = Material.WOOL; data = 14; } + else if (getTreasure().getTreasureType() == TreasureType.ST_PATRICKS) + { + mat = Material.GOLD_BLOCK; + data = 0; + } else continue; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java index 12bc94e90..087374d5d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java @@ -49,15 +49,6 @@ public class BuyChestButton implements IButton return; } - if (_chestType == TreasureType.LOVE_CHEST) - { - if (!new File("../../update/files/EnableLoveChest.dat").exists()) - { - player.sendMessage(F.main("Treasure", "That chest is no longer available for purchase!")); - return; - } - } - if (_chestType == TreasureType.TRICK_OR_TREAT) { if (!new File("../../update/files/EnableTrickOrTreat.dat").exists()) @@ -107,7 +98,8 @@ public class BuyChestButton implements IButton } if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player) && (_chestType == TreasureType.ILLUMINATED || _chestType == TreasureType.OMEGA - || _chestType == TreasureType.HAUNTED || _chestType == TreasureType.GINGERBREAD)) + || _chestType == TreasureType.HAUNTED || _chestType == TreasureType.GINGERBREAD + || _chestType == TreasureType.ST_PATRICKS)) { player.sendMessage(F.main("Treasure", "You seem to have all treasures for this chest unlocked already!")); return;