Guest User

BlockGristGatherer

a guest
Jul 20th, 2018
47
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.natura.minestuckarsenal.block;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. import javax.annotation.Nullable;
  7.  
  8. import com.mraof.minestuck.entity.item.EntityGrist;
  9. import com.natura.minestuckarsenal.MinestuckArsenal;
  10. import com.natura.minestuckarsenal.TabArsenal;
  11. import com.natura.minestuckarsenal.tileentity.TileEntityGristGatherer;
  12. import com.natura.minestuckarsenal.tileentity.TileEntityHub;
  13.  
  14. import net.minecraft.block.Block;
  15. import net.minecraft.block.material.MapColor;
  16. import net.minecraft.block.material.Material;
  17. import net.minecraft.block.state.IBlockState;
  18. import net.minecraft.entity.Entity;
  19. import net.minecraft.entity.EntityLivingBase;
  20. import net.minecraft.entity.item.EntityItem;
  21. import net.minecraft.entity.player.EntityPlayer;
  22. import net.minecraft.item.ItemStack;
  23. import net.minecraft.tileentity.TileEntity;
  24. import net.minecraft.util.ClassInheritanceMultiMap;
  25. import net.minecraft.util.ITickable;
  26. import net.minecraft.util.math.AxisAlignedBB;
  27. import net.minecraft.util.math.BlockPos;
  28. import net.minecraft.util.math.MathHelper;
  29. import net.minecraft.world.IBlockAccess;
  30. import net.minecraft.world.World;
  31. import net.minecraft.world.chunk.Chunk;
  32. import net.minecraftforge.items.CapabilityItemHandler;
  33. import net.minecraftforge.items.IItemHandler;
  34.  
  35. public class BlockGristGatherer extends Block implements ITickable {
  36.    
  37.     private int counter = 0;
  38.     private EntityPlayer player;
  39.    
  40.     public BlockGristGatherer() {
  41.         super(Material.IRON, MapColor.GREEN);
  42.         this.setUnlocalizedName("gristGatherer");
  43.         this.setRegistryName(MinestuckArsenal.MODID, "grist_gatherer");
  44.         this.setHardness(4.0F);
  45.         this.setResistance(8.0F);
  46.         this.setLightLevel(6.0F);
  47.         this.setCreativeTab(TabArsenal.instance);
  48.         this.setTickRandomly(true);
  49.     }
  50.    
  51.     public Class<TileEntityGristGatherer> getTileEntityClass() {
  52.         return TileEntityGristGatherer.class;
  53.     }
  54.    
  55.     public TileEntity getTileEntity(IBlockAccess world, BlockPos pos) {
  56.         return world.getTileEntity(pos);
  57.     }
  58.    
  59.     @Override
  60.     public boolean hasTileEntity(IBlockState state) {
  61.         return true;
  62.     }
  63.    
  64.     @Nullable
  65.     @Override
  66.     public TileEntity createTileEntity(World world, IBlockState state) {
  67.         return (TileEntity) new TileEntityGristGatherer(player);
  68.     }
  69.    
  70.     @Override
  71.     public void update() {
  72.         // Ticking Methods here.
  73.     }
  74.    
  75.    
  76.     @Override
  77.     public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer,
  78.             ItemStack stack) {
  79.         if(placer instanceof EntityPlayer && placer != null) {
  80.             this.player = (EntityPlayer) placer;
  81.         }
  82.         super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
  83.     }
  84.  
  85. }
RAW Paste Data