mirror of
https://github.com/plexusorg/ItemizerX.git
synced 2025-07-02 08:06:42 +00:00
Reformat and add missing attribute
This commit is contained in:
@ -2,9 +2,6 @@ package dev.plex.itemizerx.v1_18_R1;
|
||||
|
||||
import dev.plex.itemizerx.Attributes;
|
||||
import dev.plex.itemizerx.IAttributeManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
@ -14,6 +11,10 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class AttributeManager implements IAttributeManager
|
||||
{
|
||||
@Override
|
||||
@ -62,7 +63,7 @@ public class AttributeManager implements IAttributeManager
|
||||
final ListTag attrmod = getAttrList(nms);
|
||||
for (Tag nbtBase : attrmod)
|
||||
{
|
||||
final CompoundTag c = (CompoundTag)nbtBase;
|
||||
final CompoundTag c = (CompoundTag) nbtBase;
|
||||
if (c.getString("Name").equals(args[2]))
|
||||
{
|
||||
player.sendMessage(colorize("&4An attribute with the name \"&f" + args[2] + "&4\" already exists!"));
|
||||
@ -116,7 +117,7 @@ public class AttributeManager implements IAttributeManager
|
||||
boolean r = false;
|
||||
for (Tag nbtBase : attrmod)
|
||||
{
|
||||
final CompoundTag c = (CompoundTag)nbtBase;
|
||||
final CompoundTag c = (CompoundTag) nbtBase;
|
||||
if (!c.getString("Name").equals(string))
|
||||
{
|
||||
newList.add(nbtBase);
|
||||
@ -150,7 +151,7 @@ public class AttributeManager implements IAttributeManager
|
||||
player.sendMessage(colorize("&2Item attributes: "));
|
||||
for (Tag nbtBase : attrmod)
|
||||
{
|
||||
final CompoundTag c = (CompoundTag)nbtBase;
|
||||
final CompoundTag c = (CompoundTag) nbtBase;
|
||||
player.sendMessage(colorize("&e" + Attributes.get(c.getString("AttributeName")).mcName
|
||||
+ ", " + c.getDouble("Amount")));
|
||||
}
|
||||
|
Reference in New Issue
Block a user