MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / CustomColormap

Class CustomColormap

src/main/java/net/optifine/CustomColormap.java:26–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24import net.optifine.util.TextureUtils;
25
26public class CustomColormap implements CustomColors.IColorizer
27{
28 public String name = null;
29 public String basePath = null;
30 private int format = -1;
31 private MatchBlock[] matchBlocks = null;
32 private String source = null;
33 private int color = -1;
34 private int yVariance = 0;
35 private int yOffset = 0;
36 private int width = 0;
37 private int height = 0;
38 private int[] colors = null;
39 private float[][] colorsRgb = (float[][])null;
40 private static final int FORMAT_UNKNOWN = -1;
41 private static final int FORMAT_VANILLA = 0;
42 private static final int FORMAT_GRID = 1;
43 private static final int FORMAT_FIXED = 2;
44 public static final String FORMAT_VANILLA_STRING = "vanilla";
45 public static final String FORMAT_GRID_STRING = "grid";
46 public static final String FORMAT_FIXED_STRING = "fixed";
47 public static final String[] FORMAT_STRINGS = new String[] {"vanilla", "grid", "fixed"};
48 public static final String KEY_FORMAT = "format";
49 public static final String KEY_BLOCKS = "blocks";
50 public static final String KEY_SOURCE = "source";
51 public static final String KEY_COLOR = "color";
52 public static final String KEY_Y_VARIANCE = "yVariance";
53 public static final String KEY_Y_OFFSET = "yOffset";
54
55 public CustomColormap(Properties props, String path, int width, int height, String formatDefault)
56 {
57 ConnectedParser connectedparser = new ConnectedParser("Colormap");
58 this.name = connectedparser.parseName(path);
59 this.basePath = connectedparser.parseBasePath(path);
60 this.format = this.parseFormat(props.getProperty("format", formatDefault));
61 this.matchBlocks = connectedparser.parseMatchBlocks(props.getProperty("blocks"));
62 this.source = parseTexture(props.getProperty("source"), path, this.basePath);
63 this.color = ConnectedParser.parseColor(props.getProperty("color"), -1);
64 this.yVariance = connectedparser.parseInt(props.getProperty("yVariance"), 0);
65 this.yOffset = connectedparser.parseInt(props.getProperty("yOffset"), 0);
66 this.width = width;
67 this.height = height;
68 }
69
70 private int parseFormat(String str)
71 {
72 if (str == null)
73 {
74 return 0;
75 }
76 else
77 {
78 str = str.trim();
79
80 if (str.equals("vanilla"))
81 {
82 return 0;
83 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected