mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-31 11:19:13 +00:00
Merge pull request #246 from SquidDev-CC/hotfix/at-stacked-block
Remove AT for Block.createStackedBlock
This commit is contained in:
commit
d6bf2c5dbc
@ -14,11 +14,13 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
public class TurtleCompareCommand implements ITurtleCommand
|
public class TurtleCompareCommand implements ITurtleCommand
|
||||||
{
|
{
|
||||||
@ -56,7 +58,18 @@ public class TurtleCompareCommand implements ITurtleCommand
|
|||||||
// Try createStackedBlock first
|
// Try createStackedBlock first
|
||||||
if( !lookAtBlock.hasTileEntity( lookAtState ) )
|
if( !lookAtBlock.hasTileEntity( lookAtState ) )
|
||||||
{
|
{
|
||||||
lookAtStack = lookAtBlock.createStackedBlock( lookAtState );
|
try
|
||||||
|
{
|
||||||
|
Method method = ReflectionHelper.findMethod(
|
||||||
|
Block.class, lookAtBlock,
|
||||||
|
new String[] { "func_180643_i", "createStackedBlock" },
|
||||||
|
IBlockState.class
|
||||||
|
);
|
||||||
|
lookAtStack = (ItemStack) method.invoke( lookAtBlock, lookAtState );
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if the block drops anything with the same ID as itself
|
// See if the block drops anything with the same ID as itself
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
# RecordMedia (and related methods)
|
# RecordMedia (and related methods)
|
||||||
public net.minecraft.item.ItemRecord field_185076_b # sound
|
public net.minecraft.item.ItemRecord field_185076_b # sound
|
||||||
public net.minecraft.item.ItemRecord field_185077_c # displayName
|
public net.minecraft.item.ItemRecord field_185077_c # displayName
|
||||||
|
|
||||||
# TurtleCompareCommand
|
|
||||||
public net.minecraft.block.Block func_180643_i(Lnet/minecraft/block/state/IBlockState;)Lnet/minecraft/item/ItemStack; # createStackedBlock
|
|
||||||
|
Loading…
Reference in New Issue
Block a user