aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pers/gwyog/gtneioreplugin/util/DimensionHelper.java
blob: 1d4b0e00255ec542a437862ffcdcd640f9e69cb3 (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package pers.gwyog.gtneioreplugin.util;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

public class DimensionHelper {

    public static String[] DimName =
            {
                    "EndAsteroid",
                    "GalacticraftCore_Moon",
                    "GalacticraftMars_Asteroids",
                    "GalacticraftMars_Mars",
                    "GalaxySpace_BarnardC",
                    "GalaxySpace_BarnardE",
                    "GalaxySpace_BarnardF",
                    "GalaxySpace_Callisto",
                    "GalaxySpace_CentauriA",
                    "GalaxySpace_Ceres",
                    "GalaxySpace_Deimos",
                    "GalaxySpace_Enceladus",
                    "GalaxySpace_Europa",
                    "GalaxySpace_Ganymede",
                    "GalaxySpace_Haumea",
                    "GalaxySpace_Io",
                    "GalaxySpace_Kuiperbelt",
                    "GalaxySpace_MakeMake",
                    "GalaxySpace_Mercury",
                    "GalaxySpace_Miranda",
                    "GalaxySpace_Oberon",
                    "GalaxySpace_Phobos",
                    "GalaxySpace_Pluto",
                    "GalaxySpace_Proteus",
                    "GalaxySpace_TcetiE",
                    "GalaxySpace_Titan",
                    "GalaxySpace_Triton",
                    "GalaxySpace_VegaB",
                    "GalaxySpace_Venus",
                    "Nether",
                    "Overworld",
                    "TheEnd",
                    "Vanilla_EndAsteroids",
                    "Twilight",
                    "Underdark"
            };

    public static String[] DimNameDisplayed =
            {// first 2 letters if one word else 1 letter of every word, execpt capital letter in name, then 1rst + capital Moon = Mo, BarnardC = BC, EndAsteroid = EA
                    "EA",
                    "Mo",
                    "As",
                    "Ma",
                    "BC",
                    "BE",
                    "BF",
                    "Ca",
                    "CA",
                    "Ce",
                    "De",
                    "En",
                    "Eu",
                    "Ga",
                    "Ha",
                    "Io",
                    "KB",
                    "MM",
                    "Me",
                    "Mi",
                    "Ob",
                    "Ph",
                    "Pl",
                    "Pr",
                    "TE",
                    "Ti",
                    "Tr",
                    "VB",
                    "Ve",
                    "Ne",
                    "Ow",
                    "EN",//End = EN bc En = Encalus
                    "VA",
                    "TF",
                    "DD"
            };

    private static HashMap<String, List<String>> tooltipBuffer = new HashMap<>();

    private static List<String> computeString(String line) {
        String[] dims = line.split(",");
        for (int j = 0; j < dims.length; j++) {
            String s = dims[j];
            s = s.replaceAll(",", "");
            s = s.trim();
            for (int i = 0; i < DimNameDisplayed.length; i++) {
                if (s.equals(DimNameDisplayed[i])) {
                    s = DimName[i].replaceAll("GalacticraftCore_", "").replaceAll("GalacticraftMars_", "").replaceAll("GalaxySpace_", "").replaceAll("Vanilla_", "Vanilla ");
                    if (s.equals("Twilight"))
                        s = "Twilight Forrest";
                    else if (s.equals("Underdark"))
                        s = "Deep Dark";
                    else if (s.equals("EndAsteroid"))
                        s = "Far End Asteroids";
                    dims[j] = s;
                }
            }
        }
        return Arrays.asList(dims);
    }

    public static List<String> convertCondensedStringToToolTip(String line) {
        return tooltipBuffer.computeIfAbsent(line, (String tmp) -> computeString(line));
    }
}