Merge pull request #243 from SquidDev-CC/feature/access-transformer

Replace reflection with access transformers
This commit is contained in:
Daniel Ratcliffe
2017-05-16 19:25:10 +01:00
committed by GitHub
7 changed files with 22 additions and 59 deletions
@@ -17,10 +17,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import javax.annotation.Nonnull;
import java.lang.reflect.Method;
public class TurtleCompareCommand implements ITurtleCommand
{
@@ -58,22 +56,7 @@ public class TurtleCompareCommand implements ITurtleCommand
// Try createStackedBlock first
if( !lookAtBlock.hasTileEntity( lookAtState ) )
{
try
{
Method method = ReflectionHelper.findMethod(
Block.class, lookAtBlock,
new String[]{ "func_149644_j", "j", "createStackedBlock" },
IBlockState.class
);
if( method != null )
{
lookAtStack = (ItemStack)method.invoke( lookAtBlock, lookAtState );
}
}
catch( Exception e )
{
// ???
}
lookAtStack = lookAtBlock.createStackedBlock( lookAtState );
}
// See if the block drops anything with the same ID as itself