Advertisement
Guest User

Untitled

a guest
Mar 15th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. package net.minecraft.world;
  2.  
  3. import net.minecraftforge.fml.relauncher.Side;
  4. import net.minecraftforge.fml.relauncher.SideOnly;
  5.  
  6. @SideOnly(Side.CLIENT)
  7. public class ColorizerFoliage
  8. {
  9. /** Color buffer for foliage */
  10. private static int[] foliageBuffer = new int[65536];
  11.  
  12. public static void setFoliageBiomeColorizer(int[] foliageBufferIn)
  13. {
  14. foliageBuffer = foliageBufferIn;
  15. }
  16.  
  17. /**
  18. * Gets the color modifier to use for foliage.
  19. */
  20. public static int getFoliageColor(double temperature, double humidity)
  21. {
  22. humidity = humidity * temperature;
  23. int i = (int)((1.0D - temperature) * 255.0D);
  24. int j = (int)((1.0D - humidity) * 255.0D);
  25. return foliageBuffer[j << 8 | i];
  26. }
  27.  
  28. /**
  29. * Gets the foliage color for pine type (metadata 1) trees
  30. */
  31. public static int getFoliageColorPine()
  32. {
  33. return 6396257;
  34. }
  35.  
  36. /**
  37. * Gets the foliage color for birch type (metadata 2) trees
  38. */
  39. public static int getFoliageColorBirch()
  40. {
  41. return 8431445;
  42. }
  43.  
  44. public static int getFoliageColorBasic()
  45. {
  46. return 4764952;
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement