mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 12:39:05 +00:00
More linked item changes
This commit is contained in:
1 parent
d394174108
commit
4a1a092757
15 files changed
+338
-436
No files matched your search
@@ -16,6 +16,9 @@ import net.minecraftforge.common.IPlantable;
|
||||
import noppes.npcs.NoppesUtilPlayer;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.controllers.LinkedItemController;
|
||||
import noppes.npcs.controllers.data.LinkedItem;
|
||||
import noppes.npcs.items.ItemLinked;
|
||||
import noppes.npcs.items.ItemScripted;
|
||||
import noppes.npcs.scripted.CustomNPCsException;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
@@ -313,6 +316,16 @@ public class ScriptItemStack implements IItemStack {
|
||||
if(item == null)
|
||||
return null;
|
||||
|
||||
if (item.getItem() instanceof ItemLinked) {
|
||||
LinkedItem linkedItem;
|
||||
if (item.hasTagCompound()) {
|
||||
int linkedItemId = item.getTagCompound().getInteger(LinkedItem.LINKED_NBT_TAG);
|
||||
linkedItem = LinkedItemController.Instance().get(linkedItemId);
|
||||
if (linkedItem != null) {
|
||||
return new ScriptLinkedItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(item.getItem() instanceof ItemScripted) {
|
||||
return new ScriptCustomItem(item);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user