-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTropicalFishInfo.cs
More file actions
73 lines (70 loc) · 2.03 KB
/
Copy pathTropicalFishInfo.cs
File metadata and controls
73 lines (70 loc) · 2.03 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
namespace VaniFine
{
internal struct TropicalFishInfo
{
public static TropicalFishInfo FromInt(int variant, Dictionary<string, string> definition)
{
// https://minecraft.wiki/w/Tropical_Fish#Entity_data
byte patternColor = (byte)((variant >> 24) & 0xFF); // MSB
byte baseColor = (byte)((variant >> 16) & 0xFF); // 2nd MSB
byte pattern = (byte)((variant >> 8) & 0xFF); // 2nd LSB
byte shape = (byte)(variant & 0xFF); // LSB
return new TropicalFishInfo
{
PatternColor = (Color)patternColor,
BaseColor = (Color)baseColor,
Pattern = pattern,
Shape = shape,
Definition = definition,
Integer = variant
};
}
public static Dictionary<byte, Dictionary<byte, string>> FishNames = new()
{
[0] = new()
{
[0] = "Kob",
[1] = "Sunstreak",
[2] = "Snooper",
[3] = "Dasher",
[4] = "Brinely",
[5] = "Spotty",
},
[1] = new()
{
[0] = "Flopper",
[1] = "Stripey",
[2] = "Glitter",
[3] = "Blockfish",
[4] = "Betty",
[5] = "Clayfish",
}
};
public string GetName() => FishNames[Shape][Pattern];
public Color PatternColor { get; set; }
public Color BaseColor { get; set; }
public byte Pattern { get; set; }
public byte Shape { get; set; }
public int Integer { get; set; }
public Dictionary<string, string> Definition { get; set; }
}
enum Color : byte
{
White,
Orange,
Magenta,
Light_Blue,
Yellow,
Lime,
Pink,
Gray,
Light_Gray,
Cyan,
Purple,
Blue,
Brown,
Green,
Red,
Black
}
}