mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 15:29:54 +00:00
Completed Tag Support for Auras, Forms, Outlines, Effects, Linked Items, Abilities
This commit is contained in:
1 parent
0eeeec5d22
commit
111156da5a
15 files changed
+503
-5
No files matched your search
@@ -8,9 +8,13 @@ import noppes.npcs.EventHooks;
|
||||
import noppes.npcs.api.handler.data.ILinkedItem;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.controllers.LinkedItemController;
|
||||
import noppes.npcs.controllers.TagController;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.item.ScriptLinkedItem;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
|
||||
public class LinkedItem implements ILinkedItem {
|
||||
public static final String LINKED_VERSION_VERSION_TAG = "LinkedVersion";
|
||||
public static final String LINKED_DATA_NBT_TAG = "LinkedData";
|
||||
@@ -33,6 +37,8 @@ public class LinkedItem implements ILinkedItem {
|
||||
public int armorType = -2; //-2: Fits in no armor slot, -1: Fits in all slots, 0 - 3: Fits in Head -> Boots slot respectively
|
||||
public int enchantability;
|
||||
|
||||
public HashSet<UUID> tagUUIDs = new HashSet<>();
|
||||
|
||||
public LinkedItem() {
|
||||
this("New");
|
||||
}
|
||||
@@ -67,6 +73,8 @@ public class LinkedItem implements ILinkedItem {
|
||||
compound.setInteger("MaxItemUseDuration", this.maxItemUseDuration);
|
||||
compound.setInteger("ItemUseAction", this.itemUseAction);
|
||||
|
||||
TagController.writeTagUUIDs(compound, "TagUUIDs", tagUUIDs);
|
||||
|
||||
if (saveScripts) {
|
||||
NBTTagCompound scriptData = new NBTTagCompound();
|
||||
LinkedItemScript handler = getScriptHandler();
|
||||
@@ -97,6 +105,8 @@ public class LinkedItem implements ILinkedItem {
|
||||
this.maxItemUseDuration = compound.getInteger("MaxItemUseDuration");
|
||||
this.itemUseAction = compound.getInteger("ItemUseAction");
|
||||
|
||||
tagUUIDs = TagController.readTagUUIDs(compound, "TagUUIDs");
|
||||
|
||||
if (compound.hasKey("ScriptData", Constants.NBT.TAG_COMPOUND)) {
|
||||
LinkedItemScript handler = new LinkedItemScript();
|
||||
handler.readFromNBT(compound.getCompoundTag("ScriptData"));
|
||||
|
||||
Reference in new issue
Block a user