Simplify the design of Repairable

This commit is contained in:
nossr50
2019-06-21 15:10:43 -07:00
parent 0050a73be8
commit d782d64750
12 changed files with 186 additions and 145 deletions

View File

@@ -9,8 +9,6 @@ import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_13_R2.util.CraftNBTTagConfigSerializer;
import org.bukkit.inventory.ItemStack;
public class NBTManager {
private static final String CRAFT_META_ITEM_CLASS_PATH = "org.bukkit.craftbukkit.inventory.CraftMetaItem";
@@ -47,4 +45,9 @@ public class NBTManager {
}
}
public boolean hasNBT(NBTTagCompound root, NBTTagCompound nbtData) {
//TODO: Implement this
return false;
}
}

View File

@@ -1,5 +1,7 @@
package com.gmail.nossr50.util.nbt;
import net.minecraft.server.v1_13_R2.NBTTagCompound;
/**
* A simple class that acts as a container for raw NBT data
* NBT data will be constructed from the raw NBT string using server internals
@@ -10,13 +12,14 @@ package com.gmail.nossr50.util.nbt;
* 1) Read partial or complete NBT from the config file for an item
* 2) Check an items NBT tree for this NBT data during runtime once transformed
*/
public class RawNBT<T> {
public class RawNBT {
private String nbtContents;
private T nbtTree; //Will be constructed using server internals to make matching NBT easier
private NBTTagCompound nbtData; //Will be constructed using server internals to make matching NBT easier
public RawNBT(String nbtContents, T nbtTree) {
public RawNBT(String nbtContents, NBTTagCompound nbtData) {
this.nbtContents = nbtContents;
NBTManager
this.nbtData = nbtData;
}
public String getNbtContents() {
@@ -27,4 +30,7 @@ public class RawNBT<T> {
this.nbtContents = nbtContents;
}
public NBTTagCompound getNbtData() {
return nbtData;
}
}