add ItemCommand
All checks were successful
Build / build (push) Successful in 1m39s

This commit is contained in:
unurled 2024-03-15 13:22:31 +01:00
parent d12bf53972
commit c64032034c
Signed by: unurled
GPG key ID: FDBC9CBE1F82423F
7 changed files with 461 additions and 26 deletions

View file

@ -127,6 +127,14 @@ public class Item {
this.rarity = rarity;
}
public ItemType getType() {
return type;
}
public void setType(ItemType type) {
this.type = type;
}
public HashMap<Attribute, Double> getAttributes() {
return attributes;
}
@ -263,4 +271,8 @@ public class Item {
error("Failed to parse item from string: " + item + "\n" + e.getMessage());
}
}
public void setID(String arg) {
this.ID = arg;
}
}

View file

@ -3,6 +3,7 @@ package me.unurled.sacredrealms.sr.components.item;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.HashMap;
import java.util.List;
import me.unurled.sacredrealms.sr.data.DataHandler;
import me.unurled.sacredrealms.sr.data.DataManager;
import me.unurled.sacredrealms.sr.data.gson.ItemDeserializer;
@ -12,7 +13,6 @@ import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataType;
@SuppressWarnings("EmptyMethod")
public class ItemManager extends Manager {
public static final NamespacedKey ID = new NamespacedKey("sr", "id");
@ -85,4 +85,8 @@ public class ItemManager extends Manager {
public boolean isItem(String id) {
return items.containsKey(id);
}
public List<String> getItemIDs() {
return List.copyOf(items.keySet());
}
}

View file

@ -1,25 +1,3 @@
package me.unurled.sacredrealms.sr.components.item.enchantments;
public class Enchantment {
private final String name;
private final String ID;
private final Integer maxLevel;
public Enchantment(String name, String ID, Integer maxLevel) {
this.name = name;
this.ID = ID;
this.maxLevel = maxLevel;
}
public String getName() {
return name;
}
public String getID() {
return ID;
}
public Integer getMaxLevel() {
return maxLevel;
}
}
public record Enchantment(String name, String ID, Integer maxLevel) {}