Advertisement
Guest User

CostomBlock

a guest
Jan 28th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. public class MalakisBlock extends Block
  2. {
  3. public MalakisBlock(Material material) {
  4. super(material);
  5. this.setStepSound(soundTypeWood);
  6. this.setBlockName("MalakisBlock");
  7. this.setCreativeTab(CreativeTabs.tabBlock);
  8. this.setTickRandomly(true);
  9. this.setBlockBounds(0.4f, 0.4f, 0.4f, 0.6f, 0.6f, 0.6f);
  10. this.setBlockTextureName("stone");
  11.  
  12. }
  13.  
  14. public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
  15. {
  16. float f = 0.0625F;
  17. return AxisAlignedBB.getBoundingBox((double)((float)p_149668_2_ + f), (double)p_149668_3_, (double)((float)p_149668_4_ + f), (double)((float)(p_149668_2_ + 1) - f), (double)((float)(p_149668_3_ + 1) - f), (double)((float)(p_149668_4_ + 1) - f));
  18. }
  19.  
  20. @Override
  21. public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
  22. {
  23. if (entity instanceof EntityPlayer){
  24. ((EntityPlayer)entity).addPotionEffect(new PotionEffect(Potion.jump.getId(), 200, 30));
  25. }else{
  26. ((EntityLiving)entity).attackEntityFrom(DamageSource.wither, 1.0F);
  27. }
  28.  
  29. }
  30.  
  31. public boolean isOpaqueCube()
  32. {
  33. return false;
  34. }
  35.  
  36. public boolean renderAsNormalBlock(){return false;}
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement