GrassColor .java

net.minecraft.world.level.GrassColor (class, 18 lines): members: getDefaultColor, pixels, init, get.

net.minecraft.world.levelclass18 linescommon386 B

API Surface (3)

void init(final int[] pixels)
int get(final double temp, final double rain)
int getDefaultColor()

Fields & Constants (1)

pixels

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

GrassColor.java18 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level;
2
3
public class GrassColor {
4
	private static int[] pixels = new int[65536];
5
6
	public static void init(final int[] pixels) {
7
		GrassColor.pixels = pixels;
8
	}
9
10
	public static int get(final double temp, final double rain) {
11
		return ColorMapColorUtil.get(temp, rain, pixels, -65281);
12
	}
13
14
	public static int getDefaultColor() {
15
		return get(0.5, 1.0);
16
	}
17
}
18

Decompiled Minecraft 26.3 source of GrassColor (net/minecraft/world/level/GrassColor.java) with Mojang official mappings, stored verbatim on the site.