Advertisement
TitanChase

Untitled

Apr 13th, 2014
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. public class myfluid extends BlockFluidClassic
  2. {
  3.  
  4. @SideOnly(Side.CLIENT)
  5. protected IIcon stillIcon;
  6. @SideOnly(Side.CLIENT)
  7. protected IIcon flowingIcon;
  8.  
  9. public myfluid(Fluid fluid, Material material)
  10. {
  11. super(fluid, material);
  12. this.setBlockName("yourFluid");
  13. setCreativeTab(CreativeTabs.tabMisc);
  14. }
  15.  
  16. @Override
  17. public IIcon getIcon(int side, int meta)
  18. {
  19. return (side == 0 || side == 1) ? stillIcon : flowingIcon;
  20. }
  21.  
  22. @SideOnly(Side.CLIENT)
  23. @Override
  24. public void registerBlockIcons(IIconRegister iconRegister)
  25. {
  26. stillIcon = iconRegister.registerIcon(NameReferences.MOD.ID + ":fluidStill.png");
  27. flowingIcon = iconRegister.registerIcon(NameReferences.MOD.ID + ":fluidFlowing.png");
  28. }
  29.  
  30. @Override
  31. public boolean canDisplace(IBlockAccess world, int x, int y, int z)
  32. {
  33. if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
  34. return super.canDisplace(world, x, y, z);
  35. }
  36.  
  37. @Override
  38. public boolean displaceIfPossible(World world, int x, int y, int z)
  39. {
  40. if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
  41. return super.displaceIfPossible(world, x, y, z);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement