mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 15:49:43 +00:00
Implemented version change and build events for linked items
This commit is contained in:
1 parent
f62ff8a474
commit
90bd8aeb02
6 files changed
+83
-13
No files matched your search
@@ -5,6 +5,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagInt;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.EventHooks;
|
||||
import noppes.npcs.api.handler.data.ILinkedItem;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.controllers.CustomEffectController;
|
||||
@@ -41,13 +42,6 @@ public class LinkedItem implements ILinkedItem {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public IItemStack createStack() {
|
||||
LinkedItem copy = this.clone();
|
||||
ItemStack stack = new ItemStack(CustomItems.linked_item, 1);
|
||||
ScriptLinkedItem scriptLinkedItem = new ScriptLinkedItem(stack, copy);
|
||||
return NpcAPI.Instance().getIItemStack(scriptLinkedItem.item);
|
||||
}
|
||||
|
||||
public LinkedItemScript getScriptHandler() {
|
||||
return (LinkedItemScript) LinkedItemController.getInstance().getScriptHandler(this.getId());
|
||||
}
|
||||
@@ -116,6 +110,14 @@ public class LinkedItem implements ILinkedItem {
|
||||
LinkedItemController.getInstance().linkedItemsScripts.put(this.id, handler);
|
||||
}
|
||||
|
||||
public IItemStack createStack() {
|
||||
LinkedItem copy = this.clone();
|
||||
ItemStack stack = new ItemStack(CustomItems.linked_item, 1);
|
||||
ScriptLinkedItem scriptLinkedItem = new ScriptLinkedItem(stack, copy);
|
||||
EventHooks.onLinkedItemBuild(scriptLinkedItem);
|
||||
return NpcAPI.Instance().getIItemStack(scriptLinkedItem.item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
|
||||
Reference in new issue
Block a user