mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Fixed duplication glitch with custom gui slots
This commit is contained in:
1 parent
7b61511a64
commit
e759916c01
1 file changed
-18
@@ -43,22 +43,4 @@ public class ScriptGuiItemSlot extends ScriptGuiComponent implements IItemSlot {
|
||||
public int getType() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
public NBTTagCompound toNBT(NBTTagCompound nbt) {
|
||||
super.toNBT(nbt);
|
||||
if (this.hasStack()) {
|
||||
nbt.setTag("stack", this.stack.getItemNbt().getMCNBT());
|
||||
}
|
||||
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public ScriptGuiComponent fromNBT(NBTTagCompound nbt) {
|
||||
super.fromNBT(nbt);
|
||||
if (nbt.hasKey("stack")) {
|
||||
this.setStack(NpcAPI.Instance().getIItemStack(ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("stack"))));
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user