Update BlockInteger/String

This commit is contained in:
Nick 2016-03-18 12:01:58 -07:00
parent 5e9454d390
commit d05d3b90df
5 changed files with 27 additions and 19 deletions

View file

@ -6,15 +6,15 @@ import lombok.Getter;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
@ -42,7 +42,7 @@ public class BlockString extends Block
private final List<String> values;
private final PropertyString stringProp;
private final IUnlistedProperty unlistedStringProp;
private final BlockState realBlockState;
private final BlockStateContainer realBlockState;
public BlockString(Material material, String[] values, String propName)
{
@ -81,19 +81,19 @@ public class BlockString extends Block
}
@Override
public BlockState getBlockState()
public BlockStateContainer getBlockState()
{
return this.realBlockState;
}
@Override
public BlockState createBlockState()
public BlockStateContainer createBlockState()
{
return Blocks.air.getBlockState();
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player)
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
{
return new ItemStack(this, 1, this.getMetaFromState(world.getBlockState(pos)));
}
@ -121,7 +121,7 @@ public class BlockString extends Block
return (IExtendedBlockState) this.getBaseExtendedState().getBaseState();
}
private BlockState createRealBlockState()
private BlockStateContainer createRealBlockState()
{
return new ExtendedBlockState(this, new IProperty[] { stringProp }, new IUnlistedProperty[] { unlistedStringProp });
}