2013-12-27 23:59:59 +01:00
|
|
|
package appeng.block.misc;
|
|
|
|
|
|
|
|
import java.util.EnumSet;
|
|
|
|
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.world.World;
|
2014-03-07 07:15:54 +01:00
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.AEBaseBlock;
|
2014-03-07 07:15:54 +01:00
|
|
|
import appeng.client.render.BaseBlockRender;
|
|
|
|
import appeng.client.render.blocks.RenderBlockInscriber;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.features.AEFeature;
|
2014-03-07 07:15:54 +01:00
|
|
|
import appeng.core.sync.GuiBridge;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.tile.misc.TileInscriber;
|
2014-03-07 07:15:54 +01:00
|
|
|
import appeng.util.Platform;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
public class BlockInscriber extends AEBaseBlock
|
|
|
|
{
|
|
|
|
|
|
|
|
public BlockInscriber() {
|
|
|
|
super( BlockInscriber.class, Material.iron );
|
|
|
|
setfeature( EnumSet.of( AEFeature.Inscriber ) );
|
|
|
|
setTileEntiy( TileInscriber.class );
|
2014-03-07 07:15:54 +01:00
|
|
|
setLightOpacity( 2 );
|
|
|
|
isFullSize = isOpaque = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected Class<? extends BaseBlockRender> getRenderer()
|
|
|
|
{
|
|
|
|
return RenderBlockInscriber.class;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-03-05 08:27:42 +01:00
|
|
|
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-03-05 08:27:42 +01:00
|
|
|
if ( p.isSneaking() )
|
2013-12-27 23:59:59 +01:00
|
|
|
return false;
|
|
|
|
|
2014-03-07 07:15:54 +01:00
|
|
|
TileInscriber tg = getTileEntity( w, x, y, z );
|
2014-03-05 08:27:42 +01:00
|
|
|
if ( tg != null )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-03-07 07:15:54 +01:00
|
|
|
if ( Platform.isServer() )
|
|
|
|
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_INSCRIBER );
|
2014-03-05 08:27:42 +01:00
|
|
|
return true;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
2014-03-05 08:27:42 +01:00
|
|
|
return false;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|