equivalent-exchange-3/src/main/java/com/pahimar/ee3/block/BlockAlchemyArray.java
2014-10-03 15:55:22 -04:00

75 lines
2.1 KiB
Java

package com.pahimar.ee3.block;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.reference.RenderIds;
import com.pahimar.ee3.tileentity.TileEntityAlchemyArray;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
{
public BlockAlchemyArray()
{
super(Material.circuits);
this.setCreativeTab(null);
this.setBlockName(Names.Blocks.ALCHEMY_ARRAY);
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public int getRenderType()
{
return RenderIds.alchemyArray;
}
/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*
* @param world
* @param metaData
*/
@Override
public TileEntity createNewTileEntity(World world, int metaData)
{
return new TileEntityAlchemyArray();
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack)
{
super.onBlockPlacedBy(world, x, y, z, entityLiving, itemStack);
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
{
// TODO: Place the first glyph of the alchemy array from the player's currently selected glyph
}
}
@Override
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec)
{
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
{
return super.collisionRayTrace(world, x, y, z, startVec, endVec);
}
return super.collisionRayTrace(world, x, y, z, startVec, endVec);
}
}