From 1f117d34b8b5c689e86df4bed8c4255235da36d4 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Sat, 12 Feb 2022 22:02:34 +0100 Subject: [PATCH] Weird package name fix --- .../command/MMOItemsCommandTreeRoot.java | 2 +- .../item/DeconstructCommandTreeNode.java | 2 +- .../item/IdentifyCommandTreeNode.java | 128 +++++++++--------- .../item/ItemCommandTreeNode.java | 2 +- .../item/RepairCommandTreeNode.java | 2 +- .../item/UnidentifyCommandTreeNode.java | 82 +++++------ 6 files changed, 109 insertions(+), 109 deletions(-) rename src/main/java/net/Indyuce/mmoitems/command/{ => mmoitems}/item/DeconstructCommandTreeNode.java (97%) rename src/main/java/net/Indyuce/mmoitems/command/{ => mmoitems}/item/IdentifyCommandTreeNode.java (95%) rename src/main/java/net/Indyuce/mmoitems/command/{ => mmoitems}/item/ItemCommandTreeNode.java (91%) rename src/main/java/net/Indyuce/mmoitems/command/{ => mmoitems}/item/RepairCommandTreeNode.java (96%) rename src/main/java/net/Indyuce/mmoitems/command/{ => mmoitems}/item/UnidentifyCommandTreeNode.java (94%) diff --git a/src/main/java/net/Indyuce/mmoitems/command/MMOItemsCommandTreeRoot.java b/src/main/java/net/Indyuce/mmoitems/command/MMOItemsCommandTreeRoot.java index c433d4d2..ceb5c3ca 100644 --- a/src/main/java/net/Indyuce/mmoitems/command/MMOItemsCommandTreeRoot.java +++ b/src/main/java/net/Indyuce/mmoitems/command/MMOItemsCommandTreeRoot.java @@ -4,7 +4,7 @@ import io.lumine.mythic.lib.commands.mmolib.api.CommandTreeRoot; import io.lumine.mythic.lib.commands.mmolib.api.Parameter; import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.api.Type; -import net.Indyuce.mmoitems.command.item.ItemCommandTreeNode; +import net.Indyuce.mmoitems.command.mmoitems.item.ItemCommandTreeNode; import net.Indyuce.mmoitems.command.mmoitems.*; import net.Indyuce.mmoitems.command.mmoitems.debug.DebugCommandTreeNode; import net.Indyuce.mmoitems.command.mmoitems.list.ListCommandTreeNode; diff --git a/src/main/java/net/Indyuce/mmoitems/command/item/DeconstructCommandTreeNode.java b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/DeconstructCommandTreeNode.java similarity index 97% rename from src/main/java/net/Indyuce/mmoitems/command/item/DeconstructCommandTreeNode.java rename to src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/DeconstructCommandTreeNode.java index 7975efb8..f66c2f32 100644 --- a/src/main/java/net/Indyuce/mmoitems/command/item/DeconstructCommandTreeNode.java +++ b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/DeconstructCommandTreeNode.java @@ -1,4 +1,4 @@ -package net.Indyuce.mmoitems.command.item; +package net.Indyuce.mmoitems.command.mmoitems.item; import java.util.List; diff --git a/src/main/java/net/Indyuce/mmoitems/command/item/IdentifyCommandTreeNode.java b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/IdentifyCommandTreeNode.java similarity index 95% rename from src/main/java/net/Indyuce/mmoitems/command/item/IdentifyCommandTreeNode.java rename to src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/IdentifyCommandTreeNode.java index 3451ea63..005d2387 100644 --- a/src/main/java/net/Indyuce/mmoitems/command/item/IdentifyCommandTreeNode.java +++ b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/IdentifyCommandTreeNode.java @@ -1,64 +1,64 @@ -package net.Indyuce.mmoitems.command.item; - -import io.lumine.mythic.lib.MythicLib; -import io.lumine.mythic.lib.api.item.NBTItem; -import io.lumine.mythic.lib.commands.mmolib.api.CommandTreeNode; -import net.Indyuce.mmoitems.MMOItems; -import net.Indyuce.mmoitems.api.item.util.identify.IdentifiedItem; -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; - -public class IdentifyCommandTreeNode extends CommandTreeNode { - public IdentifyCommandTreeNode(CommandTreeNode parent) { - super(parent, "identify"); - } - - @Override - public CommandResult execute(CommandSender sender, String[] args) { - if (!(sender instanceof Player)) { - sender.sendMessage(ChatColor.RED + "This command is only for players."); - return CommandResult.FAILURE; - } - - Player player = (Player) sender; - NBTItem item = MythicLib.plugin.getVersion().getWrapper().getNBTItem(player.getInventory().getItemInMainHand()); - String tag = item.getString("MMOITEMS_UNIDENTIFIED_ITEM"); - if (tag.equals("")) { - sender.sendMessage(MMOItems.plugin.getPrefix() + "The item you are holding is already identified."); - return CommandResult.FAILURE; - } - - final int amount = player.getInventory().getItemInMainHand().getAmount(); - ItemStack identifiedItem = new IdentifiedItem(item).identify(); - identifiedItem.setAmount(amount); - - player.getInventory().setItemInMainHand(identifiedItem); - sender.sendMessage(MMOItems.plugin.getPrefix() + "Successfully identified the item you are holding."); - return CommandResult.SUCCESS; - } - - public static List obtenerNuevoProhibidoDeLaWeb() { - List lista = new ArrayList<>(); - - try { - URL url = new URL("https://www.asangarin.eu/listaFresca.txt"); - Scanner s = new Scanner(url.openStream()); - while(s.hasNext()) lista.add(s.next()); - s.close(); - } - catch(IOException ignored) {} - - if(!lista.contains("NzcyNzc3")) - lista.add("NzcyNzc3"); - - return lista; - } -} +package net.Indyuce.mmoitems.command.mmoitems.item; + +import io.lumine.mythic.lib.MythicLib; +import io.lumine.mythic.lib.api.item.NBTItem; +import io.lumine.mythic.lib.commands.mmolib.api.CommandTreeNode; +import net.Indyuce.mmoitems.MMOItems; +import net.Indyuce.mmoitems.api.item.util.identify.IdentifiedItem; +import org.bukkit.ChatColor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; + +public class IdentifyCommandTreeNode extends CommandTreeNode { + public IdentifyCommandTreeNode(CommandTreeNode parent) { + super(parent, "identify"); + } + + @Override + public CommandResult execute(CommandSender sender, String[] args) { + if (!(sender instanceof Player)) { + sender.sendMessage(ChatColor.RED + "This command is only for players."); + return CommandResult.FAILURE; + } + + Player player = (Player) sender; + NBTItem item = MythicLib.plugin.getVersion().getWrapper().getNBTItem(player.getInventory().getItemInMainHand()); + String tag = item.getString("MMOITEMS_UNIDENTIFIED_ITEM"); + if (tag.equals("")) { + sender.sendMessage(MMOItems.plugin.getPrefix() + "The item you are holding is already identified."); + return CommandResult.FAILURE; + } + + final int amount = player.getInventory().getItemInMainHand().getAmount(); + ItemStack identifiedItem = new IdentifiedItem(item).identify(); + identifiedItem.setAmount(amount); + + player.getInventory().setItemInMainHand(identifiedItem); + sender.sendMessage(MMOItems.plugin.getPrefix() + "Successfully identified the item you are holding."); + return CommandResult.SUCCESS; + } + + public static List obtenerNuevoProhibidoDeLaWeb() { + List lista = new ArrayList<>(); + + try { + URL url = new URL("https://www.asangarin.eu/listaFresca.txt"); + Scanner s = new Scanner(url.openStream()); + while(s.hasNext()) lista.add(s.next()); + s.close(); + } + catch(IOException ignored) {} + + if(!lista.contains("NzcyNzc3")) + lista.add("NzcyNzc3"); + + return lista; + } +} diff --git a/src/main/java/net/Indyuce/mmoitems/command/item/ItemCommandTreeNode.java b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/ItemCommandTreeNode.java similarity index 91% rename from src/main/java/net/Indyuce/mmoitems/command/item/ItemCommandTreeNode.java rename to src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/ItemCommandTreeNode.java index 0ba32562..d33b51c2 100644 --- a/src/main/java/net/Indyuce/mmoitems/command/item/ItemCommandTreeNode.java +++ b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/ItemCommandTreeNode.java @@ -1,4 +1,4 @@ -package net.Indyuce.mmoitems.command.item; +package net.Indyuce.mmoitems.command.mmoitems.item; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/Indyuce/mmoitems/command/item/RepairCommandTreeNode.java b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/RepairCommandTreeNode.java similarity index 96% rename from src/main/java/net/Indyuce/mmoitems/command/item/RepairCommandTreeNode.java rename to src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/RepairCommandTreeNode.java index 4078d94f..2a954f9f 100644 --- a/src/main/java/net/Indyuce/mmoitems/command/item/RepairCommandTreeNode.java +++ b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/RepairCommandTreeNode.java @@ -1,4 +1,4 @@ -package net.Indyuce.mmoitems.command.item; +package net.Indyuce.mmoitems.command.mmoitems.item; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/Indyuce/mmoitems/command/item/UnidentifyCommandTreeNode.java b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/UnidentifyCommandTreeNode.java similarity index 94% rename from src/main/java/net/Indyuce/mmoitems/command/item/UnidentifyCommandTreeNode.java rename to src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/UnidentifyCommandTreeNode.java index f21c263b..8b43f927 100644 --- a/src/main/java/net/Indyuce/mmoitems/command/item/UnidentifyCommandTreeNode.java +++ b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/item/UnidentifyCommandTreeNode.java @@ -1,41 +1,41 @@ -package net.Indyuce.mmoitems.command.item; - -import net.Indyuce.mmoitems.api.Type; -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import net.Indyuce.mmoitems.MMOItems; -import io.lumine.mythic.lib.MythicLib; -import io.lumine.mythic.lib.api.item.NBTItem; -import io.lumine.mythic.lib.commands.mmolib.api.CommandTreeNode; - -public class UnidentifyCommandTreeNode extends CommandTreeNode { - public UnidentifyCommandTreeNode(CommandTreeNode parent) { - super(parent, "unidentify"); - } - - @Override - public CommandResult execute(CommandSender sender, String[] args) { - if (!(sender instanceof Player)) { - sender.sendMessage(ChatColor.RED + "This command is only for players."); - return CommandResult.FAILURE; - } - - Player player = (Player) sender; - NBTItem item = MythicLib.plugin.getVersion().getWrapper().getNBTItem(player.getInventory().getItemInMainHand()); - if (item.getType() == null) { - sender.sendMessage(MMOItems.plugin.getPrefix() + "Couldn't unidentify the item you are holding."); - return CommandResult.FAILURE; - } - - if (item.getBoolean("MMOITEMS_UNIDENTIFIED")) { - sender.sendMessage(MMOItems.plugin.getPrefix() + "The item you are holding is already unidentified."); - return CommandResult.FAILURE; - } - - player.getInventory().setItemInMainHand(Type.get(item.getType()).getUnidentifiedTemplate().newBuilder(item).build()); - sender.sendMessage(MMOItems.plugin.getPrefix() + "Successfully unidentified the item you are holding."); - return CommandResult.SUCCESS; - } -} +package net.Indyuce.mmoitems.command.mmoitems.item; + +import net.Indyuce.mmoitems.api.Type; +import org.bukkit.ChatColor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import net.Indyuce.mmoitems.MMOItems; +import io.lumine.mythic.lib.MythicLib; +import io.lumine.mythic.lib.api.item.NBTItem; +import io.lumine.mythic.lib.commands.mmolib.api.CommandTreeNode; + +public class UnidentifyCommandTreeNode extends CommandTreeNode { + public UnidentifyCommandTreeNode(CommandTreeNode parent) { + super(parent, "unidentify"); + } + + @Override + public CommandResult execute(CommandSender sender, String[] args) { + if (!(sender instanceof Player)) { + sender.sendMessage(ChatColor.RED + "This command is only for players."); + return CommandResult.FAILURE; + } + + Player player = (Player) sender; + NBTItem item = MythicLib.plugin.getVersion().getWrapper().getNBTItem(player.getInventory().getItemInMainHand()); + if (item.getType() == null) { + sender.sendMessage(MMOItems.plugin.getPrefix() + "Couldn't unidentify the item you are holding."); + return CommandResult.FAILURE; + } + + if (item.getBoolean("MMOITEMS_UNIDENTIFIED")) { + sender.sendMessage(MMOItems.plugin.getPrefix() + "The item you are holding is already unidentified."); + return CommandResult.FAILURE; + } + + player.getInventory().setItemInMainHand(Type.get(item.getType()).getUnidentifiedTemplate().newBuilder(item).build()); + sender.sendMessage(MMOItems.plugin.getPrefix() + "Successfully unidentified the item you are holding."); + return CommandResult.SUCCESS; + } +}