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:
Luis C.M. committed 2025-02-17 17:26:40 -06:00
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();