2015-11-08 02:37:12 +00:00
|
|
|
package WayofTime.bloodmagic.block;
|
|
|
|
|
2016-01-07 23:05:23 +00:00
|
|
|
import net.minecraft.block.BlockContainer;
|
2015-11-08 02:37:12 +00:00
|
|
|
import net.minecraft.block.material.Material;
|
2016-01-07 23:05:23 +00:00
|
|
|
import net.minecraft.block.state.IBlockState;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.inventory.InventoryHelper;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.util.BlockPos;
|
|
|
|
import net.minecraft.util.EnumFacing;
|
|
|
|
import net.minecraft.world.World;
|
2016-01-07 21:36:52 +00:00
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
|
|
|
import WayofTime.bloodmagic.api.Constants;
|
2016-01-07 23:05:23 +00:00
|
|
|
import WayofTime.bloodmagic.tile.TileSoulForge;
|
|
|
|
import WayofTime.bloodmagic.tile.TileTeleposer;
|
2015-11-08 02:37:12 +00:00
|
|
|
|
2016-01-07 23:05:23 +00:00
|
|
|
public class BlockSoulForge extends BlockContainer
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
|
|
|
public BlockSoulForge()
|
|
|
|
{
|
2015-11-08 02:37:12 +00:00
|
|
|
super(Material.iron);
|
|
|
|
|
2016-01-07 21:36:52 +00:00
|
|
|
setUnlocalizedName(Constants.Mod.MODID + ".soulforge");
|
2015-11-08 02:37:12 +00:00
|
|
|
setHardness(2.0F);
|
|
|
|
setResistance(5.0F);
|
|
|
|
setStepSound(soundTypeMetal);
|
2016-01-07 23:05:23 +00:00
|
|
|
setHarvestLevel("pickaxe", 1);
|
2015-11-08 02:37:12 +00:00
|
|
|
setCreativeTab(BloodMagic.tabBloodMagic);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-01-07 21:36:52 +00:00
|
|
|
public boolean isOpaqueCube()
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
2016-01-07 21:36:52 +00:00
|
|
|
return false;
|
|
|
|
}
|
2015-11-08 02:37:12 +00:00
|
|
|
|
2016-01-07 21:36:52 +00:00
|
|
|
@Override
|
|
|
|
public boolean isFullCube()
|
|
|
|
{
|
2015-11-08 02:37:12 +00:00
|
|
|
return false;
|
|
|
|
}
|
2016-01-07 21:36:52 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isVisuallyOpaque()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getRenderType()
|
|
|
|
{
|
|
|
|
return 3;
|
|
|
|
}
|
2016-01-07 23:05:23 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
|
|
|
{
|
|
|
|
if (world.getTileEntity(pos) instanceof TileSoulForge)
|
|
|
|
{
|
|
|
|
player.openGui(BloodMagic.instance, Constants.Gui.SOUL_FORGE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
|
|
|
{
|
|
|
|
if (worldIn.getTileEntity(pos) != null && worldIn.getTileEntity(pos) instanceof TileTeleposer)
|
|
|
|
{
|
|
|
|
InventoryHelper.dropInventoryItems(worldIn, pos, (TileTeleposer) worldIn.getTileEntity(pos));
|
|
|
|
}
|
|
|
|
|
|
|
|
super.breakBlock(worldIn, pos, state);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TileEntity createNewTileEntity(World worldIn, int meta)
|
|
|
|
{
|
|
|
|
return new TileSoulForge();
|
|
|
|
}
|
2015-11-08 02:37:12 +00:00
|
|
|
}
|