package info.u_team.u_team_core.util;

import java.util.function.Supplier;

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;
		speedFactor = properties.speedFactor;
		jumpFactor = properties.jumpFactor;
		lootTable = properties.lootTable;
		isSolid = properties.isSolid;
		variableOpacity = properties.variableOpacity;
		
		setValueHarvestLevel(getValueHarvestLevel(properties));
		setValueHarvestTool(getValueHarvestTool(properties));
		setLootTableSupplier(getLootTableSupplier(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");
	}
	
	private Supplier<ResourceLocation> getLootTableSupplier(Properties properties) {
		return ObfuscationReflectionHelper.getPrivateValue(Properties.class, properties, "lootTableSupplier");
	}
	
	private void setLootTableSupplier(Supplier<ResourceLocation> value) {
		ObfuscationReflectionHelper.setPrivateValue(Properties.class, this, value, "lootTableSupplier");
	}
	
	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);
	}
}

@@ -96,16 +96,24 @@
 t.block.
+Abstract
 Block.Pr
@@ -126,46 +126,8 @@
 es;%0A
-import net.minecraft.block.SoundType;%0A
 impo
@@ -553,24 +553,31 @@
 perties.
-mapColor
+field_235800_b_
 );%0A%09%09blo
@@ -659,114 +659,138 @@
 ;%0A%09%09
-lightValue = properties.lightValue;%0A%09%09resistance = properties.resistance;%0A%09%09hardness = properties.hardness
+field_235803_e_ = properties.field_235803_e_;%0A%09%09resistance = properties.resistance;%0A%09%09field_235806_h_ = properties.field_235806_h_
 ;%0A%09%09
@@ -1019,16 +1019,400 @@
 sSolid;%0A
+%09%09field_235813_o_ = properties.field_235813_o_;%0A%09%09field_235814_p_ = properties.field_235814_p_;%0A%09%09field_235814_p_ = properties.field_235814_p_;%0A%09%09field_235815_q_ = properties.field_235815_q_;%0A%09%09field_235816_r_ = properties.field_235816_r_;%0A%09%09field_235817_s_ = properties.field_235817_s_;%0A%09%09field_235818_t_ = properties.field_235818_t_;%0A%09%09field_235819_u_ = properties.field_235819_u_;%0A
 %09%09variab
@@ -2628,833 +2628,6 @@
 %0A%09%7D%0A
-%09%0A%09public Material getMaterial() %7B%0A%09%09return material;%0A%09%7D%0A%09%0A%09public MaterialColor getMapColor() %7B%0A%09%09return mapColor;%0A%09%7D%0A%09%0A%09public boolean isBlocksMovement() %7B%0A%09%09return blocksMovement;%0A%09%7D%0A%09%0A%09public SoundType getSoundType() %7B%0A%09%09return soundType;%0A%09%7D%0A%09%0A%09public int getLightValue() %7B%0A%09%09return lightValue;%0A%09%7D%0A%09%0A%09public float getResistance() %7B%0A%09%09return resistance;%0A%09%7D%0A%09%0A%09public float getHardness() %7B%0A%09%09return hardness;%0A%09%7D%0A%09%0A%09public boolean isTickRandomly() %7B%0A%09%09return ticksRandomly;%0A%09%7D%0A%09%0A%09public float getSlipperiness() %7B%0A%09%09return slipperiness;%0A%09%7D%0A%09%0A%09public ResourceLocation getLootTable() %7B%0A%09%09return lootTable;%0A%09%7D%0A%09%0A%09public boolean isVariableOpacity() %7B%0A%09%09return variableOpacity;%0A%09%7D%0A%09%0A%09public int getHarvestLevel() %7B%0A%09%09return getValueHarvestLevel(this);%0A%09%7D%0A%09%0A%09public ToolType getHarvestTool() %7B%0A%09%09return getValueHarvestTool(this);%0A%09%7D%0A
 %7D%0A

Fix block properties