2016-02-25 16:19:57 -05:00
|
|
|
package WayofTime.bloodmagic.item.block;
|
|
|
|
|
2016-03-17 13:00:44 -07:00
|
|
|
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
|
|
|
import WayofTime.bloodmagic.tile.TileDemonCrystal;
|
2016-02-25 16:19:57 -05:00
|
|
|
import net.minecraft.block.Block;
|
2016-02-25 22:00:02 -05:00
|
|
|
import net.minecraft.block.state.IBlockState;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2016-02-25 16:19:57 -05:00
|
|
|
import net.minecraft.item.ItemBlock;
|
|
|
|
import net.minecraft.item.ItemStack;
|
2016-02-25 22:00:02 -05:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.util.EnumFacing;
|
2016-03-18 12:45:37 -07:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2016-02-25 22:00:02 -05:00
|
|
|
import net.minecraft.world.World;
|
2016-02-25 16:19:57 -05:00
|
|
|
|
|
|
|
public class ItemBlockDemonCrystal extends ItemBlock
|
|
|
|
{
|
|
|
|
public ItemBlockDemonCrystal(Block block)
|
|
|
|
{
|
|
|
|
super(block);
|
|
|
|
setHasSubtypes(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getUnlocalizedName(ItemStack stack)
|
|
|
|
{
|
|
|
|
return super.getUnlocalizedName(stack) + EnumDemonWillType.values()[stack.getItemDamage()];
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getMetadata(int meta)
|
|
|
|
{
|
|
|
|
return meta;
|
|
|
|
}
|
2016-02-25 22:00:02 -05:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState)
|
|
|
|
{
|
|
|
|
if (super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState))
|
|
|
|
{
|
|
|
|
TileEntity tile = world.getTileEntity(pos);
|
|
|
|
if (tile instanceof TileDemonCrystal)
|
|
|
|
{
|
|
|
|
((TileDemonCrystal) tile).setPlacement(side);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2016-02-25 16:19:57 -05:00
|
|
|
}
|