2015-11-08 02:37:12 +00:00
|
|
|
package WayofTime.bloodmagic.block;
|
|
|
|
|
2016-03-16 22:37:55 +00:00
|
|
|
import WayofTime.bloodmagic.client.IVariantProvider;
|
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.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;
|
2016-03-16 22:37:55 +00:00
|
|
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
2015-11-08 02:37:12 +00:00
|
|
|
|
2016-03-16 22:37:55 +00:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class BlockSoulForge extends BlockContainer implements IVariantProvider
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
|
|
|
public BlockSoulForge()
|
|
|
|
{
|
2015-11-08 02:37:12 +00:00
|
|
|
super(Material.iron);
|
|
|
|
|
2016-01-08 19:56:36 +00:00
|
|
|
setUnlocalizedName(Constants.Mod.MODID + ".soulForge");
|
2016-01-19 06:34:12 +00:00
|
|
|
setRegistryName(Constants.BloodMagicBlock.SOUL_FORGE.getRegName());
|
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);
|
2016-02-05 23:17:43 +00:00
|
|
|
|
|
|
|
setBlockBounds(0.06F, 0.0F, 0.06F, 0.94F, 0.75F, 0.94F);
|
2015-11-08 02:37:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@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
|
2016-01-09 02:30:49 +00:00
|
|
|
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
2016-01-07 23:05:23 +00:00
|
|
|
{
|
2016-01-09 02:30:49 +00:00
|
|
|
TileSoulForge tileSoulForge = (TileSoulForge) world.getTileEntity(blockPos);
|
|
|
|
if (tileSoulForge != null)
|
|
|
|
tileSoulForge.dropItems();
|
2016-01-07 23:05:23 +00:00
|
|
|
|
2016-01-09 02:30:49 +00:00
|
|
|
super.breakBlock(world, blockPos, blockState);
|
2016-01-07 23:05:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TileEntity createNewTileEntity(World worldIn, int meta)
|
|
|
|
{
|
|
|
|
return new TileSoulForge();
|
|
|
|
}
|
2016-03-16 22:37:55 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<Pair<Integer, String>> getVariants() {
|
|
|
|
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
|
|
|
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
|
|
|
return ret;
|
|
|
|
}
|
2015-11-08 02:37:12 +00:00
|
|
|
}
|