This commit is contained in:
parent
d12bf53972
commit
c64032034c
7 changed files with 461 additions and 26 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue