mirror of
https://github.com/plexusorg/ItemizerX.git
synced 2025-07-02 16:16:42 +00:00
Reformat and add missing attribute
This commit is contained in:
@ -1,9 +1,5 @@
|
||||
package dev.plex.itemizerx;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -27,6 +23,11 @@ import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
|
||||
{
|
||||
final List<Material> POTIONS = Arrays.asList(Material.POTION, Material.LINGERING_POTION, Material.SPLASH_POTION);
|
||||
@ -348,7 +349,7 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
|
||||
return true;
|
||||
}
|
||||
final PotionEffect pot = new PotionEffect(potType, tick, level);
|
||||
final PotionMeta potionMeta = (PotionMeta)meta;
|
||||
final PotionMeta potionMeta = (PotionMeta) meta;
|
||||
assert potionMeta != null;
|
||||
if (potionMeta.hasCustomEffect(pot.getType()))
|
||||
{
|
||||
@ -379,7 +380,7 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
|
||||
sender.sendMessage(mm.deserialize("<dark_red>The potion effect <white>\"" + args[2] + "<white>\" <dark_red>does not exist!"));
|
||||
return true;
|
||||
}
|
||||
final PotionMeta potionMeta = (PotionMeta)meta;
|
||||
final PotionMeta potionMeta = (PotionMeta) meta;
|
||||
assert potionMeta != null;
|
||||
if (!potionMeta.hasCustomEffect(potType))
|
||||
{
|
||||
@ -427,7 +428,7 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
|
||||
sender.sendMessage(mm.deserialize("<aqua>/itemizer potion color <<white>hexcolor<aqua>> <red>- <gold>Set the potion color"));
|
||||
return true;
|
||||
}
|
||||
final PotionMeta potionMeta = (PotionMeta)meta;
|
||||
final PotionMeta potionMeta = (PotionMeta) meta;
|
||||
assert potionMeta != null;
|
||||
try
|
||||
{
|
||||
@ -818,7 +819,7 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
|
||||
return true;
|
||||
}
|
||||
Component name = mm.deserialize(StringUtils.join(args, " ", 1, args.length));
|
||||
final BookMeta bookMeta = (BookMeta)meta;
|
||||
final BookMeta bookMeta = (BookMeta) meta;
|
||||
assert bookMeta != null;
|
||||
bookMeta.title(name);
|
||||
item.setItemMeta(bookMeta);
|
||||
@ -844,7 +845,7 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
|
||||
return true;
|
||||
}
|
||||
Component name = mm.deserialize(args[1]);
|
||||
final BookMeta bookMeta = (BookMeta)meta;
|
||||
final BookMeta bookMeta = (BookMeta) meta;
|
||||
assert bookMeta != null;
|
||||
bookMeta.author(name);
|
||||
item.setItemMeta(bookMeta);
|
||||
@ -874,7 +875,7 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
|
||||
{
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
final SkullMeta skullMeta = (SkullMeta)meta;
|
||||
final SkullMeta skullMeta = (SkullMeta) meta;
|
||||
assert skullMeta != null;
|
||||
skullMeta.setOwner(name);
|
||||
item.setItemMeta(skullMeta);
|
||||
@ -915,7 +916,7 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
|
||||
{
|
||||
cpb.getAPI().logRemoval(player.getName(), block.getLocation(), block.getType(), block.getBlockData());
|
||||
}
|
||||
Sign sign = (Sign)block.getState();
|
||||
Sign sign = (Sign) block.getState();
|
||||
sign.line(line - 1, text);
|
||||
sign.update();
|
||||
if (cpb.getAPI() != null)
|
||||
|
@ -1,11 +1,5 @@
|
||||
package dev.plex.itemizerx;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
@ -28,6 +22,13 @@ import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class ItemizerXCompatCommand implements CommandExecutor, ItemizerXBase
|
||||
{
|
||||
final List<Material> POTIONS = Arrays.asList(Material.POTION, Material.LINGERING_POTION, Material.SPLASH_POTION);
|
||||
@ -352,7 +353,7 @@ public class ItemizerXCompatCommand implements CommandExecutor, ItemizerXBase
|
||||
return true;
|
||||
}
|
||||
final PotionEffect pot = new PotionEffect(potType, tick, level);
|
||||
final PotionMeta potionMeta = (PotionMeta)meta;
|
||||
final PotionMeta potionMeta = (PotionMeta) meta;
|
||||
assert potionMeta != null;
|
||||
if (potionMeta.hasCustomEffect(pot.getType()))
|
||||
{
|
||||
@ -383,7 +384,7 @@ public class ItemizerXCompatCommand implements CommandExecutor, ItemizerXBase
|
||||
sender.sendMessage(colorize("&4The potion effect &f\"" + args[2] + "&f\"&4 does not exist!"));
|
||||
return true;
|
||||
}
|
||||
final PotionMeta potionMeta = (PotionMeta)meta;
|
||||
final PotionMeta potionMeta = (PotionMeta) meta;
|
||||
assert potionMeta != null;
|
||||
if (!potionMeta.hasCustomEffect(potType))
|
||||
{
|
||||
@ -434,7 +435,7 @@ public class ItemizerXCompatCommand implements CommandExecutor, ItemizerXBase
|
||||
+ "&b/itemizer potion color <&fhexcolor&b> &c- &6Set a potion color"));
|
||||
return true;
|
||||
}
|
||||
final PotionMeta potionMeta = (PotionMeta)meta;
|
||||
final PotionMeta potionMeta = (PotionMeta) meta;
|
||||
assert potionMeta != null;
|
||||
try
|
||||
{
|
||||
@ -830,7 +831,7 @@ public class ItemizerXCompatCommand implements CommandExecutor, ItemizerXBase
|
||||
return true;
|
||||
}
|
||||
String name = colorize(StringUtils.join(args, " ", 1, args.length));
|
||||
final BookMeta bookMeta = (BookMeta)meta;
|
||||
final BookMeta bookMeta = (BookMeta) meta;
|
||||
assert bookMeta != null;
|
||||
bookMeta.setTitle(name);
|
||||
item.setItemMeta(bookMeta);
|
||||
@ -856,7 +857,7 @@ public class ItemizerXCompatCommand implements CommandExecutor, ItemizerXBase
|
||||
return true;
|
||||
}
|
||||
String name = colorize(args[1]);
|
||||
final BookMeta bookMeta = (BookMeta)meta;
|
||||
final BookMeta bookMeta = (BookMeta) meta;
|
||||
assert bookMeta != null;
|
||||
bookMeta.setAuthor(name);
|
||||
item.setItemMeta(bookMeta);
|
||||
@ -886,7 +887,7 @@ public class ItemizerXCompatCommand implements CommandExecutor, ItemizerXBase
|
||||
{
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
final SkullMeta skullMeta = (SkullMeta)meta;
|
||||
final SkullMeta skullMeta = (SkullMeta) meta;
|
||||
assert skullMeta != null;
|
||||
skullMeta.setOwner(name);
|
||||
item.setItemMeta(skullMeta);
|
||||
@ -928,7 +929,7 @@ public class ItemizerXCompatCommand implements CommandExecutor, ItemizerXBase
|
||||
{
|
||||
cpb.getAPI().logRemoval(player.getName(), block.getLocation(), block.getType(), block.getBlockData());
|
||||
}
|
||||
Sign sign = (Sign)block.getState();
|
||||
Sign sign = (Sign) block.getState();
|
||||
sign.setLine(line - 1, text);
|
||||
sign.update();
|
||||
if (cpb.getAPI() != null)
|
||||
|
@ -1,9 +1,5 @@
|
||||
package dev.plex.itemizerx;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -12,6 +8,11 @@ import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemizerXTab implements TabCompleter
|
||||
{
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user