mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 03:44:49 +00:00
Linked Item Building
This commit is contained in:
1 parent
639e44f98f
commit
85165070e0
2 files changed
+13
-5
No files matched your search
@@ -13,9 +13,19 @@ public class ScriptLinkedItem extends ScriptCustomizableItem implements IItemLin
|
||||
public int linkedVersion = 1;
|
||||
public ScriptLinkedItem(ItemStack item) {
|
||||
super(item);
|
||||
setDefaults();
|
||||
loadItemData();
|
||||
}
|
||||
|
||||
// For Building new Linked Item
|
||||
public ScriptLinkedItem(ItemStack item, LinkedItem linkedItem) {
|
||||
super(item);
|
||||
this.linkedItem = linkedItem.clone();
|
||||
this.linkedVersion = this.linkedItem.version;
|
||||
setDefaults();
|
||||
saveItemData();
|
||||
}
|
||||
|
||||
public void setDefaults(){
|
||||
this.itemDisplay.texture = null;
|
||||
this.itemDisplay.translateX = null;
|
||||
@@ -194,7 +204,7 @@ public class ScriptLinkedItem extends ScriptCustomizableItem implements IItemLin
|
||||
|
||||
public void setItemNBT(NBTTagCompound compound) {
|
||||
this.itemDisplay.readFromNBT(compound);
|
||||
this.linkedItem.readFromNBT(compound, false);
|
||||
this.linkedItem.readFromNBT(compound.getCompoundTag(LinkedItem.LINKED_DATA_NBT_TAG), false);
|
||||
this.linkedVersion = compound.getInteger(LinkedItem.LINKED_VERSION_VERSION_TAG);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user