Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.sirapathy;
- import me.sirapathy.Events.OutfitEffects;
- import me.sirapathy.Inventories.InventoryGUI;
- import me.sirapathy.Inventories.OutfitGUI1;
- import me.sirapathy.Skull.SkullManager;
- import me.sirapathy.Skull.SkullType;
- import org.bukkit.Color;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.HumanEntity;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.inventory.InventoryClickEvent;
- import org.bukkit.event.inventory.InventoryType.SlotType;
- import org.bukkit.event.player.PlayerQuitEvent;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.LeatherArmorMeta;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main$1 extends JavaPlugin implements Listener{
- public void onEnable()
- {
- getLogger().info("SkylandWardrobe has been enabled!");
- getServer().getPluginManager().registerEvents(this, this);
- getServer().getPluginManager().registerEvents(new OutfitEffects(this), this);
- SkullManager.setUp();
- OutfitEffects.chickenSpawn();
- }
- public void onDisable()
- {
- getLogger().info("SkylandWardrobe has been disabled!");
- }
- public ItemStack getColorArmor(Material m, Color c)
- {
- ItemStack i = new ItemStack(m, 1);
- LeatherArmorMeta meta = (LeatherArmorMeta) i.getItemMeta();
- meta.setColor(c);
- i.setItemMeta(meta);
- return i;
- }
- @EventHandler
- public void onQuit(PlayerQuitEvent e)
- {
- e.getPlayer().getInventory().setArmorContents(null);
- }
- public int r;
- public int g;
- public int b = 20;
- public int time = 59;
- @EventHandler
- public void onInvClick(final InventoryClickEvent e)
- {
- if (e.getInventory().getName().equals("Skyland Outfits (1/2)"))
- {
- e.setCancelled(true);
- final HumanEntity p = e.getWhoClicked();
- if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Rainbow"))
- {
- p.getInventory().setHelmet(new ItemStack(Material.LEATHER_HELMET));
- getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable()
- {
- public void run()
- {
- if (!p.getInventory().getHelmet().getItemMeta().hasDisplayName() && p.getInventory().getHelmet().getType().equals(Material.LEATHER_HELMET))
- {
- switch (Main$1.this.time)
- {
- case 59:
- Main$1.this.r = 255;
- Main$1.this.g = 0;
- Main$1.this.b = 0;
- Main$1.this.time -= 1;
- break;
- case 58:
- Main$1.this.r = 255;
- Main$1.this.g = 68;
- Main$1.this.b = 0;
- Main$1.this.time -= 1;
- break;
- case 57:
- Main$1.this.r = 255;
- Main$1.this.g = 111;
- Main$1.this.b = 0;
- Main$1.this.time -= 1;
- break;
- case 56:
- Main$1.this.r = 255;
- Main$1.this.g = 171;
- Main$1.this.b = 0;
- Main$1.this.time -= 1;
- break;
- case 55:
- Main$1.this.r = 255;
- Main$1.this.g = 255;
- Main$1.this.b = 0;
- Main$1.this.time -= 1;
- break;
- case 54:
- Main$1.this.r = 188;
- Main$1.this.g = 255;
- Main$1.this.b = 0;
- Main$1.this.time -= 1;
- break;
- case 53:
- Main$1.this.r = 128;
- Main$1.this.g = 255;
- Main$1.this.b = 0;
- Main$1.this.time -= 1;
- break;
- case 52:
- Main$1.this.r = 43;
- Main$1.this.g = 255;
- Main$1.this.b = 0;
- Main$1.this.time -= 1;
- break;
- case 51:
- Main$1.this.r = 0;
- Main$1.this.g = 255;
- Main$1.this.b = 9;
- Main$1.this.time -= 1;
- break;
- case 50:
- Main$1.this.r = 0;
- Main$1.this.g = 255;
- Main$1.this.b = 51;
- Main$1.this.time -= 1;
- break;
- case 49:
- Main$1.this.r = 0;
- Main$1.this.g = 255;
- Main$1.this.b = 111;
- Main$1.this.time -= 1;
- break;
- case 48:
- Main$1.this.r = 0;
- Main$1.this.g = 255;
- Main$1.this.b = 162;
- Main$1.this.time -= 1;
- break;
- case 47:
- Main$1.this.r = 0;
- Main$1.this.g = 255;
- Main$1.this.b = 230;
- Main$1.this.time -= 1;
- break;
- case 46:
- Main$1.this.r = 0;
- Main$1.this.g = 239;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 45:
- Main$1.this.r = 0;
- Main$1.this.g = 196;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 44:
- Main$1.this.r = 0;
- Main$1.this.g = 173;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 43:
- Main$1.this.r = 0;
- Main$1.this.g = 162;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 42:
- Main$1.this.r = 0;
- Main$1.this.g = 137;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 41:
- Main$1.this.r = 0;
- Main$1.this.g = 100;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 40:
- Main$1.this.r = 0;
- Main$1.this.g = 77;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 39:
- Main$1.this.r = 0;
- Main$1.this.g = 34;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 38:
- Main$1.this.r = 17;
- Main$1.this.g = 0;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 37:
- Main$1.this.r = 37;
- Main$1.this.g = 0;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 36:
- Main$1.this.r = 68;
- Main$1.this.g = 0;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 35:
- Main$1.this.r = 89;
- Main$1.this.g = 0;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 34:
- Main$1.this.r = 102;
- Main$1.this.g = 0;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 33:
- Main$1.this.r = 124;
- Main$1.this.g = 0;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 32:
- Main$1.this.r = 154;
- Main$1.this.g = 0;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 31:
- Main$1.this.r = 222;
- Main$1.this.g = 0;
- Main$1.this.b = 255;
- Main$1.this.time -= 1;
- break;
- case 30:
- Main$1.this.r = 255;
- Main$1.this.g = 0;
- Main$1.this.b = 247;
- Main$1.this.time -= 1;
- break;
- case 29:
- Main$1.this.r = 255;
- Main$1.this.g = 0;
- Main$1.this.b = 179;
- Main$1.this.time -= 1;
- break;
- case 28:
- Main$1.this.r = 255;
- Main$1.this.g = 0;
- Main$1.this.b = 128;
- Main$1.this.time = 59;
- }
- Color c = Color.fromRGB(Main$1.this.r, Main$1.this.g, Main$1.this.b);
- p.getInventory().setHelmet(getColorArmor(Material.LEATHER_HELMET, c));
- p.getInventory().setChestplate(getColorArmor(Material.LEATHER_CHESTPLATE, c));
- p.getInventory().setLeggings(getColorArmor(Material.LEATHER_LEGGINGS, c));
- p.getInventory().setBoots(getColorArmor(Material.LEATHER_BOOTS, c));
- }
- }
- },0,2L);
- }
- // Armor
- if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Chain Helmet"))
- {
- p.getInventory().setHelmet(new ItemStack(Material.CHAINMAIL_HELMET));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Chain Chestplate"))
- {
- p.getInventory().setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Chain Leggings"))
- {
- p.getInventory().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Chain Boots"))
- {
- p.getInventory().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Gold Helmet"))
- {
- p.getInventory().setHelmet(new ItemStack(Material.GOLD_HELMET));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Gold Chestplate"))
- {
- p.getInventory().setChestplate(new ItemStack(Material.GOLD_CHESTPLATE));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Gold Leggings"))
- {
- p.getInventory().setLeggings(new ItemStack(Material.GOLD_LEGGINGS));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Gold Boots"))
- {
- p.getInventory().setBoots(new ItemStack(Material.GOLD_BOOTS));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Iron Helmet"))
- {
- p.getInventory().setHelmet(new ItemStack(Material.IRON_HELMET));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Iron Chestplate"))
- {
- p.getInventory().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Iron Leggings"))
- {
- p.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Iron Boots"))
- {
- p.getInventory().setBoots(new ItemStack(Material.IRON_BOOTS));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Diamond Helmet"))
- {
- p.getInventory().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Diamond Chestplate"))
- {
- p.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Diamond Leggings"))
- {
- p.getInventory().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Diamond Boots"))
- {
- p.getInventory().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Remove Armor"))
- {
- p.getInventory().setHelmet(null);
- p.getInventory().setChestplate(null);
- p.getInventory().setLeggings(null);
- p.getInventory().setBoots(null);
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Next Page"))
- {
- p.openInventory(OutfitGUI1.getInventory());
- }
- }
- else if (e.getInventory().getName().equals("Skyland Outfits (2/2)")) //Outfits
- {
- e.setCancelled(true);
- HumanEntity p = e.getWhoClicked();
- if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Mario"))
- {
- ItemStack MarioChestplate = new ItemStack(Material.LEATHER_CHESTPLATE);
- LeatherArmorMeta meta1 = (LeatherArmorMeta) MarioChestplate.getItemMeta();
- meta1.setColor(Color.fromRGB(204,1,15));
- MarioChestplate.setItemMeta(meta1);
- ItemStack MarioLeggings = new ItemStack(Material.LEATHER_LEGGINGS);
- LeatherArmorMeta meta2 = (LeatherArmorMeta) MarioLeggings.getItemMeta();
- meta2.setColor(Color.fromRGB(1,104,218));
- MarioLeggings.setItemMeta(meta2);
- ItemStack MarioBoots = new ItemStack(Material.LEATHER_BOOTS);
- LeatherArmorMeta meta3 = (LeatherArmorMeta) MarioBoots.getItemMeta();
- meta3.setColor(Color.fromRGB(219,157,116));
- MarioBoots.setItemMeta(meta3);
- p.getInventory().setHelmet((ItemStack) SkullManager.outfitSkulls.get(SkullType.MARIO));
- p.getInventory().setChestplate(MarioChestplate);
- p.getInventory().setLeggings(MarioLeggings);
- p.getInventory().setBoots(MarioBoots);
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Sonic"))
- {
- ItemStack SonicChestplate = new ItemStack(Material.LEATHER_CHESTPLATE);
- LeatherArmorMeta sonicmeta1 = (LeatherArmorMeta) SonicChestplate.getItemMeta();
- sonicmeta1.setColor(Color.fromRGB(8,35,181));
- SonicChestplate.setItemMeta(sonicmeta1);
- ItemStack SonicLeggings = new ItemStack(Material.LEATHER_LEGGINGS);
- LeatherArmorMeta sonicmeta2 = (LeatherArmorMeta) SonicLeggings.getItemMeta();
- sonicmeta2.setColor(Color.fromRGB(8,35,181));
- SonicLeggings.setItemMeta(sonicmeta2);
- ItemStack SonicBoots = new ItemStack(Material.LEATHER_BOOTS);
- LeatherArmorMeta sonicmeta3 = (LeatherArmorMeta) SonicBoots.getItemMeta();
- sonicmeta3.setColor(Color.fromRGB(135,47,43));
- SonicBoots.setItemMeta(sonicmeta3);
- p.getInventory().setHelmet((ItemStack) SkullManager.outfitSkulls.get(SkullType.SONIC));
- p.getInventory().setChestplate(SonicChestplate);
- p.getInventory().setLeggings(SonicLeggings);
- p.getInventory().setBoots(SonicBoots);
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Link"))
- {
- ItemStack LinkChestplate = new ItemStack(Material.LEATHER_CHESTPLATE);
- LeatherArmorMeta linkmeta1 = (LeatherArmorMeta) LinkChestplate.getItemMeta();
- linkmeta1.setColor(Color.fromRGB(72,116,57));
- LinkChestplate.setItemMeta(linkmeta1);
- ItemStack LinkLeggings = new ItemStack(Material.LEATHER_LEGGINGS);
- LeatherArmorMeta linkmeta2 = (LeatherArmorMeta) LinkLeggings.getItemMeta();
- linkmeta2.setColor(Color.fromRGB(204,205,187));
- LinkLeggings.setItemMeta(linkmeta2);
- ItemStack LinkBoots = new ItemStack(Material.LEATHER_BOOTS);
- LeatherArmorMeta linkmeta3 = (LeatherArmorMeta) LinkBoots.getItemMeta();
- linkmeta3.setColor(Color.fromRGB(130,94,62));
- LinkBoots.setItemMeta(linkmeta3);
- p.getInventory().setHelmet((ItemStack) SkullManager.outfitSkulls.get(SkullType.LINK));
- p.getInventory().setChestplate(LinkChestplate);
- p.getInventory().setLeggings(LinkLeggings);
- p.getInventory().setBoots(LinkBoots);
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Remove Armor"))
- {
- p.getInventory().setHelmet(null);
- p.getInventory().setChestplate(null);
- p.getInventory().setLeggings(null);
- p.getInventory().setBoots(null);
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().contains("Last Page"))
- {
- p.openInventory(InventoryGUI.getInventory());
- }
- }
- else if (e.getWhoClicked().getWorld().getName().equals("Spawn"))
- {
- if (e.getSlotType() == SlotType.ARMOR)
- {
- e.setCancelled(true);
- e.getWhoClicked().closeInventory();
- }
- else
- {
- return;
- }
- }
- else
- {
- return;
- }
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
- {
- Player p = (Player) sender;
- if (p.hasPermission("skylandwardrobe.gui") || p.isOp())
- {
- if (cmd.getName().equalsIgnoreCase("wardrobe"))
- {
- p.openInventory(InventoryGUI.getInventory());
- }
- if (cmd.getName().equalsIgnoreCase("outfits"))
- {
- p.openInventory(OutfitGUI1.getInventory());
- }
- }
- return true;
- }
- }
Add Comment
Please, Sign In to add comment