package arekkuusu.implom.common.item;

import arekkuusu.implom.api.helper.NBTHelper;
import arekkuusu.implom.client.util.baker.DummyModelRegistry;
import arekkuusu.implom.client.util.baker.model.ModelClockwork;
import arekkuusu.implom.client.util.helper.ModelHandler;
import arekkuusu.implom.common.lib.LibMod;
import arekkuusu.implom.common.lib.LibNames;
import net.katsstuff.teamnightclipse.mirror.client.helper.ResourceHelperStatic;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;

public class ItemClockwork extends ItemBase {

	public ItemClockwork() {
		super(LibNames.CLOCKWORK);
		/*addPropertyOverride(ResourceHelperStatic.getSimple(LibMod.MOD_ID, "unsealed"), (s, w, e) ->
				NBTHelper.getBoolean(s, "unsealed") ? 1 : 0
		);
		addPropertyOverride(ResourceHelperStatic.getSimple(LibMod.MOD_ID, "quartz"), (s, w, e) -> NBTHelper.getNBTTag(s, "quartz")
				.flatMap(tag -> NBTHelper.getEnum(ItemQuartz.Quartz.class, new ItemStack(tag), "quartz_kind"))
				.map(q -> {
					switch (q.color) {
						case WHITE:
							return 0.1F;
						case BLUE:
							return 0.2F;
						case GREEN:
							return 0.3F;
						case YELLOW:
							return 0.4F;
						case PINK:
							return 0.5F;
						default:
							return 0F;
					}
				}).orElse(0F)
		);*/
	}

	@Override
	public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
		ItemStack stack = playerIn.getHeldItem(handIn);
		NBTHelper.setBoolean(stack, "unsealed", !NBTHelper.getBoolean(stack, "unsealed"));
		return super.onItemRightClick(worldIn, playerIn, handIn);
	}

	@Override
	public void registerModel() {
		DummyModelRegistry.register(this, new ModelClockwork());
		ModelHandler.registerModel(this, 0);
	}
}

@@ -734,672 +734,27 @@
 ;%0A%09%09
-/*addPropertyOverride(ResourceHelperStatic.getSimple(LibMod.MOD_ID, %22unsealed%22), (s, w, e) -%3E%0A%09%09%09%09NBTHelper.getBoolean(s, %22unsealed%22) ? 1 : 0%0A%09%09);%0A%09%09addPropertyOverride(ResourceHelperStatic.getSimple(LibMod.MOD_ID, %22quartz%22), (s, w, e) -%3E NBTHelper.getNBTTag(s, %22quartz%22)%0A%09%09%09%09.flatMap(tag -%3E NBTHelper.getEnum(ItemQuartz.Quartz.class, new ItemStack(tag), %22quartz_kind%22))%0A%09%09%09%09.map(q -%3E %7B%0A%09%09%09%09%09switch (q.color) %7B%0A%09%09%09%09%09%09case WHITE:%0A%09%09%09%09%09%09%09return 0.1F;%0A%09%09%09%09%09%09case BLUE:%0A%09%09%09%09%09%09%09return 0.2F;%0A%09%09%09%09%09%09case GREEN:%0A%09%09%09%09%09%09%09return 0.3F;%0A%09%09%09%09%09%09case YELLOW:%0A%09%09%09%09%09%09%09return 0.4F;%0A%09%09%09%09%09%09case PINK:%0A%09%09%09%09%09%09%09return 0.5F;%0A%09%09%09%09%09%09default:%0A%09%09%09%09%09%09%09return 0F;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D).orElse(0F)%0A%09%09);*/
+setMaxStackSize(1);
 %0A%09%7D%0A

Reduce clockwork stack size to 1