mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Fix Setting Item Stack to Null
This commit is contained in:
1 parent
d4e0664f97
commit
c8d62f0c72
1 file changed
+6
-1
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user