pryingtuna85649

fluids class

May 17th, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. package com.wizardofoz.basic.fluid;
  2.  
  3. import javax.swing.Icon;
  4.  
  5. import com.wizardofoz.basic.Winkies;
  6.  
  7. import cpw.mods.fml.relauncher.Side;
  8. import cpw.mods.fml.relauncher.SideOnly;
  9. import net.minecraft.block.material.Material;
  10. import net.minecraft.client.renderer.texture.IIconRegister;
  11. import net.minecraft.creativetab.CreativeTabs;
  12. import net.minecraft.util.IIcon;
  13. import net.minecraft.world.IBlockAccess;
  14. import net.minecraft.world.World;
  15. import net.minecraftforge.fluids.BlockFluidClassic;
  16. import net.minecraftforge.fluids.Fluid;
  17.  
  18. public class OzFluids extends BlockFluidClassic {
  19.  
  20. @SideOnly(Side.CLIENT)
  21. protected IIcon stillIcon;
  22. @SideOnly(Side.CLIENT)
  23. protected IIcon flowingIcon;
  24.  
  25. public OzFluids(int id, Fluid fluid, Material material) {
  26. super(fluid, material);
  27. this.setBlockName("OzFluids");
  28. this.setCreativeTab(CreativeTabs.tabMisc);
  29. }
  30.  
  31. @Override
  32. public IIcon getIcon(int side, int meta) {
  33. return (side == 0 || side == 1) ? stillIcon : flowingIcon;
  34. }
  35.  
  36. @SideOnly(Side.CLIENT)
  37. //@Override
  38. public void registerIcons(IIconRegister register) {
  39. stillIcon = register.registerIcon("Winkies:textures/blocks/YellowWater_still");
  40. flowingIcon = register.registerIcon("Winkies:textures/blocks/YellowWater_flow");
  41. }
  42.  
  43. @Override
  44. public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
  45. if(world.getBlock(x, y, z).isAir(world, x, y, z)) {
  46. return true;
  47. }
  48. return super.canDisplace(world, x, y, z);
  49. }
  50.  
  51. @Override
  52. public boolean displaceIfPossible(World world, int x, int y, int z) {
  53. if(world.getBlock(x, y, z).isAir(world, x, y, z)) {
  54. return true;
  55. }
  56. return super.displaceIfPossible(world, x, y, z);
  57. }
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment