Merge branch 'dev' into animation-events

This commit is contained in:
Luis C.M. committed 2024-04-07 15:11:39 -05:00
commit 113d27b364
19 files changed
+349 -81

No files matched your search

@@ -1,6 +1,7 @@
package noppes.npcs.scripted.entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import noppes.npcs.NoppesUtilServer;
import noppes.npcs.api.IPos;
import noppes.npcs.api.ITimers;
@@ -617,7 +618,11 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
* @param item The item the drop list slot will be changed to
*/
public void setLootItem(int slot, IItemStack item) {
npc.inventory.setInventorySlotContents(slot+7, item.getMCItemStack());
if(item == null || item.getMCItemStack() == null){
npc.inventory.setInventorySlotContents(slot+7, (ItemStack) null);
} else {
npc.inventory.setInventorySlotContents(slot+7, item.getMCItemStack());
}
}
/**