Added removeTags() function to ScriptItemStack and isCustomGUI function to ScriptContainer

This commit is contained in:
luisc committed 2022-01-12 04:54:07 -06:00
1 parent 6b9cfb9d25
commit 8919a182c5
4 files changed
+15

No files matched your search

@@ -10,6 +10,7 @@ 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.interfaces.IContainer;
import noppes.npcs.scripted.interfaces.IItemStack;
@@ -82,4 +83,8 @@ public class ScriptContainer implements IContainer {
return items;
}
public boolean isCustomGUI() {
return this.container instanceof ContainerCustomGui;
}
}
@@ -134,6 +134,12 @@ public class ScriptItemStack implements IItemStack {
return ((NBTTagString)tag).func_150285_a_();
return tag;
}
public INbt removeTags() {
ScriptNbt nbt = (ScriptNbt)NpcAPI.Instance().getINbt(item.stackTagCompound);
item.stackTagCompound = null;
return nbt;
}
public boolean isEnchanted(){
return item.isItemEnchanted();
@@ -22,4 +22,6 @@ public interface IContainer {
int count(IItemStack var1, boolean var2, boolean var3);
IItemStack[] getItems();
boolean isCustomGUI();
}
@@ -63,6 +63,8 @@ public interface IItemStack {
*/
public Object getTag(String key);
public INbt removeTags();
public boolean isEnchanted();
/**