package info.u_team.u_team_core.util;

import java.util.Map;
import java.util.concurrent.Callable;
import java.util.function.Supplier;

import com.google.common.collect.Maps;

import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
import net.minecraft.item.*;
import net.minecraft.item.Item.Properties;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;

public class ItemProperties extends Properties {
	
	public ItemProperties() {
	}
	
	public ItemProperties(Properties properties) {
		maxStackSize = properties.maxStackSize;
		maxDamage = properties.maxDamage;
		containerItem = properties.containerItem;
		group = properties.group;
		rarity = properties.rarity;
		food = properties.food;
		setValueCanRepair(getValueCanRepair(properties));
		setValueToolClasses(Maps.newHashMap(getValueToolClasses(properties)));
		setValueIster(getValueIster(properties));
	}
	
	private boolean getValueCanRepair(Properties properties) {
		return ObfuscationReflectionHelper.getPrivateValue(Properties.class, properties, "canRepair");
	}
	
	private void setValueCanRepair(boolean value) {
		ObfuscationReflectionHelper.setPrivateValue(Properties.class, this, value, "canRepair");
	}
	
	private Map<ToolType, Integer> getValueToolClasses(Properties properties) {
		return ObfuscationReflectionHelper.getPrivateValue(Properties.class, properties, "toolClasses");
	}
	
	private void setValueToolClasses(Map<ToolType, Integer> value) {
		ObfuscationReflectionHelper.setPrivateValue(Properties.class, this, value, "toolClasses");
	}
	
	private Supplier<Callable<ItemStackTileEntityRenderer>> getValueIster(Properties properties) {
		return ObfuscationReflectionHelper.getPrivateValue(Properties.class, properties, "ister");
	}
	
	private void setValueIster(Supplier<Callable<ItemStackTileEntityRenderer>> value) {
		ObfuscationReflectionHelper.setPrivateValue(Properties.class, this, value, "ister");
	}
	
	public int getMaxStackSize() {
		return maxStackSize;
	}
	
	public int getMaxDamage() {
		return maxDamage;
	}
	
	public Item getContainerItem() {
		return containerItem;
	}
	
	public ItemGroup getGroup() {
		return group;
	}
	
	public Rarity getRarity() {
		return rarity;
	}
	
	public Food getFood() {
		return food;
	}
	
	public boolean isCanRepair() {
		return getValueCanRepair(this);
	}
	
	public Map<ToolType, Integer> getToolClasses() {
		return getValueToolClasses(this);
	}
	
	public Supplier<Callable<ItemStackTileEntityRenderer>> getIster() {
		return getValueIster(this);
	}
}

@@ -1964,597 +1964,6 @@
 %0A%09%7D%0A
-%09%0A%09public int getMaxStackSize() %7B%0A%09%09return maxStackSize;%0A%09%7D%0A%09%0A%09public int getMaxDamage() %7B%0A%09%09return maxDamage;%0A%09%7D%0A%09%0A%09public Item getContainerItem() %7B%0A%09%09return containerItem;%0A%09%7D%0A%09%0A%09public ItemGroup getGroup() %7B%0A%09%09return group;%0A%09%7D%0A%09%0A%09public Rarity getRarity() %7B%0A%09%09return rarity;%0A%09%7D%0A%09%0A%09public Food getFood() %7B%0A%09%09return food;%0A%09%7D%0A%09%0A%09public boolean isCanRepair() %7B%0A%09%09return getValueCanRepair(this);%0A%09%7D%0A%09%0A%09public Map%3CToolType, Integer%3E getToolClasses() %7B%0A%09%09return getValueToolClasses(this);%0A%09%7D%0A%09%0A%09public Supplier%3CCallable%3CItemStackTileEntityRenderer%3E%3E getIster() %7B%0A%09%09return getValueIster(this);%0A%09%7D%0A
 %7D%0A

Remove getter