package info.u_team.u_team_core.util;

import net.minecraft.block.Block.Properties;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.*;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;

public class BlockProperties extends Properties {
	
	public BlockProperties(Material material, MaterialColor color) {
		super(material, color);
	}
	
	public BlockProperties(Properties properties) {
		super(properties.material, properties.mapColor);
		blocksMovement = properties.blocksMovement;
		soundType = properties.soundType;
		lightValue = properties.lightValue;
		resistance = properties.resistance;
		hardness = properties.hardness;
		ticksRandomly = properties.ticksRandomly;
		slipperiness = properties.slipperiness;
		lootTable = properties.lootTable;
		variableOpacity = properties.variableOpacity;
		
		setValueHarvestLevel(getValueHarvestLevel(properties));
		setValueHarvestTool(getValueHarvestTool(properties));
	}
	
	private int getValueHarvestLevel(Properties properties) {
		return ObfuscationReflectionHelper.getPrivateValue(Properties.class, properties, "harvestLevel");
	}
	
	private void setValueHarvestLevel(int value) {
		ObfuscationReflectionHelper.setPrivateValue(Properties.class, this, value, "harvestLevel");
	}
	
	private ToolType getValueHarvestTool(Properties properties) {
		return ObfuscationReflectionHelper.getPrivateValue(Properties.class, properties, "harvestTool");
	}
	
	private void setValueHarvestTool(ToolType value) {
		ObfuscationReflectionHelper.setPrivateValue(Properties.class, this, value, "harvestTool");
	}
	
	public Material getMaterial() {
		return material;
	}
	
	public MaterialColor getMapColor() {
		return mapColor;
	}
	
	public boolean isBlocksMovement() {
		return blocksMovement;
	}
	
	public SoundType getSoundType() {
		return soundType;
	}
	
	public int getLightValue() {
		return lightValue;
	}
	
	public float getResistance() {
		return resistance;
	}
	
	public float getHardness() {
		return hardness;
	}
	
	public boolean isTickRandomly() {
		return ticksRandomly;
	}
	
	public float getSlipperiness() {
		return slipperiness;
	}
	
	public ResourceLocation getLootTable() {
		return lootTable;
	}
	
	public boolean isVariableOpacity() {
		return variableOpacity;
	}
	
	public int getHarvestLevel() {
		return getValueHarvestLevel(this);
	}
	
	public ToolType getHarvestTool() {
		return getValueHarvestTool(this);
	}
}

@@ -34,16 +34,55 @@
 til;%0D%0A%0D%0A
+import java.util.function.Supplier;%0D%0A%0D%0A
 import n
@@ -904,40 +904,187 @@
 %0D%0A%09%09
-lootTable = properties.lootTable
+field_226893_j_ = properties.field_226893_j_;%0D%0A%09%09field_226894_k_ = properties.field_226894_k_;%0D%0A%09%09lootTable = properties.lootTable;%0D%0A%09%09field_226895_m_ = properties.field_226895_m_
 ;%0D%0A%09
@@ -1247,24 +1247,83 @@
 perties));%0D%0A
+%09%09setLootTableSupplier(getLootTableSupplier(properties));%0D%0A
 %09%7D%0D%0A%09%0D%0A%09priv
@@ -1953,32 +1953,407 @@
 Tool%22);%0D%0A%09%7D%0D%0A%09%0D%0A
+%09private Supplier%3CResourceLocation%3E getLootTableSupplier(Properties properties) %7B%0D%0A%09%09return ObfuscationReflectionHelper.getPrivateValue(Properties.class, properties, %22lootTableSupplier%22);%0D%0A%09%7D%0D%0A%09%0D%0A%09private void setLootTableSupplier(Supplier%3CResourceLocation%3E value) %7B%0D%0A%09%09ObfuscationReflectionHelper.setPrivateValue(Properties.class, this, value, %22lootTableSupplier%22);%0D%0A%09%7D%0D%0A%09%0D%0A
 %09public Material

Fix block properties now copy all things correctly