-
Notifications
You must be signed in to change notification settings - Fork 81
/
LeavesColorizer.java
55 lines (50 loc) · 1.56 KB
/
LeavesColorizer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.progwml6.natura.world.client;
import com.progwml6.natura.world.block.TreeType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockDisplayReader;
import net.minecraft.world.biome.BiomeColors;
public class LeavesColorizer {
public static int mapleColor = 0xcc5718;
public static int amaranthColor = 10079569;
public static int noColor = 16777215;
public static int leaves2Color = 7842607;
public static int leavesColor = 0xffffff;
public static int getColorStatic(TreeType type) {
switch (type) {
case MAPLE:
return LeavesColorizer.mapleColor;
case AMARANTH:
return LeavesColorizer.amaranthColor;
case SILVERBELL:
case TIGER:
return LeavesColorizer.leavesColor;
case EUCALYPTUS:
case HOPSEED:
return LeavesColorizer.leaves2Color;
case WILLOW:
case SAKURA:
return LeavesColorizer.noColor;
default:
return LeavesColorizer.leavesColor;
}
}
public static int getColorForPos(IBlockDisplayReader worldIn, BlockPos pos, TreeType type) {
switch (type) {
case MAPLE:
return LeavesColorizer.mapleColor;
case AMARANTH:
return BiomeColors.getFoliageColor(worldIn, pos) + 0x222222;
case SILVERBELL:
case TIGER:
return LeavesColorizer.leavesColor;
case EUCALYPTUS:
case HOPSEED:
return BiomeColors.getFoliageColor(worldIn, pos);
case WILLOW:
case SAKURA:
return LeavesColorizer.noColor;
default:
return LeavesColorizer.leavesColor;
}
}
}