Guest User

Block class

a guest
Dec 30th, 2016
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. package com.theundertaker11.GeneticsReborn.blocks.cellanalyser;
  2.  
  3. import javax.annotation.Nullable;
  4.  
  5. import com.theundertaker11.GeneticsReborn.GeneticsReborn;
  6. import com.theundertaker11.GeneticsReborn.blocks.StorageBlockBase;
  7. import com.theundertaker11.GeneticsReborn.gui.GuiHandler;
  8.  
  9. import net.minecraft.block.state.IBlockState;
  10. import net.minecraft.entity.player.EntityPlayer;
  11. import net.minecraft.item.ItemStack;
  12. import net.minecraft.tileentity.TileEntity;
  13. import net.minecraft.util.EnumFacing;
  14. import net.minecraft.util.EnumHand;
  15. import net.minecraft.util.math.BlockPos;
  16. import net.minecraft.util.text.TextComponentString;
  17. import net.minecraft.world.World;
  18.  
  19. public class CellAnalyser extends StorageBlockBase{
  20.  
  21. public CellAnalyser(String name) {
  22. super(name);
  23. }
  24. @Override
  25. public TileEntity createTileEntity(World world, IBlockState state)
  26. {
  27. return new GRTileEntityCellAnalyser();
  28. }
  29. @Override
  30. public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
  31. if(worldIn.isRemote) return true;
  32. TileEntity tEntity = worldIn.getTileEntity(pos);
  33.  
  34. if(tEntity!=null&&tEntity instanceof GRTileEntityCellAnalyser)
  35. {
  36. playerIn.openGui(GeneticsReborn.instance, GuiHandler.CellAnalyserGuiID, worldIn, pos.getX(), pos.getY(), pos.getZ());
  37. }
  38. return true;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment