Added detectAndSendChanges, putStackInSlot(slot,itemStack), isPlayerNotUsingContainer(player) functions to ScriptContainer

This commit is contained in:
Luis C.M committed 2022-05-03 14:05:49 -05:00
1 parent 09f76d84c4
commit 80e3c075c7
2 files changed
+23

No files matched your search

@@ -6,11 +6,13 @@
package noppes.npcs.scripted;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import noppes.npcs.NoppesUtilPlayer;
import noppes.npcs.containers.ContainerCustomGui;
import noppes.npcs.scripted.entity.ScriptPlayer;
import noppes.npcs.scripted.interfaces.IContainer;
import noppes.npcs.scripted.interfaces.IItemStack;
@@ -87,4 +89,16 @@ public class ScriptContainer implements IContainer {
public boolean isCustomGUI() {
return this.container instanceof ContainerCustomGui;
}
public void detectAndSendChanges() {
container.detectAndSendChanges();
}
public void putStackInSlot(int slot, ScriptItemStack itemStack){
container.putStackInSlot(slot,itemStack.getMCItemStack());
}
public boolean isPlayerNotUsingContainer(ScriptPlayer player){
return container.isPlayerNotUsingContainer((EntityPlayerMP) player.getMCEntity());
}
}