mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Weird package name fix
This commit is contained in:
parent
cc7d4e8f20
commit
1f117d34b8
@ -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;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package net.Indyuce.mmoitems.command.item;
|
||||
package net.Indyuce.mmoitems.command.mmoitems.item;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -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<String> obtenerNuevoProhibidoDeLaWeb() {
|
||||
List<String> 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<String> obtenerNuevoProhibidoDeLaWeb() {
|
||||
List<String> 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;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package net.Indyuce.mmoitems.command.item;
|
||||
package net.Indyuce.mmoitems.command.mmoitems.item;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -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;
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user