mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 13:49:05 +00:00
Added a function to create an item stack from a linked item in the LinkedItem class, referenced in the controller and creation packet as well.
This commit is contained in:
1 parent
5c04b1aae6
commit
f62ff8a474
3 files changed
+25
-6
No files matched your search
@@ -6,6 +6,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.api.handler.data.ILinkedItem;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.util.NBTJsonUtil;
|
||||
|
||||
@@ -34,6 +35,14 @@ public class LinkedItemController {
|
||||
return new LinkedItem(name);
|
||||
}
|
||||
|
||||
public IItemStack createItemStack(int id) {
|
||||
LinkedItem linkedItem = this.get(id);
|
||||
if (linkedItem != null) {
|
||||
return linkedItem.createStack();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void add(LinkedItem linkedItem) {
|
||||
if (linkedItem != null) {
|
||||
String name = linkedItem.getName();
|
||||
|
||||
Reference in new issue
Block a user