2014-04-11 22:01:11 +02:00
|
|
|
package com.pahimar.ee3.block;
|
|
|
|
|
2014-07-07 03:47:57 +02:00
|
|
|
import com.pahimar.ee3.EquivalentExchange3;
|
2014-09-19 21:55:28 +02:00
|
|
|
import com.pahimar.ee3.reference.GUIs;
|
2014-04-11 22:01:11 +02:00
|
|
|
import com.pahimar.ee3.reference.Names;
|
|
|
|
import com.pahimar.ee3.reference.RenderIds;
|
2014-04-30 03:46:59 +02:00
|
|
|
import com.pahimar.ee3.tileentity.TileEntityResearchStation;
|
2014-04-11 22:01:11 +02:00
|
|
|
import net.minecraft.block.material.Material;
|
2014-07-07 03:47:57 +02:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2014-04-11 22:01:11 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
2015-05-28 03:37:55 +02:00
|
|
|
public class BlockResearchStation extends BlockTileEntityEE
|
2014-04-11 22:01:11 +02:00
|
|
|
{
|
|
|
|
public BlockResearchStation()
|
|
|
|
{
|
|
|
|
super(Material.rock);
|
|
|
|
this.setHardness(2.0f);
|
2015-03-19 03:22:13 +01:00
|
|
|
this.setBlockName(Names.Blocks.RESEARCH_STATION);
|
2014-04-11 22:01:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TileEntity createNewTileEntity(World world, int metaData)
|
|
|
|
{
|
2014-04-30 03:46:59 +02:00
|
|
|
return new TileEntityResearchStation();
|
2014-04-11 22:01:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean renderAsNormalBlock()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isOpaqueCube()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getRenderType()
|
|
|
|
{
|
|
|
|
return RenderIds.researchStation;
|
|
|
|
}
|
2014-07-07 03:47:57 +02:00
|
|
|
|
|
|
|
@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 TileEntityResearchStation)
|
|
|
|
{
|
2014-09-19 21:55:28 +02:00
|
|
|
player.openGui(EquivalentExchange3.instance, GUIs.RESEARCH_STATION.ordinal(), world, x, y, z);
|
2014-07-07 03:47:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2014-04-11 22:01:11 +02:00
|
|
|
}
|