costume sets

This commit is contained in:
Cheese 2015-12-11 20:59:55 +11:00
parent 7fc08f34a7
commit d7f39bdfd8
26 changed files with 206 additions and 90 deletions

View File

@ -1,6 +1,7 @@
package mineplex.core.cosmetic.ui.page;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.bukkit.Bukkit;
@ -10,10 +11,13 @@ import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.CurrencyType;
import mineplex.core.common.util.C;
import mineplex.core.cosmetic.CosmeticManager;
import mineplex.core.cosmetic.ui.CosmeticShop;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.gadgets.outfit.OutfitRaveSuit;
import mineplex.core.gadget.gadgets.outfit.OutfitSpaceSuit;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.gadget.types.ItemGadget;
@ -37,19 +41,19 @@ public class CostumePage extends GadgetPage
{
int slot;
List<Class> costumeClasses = new ArrayList<Class>();
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Costume))
{
if (gadget.GetCost(CurrencyType.Coins) == -1)
continue;
OutfitGadget outfitGadget = ((OutfitGadget) gadget);
Class clazz = gadget.getClass();
if (!costumeClasses.contains(clazz))
{
costumeClasses.add(clazz);
}
int offset = 0;
if (gadget instanceof OutfitRaveSuit) offset = 0;
else if (gadget instanceof OutfitSpaceSuit) offset = 1;
slot = (costumeClasses.indexOf(clazz) * 2) + 3 + 18;
slot = offset + 1 + 18; //1 buffer to left, 18 = 2 lines down
if (outfitGadget.GetSlot() == OutfitGadget.ArmorSlot.Chest)
slot += 9;

View File

@ -32,66 +32,18 @@ import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
import mineplex.core.gadget.event.GadgetEnableEvent;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailTitan;
import mineplex.core.gadget.gadgets.death.DeathCandyCane;
import mineplex.core.gadget.gadgets.death.DeathFrostLord;
import mineplex.core.gadget.gadgets.death.DeathTitan;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan;
import mineplex.core.gadget.gadgets.hat.HatCoal;
import mineplex.core.gadget.gadgets.hat.HatPresent;
import mineplex.core.gadget.gadgets.hat.HatSanta;
import mineplex.core.gadget.gadgets.hat.HatSnowman;
import mineplex.core.gadget.gadgets.item.ItemBatGun;
import mineplex.core.gadget.gadgets.item.ItemCoal;
import mineplex.core.gadget.gadgets.item.ItemCoinBomb;
import mineplex.core.gadget.gadgets.item.ItemDuelingSword;
import mineplex.core.gadget.gadgets.item.ItemEtherealPearl;
import mineplex.core.gadget.gadgets.item.ItemFirework;
import mineplex.core.gadget.gadgets.item.ItemFleshHook;
import mineplex.core.gadget.gadgets.item.ItemFreezeCannon;
import mineplex.core.gadget.gadgets.item.ItemMelonLauncher;
import mineplex.core.gadget.gadgets.item.ItemPaintballGun;
import mineplex.core.gadget.gadgets.item.ItemPaintbrush;
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
import mineplex.core.gadget.gadgets.item.ItemSnowball;
import mineplex.core.gadget.gadgets.item.ItemTNT;
import mineplex.core.gadget.gadgets.morph.MorphBat;
import mineplex.core.gadget.gadgets.morph.MorphBlaze;
import mineplex.core.gadget.gadgets.morph.MorphBlock;
import mineplex.core.gadget.gadgets.morph.MorphBunny;
import mineplex.core.gadget.gadgets.morph.MorphChicken;
import mineplex.core.gadget.gadgets.morph.MorphCow;
import mineplex.core.gadget.gadgets.morph.MorphCreeper;
import mineplex.core.gadget.gadgets.morph.MorphEnderman;
import mineplex.core.gadget.gadgets.morph.MorphPig;
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
import mineplex.core.gadget.gadgets.morph.MorphSlime;
import mineplex.core.gadget.gadgets.morph.MorphSnowman;
import mineplex.core.gadget.gadgets.morph.MorphTitan;
import mineplex.core.gadget.gadgets.morph.MorphVillager;
import mineplex.core.gadget.gadgets.morph.MorphWither;
import mineplex.core.gadget.gadgets.outfit.OutfitRaveSuit;
import mineplex.core.gadget.gadgets.outfit.OutfitSpaceSuit;
import mineplex.core.gadget.gadgets.outfit.OutfitTeam;
import mineplex.core.gadget.gadgets.particle.ParticleCandyCane;
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
import mineplex.core.gadget.gadgets.particle.ParticleEnchant;
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
import mineplex.core.gadget.gadgets.particle.ParticleFoot;
import mineplex.core.gadget.gadgets.particle.ParticleFrostLord;
import mineplex.core.gadget.gadgets.particle.ParticleGreen;
import mineplex.core.gadget.gadgets.particle.ParticleHeart;
import mineplex.core.gadget.gadgets.particle.ParticleHelix;
import mineplex.core.gadget.gadgets.particle.ParticleLegend;
import mineplex.core.gadget.gadgets.particle.ParticleRain;
import mineplex.core.gadget.gadgets.particle.ParticleTitan;
import mineplex.core.gadget.gadgets.arrowtrail.*;
import mineplex.core.gadget.gadgets.death.*;
import mineplex.core.gadget.gadgets.doublejump.*;
import mineplex.core.gadget.gadgets.hat.*;
import mineplex.core.gadget.gadgets.item.*;
import mineplex.core.gadget.gadgets.morph.*;
import mineplex.core.gadget.gadgets.outfit.*;
import mineplex.core.gadget.gadgets.particle.*;
import mineplex.core.gadget.set.SetCandyCane;
import mineplex.core.gadget.set.SetFrostLord;
import mineplex.core.gadget.set.SetRaveSuit;
import mineplex.core.gadget.set.SetSpaceSuit;
import mineplex.core.gadget.set.SetTitan;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetSet;
@ -155,9 +107,14 @@ public class GadgetManager extends MiniPlugin
private void createSets()
{
//Particles
addSet(new SetFrostLord(this));
addSet(new SetCandyCane(this));
addSet(new SetTitan(this));
//Costumes
addSet(new SetRaveSuit(this));
addSet(new SetSpaceSuit(this));
}
private void CreateGadgets()
@ -181,15 +138,15 @@ public class GadgetManager extends MiniPlugin
addGadget(new ItemSnowball(this));
// Costume
addGadget(new OutfitRaveSuit(this, "Rave Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0));
addGadget(new OutfitRaveSuit(this, "Rave Shirt", -2, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0));
addGadget(new OutfitRaveSuit(this, "Rave Pants", -2, ArmorSlot.Legs, Material.LEATHER_LEGGINGS, (byte)0));
addGadget(new OutfitRaveSuit(this, "Rave Boots", -2, ArmorSlot.Boots, Material.LEATHER_BOOTS, (byte)0));
addGadget(new OutfitRaveSuitHelmet(this));
addGadget(new OutfitRaveSuitChestplate(this));
addGadget(new OutfitRaveSuitLeggings(this));
addGadget(new OutfitRaveSuitBoots(this));
addGadget(new OutfitSpaceSuit(this, "Space Helmet", -2, ArmorSlot.Helmet, Material.GLASS, (byte)0));
addGadget(new OutfitSpaceSuit(this, "Space Jacket", -2, ArmorSlot.Chest, Material.GOLD_CHESTPLATE, (byte)0));
addGadget(new OutfitSpaceSuit(this, "Space Pants", -2, ArmorSlot.Legs, Material.GOLD_LEGGINGS, (byte)0));
addGadget(new OutfitSpaceSuit(this, "Space Boots", -2, ArmorSlot.Boots, Material.GOLD_BOOTS, (byte)0));
addGadget(new OutfitSpaceSuitHelmet(this));
addGadget(new OutfitSpaceSuitChestplate(this));
addGadget(new OutfitSpaceSuitLeggings(this));
addGadget(new OutfitSpaceSuitBoots(this));
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));
@ -351,7 +308,7 @@ public class GadgetManager extends MiniPlugin
}
}
public void removeGadetType(Player player, GadgetType type)
public void removeGadgetType(Player player, GadgetType type)
{
List<Gadget> gadgets = _gadgets.get(type);
if(gadgets == null) return;

View File

@ -28,7 +28,7 @@ public class ItemDuelingSword extends ItemGadget
@Override
public void ApplyItem(Player player, boolean inform)
{
Manager.removeGadetType(player, GadgetType.Item);
Manager.removeGadgetType(player, GadgetType.Item);
_active.add(player);

View File

@ -55,7 +55,7 @@ public class ItemPaintbrush extends ItemGadget
@Override
public void ApplyItem(Player player, boolean inform)
{
Manager.removeGadetType(player, GadgetType.Item);
Manager.removeGadgetType(player, GadgetType.Item);
_active.add(player);

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitRaveSuitBoots extends OutfitRaveSuit
{
public OutfitRaveSuitBoots(GadgetManager manager)
{
super(manager, "Rave Boots", -2, ArmorSlot.Boots, Material.LEATHER_BOOTS, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitRaveSuitChestplate extends OutfitRaveSuit
{
public OutfitRaveSuitChestplate(GadgetManager manager)
{
super(manager, "Rave Shirt", -2, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitRaveSuitHelmet extends OutfitRaveSuit
{
public OutfitRaveSuitHelmet(GadgetManager manager)
{
super(manager, "Rave Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitRaveSuitLeggings extends OutfitRaveSuit
{
public OutfitRaveSuitLeggings(GadgetManager manager)
{
super(manager, "Rave Pants", -2, ArmorSlot.Legs, Material.LEATHER_LEGGINGS, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitSpaceSuitBoots extends OutfitRaveSuit
{
public OutfitSpaceSuitBoots(GadgetManager manager)
{
super(manager, "Space Boots", -2, ArmorSlot.Boots, Material.GOLD_BOOTS, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitSpaceSuitChestplate extends OutfitRaveSuit
{
public OutfitSpaceSuitChestplate(GadgetManager manager)
{
super(manager, "Space Jacket", -2, ArmorSlot.Chest, Material.GOLD_CHESTPLATE, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitSpaceSuitHelmet extends OutfitRaveSuit
{
public OutfitSpaceSuitHelmet(GadgetManager manager)
{
super(manager, "Space Helmet", -2, ArmorSlot.Helmet, Material.GLASS, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitSpaceSuitLeggings extends OutfitRaveSuit
{
public OutfitSpaceSuitLeggings(GadgetManager manager)
{
super(manager, "Space Pants", -2, ArmorSlot.Legs, Material.GOLD_LEGGINGS, (byte)0);
}
}

View File

@ -56,7 +56,7 @@ public class OutfitTeam extends OutfitGadget
@Override
public void ApplyArmor(Player player)
{
Manager.removeGadetType(player, GadgetType.Morph);
Manager.removeGadgetType(player, GadgetType.Morph);
Manager.RemoveOutfit(player, _slot);

View File

@ -0,0 +1,17 @@
package mineplex.core.gadget.set;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.outfit.*;
import mineplex.core.gadget.types.GadgetSet;
public class SetRaveSuit extends GadgetSet
{
public SetRaveSuit(GadgetManager manager)
{
super(manager, "Rave Suit", "Coming Soon...",
manager.getGadget(OutfitRaveSuitHelmet.class),
manager.getGadget(OutfitRaveSuitChestplate.class),
manager.getGadget(OutfitRaveSuitLeggings.class),
manager.getGadget(OutfitRaveSuitBoots.class));
}
}

View File

@ -0,0 +1,17 @@
package mineplex.core.gadget.set;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.outfit.*;
import mineplex.core.gadget.types.GadgetSet;
public class SetSpaceSuit extends GadgetSet
{
public SetSpaceSuit(GadgetManager manager)
{
super(manager, "Space Suit", "Coming Soon...",
manager.getGadget(OutfitSpaceSuitHelmet.class),
manager.getGadget(OutfitSpaceSuitChestplate.class),
manager.getGadget(OutfitSpaceSuitLeggings.class),
manager.getGadget(OutfitSpaceSuitBoots.class));
}
}

View File

@ -28,7 +28,7 @@ public abstract class ArrowEffectGadget extends Gadget
@Override
public void EnableCustom(Player player)
{
Manager.removeGadetType(player, GadgetType.ArrowTrail);
Manager.removeGadgetType(player, GadgetType.ArrowTrail);
_active.add(player);

View File

@ -17,7 +17,7 @@ public abstract class DeathEffectGadget extends Gadget
@Override
public void EnableCustom(Player player)
{
Manager.removeGadetType(player, GadgetType.Death);
Manager.removeGadgetType(player, GadgetType.Death);
_active.add(player);

View File

@ -19,7 +19,7 @@ public abstract class DoubleJumpEffectGadget extends Gadget
@Override
public void EnableCustom(Player player)
{
Manager.removeGadetType(player, GadgetType.DoubleJump);
Manager.removeGadgetType(player, GadgetType.DoubleJump);
_active.add(player);

View File

@ -5,6 +5,7 @@ import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import mineplex.core.common.util.C;
@ -63,13 +64,13 @@ public abstract class GadgetSet implements Listener
}
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR)
public void onActivate(GadgetEnableEvent event)
{
checkPlayer(event.getPlayer(), event.getGadget(), true);
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR)
public void onDeativate(GadgetDisableEvent event)
{
checkPlayer(event.getPlayer(), event.getGadget(), false);

View File

@ -33,7 +33,7 @@ public abstract class HatGadget extends OutfitGadget
public void ApplyArmor(Player player)
{
Manager.removeGadetType(player, GadgetType.Morph);
Manager.removeGadgetType(player, GadgetType.Morph);
Manager.RemoveOutfit(player, _slot);

View File

@ -64,7 +64,7 @@ public abstract class ItemGadget extends Gadget
public void ApplyItem(Player player, boolean inform)
{
Manager.removeGadetType(player, GadgetType.Item);
Manager.removeGadgetType(player, GadgetType.Item);
_active.add(player);

View File

@ -19,7 +19,7 @@ public abstract class MorphGadget extends Gadget
public void ApplyArmor(Player player)
{
Manager.removeGadetType(player, GadgetType.Morph);
Manager.removeGadgetType(player, GadgetType.Morph);
_active.add(player);

View File

@ -34,7 +34,7 @@ public abstract class OutfitGadget extends Gadget
public void ApplyArmor(Player player)
{
Manager.removeGadetType(player, GadgetType.Morph);
Manager.removeGadgetType(player, GadgetType.Morph);
Manager.RemoveOutfit(player, _slot);

View File

@ -17,7 +17,7 @@ public abstract class ParticleGadget extends Gadget
@Override
public void EnableCustom(Player player)
{
Manager.removeGadetType(player, GadgetType.Particle);
Manager.removeGadgetType(player, GadgetType.Particle);
_active.add(player);

View File

@ -178,7 +178,7 @@ public class DisguiseCommand extends CommandBase<HubManager> implements Listener
changeName(caller, args[0]);
Plugin.GetGadget().removeGadetType(caller, GadgetType.Item);
Plugin.GetGadget().removeGadgetType(caller, GadgetType.Item);
UtilPlayer.message(caller, C.cGreen + C.Bold + "Disguise Active: " + ChatColor.RESET + args[0]);
} catch(Exception e)

View File

@ -169,7 +169,7 @@ public class DisguiseCommand extends CommandBase<ArcadeManager> implements Liste
changeName(caller, args[0], true);
Plugin.getCosmeticManager().getGadgetManager().removeGadetType(caller, GadgetType.Item);
Plugin.getCosmeticManager().getGadgetManager().removeGadgetType(caller, GadgetType.Item);
Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "Quit> " + ChatColor.GRAY + _disguisedPlayersNames.get(caller));
UtilPlayer.message(caller, C.cGreen + C.Bold + "Disguise Active: " + ChatColor.RESET + args[0]);