Mineplex2018-withcommit/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/commands/GearCommand.java

77 lines
2.4 KiB
Java
Raw Normal View History

package mineplex.game.clans.items.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInput;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.recharge.Recharge;
import mineplex.game.clans.clans.ClanInfo;
import mineplex.game.clans.clans.ClanRole;
import mineplex.game.clans.clans.ClansManager;
import mineplex.game.clans.clans.ClansUtility.ClanRelation;
import mineplex.game.clans.clans.ClientClan;
import mineplex.game.clans.items.CustomItem;
import mineplex.game.clans.items.GearManager;
import mineplex.game.clans.items.attributes.weapon.FlamingAttribute;
import mineplex.game.clans.items.attributes.weapon.FrostedAttribute;
import mineplex.game.clans.items.attributes.weapon.SharpAttribute;
import mineplex.game.clans.items.legendaries.LegendaryItem;
import mineplex.game.clans.items.legendaries.WindBlade;
public class GearCommand extends CommandBase<GearManager>
{
public GearCommand(GearManager plugin)
{
super(plugin, Rank.ALL, "gear", "custom-gear");
}
@Override
public void Execute(Player caller, String[] args)
{
UtilPlayer.message(caller, F.main("Gear", "Opening custom gear GUI!"));
if (caller.getItemInHand() != null && caller.getItemInHand().getType() != Material.AIR)
{
ItemStack item = caller.getItemInHand();
ItemMeta meta = item.getItemMeta();
List<String> lore = meta.getLore();
lore.set(0, "Test");
meta.setLore(lore);
item.setItemMeta(meta);
System.out.println("aaaaaaa");
return;
}
else
{
LegendaryItem legendary = new WindBlade();
caller.setItemInHand(legendary.toItemStack(1));
return;
}
/*CustomItem customItem = new CustomItem();
customItem.setPrefix(new FrostedAttribute());
customItem.setSuperPrefix(new SharpAttribute());
customItem.setSuffix(new FlamingAttribute());
ItemStack sword = customItem.toItemStack(1);
caller.setItemInHand(sword);*/
// TODO: Open custom gear GUI here
}
}