2014-07-17 21:20:53 +02:00
|
|
|
package com.pahimar.ee3.block;
|
|
|
|
|
|
|
|
import com.pahimar.ee3.EquivalentExchange3;
|
2014-09-19 21:55:28 +02:00
|
|
|
import com.pahimar.ee3.reference.GUIs;
|
2014-07-17 21:20:53 +02:00
|
|
|
import com.pahimar.ee3.reference.Names;
|
|
|
|
import com.pahimar.ee3.reference.RenderIds;
|
|
|
|
import com.pahimar.ee3.tileentity.TileEntityAugmentationTable;
|
|
|
|
import net.minecraft.block.ITileEntityProvider;
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
|
|
public class BlockAugmentationTable extends BlockEE implements ITileEntityProvider
|
|
|
|
{
|
|
|
|
public BlockAugmentationTable()
|
|
|
|
{
|
|
|
|
super(Material.rock);
|
|
|
|
this.setHardness(2.0f);
|
|
|
|
this.setBlockName(Names.Blocks.AUGMENTATION_TABLE);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TileEntity createNewTileEntity(World world, int metaData)
|
|
|
|
{
|
|
|
|
return new TileEntityAugmentationTable();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean renderAsNormalBlock()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isOpaqueCube()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getRenderType()
|
|
|
|
{
|
|
|
|
return RenderIds.augmentationTable;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
|
|
|
|
{
|
|
|
|
if (player.isSneaking())
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!world.isRemote)
|
|
|
|
{
|
|
|
|
if (world.getTileEntity(x, y, z) instanceof TileEntityAugmentationTable)
|
|
|
|
{
|
2014-09-19 21:55:28 +02:00
|
|
|
player.openGui(EquivalentExchange3.instance, GUIs.AUGMENTATION_TABLE.ordinal(), world, x, y, z);
|
2014-07-17 21:20:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|