Merge branch 'update/stpatrickscosmetics' into develop

This commit is contained in:
cnr 2017-03-15 23:15:10 -05:00
commit e5d2ad34eb
42 changed files with 1014 additions and 108 deletions

View File

@ -111,6 +111,30 @@ public class ShapeWings extends ShapeGrid implements CosmeticShape
"000000$000000" "000000$000000"
}; };
public static final String[] FOUR_LEAF_CLOVER = new String[]
{
"$$$$$$$$###$$$$$$$",
"$$$$$$##***#$$$$$$",
"$$$$##****%#$$$$$$",
"$$$#******%#$###$$",
"$$$#***%#%%##***#$",
"$$$$#**%#%#*****#$",
"$$$####*%%#*%%**#$",
"$##***#*%#**##**##",
"#***%%*###******%#",
"#**%##*%###%%%%%%#",
"#**#**%%#**######$",
"$#****%#*****#$$$$",
"$$#*%%%#******#$$$",
"$$#####**%#****#$$",
"$$$$$##**%#***%#$$",
"$$$$$###****%%%#$$",
"$$$$##$#%%%%%##$$$",
"$$$##$$$#####$$$$$",
"$###$$$$$$$$$$$$$$",
"$##$$$$$$$$$$$$$$$"
};
/** /**
* Default rotation to give the wings a little tilt when displayed on players for instance * Default rotation to give the wings a little tilt when displayed on players for instance

View File

@ -64,6 +64,7 @@ public class SkinData
public final static SkinData TURKEY = new SkinData("eyJ0aW1lc3RhbXAiOjE0NzU3NzM2MTc5MDQsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8xYzdmYjczMTRkNmY1ZTMzNmVjN2ViNTI1ZGM0ODMzOWNhMjI4ZDk3ODU1MDM3ZDZhNDIwOGZjNzYwNDc1NiJ9fX0=", "eZWi1LOD8ke7MCUAfhspBCnyfCoGM8suFLKtbW6b27CURoRBG3eKIfwLYYeMp3ObjoZ8gCB90s28Qyw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WaoIoeKpxdCmAtjgV6FI8zDy2Yzi+MF4O9e4VqH0tMBoD2/CZScQwNEzc4YXf2M2fglKn9uK2+xrgLV+XS+SNdIn7BRiNlQf96u6N2G0lO+eb09LbIfIgAgfnyLiARccWa+VNo6gwlCFyRMnwOlgqxL5XA5Um4kkx2ZReRRCDFQ4NV5eLBktLd5wpECyOuY7v7S3zLqwbhwG47gS8hnXqmtHG5RW0RUQZEryg638Cw7hwr2k09iStfok8WeZUIJ+fuUWgdArvbtN36a2pCXyFdqzp+E8xzSF4E9SQv0K+1lNj+w4L58dh8pddeKK8m5bpjINj4xZ6nf7reWYQAX/imVNYTXTW8JqYnF+++xViBwmfeeM3PmEg+wyTduh+M25nyhGcqn5l+UyQ9aMzzdNs2aEdx12fOm1sOFXjHrHWeo6ciEm7sY1SDjiJ99VVXuGHCJWBtxq/B+c+vC/Cj8itEYOetwe5NKrgI99pZjG+KiRr4L0n8/NA3Px7SbKUUpHse80pNMjGfFW4pAOyFXJaKHrObWT2iL2AnTe+yfdY4sf/JZT4=");
// Comments this out for now, so it doesn't load the player profile // Comments this out for now, so it doesn't load the player profile
// A better way to do this would check for the properties when getting the skull or the skin // A better way to do this would check for the properties when getting the skull or the skin

View File

@ -1,23 +1,26 @@
package mineplex.core.cosmetic.ui.page; package mineplex.core.cosmetic.ui.page;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.common.currency.GlobalCurrency; import mineplex.core.common.currency.GlobalCurrency;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.cosmetic.CosmeticManager;
import mineplex.core.cosmetic.ui.CosmeticShop; import mineplex.core.cosmetic.ui.CosmeticShop;
import mineplex.core.donation.DonationManager; import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.gadgets.outfit.freezesuit.OutfitFreezeSuit;
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuit; import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuit;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuit; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuit;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksSuit;
import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.GadgetType;
import mineplex.core.gadget.types.ItemGadget; import mineplex.core.gadget.types.ItemGadget;
import mineplex.core.gadget.types.OutfitGadget; import mineplex.core.gadget.types.OutfitGadget;
import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem; import mineplex.core.shop.item.ShopItem;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
/** /**
* Created by shaun on 14-09-15. * Created by shaun on 14-09-15.
@ -42,11 +45,13 @@ public class CostumePage extends GadgetPage
OutfitGadget outfitGadget = ((OutfitGadget) gadget); OutfitGadget outfitGadget = ((OutfitGadget) gadget);
int offset = 0; int offset;
if (gadget instanceof OutfitRaveSuit) offset = 0; if (gadget instanceof OutfitRaveSuit) offset = 0;
else if (gadget instanceof OutfitSpaceSuit) offset = 1; else if (gadget instanceof OutfitSpaceSuit) offset = 1;
else offset = 2; else if (gadget instanceof OutfitFreezeSuit) offset = 2;
else if (gadget instanceof OutfitStPatricksSuit) offset = 3;
else offset = 4;
slot = offset + 1 + 18; //1 buffer to left, 18 = 2 lines down slot = offset + 1 + 18; //1 buffer to left, 18 = 2 lines down

View File

@ -22,6 +22,8 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.common.currency.GlobalCurrency; import mineplex.core.common.currency.GlobalCurrency;
@ -165,9 +167,13 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
itemLore.add(C.cBlack); itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Disable"); itemLore.add(C.cGreen + "Click to Disable");
addButton(slot, new ShopItem(pet.getMaterial(), pet.getData(), ItemStack item = pet.getDisplayItem();
pet.getName() + " (" + C.cWhite + petName + C.cGreen + ")", ItemMeta itemMeta = item.getItemMeta();
itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivatePetButton(this, getPlugin().getPetManager())); itemMeta.setDisplayName(C.cGreen + C.Bold + pet.getName() + C.cGreen + " (" + C.cWhite + petName + C.cGreen + ")");
itemMeta.setLore(itemLore);
item.setItemMeta(itemMeta);
addButton(slot, new ShopItem(item, false, false).hideInfo(), new DeactivatePetButton(this, getPlugin().getPetManager()));
addGlow(slot); addGlow(slot);
} }
@ -175,29 +181,14 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
{ {
itemLore.add(C.cBlack); itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Enable"); itemLore.add(C.cGreen + "Click to Enable");
/*
ItemStack petItem = ItemStackFactory.Instance.CreateStack(pet.getMaterial(), pet.getData(), 1,
pet.getName() + " (" + C.cWhite + petName + C.cGreen + ")", itemLore);
IButton iButton = new ActivatePetButton(pet, this); ItemStack item = pet.getDisplayItem();
ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(C.cGreen + C.Bold + pet.getName() + C.cGreen + " (" + C.cWhite + petName + C.cGreen + ")");
itemMeta.setLore(itemLore);
item.setItemMeta(itemMeta);
if (pet.equals(PetType.SHULKER)) addButton(slot, new ShopItem(item, false, false).hideInfo(), new ActivatePetButton(pet, this));
{
petItem = UtilItem.getVersionSpecificItem(_player, UtilPlayer.PlayerVersion._1_9, petItem);
if (petItem.getType().equals(Material.BARRIER))
{
iButton = null;
}
else
{
// Does not set the item stack yet
//petItem.setType(Material.getMaterial(201));
}
}*/
addButton(slot, new ShopItem(pet.getMaterial(), pet.getData(),
pet.getName() + " (" + C.cWhite + petName + C.cGreen + ")",
itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivatePetButton(pet, this));
//addButton(slot, new ShopItem(petItem, false, false), iButton); //addButton(slot, new ShopItem(petItem, false, false), iButton);
} }
} }

View File

@ -2,8 +2,10 @@ package mineplex.core.gadget;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.function.Predicate; import java.util.function.Predicate;
@ -28,7 +30,6 @@ import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager; import mineplex.core.achievement.AchievementManager;
import mineplex.core.blockrestore.BlockRestore; import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
@ -153,6 +154,10 @@ import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitBoots;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksBoots;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksChestplate;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksHat;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksLeggings;
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoosterManager; import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoosterManager;
import mineplex.core.gadget.gadgets.particle.ParticleChristmasTree; import mineplex.core.gadget.gadgets.particle.ParticleChristmasTree;
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes; import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
@ -179,6 +184,7 @@ import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant; import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt; import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt;
import mineplex.core.gadget.gadgets.taunts.EternalTaunt; import mineplex.core.gadget.gadgets.taunts.EternalTaunt;
import mineplex.core.gadget.gadgets.taunts.RainbowTaunt;
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken; import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames; import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames;
import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween; import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween;
@ -206,6 +212,7 @@ import mineplex.core.gadget.set.SetWisdom;
import mineplex.core.gadget.set.suits.SetFreezeSuit; import mineplex.core.gadget.set.suits.SetFreezeSuit;
import mineplex.core.gadget.set.suits.SetRaveSuit; import mineplex.core.gadget.set.suits.SetRaveSuit;
import mineplex.core.gadget.set.suits.SetSpaceSuit; import mineplex.core.gadget.set.suits.SetSpaceSuit;
import mineplex.core.gadget.set.suits.SetStPatricksSuit;
import mineplex.core.gadget.types.ArrowEffectGadget; import mineplex.core.gadget.types.ArrowEffectGadget;
import mineplex.core.gadget.types.BalloonGadget; import mineplex.core.gadget.types.BalloonGadget;
import mineplex.core.gadget.types.DeathEffectGadget; import mineplex.core.gadget.types.DeathEffectGadget;
@ -253,10 +260,10 @@ public class GadgetManager extends MiniPlugin
private TreasureManager _treasureManager; private TreasureManager _treasureManager;
private SoulManager _soulManager; private SoulManager _soulManager;
private NautHashMap<GadgetType, List<Gadget>> _gadgets; private Map<GadgetType, List<Gadget>> _gadgets;
private final NautHashMap<Player, Long> _lastMove = new NautHashMap<>(); private final Map<Player, Long> _lastMove = new HashMap<>();
private final NautHashMap<Player, NautHashMap<GadgetType, Gadget>> _playerActiveGadgetMap = new NautHashMap<>(); private final Map<Player, Map<GadgetType, Gadget>> _playerActiveGadgetMap = new HashMap<>();
private final HashSet<GadgetSet> _sets = new HashSet<>(); private final HashSet<GadgetSet> _sets = new HashSet<>();
@ -315,8 +322,11 @@ public class GadgetManager extends MiniPlugin
addSet(new SetRaveSuit(this)); addSet(new SetRaveSuit(this));
addSet(new SetSpaceSuit(this)); addSet(new SetSpaceSuit(this));
addSet(new SetFreezeSuit(this)); addSet(new SetFreezeSuit(this));
addSet(new SetStPatricksSuit(this));
// Hidden in this update // Hidden in this update
//addSet(new SetWindUpSuit(this)); //addSet(new SetWindUpSuit(this));
// Sets
addSet(new SetParty(this)); addSet(new SetParty(this));
addSet(new SetCupidsLove(this)); addSet(new SetCupidsLove(this));
addSet(new SetEmerald(this)); addSet(new SetEmerald(this));
@ -330,7 +340,7 @@ public class GadgetManager extends MiniPlugin
private void createGadgets() private void createGadgets()
{ {
_gadgets = new NautHashMap<>(); _gadgets = new HashMap<>();
// Items // Items
addGadget(new ItemEtherealPearl(this)); addGadget(new ItemEtherealPearl(this));
@ -373,6 +383,11 @@ public class GadgetManager extends MiniPlugin
addGadget(new OutfitFreezeSuitLeggings(this)); addGadget(new OutfitFreezeSuitLeggings(this));
addGadget(new OutfitFreezeSuitBoots(this)); addGadget(new OutfitFreezeSuitBoots(this));
addGadget(new OutfitStPatricksHat(this));
addGadget(new OutfitStPatricksChestplate(this));
addGadget(new OutfitStPatricksLeggings(this));
addGadget(new OutfitStPatricksBoots(this));
addGadget(new OutfitTeam(this, "Team Helmet", -1, ArmorSlot.HELMET, Material.LEATHER_HELMET, (byte)0)); addGadget(new OutfitTeam(this, "Team Helmet", -1, ArmorSlot.HELMET, Material.LEATHER_HELMET, (byte)0));
addGadget(new OutfitTeam(this, "Team Shirt", -1, ArmorSlot.CHEST, Material.LEATHER_CHESTPLATE, (byte)0)); addGadget(new OutfitTeam(this, "Team Shirt", -1, ArmorSlot.CHEST, Material.LEATHER_CHESTPLATE, (byte)0));
addGadget(new OutfitTeam(this, "Team Pants", -1, ArmorSlot.LEGS, Material.LEATHER_LEGGINGS, (byte)0)); addGadget(new OutfitTeam(this, "Team Pants", -1, ArmorSlot.LEGS, Material.LEATHER_LEGGINGS, (byte)0));
@ -561,6 +576,7 @@ public class GadgetManager extends MiniPlugin
// TAUNTS!!! // TAUNTS!!!
addGadget(new EternalTaunt(this)); addGadget(new EternalTaunt(this));
addGadget(new BlowAKissTaunt(this)); addGadget(new BlowAKissTaunt(this));
addGadget(new RainbowTaunt(this));
// Gem Hunters Mounts // Gem Hunters Mounts
for (MountType mount : MountType.values()) for (MountType mount : MountType.values())
@ -1035,7 +1051,7 @@ public class GadgetManager extends MiniPlugin
public void setActive(Player player, Gadget gadget) public void setActive(Player player, Gadget gadget)
{ {
if (!_playerActiveGadgetMap.containsKey(player)) if (!_playerActiveGadgetMap.containsKey(player))
_playerActiveGadgetMap.put(player, new NautHashMap<GadgetType, Gadget>()); _playerActiveGadgetMap.put(player, new HashMap<>());
_playerActiveGadgetMap.get(player).put(gadget.getGadgetType(), gadget); _playerActiveGadgetMap.get(player).put(gadget.getGadgetType(), gadget);
} }
@ -1043,7 +1059,7 @@ public class GadgetManager extends MiniPlugin
public Gadget getActive(Player player, GadgetType gadgetType) public Gadget getActive(Player player, GadgetType gadgetType)
{ {
if (!_playerActiveGadgetMap.containsKey(player)) if (!_playerActiveGadgetMap.containsKey(player))
_playerActiveGadgetMap.put(player, new NautHashMap<GadgetType, Gadget>()); _playerActiveGadgetMap.put(player, new HashMap<>());
return _playerActiveGadgetMap.get(player).get(gadgetType); return _playerActiveGadgetMap.get(player).get(gadgetType);
} }
@ -1051,7 +1067,7 @@ public class GadgetManager extends MiniPlugin
public void removeActive(Player player, Gadget gadget) public void removeActive(Player player, Gadget gadget)
{ {
if (!_playerActiveGadgetMap.containsKey(player)) if (!_playerActiveGadgetMap.containsKey(player))
_playerActiveGadgetMap.put(player, new NautHashMap<GadgetType, Gadget>()); _playerActiveGadgetMap.put(player, new HashMap<>());
_playerActiveGadgetMap.get(player).remove(gadget.getGadgetType()); _playerActiveGadgetMap.get(player).remove(gadget.getGadgetType());
} }

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit.stpatricks;
import org.bukkit.Material;
import mineplex.core.gadget.GadgetManager;
public class OutfitStPatricksBoots extends OutfitStPatricksSuit
{
public OutfitStPatricksBoots(GadgetManager manager)
{
super(manager, "St Patrick's Boots", -18, ArmorSlot.BOOTS, Material.LEATHER_BOOTS, (byte) 0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit.stpatricks;
import org.bukkit.Material;
import mineplex.core.gadget.GadgetManager;
public class OutfitStPatricksChestplate extends OutfitStPatricksSuit
{
public OutfitStPatricksChestplate(GadgetManager manager)
{
super(manager, "St Patrick's Chest", -18, ArmorSlot.CHEST, Material.LEATHER_CHESTPLATE, (byte) 0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit.stpatricks;
import org.bukkit.Material;
import mineplex.core.gadget.GadgetManager;
public class OutfitStPatricksHat extends OutfitStPatricksSuit
{
public OutfitStPatricksHat(GadgetManager manager)
{
super(manager, "St Patrick's Hat", -18, ArmorSlot.HELMET, Material.LEATHER_HELMET, (byte) 0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit.stpatricks;
import org.bukkit.Material;
import mineplex.core.gadget.GadgetManager;
public class OutfitStPatricksLeggings extends OutfitStPatricksSuit
{
public OutfitStPatricksLeggings(GadgetManager manager)
{
super(manager, "St Patrick's Pants", -18, ArmorSlot.LEGS, Material.LEATHER_LEGGINGS, (byte) 0);
}
}

View File

@ -0,0 +1,117 @@
package mineplex.core.gadget.gadgets.outfit.stpatricks;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.OutfitGadget;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
public class OutfitStPatricksSuit extends OutfitGadget
{
private HashSet<Item> _items = new HashSet<>();
public OutfitStPatricksSuit(GadgetManager manager, String name, int cost, OutfitGadget.ArmorSlot slot, Material mat, byte 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)
{
LeatherArmorMeta leatherArmorMeta = (LeatherArmorMeta) displayItem.getItemMeta();
leatherArmorMeta.setColor(Color.fromRGB(0, 153, 0));
displayItem.setItemMeta(leatherArmorMeta);
}
setDisplayItem(displayItem);
}
@Override
public void enableCustom(Player player, boolean message)
{
applyArmor(player, message);
}
@Override
public void disableCustom(Player player, boolean message)
{
removeArmor(player, message);
}
@EventHandler
public void onUpdate(UpdateEvent event)
{
// Prevents event running 4 times
if (getSlot() != ArmorSlot.HELMET)
return;
if (event.getType() == UpdateType.TICK)
cleanItems();
if (event.getType() == UpdateType.FASTER)
{
for (Player player : getActive())
{
if (setActive(player))
{
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
public void onItemPickup(PlayerPickupItemEvent event)
{
// Prevents event running 4 times
if (getSlot() != ArmorSlot.HELMET)
return;
if (_items.contains(event.getItem()))
{
event.setCancelled(true);
}
}
private boolean setActive(Player player)
{
return getSet() != null && getSet().isActive(player);
}
public void cleanItems()
{
Iterator<Item> it = _items.iterator();
while (it.hasNext())
{
Item item = it.next();
if (item.getTicksLived() >= 20)
{
item.remove();
it.remove();
}
}
}
}

View File

@ -0,0 +1,62 @@
package mineplex.core.gadget.gadgets.taunts;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.TauntGadget;
import mineplex.core.particleeffects.EffectLocation;
import mineplex.core.particleeffects.RainbowTauntEffect;
import mineplex.core.recharge.Recharge;
public class RainbowTaunt extends TauntGadget
{
private static final int COOLDOWN = 30000;
private static final int PVP_COOLDOWN = 10000;
public RainbowTaunt(GadgetManager manager)
{
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
public void onStart(Player player)
{
if (!Recharge.Instance.use(player, getName(), COOLDOWN, true, false, "Cosmetics"))
return;
Vector dir = player.getLocation().getDirection();
Vector sideA = dir.clone().setX(-dir.getZ()).setZ(dir.getX());
Vector sideB = dir.clone().setX(dir.getZ()).setZ(-dir.getX());
Location start = player.getLocation().clone().add(sideA.multiply(4).toLocation(player.getWorld()));
Location end = player.getLocation().clone().add(sideB.multiply(4).toLocation(player.getWorld()));
RainbowTauntEffect rainbowTauntEffect = new RainbowTauntEffect(start, Manager.getPlugin());
rainbowTauntEffect.setTargetLocation(new EffectLocation(end));
rainbowTauntEffect.start();
}
@Override
public void onPlay(Player player)
{
}
@Override
public void onFinish(Player player)
{
}
}

View File

@ -0,0 +1,22 @@
package mineplex.core.gadget.set.suits;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksBoots;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksChestplate;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksHat;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksLeggings;
import mineplex.core.gadget.types.GadgetSet;
public class SetStPatricksSuit extends GadgetSet
{
public SetStPatricksSuit(GadgetManager manager)
{
super(manager, "St Patrick's Suit", "Placeholder",
manager.getGadget(OutfitStPatricksHat.class),
manager.getGadget(OutfitStPatricksChestplate.class),
manager.getGadget(OutfitStPatricksLeggings.class),
manager.getGadget(OutfitStPatricksBoots.class));
}
}

View File

@ -70,6 +70,7 @@ public abstract class TauntGadget extends Gadget
@Override @Override
public void disableCustom(Player player, boolean message) public void disableCustom(Player player, boolean message)
{ {
super.disableCustom(player, message);
finish(player); finish(player);
} }

View File

@ -35,6 +35,7 @@ import mineplex.core.mount.types.MountMule;
import mineplex.core.mount.types.MountNightmareSteed; import mineplex.core.mount.types.MountNightmareSteed;
import mineplex.core.mount.types.MountSlime; import mineplex.core.mount.types.MountSlime;
import mineplex.core.mount.types.MountSpider; import mineplex.core.mount.types.MountSpider;
import mineplex.core.mount.types.MountStPatricksHorse;
import mineplex.core.mount.types.MountTitan; import mineplex.core.mount.types.MountTitan;
import mineplex.core.mount.types.MountUndead; import mineplex.core.mount.types.MountUndead;
import mineplex.core.mount.types.MountValentinesSheep; import mineplex.core.mount.types.MountValentinesSheep;
@ -48,7 +49,7 @@ public class MountManager extends MiniPlugin
private DisguiseManager _disguiseManager; private DisguiseManager _disguiseManager;
private List<Mount<?>> _types; private List<Mount<?>> _types;
private NautHashMap<Player, Mount<?>> _playerActiveMountMap = new NautHashMap<Player, Mount<?>>(); private NautHashMap<Player, Mount<?>> _playerActiveMountMap = new NautHashMap<>();
public MountManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, BlockRestore blockRestore, DisguiseManager disguiseManager) public MountManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, BlockRestore blockRestore, DisguiseManager disguiseManager)
{ {
@ -79,10 +80,10 @@ public class MountManager extends MiniPlugin
_types.add(new MountValentinesSheep(this)); _types.add(new MountValentinesSheep(this));
_types.add(new MountFreedomHorse(this)); _types.add(new MountFreedomHorse(this));
_types.add(new MountNightmareSteed(this)); _types.add(new MountNightmareSteed(this));
// Hidden in this update
_types.add(new MountChicken(this)); _types.add(new MountChicken(this));
_types.add(new MountCake(this)); _types.add(new MountCake(this));
_types.add(new MountLoveTrain(this)); _types.add(new MountLoveTrain(this));
_types.add(new MountStPatricksHorse(this));
//_types.add(new MountSheep(this)); //_types.add(new MountSheep(this));
} }

View File

@ -0,0 +1,115 @@
package mineplex.core.mount.types;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.entity.Horse;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
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;
import mineplex.core.mount.MountManager;
import mineplex.core.mount.SingleEntityMountData;
import mineplex.core.particleeffects.RainbowTrailEffect;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
public class MountStPatricksHorse extends HorseMount
{
private HashSet<Item> _items = new HashSet<>();
private Map<SingleEntityMountData<Horse>, RainbowTrailEffect> _trailMap = new HashMap<>();
public MountStPatricksHorse(MountManager manager)
{
super(manager, "St Patrick's Mount",
UtilText.splitLinesToArray(new String[]{C.cGray + "You know the cow that jumped over the moon? Total show off."}, LineFormat.LORE),
Material.CAULDRON_ITEM, (byte) 0, -7, Horse.Color.WHITE, Horse.Style.WHITE, Horse.Variant.HORSE, 1, null);
}
@Override
public void enableCustom(Player player)
{
super.enableCustom(player);
SingleEntityMountData<Horse> horseData = getActive().get(player);
horseData.getEntity().getInventory().setArmor(new ItemStack(Material.GOLD_BARDING));
_trailMap.put(horseData, new RainbowTrailEffect(horseData.getEntity(), Manager.getPlugin(), _items));
_trailMap.get(horseData).start();
}
@Override
public void disable(Player player)
{
super.disable(player);
List<SingleEntityMountData<Horse>> toRemove = new ArrayList<>();
for (SingleEntityMountData<Horse> horseData : _trailMap.keySet())
{
if (horseData.getOwner().equals(player))
toRemove.add(horseData);
}
for (SingleEntityMountData<Horse> horseData : toRemove)
{
_trailMap.get(horseData).stop();
_trailMap.remove(horseData);
}
}
@EventHandler
public void horseJump(HorseJumpEvent event)
{
for (SingleEntityMountData<Horse> horseData : _trailMap.keySet())
{
if (horseData.getEntity().equals(event.getEntity()))
{
if (Recharge.Instance.use(horseData.getOwner(), getName(), 2500, false, false, "Cosmetics"))
{
_trailMap.get(horseData).setJumping(true);
}
}
}
}
@EventHandler
public void onItemPickup(PlayerPickupItemEvent event)
{
if (_items.contains(event.getItem()))
{
event.setCancelled(true);
}
}
@EventHandler
public void onUpdate(UpdateEvent event)
{
if (event.getType() == UpdateType.TICK)
cleanItems();
}
public void cleanItems()
{
Iterator<Item> it = _items.iterator();
while (it.hasNext())
{
Item item = it.next();
if (item.getTicksLived() >= 20)
{
item.remove();
it.remove();
}
}
}
}

View File

@ -0,0 +1,33 @@
package mineplex.core.particleeffects;
import java.awt.Color;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
import mineplex.core.common.shape.ShapeWings;
import mineplex.core.common.util.UtilParticle;
public class CloverEffect extends Effect
{
private ShapeWings _cloverBlack = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '#', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
private ShapeWings _cloverDarkGreen = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '%', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
private ShapeWings _cloverGreen = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '*', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
public CloverEffect(JavaPlugin plugin, Location location)
{
super(-1, new EffectLocation(location), plugin, 1);
}
@Override
public void runEffect()
{
Location location = getEffectLocation().getLocation();
_cloverBlack.displayColored(location, Color.BLACK);
_cloverDarkGreen.displayColored(location, new Color(0, 100, 0));
_cloverGreen.displayColored(location, Color.GREEN);
}
}

View File

@ -0,0 +1,63 @@
package mineplex.core.particleeffects;
import java.awt.Color;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.particles.ColoredParticle;
import mineplex.core.common.util.particles.DustSpellColor;
public class RainbowTauntEffect extends Effect
{
private static final int PARTICLES = 25;
private static final double HEIGHT = 4;
private static final Color RED = new Color(255, 0, 0);
private static final Color ORANGE = new Color(255, 127, 0);
private static final Color YELLOW = new Color(255, 255, 0);
private static final Color GREEN = new Color(0, 255, 0);
private static final Color BLUE = new Color(0, 0, 255);
private static final Color INDIGO = new Color(75, 0, 130);
private static final Color VIOLET = new Color(143, 0, 255);
public RainbowTauntEffect(Location start, JavaPlugin javaPlugin)
{
super(16, new EffectLocation(start), javaPlugin, 5);
}
@Override
public void runEffect()
{
Location location = getEffectLocation().getFixedLocation();
Location target = getTargetLocation().getFixedLocation();
Color[] colors = new Color[]{VIOLET, INDIGO, BLUE, GREEN, YELLOW, ORANGE, RED};
for (int i = 0; i < 7; i++)
{
line(location.clone().add(0, 0.25 * i, 0), target.clone().add(0, 0.25 * i, 0), colors[i]);
}
}
private void line(Location startLocation, Location targetLocation, Color color)
{
Vector link = targetLocation.toVector().subtract(startLocation.toVector());
float length = (float) link.length();
float pitch = (float) (4 * HEIGHT / Math.pow(length, 2));
for (int i = 0; i < PARTICLES; i++)
{
Vector v = link.clone().normalize().multiply(length * i / PARTICLES);
float x = ((float) i / PARTICLES) * length - length / 2;
float y = (float) (-pitch * Math.pow(x, 2) + HEIGHT);
startLocation.add(v).add(0, y, 0);
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST,
new DustSpellColor(color), startLocation);
coloredParticle.display();
startLocation.subtract(0, y, 0).subtract(v);
}
}
}

View File

@ -0,0 +1,113 @@
package mineplex.core.particleeffects;
import java.awt.Color;
import java.util.HashSet;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.particles.ColoredParticle;
import mineplex.core.common.util.particles.DustSpellColor;
public class RainbowTrailEffect extends Effect
{
private HashSet<Item> _items;
private long _count, _jumpingTimer = 0;
private boolean _isJumping = false;
private Entity _entity;
private Color _red = new Color(255, 0, 0);
private Color _orange = new Color(255, 127, 0);
private Color _yellow = new Color(255, 255, 0);
private Color _green = new Color(0, 255, 0);
private Color _blue = new Color(0, 0, 255);
private Color _indigo = new Color(75, 0, 130);
private Color _violet = new Color(143, 0, 255);
private Color _color = _red;
public RainbowTrailEffect(Entity entity, JavaPlugin javaPlugin, HashSet<Item> items)
{
super(-1, new EffectLocation(entity), javaPlugin);
_entity = entity;
_items = items;
}
@Override
public void runEffect()
{
if (!_entity.isValid() || _entity.isDead())
{
stop();
return;
}
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST,
new DustSpellColor(_color), _effectLocation.getLocation().clone().add(0, .5, 0));
for (int i = 0; i < 7; i++)
{
coloredParticle.setLocation(_effectLocation.getLocation().clone().add(0, .5, 0));
coloredParticle.display();
if (_isJumping)
{
coloredParticle.setLocation(_effectLocation.getLocation().clone().add(.25, .5, 0));
coloredParticle.display();
coloredParticle.setLocation(_effectLocation.getLocation().clone().add(0, .5, .25));
coloredParticle.display();
}
}
if (_isJumping)
{
_jumpingTimer++;
if (_jumpingTimer >= 30)
{
setJumping(false);
_jumpingTimer = 0;
}
}
_count++;
if (_count % 5 == 0)
{
if (_color.equals(_red))
_color = _orange;
else if (_color.equals(_orange))
_color = _yellow;
else if (_color.equals(_yellow))
_color = _green;
else if (_color.equals(_green))
_color = _blue;
else if (_color.equals(_blue))
_color = _indigo;
else if (_color.equals(_indigo))
_color = _violet;
else
_color = _red;
}
if (_count == Long.MAX_VALUE - 1)
_count = 0;
}
public void setJumping(boolean jumping)
{
_isJumping = jumping;
if (_isJumping)
{
ItemStack itemStack = new ItemStack(Material.GOLD_INGOT);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.setDisplayName("DROPPED" + System.currentTimeMillis() + UtilMath.random.nextInt());
itemStack.setItemMeta(itemMeta);
Item gold = _entity.getWorld().dropItem(_entity.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));
}
}
}

View File

@ -396,6 +396,20 @@ public class PetManager extends MiniClientPlugin<PetClient>
UtilEnt.silence(villager, true); UtilEnt.silence(villager, true);
_trueLovePets.put(zombie, new TrueLoveData(player, zombie, villager)); _trueLovePets.put(zombie, new TrueLoveData(player, zombie, villager));
} }
else if (petType.equals(PetType.LEPRECHAUN))
{
Zombie zombie = (Zombie) pet;
zombie.setBaby(true);
UtilEnt.silence(zombie, true);
zombie.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1, false, false));
zombie.getEquipment().setHelmet(SkinData.LEPRECHAUN.getSkull());
zombie.getEquipment().setChestplate(ItemStackFactory.Instance.createColoredLeatherArmor(1, org.bukkit.Color.fromRGB(0, 153, 0)));
zombie.getEquipment().setLeggings(ItemStackFactory.Instance.createColoredLeatherArmor(2, org.bukkit.Color.fromRGB(0, 153, 0)));
zombie.getEquipment().setBoots(ItemStackFactory.Instance.createColoredLeatherArmor(3, org.bukkit.Color.fromRGB(0, 153, 0)));
}
_activePetOwnerTypes.put(player.getName(), petType); _activePetOwnerTypes.put(player.getName(), petType);
_activePetOwners.put(player.getName(), pet); _activePetOwners.put(player.getName(), pet);

View File

@ -6,7 +6,9 @@ import java.util.Optional;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.skin.SkinData;
import mineplex.core.pet.sales.PetSalesPackage; import mineplex.core.pet.sales.PetSalesPackage;
public enum PetType public enum PetType
@ -30,7 +32,8 @@ public enum PetType
BLAZE("Grim Reaper", EntityType.BLAZE, -8, "Aww isn't he so cute with his little wings and little scythe?"), BLAZE("Grim Reaper", EntityType.BLAZE, -8, "Aww isn't he so cute with his little wings and little scythe?"),
GINGERBREAD_MAN("Gingerbread Man", EntityType.ZOMBIE, -16, "Looks like you can catch him after all."), 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), 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)) 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, "Apparently this little guy lost his Pot of Gold in the war.", SkinData.LEPRECHAUN.getSkull())
// TODO CHECK IF LOBBY IS 1.9+ // TODO CHECK IF LOBBY IS 1.9+
// Not in this update // 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.") //SHULKER("Shulker Pet", EntityType.BAT, 0, "Is it a turtle or an alien? Either way its shot can be really UPLIFTING.")
@ -42,6 +45,7 @@ public enum PetType
private final Material _material; private final Material _material;
private final byte _data; private final byte _data;
private YearMonth _yearMonth; private YearMonth _yearMonth;
private ItemStack _displayItem;
PetType(String name, EntityType entityType, int price) PetType(String name, EntityType entityType, int price)
{ {
@ -84,6 +88,12 @@ public enum PetType
_yearMonth = yearMonth; _yearMonth = yearMonth;
} }
PetType(String name, EntityType entityType, int price, String lore, ItemStack displayItem)
{
this(name, entityType, price, lore);
_displayItem = displayItem;
}
public String getName() public String getName()
{ {
return _name; return _name;
@ -114,6 +124,15 @@ public enum PetType
return _data; return _data;
} }
public ItemStack getDisplayItem()
{
if (_displayItem == null)
{
return new ItemStack(_material, 1, _data);
}
return _displayItem;
}
public YearMonth getYearMonth() public YearMonth getYearMonth()
{ {
return _yearMonth; return _yearMonth;

View File

@ -91,6 +91,10 @@ import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitBoots;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksBoots;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksChestplate;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksHat;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksLeggings;
import mineplex.core.gadget.gadgets.particle.ParticleChristmasTree; import mineplex.core.gadget.gadgets.particle.ParticleChristmasTree;
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes; import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
import mineplex.core.gadget.gadgets.particle.ParticleFairy; import mineplex.core.gadget.gadgets.particle.ParticleFairy;
@ -113,6 +117,7 @@ import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot;
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood; import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant; import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt; import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt;
import mineplex.core.gadget.gadgets.taunts.RainbowTaunt;
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken; import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames; import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames;
import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween; import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween;
@ -140,6 +145,7 @@ import mineplex.core.mount.types.MountMule;
import mineplex.core.mount.types.MountNightmareSteed; import mineplex.core.mount.types.MountNightmareSteed;
import mineplex.core.mount.types.MountSlime; import mineplex.core.mount.types.MountSlime;
import mineplex.core.mount.types.MountSpider; import mineplex.core.mount.types.MountSpider;
import mineplex.core.mount.types.MountStPatricksHorse;
import mineplex.core.mount.types.MountUndead; import mineplex.core.mount.types.MountUndead;
import mineplex.core.mount.types.MountValentinesSheep; import mineplex.core.mount.types.MountValentinesSheep;
import mineplex.core.mount.types.MountZombie; import mineplex.core.mount.types.MountZombie;
@ -553,6 +559,11 @@ public class RewardManager
addPetReward(Type.LOVECHEST, PetType.CUPID_PET, rarity, 50, 500); addPetReward(Type.LOVECHEST, PetType.CUPID_PET, rarity, 50, 500);
addGadget(Type.LOVECHEST, getGadget(WinEffectLoveIsABattlefield.class), rarity, 100, 500); addGadget(Type.LOVECHEST, getGadget(WinEffectLoveIsABattlefield.class), rarity, 100, 500);
// ST PATRICKS
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksChestplate.class), rarity, 50);
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksLeggings.class), rarity, 50);
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksBoots.class), rarity, 50);
} }
public void addLegendary() public void addLegendary()
@ -770,6 +781,14 @@ public class RewardManager
addGadget(Type.LOVECHEST, getGadget(MorphLoveDoctor.class), rarity, 30, 5000); addGadget(Type.LOVECHEST, getGadget(MorphLoveDoctor.class), rarity, 30, 5000);
addGadget(Type.LOVECHEST, getGadget(BlowAKissTaunt.class), rarity, 50, 5000); addGadget(Type.LOVECHEST, getGadget(BlowAKissTaunt.class), rarity, 50, 5000);
addGadget(Type.LOVECHEST, getGadget(ParticleWingsLove.class), rarity, 10, 5000); addGadget(Type.LOVECHEST, getGadget(ParticleWingsLove.class), rarity, 10, 5000);
// ST PATRICKS
addGadget(Type.STPATRICKS, getGadget(RainbowTaunt.class), rarity, 30);
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksHat.class), rarity, 15);
addPetReward(Type.STPATRICKS, PetType.LEPRECHAUN, rarity, 30);
addMount(Type.STPATRICKS, getMount(MountStPatricksHorse.class), rarity, 30);
} }
public UnknownPackageReward addMount(Type type, Mount<?> mount, RewardRarity rarity, int weight) public UnknownPackageReward addMount(Type type, Mount<?> mount, RewardRarity rarity, int weight)

View File

@ -64,6 +64,7 @@ public class RewardPool
GINGERBREAD(false, 1), GINGERBREAD(false, 1),
MINESTRIKE(true, 2), MINESTRIKE(true, 2),
LOVECHEST(false, 1), LOVECHEST(false, 1),
STPATRICKS(false, 1),
CARL_SPINNER(true); CARL_SPINNER(true);
private boolean _useDuplicates; private boolean _useDuplicates;

View File

@ -21,6 +21,7 @@ public enum RewardType
MINESTRIKE_CHEST( 0, 2, 16, 0), MINESTRIKE_CHEST( 0, 2, 16, 0),
LOVE_CHEST( 0, 6, 18, 0), LOVE_CHEST( 0, 6, 18, 0),
VALENTINES_GIFT( 0, 7, 20, 20), VALENTINES_GIFT( 0, 7, 20, 20),
ST_PATRICKS( 0, 6, 18, 0),
SPINNER_FILLER( 0.1, 1, 4, 20), SPINNER_FILLER( 0.1, 1, 4, 20),
SPINNER_REAL( 0.000001, 0.05, 0.4, 5); SPINNER_REAL( 0.000001, 0.05, 0.4, 5);

View File

@ -111,7 +111,7 @@ public class HolidayCheerTrack extends Track
@EventHandler @EventHandler
public void onUseCosmetic(TreasureStartEvent event) public void onUseCosmetic(TreasureStartEvent event)
{ {
if (!HOLIDAY_CHESTS.contains(event.getTreasureType())) if (!HOLIDAY_CHESTS.contains(event.getTreasure().getTreasureType()))
return; return;
int points = 100; int points = 100;

View File

@ -119,8 +119,8 @@ public class LuckyTrack extends Track
int basePoints = POINTS.get(reward.getRarity()); int basePoints = POINTS.get(reward.getRarity());
if (MULTIPLIER.get(event.getTreasureType()) != null) if (MULTIPLIER.get(event.getTreasure().getTreasureType()) != null)
basePoints *= MULTIPLIER.get(event.getTreasureType()); basePoints *= MULTIPLIER.get(event.getTreasure().getTreasureType());
incrementFor(event.getPlayer(), basePoints); incrementFor(event.getPlayer(), basePoints);
} }

View File

@ -79,9 +79,9 @@ public class TreasureHunterTrack extends Track
@EventHandler @EventHandler
public void onUseCosmetic(TreasureStartEvent event) public void onUseCosmetic(TreasureStartEvent event)
{ {
if (POINTS.containsKey(event.getTreasureType())) if (POINTS.containsKey(event.getTreasure().getTreasureType()))
{ {
int basePoints = POINTS.get(event.getTreasureType()); int basePoints = POINTS.get(event.getTreasure().getTreasureType());
if (isSetActive(event.getPlayer(), SetWisdom.class)) if (isSetActive(event.getPlayer(), SetWisdom.class))
{ {

View File

@ -49,9 +49,6 @@ import mineplex.core.treasure.animation.LootRareAnimation;
import mineplex.core.treasure.animation.LootUncommonAnimation; import mineplex.core.treasure.animation.LootUncommonAnimation;
import mineplex.core.treasure.animation.TreasureRemoveAnimation; import mineplex.core.treasure.animation.TreasureRemoveAnimation;
/**
* Created by Shaun on 8/27/2014.
*/
public class Treasure public class Treasure
{ {
private BlockRestore _blockRestore; private BlockRestore _blockRestore;
@ -82,15 +79,18 @@ public class Treasure
private HologramManager _hologramManager; private HologramManager _hologramManager;
private ServerStatusManager _statusManager; private ServerStatusManager _statusManager;
public Treasure(Player player, Reward[] rewards, RewardType rewardType, Block centerBlock, Block[] chestBlocks, TreasureType treasureType, BlockRestore blockRestore, HologramManager hologramManager, ServerStatusManager statusManager) private TreasureManager _treasureManager;
public Treasure(TreasureManager treasureManager, Player player, Reward[] rewards, RewardType rewardType, Block centerBlock, Block[] chestBlocks, TreasureType treasureType, BlockRestore blockRestore, HologramManager hologramManager, ServerStatusManager statusManager)
{ {
this(player, new Random(), rewards, rewardType, centerBlock, chestBlocks, treasureType, hologramManager, statusManager); this(treasureManager, player, new Random(), rewards, rewardType, centerBlock, chestBlocks, treasureType, hologramManager, statusManager);
_blockRestore = blockRestore; _blockRestore = blockRestore;
} }
public Treasure(Player player, Random seed, Reward[] rewards, RewardType rewardType, Block centerBlock, Block[] chestBlocks, TreasureType treasureType, HologramManager hologramManager, ServerStatusManager statusManager) public Treasure(TreasureManager treasureManager, Player player, Random seed, Reward[] rewards, RewardType rewardType, Block centerBlock, Block[] chestBlocks, TreasureType treasureType, HologramManager hologramManager, ServerStatusManager statusManager)
{ {
_treasureManager = treasureManager;
_player = player; _player = player;
_random = seed; _random = seed;
@ -215,6 +215,15 @@ public class Treasure
double rX = Math.random() * 2 - 1, rZ = Math.random() * 2 - 1; double rX = Math.random() * 2 - 1, rZ = Math.random() * 2 - 1;
UtilParticle.PlayParticle(type, block.getLocation().add(.5 + rX, .7, .5 + rZ), .5f, .5f, .5f, .25f, 1, ViewDist.NORMAL); UtilParticle.PlayParticle(type, block.getLocation().add(.5 + rX, .7, .5 + rZ), .5f, .5f, .5f, .25f, 1, ViewDist.NORMAL);
} }
else if (_treasureType == TreasureType.ST_PATRICKS)
{
int r = (int) (Math.random() * 2);
double rX = Math.random() * 2 - 1, rZ = Math.random() * 2 - 1;
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST,
new DustSpellColor((r == 0) ? Color.GREEN : new Color(0, 100, 0)),
block.getLocation().add(.5 + rX, .7, .5 + rZ));
coloredParticle.display();
}
else else
{ {
UtilParticle.PlayParticle(type, block.getLocation().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.2F, 0, UtilParticle.PlayParticle(type, block.getLocation().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.2F, 0,
@ -320,7 +329,7 @@ public class Treasure
if (isFinished()) if (isFinished())
{ {
TreasureRemoveAnimation animation = new TreasureRemoveAnimation(Treasure.this, _openedChestBlockInfo, _chestBlockInfo); TreasureRemoveAnimation animation = new TreasureRemoveAnimation(Treasure.this, _chestBlockInfo);
_animations.add(animation); _animations.add(animation);
_finished = true; _finished = true;
} }
@ -452,4 +461,14 @@ public class Treasure
{ {
return _treasureType; return _treasureType;
} }
public void addAnimation(Animation animation)
{
_animations.add(animation);
}
public TreasureManager getTreasureManager()
{
return _treasureManager;
}
} }

View File

@ -115,6 +115,7 @@ public class TreasureLocation implements Listener
return; return;
} }
chargeAccount(player, treasureType, new Callback<Boolean>() chargeAccount(player, treasureType, new Callback<Boolean>()
{ {
@Override @Override
@ -172,12 +173,12 @@ public class TreasureLocation implements Listener
Bukkit.broadcastMessage(F.main("Treasure", F.name(player.getName()) + " is opening " + pron + name)); Bukkit.broadcastMessage(F.main("Treasure", F.name(player.getName()) + " is opening " + pron + name));
} }
TreasureStartEvent startEvent = new TreasureStartEvent(player, treasureType, Arrays.asList(rewards)); Treasure treasure = new Treasure(_treasureManager, player, rewards, treasureType.getRewardType(), _chestBlock, _chestSpawns, treasureType, _treasureManager.getBlockRestore(), _hologramManager, _statusManager);
UtilServer.CallEvent(startEvent);
Treasure treasure = new Treasure(player, rewards, treasureType.getRewardType(), _chestBlock, _chestSpawns, treasureType, _treasureManager.getBlockRestore(), _hologramManager, _statusManager);
_currentTreasure = treasure; _currentTreasure = treasure;
TreasureStartEvent startEvent = new TreasureStartEvent(player, treasure, Arrays.asList(rewards));
UtilServer.CallEvent(startEvent);
UtilTextMiddle.display(treasureType.getName(), "Choose " + rewards.length + " " + UtilText.plural("Chest", rewards.length) + " To Open", 20, 180, 20, player); UtilTextMiddle.display(treasureType.getName(), "Choose " + rewards.length + " " + UtilText.plural("Chest", rewards.length) + " To Open", 20, 180, 20, player);
UtilPlayer.message(player, F.main("Treasure", "Choose " + rewards.length + " " + UtilText.plural("Chest", rewards.length) + " To Open")); UtilPlayer.message(player, F.main("Treasure", "Choose " + rewards.length + " " + UtilText.plural("Chest", rewards.length) + " To Open"));

View File

@ -1,11 +1,17 @@
package mineplex.core.treasure; package mineplex.core.treasure;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
@ -25,10 +31,12 @@ import mineplex.core.reward.RewardPool;
import mineplex.core.reward.RewardType; import mineplex.core.reward.RewardType;
import mineplex.core.stats.StatsManager; import mineplex.core.stats.StatsManager;
import mineplex.core.status.ServerStatusManager; import mineplex.core.status.ServerStatusManager;
import mineplex.core.treasure.animation.Animation;
import mineplex.core.treasure.event.TreasureFinishEvent;
import mineplex.core.treasure.event.TreasureStartEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
/**
* Created by Shaun on 8/27/2014.
*/
public class TreasureManager extends MiniPlugin public class TreasureManager extends MiniPlugin
{ {
private CoreClientManager _clientManager; private CoreClientManager _clientManager;
@ -39,6 +47,9 @@ public class TreasureManager extends MiniPlugin
private StatsManager _statsManager; private StatsManager _statsManager;
private List<TreasureLocation> _treasureLocations; private List<TreasureLocation> _treasureLocations;
private List<Location> _blockLocations; private List<Location> _blockLocations;
private List<Item> _items;
private Map<Treasure, Animation> _treasureAnimations = new HashMap<>();
public TreasureManager(JavaPlugin plugin, CoreClientManager clientManager, ServerStatusManager statusManager, DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, GadgetManager gadgetManager, BlockRestore blockRestore, HologramManager hologramManager, StatsManager statsManager, RewardManager rewardManager) public TreasureManager(JavaPlugin plugin, CoreClientManager clientManager, ServerStatusManager statusManager, DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, GadgetManager gadgetManager, BlockRestore blockRestore, HologramManager hologramManager, StatsManager statsManager, RewardManager rewardManager)
{ {
@ -53,6 +64,7 @@ public class TreasureManager extends MiniPlugin
_treasureLocations = Lists.newArrayList(); _treasureLocations = Lists.newArrayList();
_blockLocations = Lists.newArrayList(); _blockLocations = Lists.newArrayList();
_items = Lists.newArrayList();
for(Location location : LocationConstants.CHEST_LOCATIONS) for(Location location : LocationConstants.CHEST_LOCATIONS)
{ {
@ -161,4 +173,58 @@ public class TreasureManager extends MiniPlugin
{ {
return _blockLocations; return _blockLocations;
} }
@EventHandler
public void playCustomAnimation(TreasureStartEvent event)
{
TreasureType treasureType = event.getTreasure().getTreasureType();
/*if (treasureType == TreasureType.ST_PATRICKS)
{
StPatricksChestAnimation stPatricksChestAnimation = new StPatricksChestAnimation(event.getTreasure(), event.getTreasure().getCenterBlock());
event.getTreasure().addAnimation(stPatricksChestAnimation);
_treasureAnimations.put(event.getTreasure(), stPatricksChestAnimation);
}*/
}
@EventHandler
public void stopCustomAnimation(TreasureFinishEvent event)
{
if (_treasureAnimations.containsKey(event.getTreasure()))
{
Animation animation = _treasureAnimations.get(event.getTreasure());
animation.setRunning(false);
}
}
public void addItem(Item item)
{
_items.add(item);
}
@EventHandler
public void pickupItem(PlayerPickupItemEvent event)
{
if (_items.contains(event.getItem()))
{
event.setCancelled(true);
}
}
@EventHandler
public void removeItems(UpdateEvent event)
{
if (event.getType() == UpdateType.TICK)
{
Iterator<Item> it = _items.iterator();
while (it.hasNext())
{
Item item = it.next();
if (item.getTicksLived() >= 20)
{
item.remove();
it.remove();
}
}
}
}
} }

View File

@ -90,6 +90,13 @@ public enum TreasureStyle
ParticleType.HEART, ParticleType.HEART,
Sound.VILLAGER_YES, Sound.VILLAGER_YES,
Sound.VILLAGER_YES Sound.VILLAGER_YES
),
STPATRICKS(
ParticleType.HAPPY_VILLAGER,
ParticleType.HAPPY_VILLAGER,
ParticleType.HAPPY_VILLAGER,
Sound.VILLAGER_YES,
Sound.VILLAGER_YES
); );
private ParticleType _secondaryParticle; private ParticleType _secondaryParticle;

View File

@ -32,7 +32,9 @@ public enum TreasureType
MINESTRIKE(C.cGold + "Minestrike Treasure", "Minestrike Chest", "MinestrikeChest", RewardType.MINESTRIKE_CHEST, Material.CHEST, TreasureStyle.MINESTRIKE, RewardPool.Type.MINESTRIKE, true, 10000), MINESTRIKE(C.cGold + "Minestrike Treasure", "Minestrike Chest", "MinestrikeChest", RewardType.MINESTRIKE_CHEST, Material.CHEST, TreasureStyle.MINESTRIKE, RewardPool.Type.MINESTRIKE, true, 10000),
LOVE_CHEST(C.cRed + "Love Treasure", "Love Chest", "LoveChest", RewardType.LOVE_CHEST, Material.CHEST, TreasureStyle.LOVECHEST, RewardPool.Type.LOVECHEST, true, 20000); LOVE_CHEST(C.cRed + "Love Treasure", "Love Chest", "LoveChest", RewardType.LOVE_CHEST, Material.CHEST, TreasureStyle.LOVECHEST, RewardPool.Type.LOVECHEST, true, 20000),
ST_PATRICKS(C.cGreen + "St Patrick's Treasure", "St Patricks Chest", "StPatricksChest", RewardType.ST_PATRICKS, Material.CHEST, TreasureStyle.STPATRICKS,RewardPool.Type.STPATRICKS, true, 20000);
private final String _name; private final String _name;
private final RewardType _rewardType; private final RewardType _rewardType;

View File

@ -94,6 +94,11 @@ public class BlockChangeAnimation extends Animation
mat = Material.WOOL; mat = Material.WOOL;
data = 6; data = 6;
} }
else if (getTreasure().getTreasureType() == TreasureType.ST_PATRICKS)
{
mat = Material.WOOL;
data = 13;
}
else else
continue; continue;
@ -141,6 +146,11 @@ public class BlockChangeAnimation extends Animation
mat = Material.WOOL; mat = Material.WOOL;
data = 14; data = 14;
} }
else if (getTreasure().getTreasureType() == TreasureType.ST_PATRICKS)
{
mat = Material.GOLD_BLOCK;
data = 0;
}
else else
continue; continue;

View File

@ -36,9 +36,6 @@ import mineplex.core.treasure.BlockInfo;
import mineplex.core.treasure.Treasure; import mineplex.core.treasure.Treasure;
import mineplex.core.treasure.TreasureType; import mineplex.core.treasure.TreasureType;
/**
* Created by Shaun on 8/29/2014.
*/
public class ChestSpawnAnimation extends Animation public class ChestSpawnAnimation extends Animation
{ {
private static final int ANIMATION_DURATION = 80; private static final int ANIMATION_DURATION = 80;
@ -134,7 +131,8 @@ public class ChestSpawnAnimation extends Animation
UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), newLoc, 0f, 0f, 0f, 0, 1, UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), newLoc, 0f, 0f, 0f, 0, 1,
ViewDist.NORMAL, UtilServer.getPlayers()); ViewDist.NORMAL, UtilServer.getPlayers());
} }
else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL || getTreasure().getTreasureType() == TreasureType.MINESTRIKE) else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL || getTreasure().getTreasureType() == TreasureType.MINESTRIKE ||
getTreasure().getTreasureType() == TreasureType.ST_PATRICKS)
{ {
float y = 5 * scale; float y = 5 * scale;
double width = 0.7 * ((double) getTicks() / (double) ANIMATION_DURATION); double width = 0.7 * ((double) getTicks() / (double) ANIMATION_DURATION);
@ -153,7 +151,10 @@ public class ChestSpawnAnimation extends Animation
} }
else else
{ {
ColoredParticle coloredParticle = new ColoredParticle(ParticleType.RED_DUST, new DustSpellColor(Color.YELLOW), _centerLocation.clone().add(x * width, y, z * width)); DustSpellColor minestrikeColor = new DustSpellColor(Color.YELLOW);
DustSpellColor stpatricksColor = new DustSpellColor(Color.GREEN);
ColoredParticle coloredParticle = new ColoredParticle(ParticleType.RED_DUST,
(getTreasure().getTreasureType() == TreasureType.MINESTRIKE) ? minestrikeColor : stpatricksColor, _centerLocation.clone().add(x * width, y, z * width));
coloredParticle.display(); coloredParticle.display();
} }
} }
@ -245,6 +246,11 @@ public class ChestSpawnAnimation extends Animation
doBats(true, _centerLocation.clone().add(0, 6, 0), _bats); doBats(true, _centerLocation.clone().add(0, 6, 0), _bats);
} }
} }
else if (getTreasure().getTreasureType() == TreasureType.ST_PATRICKS)
{
Location location = _centerLocation.clone().add(0, 5, 0);
}
//Spawn Chest //Spawn Chest
if (getTicks() >= ANIMATION_DURATION) if (getTicks() >= ANIMATION_DURATION)

View File

@ -0,0 +1,46 @@
package mineplex.core.treasure.animation;
import java.awt.Color;
import org.bukkit.block.Block;
import org.bukkit.util.Vector;
import mineplex.core.common.shape.ShapeWings;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.treasure.Treasure;
public class StPatricksChestAnimation extends Animation
{
private Block _center;
private int _tick = 0;
private ShapeWings _cloverBlack = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '#', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
private ShapeWings _cloverDarkGreen = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '%', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
private ShapeWings _cloverGreen = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '*', ShapeWings.DEFAULT_ROTATION, ShapeWings.FOUR_LEAF_CLOVER);
public StPatricksChestAnimation(Treasure treasure, Block center)
{
super(treasure);
_center = center;
}
@Override
protected void tick()
{
_tick++;
if (_tick % 5 == 0)
{
_cloverBlack.displayColored(_center.getLocation().add(0, 5, 0), Color.BLACK);
_cloverDarkGreen.displayColored(_center.getLocation().add(0, 5, 0), new Color(0, 100, 0));
_cloverGreen.displayColored(_center.getLocation().add(0, 5, 0), Color.GREEN);
}
}
@Override
protected void onFinish()
{
}
}

View File

@ -3,22 +3,27 @@ package mineplex.core.treasure.animation;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilAction;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.treasure.BlockInfo; import mineplex.core.treasure.BlockInfo;
import mineplex.core.treasure.Treasure; import mineplex.core.treasure.Treasure;
import mineplex.core.treasure.TreasureType;
/**
* Created by shaun on 14-09-15.
*/
public class TreasureRemoveAnimation extends Animation public class TreasureRemoveAnimation extends Animation
{ {
private Random _random = new Random(); private Random _random = new Random();
private List<BlockInfo> _openedChests;
private List<BlockInfo> _otherChests; private List<BlockInfo> _otherChests;
private int _count = 0;
public TreasureRemoveAnimation(Treasure treasure, List<BlockInfo> openedChests, List<BlockInfo> otherChests) public TreasureRemoveAnimation(Treasure treasure, List<BlockInfo> otherChests)
{ {
super(treasure); super(treasure);
_openedChests = openedChests;
_otherChests = otherChests; _otherChests = otherChests;
} }
@ -31,14 +36,13 @@ public class TreasureRemoveAnimation extends Animation
{ {
BlockInfo info = _otherChests.remove(_random.nextInt(_otherChests.size())); BlockInfo info = _otherChests.remove(_random.nextInt(_otherChests.size()));
getTreasure().resetBlockInfo(info); getTreasure().resetBlockInfo(info);
// System.out.println("otherchests"); if (getTreasure().getTreasureType() == TreasureType.ST_PATRICKS)
{
// Drops gold nugget
dropItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_NUGGET, (byte) 0, 1, "DroppedNugget" + _count), info);
_count++;
}
} }
// else if (!_openedChests.isEmpty())
// {
// System.out.println("openchests");
// BlockInfo info = _openedChests.remove(_random.nextInt(_openedChests.size()));
// getTreasure().resetBlockInfo(info);
// }
else else
{ {
finish(); finish();
@ -46,6 +50,16 @@ public class TreasureRemoveAnimation extends Animation
} }
} }
private void dropItem(ItemStack itemStack, BlockInfo blockInfo)
{
Location location = blockInfo.getBlock().getLocation();
Item item = location.getWorld().dropItem(location.add(0, .5, 0), itemStack);
Vector vel = new Vector(Math.sin(_count * 9/5d), 0, Math.cos(_count * 9/5d));
UtilAction.velocity(item, vel, Math.abs(Math.sin(_count * 12/3000d)), false, 0, 0.2 +
Math.abs(Math.cos(_count * 12/3000d))*0.6, 1, false);
getTreasure().getTreasureManager().addItem(item);
}
@Override @Override
protected void onFinish() protected void onFinish()
{ {

View File

@ -8,20 +8,20 @@ import org.bukkit.event.Event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import mineplex.core.reward.Reward; import mineplex.core.reward.Reward;
import mineplex.core.treasure.TreasureType; import mineplex.core.treasure.Treasure;
public class TreasureStartEvent extends Event public class TreasureStartEvent extends Event
{ {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
private Player _player; private Player _player;
private TreasureType _treasureType; private Treasure _treasure;
private List<Reward> _rewards; private List<Reward> _rewards;
public TreasureStartEvent(Player player, TreasureType treasureType, List<Reward> rewards) public TreasureStartEvent(Player player, Treasure treasure, List<Reward> rewards)
{ {
_player = player; _player = player;
_treasureType = treasureType; _treasure = treasure;
_rewards = rewards; _rewards = rewards;
} }
@ -30,9 +30,9 @@ public class TreasureStartEvent extends Event
return _player; return _player;
} }
public TreasureType getTreasureType() public Treasure getTreasure()
{ {
return _treasureType; return _treasure;
} }
public List<Reward> getRewards() public List<Reward> getRewards()

View File

@ -98,7 +98,8 @@ public class BuyChestButton implements IButton
} }
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player) if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player)
&& (_chestType == TreasureType.ILLUMINATED || _chestType == TreasureType.OMEGA && (_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!")); player.sendMessage(F.main("Treasure", "You seem to have all treasures for this chest unlocked already!"));
return; return;

View File

@ -137,6 +137,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
int gingerbreadCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.GINGERBREAD.getItemName()); int gingerbreadCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.GINGERBREAD.getItemName());
int minestrikeCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MINESTRIKE.getItemName()); int minestrikeCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MINESTRIKE.getItemName());
int loveCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.LOVE_CHEST.getItemName()); int loveCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.LOVE_CHEST.getItemName());
int stpatricksCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.ST_PATRICKS.getItemName());
boolean availableChristmas = false; boolean availableChristmas = false;
boolean availableFreedom = false; boolean availableFreedom = false;
@ -144,7 +145,8 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
boolean availableTrick = false; boolean availableTrick = false;
boolean availableThank = false; boolean availableThank = false;
boolean availableGingerbread = false; boolean availableGingerbread = false;
boolean availableLove = new File("../../update/files/EnableLoveChest.dat").exists(); boolean availableLove = false;
boolean availableStPatricks = new File("../../update/files/EnableStPatricksChest.dat").exists();
List<String> shardLore = new ArrayList<>(); List<String> shardLore = new ArrayList<>();
shardLore.add(" "); shardLore.add(" ");
@ -407,6 +409,30 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
} }
} }
List<String> stpatricksLore = Lists.newArrayList();
stpatricksLore.add(" ");
stpatricksLore.add(F.value("St Patrick's Chests Owned", "" + stpatricksCount));
stpatricksLore.add(" ");
stpatricksLore.addAll(UtilText.splitLines(new String[]{C.cGray + "Placeholder"}, LineFormat.LORE));
stpatricksLore.add(" ");
if (stpatricksCount > 0)
{
stpatricksLore.add(C.cGreen + "Click to Open!");
}
else
{
if (!availableStPatricks)
{
stpatricksLore.add(C.cRed + "This item is no longer available");
}
else
{
stpatricksLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + TreasureType.LOVE_CHEST.getPurchasePrice() + " Treasure Shards");
stpatricksLore.add(" ");
stpatricksLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
}
}
ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false); ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false);
// Normal chests // Normal chests
@ -425,6 +451,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
ItemStack thank = new ShopItem(Material.COOKED_CHICKEN, C.cGoldB + "Thankful Treasure", thankLore.toArray(new String[0]), 0, false, false); ItemStack thank = new ShopItem(Material.COOKED_CHICKEN, C.cGoldB + "Thankful Treasure", thankLore.toArray(new String[0]), 0, false, false);
ItemStack gingerbread = SkinData.GINGERBREAD.getSkull(C.cRedB + "Gingerbread" + C.cGreenB + " Treasure", gingerbreadLore); ItemStack gingerbread = SkinData.GINGERBREAD.getSkull(C.cRedB + "Gingerbread" + C.cGreenB + " Treasure", gingerbreadLore);
ItemStack lovechest = new ShopItem(Material.WOOL, (byte) 6, C.cRedB + "Love Chest", lovechestLore.toArray(new String[0]), 0, false, false); ItemStack lovechest = new ShopItem(Material.WOOL, (byte) 6, C.cRedB + "Love Chest", lovechestLore.toArray(new String[0]), 0, false, false);
ItemStack stpatricks = SkinData.LEPRECHAUN.getSkull(C.cGreenB + "St Patrick's Treasure", stpatricksLore);
// Adds shard item // Adds shard item
addItem(49, shards); addItem(49, shards);
@ -447,6 +474,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
TreasurePageItem thankTreasureItem = new TreasurePageItem(thank, thankCount, TreasureType.THANKFUL); TreasurePageItem thankTreasureItem = new TreasurePageItem(thank, thankCount, TreasureType.THANKFUL);
TreasurePageItem gingerbreadTreasureItem = new TreasurePageItem(gingerbread, gingerbreadCount, TreasureType.GINGERBREAD); TreasurePageItem gingerbreadTreasureItem = new TreasurePageItem(gingerbread, gingerbreadCount, TreasureType.GINGERBREAD);
TreasurePageItem loveChestItem = new TreasurePageItem(lovechest, loveCount, TreasureType.LOVE_CHEST); TreasurePageItem loveChestItem = new TreasurePageItem(lovechest, loveCount, TreasureType.LOVE_CHEST);
TreasurePageItem stPatricksItem = new TreasurePageItem(stpatricks, stpatricksCount, TreasureType.ST_PATRICKS);
_normalTreasures.add(oldTreasureItem); _normalTreasures.add(oldTreasureItem);
_normalTreasures.add(ancientTreasureItem); _normalTreasures.add(ancientTreasureItem);
@ -455,6 +483,11 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
_normalTreasures.add(omegaTreasureItem); _normalTreasures.add(omegaTreasureItem);
_normalTreasures.add(minestrikeTreasureItem); _normalTreasures.add(minestrikeTreasureItem);
if (availableStPatricks)
_specialTreasures.add(stPatricksItem);
else
_seasonalTreasures.add(stPatricksItem);
if (availableLove) if (availableLove)
_specialTreasures.add(loveChestItem); _specialTreasures.add(loveChestItem);
else else

View File

@ -166,6 +166,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
int gingerbreadChestsReceived = 0; int gingerbreadChestsReceived = 0;
int minestrikeChestsReceived = 0; int minestrikeChestsReceived = 0;
int loveChestsReceived = 0; int loveChestsReceived = 0;
int stPatricksChestReceived = 0;
for (CoinTransactionToken transaction : donor.getCoinTransactions()) for (CoinTransactionToken transaction : donor.getCoinTransactions())
{ {
@ -319,6 +320,16 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
loveChestsReceived += 1; loveChestsReceived += 1;
} }
} }
if (transaction.SalesPackageName.startsWith("St Patricks Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
stPatricksChestReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
stPatricksChestReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Valentines Gift")) if (transaction.SalesPackageName.startsWith("Valentines Gift"))
{ {
if (transaction.Coins == 0 && transaction.Gems == 0) if (transaction.Coins == 0 && transaction.Gems == 0)
@ -391,6 +402,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
caller.sendMessage(C.cBlue + "Trick or Treat Chests Received: " + C.cYellow + trickOrTreatChestsReceived + " " + C.cBlue + "Thankful Chests Received: " + C.cYellow + thankfulChestsReceived); caller.sendMessage(C.cBlue + "Trick or Treat Chests Received: " + C.cYellow + trickOrTreatChestsReceived + " " + C.cBlue + "Thankful Chests Received: " + C.cYellow + thankfulChestsReceived);
caller.sendMessage(C.cBlue + "Gingerbread Chests Received: " + C.cYellow + gingerbreadChestsReceived + " " + C.cBlue + "Minestrike Chests Received: " + C.cYellow + minestrikeChestsReceived); caller.sendMessage(C.cBlue + "Gingerbread Chests Received: " + C.cYellow + gingerbreadChestsReceived + " " + C.cBlue + "Minestrike Chests Received: " + C.cYellow + minestrikeChestsReceived);
caller.sendMessage(C.cBlue + "Love Chests Received: " + C.cYellow + loveChestsReceived); caller.sendMessage(C.cBlue + "Love Chests Received: " + C.cYellow + loveChestsReceived);
caller.sendMessage(C.cBlue + "St Patrick's Chests Received: " + C.cYellow + stPatricksChestReceived);
caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived); caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived);
caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min/60 min) Received: " + C.cYellow + runeAmplifier20 + "/" + runeAmplifier60); caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min/60 min) Received: " + C.cYellow + runeAmplifier20 + "/" + runeAmplifier60);
caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Usage") + " " + C.cBlue + "Clan Banner Editor: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Editor")); caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Usage") + " " + C.cBlue + "Clan Banner Editor: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Editor"));

View File

@ -39,6 +39,7 @@ import mineplex.staffServer.salespackage.salespackages.Pet;
import mineplex.staffServer.salespackage.salespackages.PowerPlayClub; import mineplex.staffServer.salespackage.salespackages.PowerPlayClub;
import mineplex.staffServer.salespackage.salespackages.RuneAmplifier; import mineplex.staffServer.salespackage.salespackages.RuneAmplifier;
import mineplex.staffServer.salespackage.salespackages.SalesPackageBase; import mineplex.staffServer.salespackage.salespackages.SalesPackageBase;
import mineplex.staffServer.salespackage.salespackages.StPatricksChest;
import mineplex.staffServer.salespackage.salespackages.ThankfulChest; import mineplex.staffServer.salespackage.salespackages.ThankfulChest;
import mineplex.staffServer.salespackage.salespackages.TrickOrTreatChest; import mineplex.staffServer.salespackage.salespackages.TrickOrTreatChest;
@ -100,6 +101,7 @@ public class SalesPackageManager extends MiniPlugin
AddSalesPackage(new HauntedChest(this)); AddSalesPackage(new HauntedChest(this));
AddSalesPackage(new MinestrikeChest(this)); AddSalesPackage(new MinestrikeChest(this));
AddSalesPackage(new LoveChest(this)); AddSalesPackage(new LoveChest(this));
AddSalesPackage(new StPatricksChest(this));
AddSalesPackage(new TrickOrTreatChest(this)); AddSalesPackage(new TrickOrTreatChest(this));
AddSalesPackage(new ThankfulChest(this)); AddSalesPackage(new ThankfulChest(this));
@ -171,7 +173,7 @@ public class SalesPackageManager extends MiniPlugin
coinBuilder = coinBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray"); coinBuilder = coinBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
} }
else if (salesPackage instanceof MythicalChest || salesPackage instanceof AncientChest || salesPackage instanceof OldChest || salesPackage instanceof IlluminatedChest || salesPackage instanceof FreedomChest || salesPackage instanceof HauntedChest || salesPackage instanceof TrickOrTreatChest else if (salesPackage instanceof MythicalChest || salesPackage instanceof AncientChest || salesPackage instanceof OldChest || salesPackage instanceof IlluminatedChest || salesPackage instanceof FreedomChest || salesPackage instanceof HauntedChest || salesPackage instanceof TrickOrTreatChest
|| salesPackage instanceof ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest || salesPackage instanceof LoveChest) || salesPackage instanceof ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest || salesPackage instanceof LoveChest || salesPackage instanceof StPatricksChest)
{ {
chestBuilder = chestBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray"); chestBuilder = chestBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
} }

View File

@ -0,0 +1,20 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class StPatricksChest extends SalesPackageBase
{
public StPatricksChest(SalesPackageManager manager)
{
super(manager, "1 St Patricks Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item St Patricks Chest", "Give 1 St Patricks Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,8 +1,9 @@
package nautilus.game.arcade.managers; package nautilus.game.arcade.managers;
import mineplex.core.Managers; import java.util.ArrayList;
import mineplex.core.PlayerSelector; import java.util.Iterator;
import mineplex.core.common.util.UtilLambda; import java.util.List;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.FireworkEffect.Type; import org.bukkit.FireworkEffect.Type;
@ -14,11 +15,13 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import mineplex.core.PlayerSelector;
import mineplex.core.bonuses.event.CarlSpinnerEvent; import mineplex.core.bonuses.event.CarlSpinnerEvent;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilLambda;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextBottom; import mineplex.core.common.util.UtilTextBottom;
@ -32,13 +35,13 @@ import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.GadgetType;
import mineplex.core.mount.Mount; import mineplex.core.mount.Mount;
import mineplex.core.mount.types.MountDragon; import mineplex.core.mount.types.MountDragon;
import mineplex.core.titles.Titles;
import mineplex.core.portal.GenericServer; import mineplex.core.portal.GenericServer;
import mineplex.core.portal.Intent; import mineplex.core.portal.Intent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.RestartServerEvent; import mineplex.core.updater.event.RestartServerEvent;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.events.GamePrepareCountdownCommence; import nautilus.game.arcade.events.GamePrepareCountdownCommence;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
@ -50,20 +53,6 @@ import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.uhc.UHC; import nautilus.game.arcade.game.games.uhc.UHC;
import nautilus.game.arcade.gametutorial.TutorialPhase; import nautilus.game.arcade.gametutorial.TutorialPhase;
import nautilus.game.arcade.gametutorial.TutorialText; import nautilus.game.arcade.gametutorial.TutorialText;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class GameManager implements Listener public class GameManager implements Listener
{ {