mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 13:04:46 +00:00
Hook Up Linked Item to existing Events
This commit is contained in:
1 parent
f84dd5477d
commit
690f2ca10d
6 files changed
+62
-47
No files matched your search
@@ -22,6 +22,7 @@ import net.minecraftforge.event.entity.living.*;
|
||||
import net.minecraftforge.event.entity.player.*;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.item.IItemCustomizable;
|
||||
import noppes.npcs.constants.EnumQuestType;
|
||||
import noppes.npcs.controllers.CustomEffectController;
|
||||
import noppes.npcs.controllers.PartyController;
|
||||
@@ -53,8 +54,8 @@ public class ScriptPlayerEventHandler {
|
||||
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++){
|
||||
ItemStack item = player.inventory.getStackInSlot(i);
|
||||
if(item != null && item.getItem() == CustomItems.scripted_item){
|
||||
ScriptCustomItem isw = (ScriptCustomItem) NpcAPI.Instance().getIItemStack(item);
|
||||
if(item != null && NoppesUtilServer.isScriptableItem(item.getItem())){
|
||||
IItemCustomizable isw = (IItemCustomizable) NpcAPI.Instance().getIItemStack(item);
|
||||
EventHooks.onScriptItemUpdate(isw, player);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user