mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 11:15:21 +01:00
Made colors load from jar when not found in filesystem.
This commit is contained in:
parent
4f0e89b1d8
commit
342a72f39f
@ -20,12 +20,12 @@
|
|||||||
<fileset dir="${bin}"/>
|
<fileset dir="${bin}"/>
|
||||||
<fileset file="${src}/main/resources/plugin.yml"/>
|
<fileset file="${src}/main/resources/plugin.yml"/>
|
||||||
<zipfileset dir="web" prefix="web/"/>
|
<zipfileset dir="web" prefix="web/"/>
|
||||||
|
<zipfileset file="${src}/main/resources/colors.txt"/>
|
||||||
</jar>
|
</jar>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="deploy" depends="dist">
|
<target name="deploy" depends="dist">
|
||||||
<copy file="${dist}/${pluginname}.jar" todir="${plugins}"/>
|
<copy file="${dist}/${pluginname}.jar" todir="${plugins}"/>
|
||||||
<copy file="colors.txt" todir="${minecraft}"/>
|
|
||||||
<copy todir="${http_root}">
|
<copy todir="${http_root}">
|
||||||
<fileset dir="web"/>
|
<fileset dir="web"/>
|
||||||
</copy>
|
</copy>
|
||||||
|
@ -82,6 +82,12 @@ public class MapManager extends Thread {
|
|||||||
this.debugger = debugger;
|
this.debugger = debugger;
|
||||||
this.staleQueue = new StaleQueue();
|
this.staleQueue = new StaleQueue();
|
||||||
|
|
||||||
|
|
||||||
|
File tilepathFile = new File(tilepath);
|
||||||
|
if (!tilepathFile.isDirectory())
|
||||||
|
tilepathFile.mkdirs();
|
||||||
|
|
||||||
|
|
||||||
serverport = 8123;
|
serverport = 8123;
|
||||||
bindaddress = "0.0.0.0";
|
bindaddress = "0.0.0.0";
|
||||||
//webPath = "/srv/http/dynmap/";
|
//webPath = "/srv/http/dynmap/";
|
||||||
|
@ -2,6 +2,8 @@ package org.dynmap.kzedmap;
|
|||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -35,8 +37,11 @@ public class KzedMap extends Map {
|
|||||||
|
|
||||||
public KzedMap(MapManager manager, World world, Debugger debugger) {
|
public KzedMap(MapManager manager, World world, Debugger debugger) {
|
||||||
super(manager, world, debugger);
|
super(manager, world, debugger);
|
||||||
if (colors == null)
|
getDebugger().debug("Loading colors...");
|
||||||
|
if (colors == null) {
|
||||||
|
getDebugger().debug("Loading colors2...");
|
||||||
colors = loadColorSet("colors.txt");
|
colors = loadColorSet("colors.txt");
|
||||||
|
}
|
||||||
renderers = new MapTileRenderer[] {
|
renderers = new MapTileRenderer[] {
|
||||||
new DefaultTileRenderer("t", debugger),
|
new DefaultTileRenderer("t", debugger),
|
||||||
new CaveTileRenderer("ct", debugger),
|
new CaveTileRenderer("ct", debugger),
|
||||||
@ -312,14 +317,21 @@ public class KzedMap extends Map {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static java.util.Map<Integer, Color[]> loadColorSet(String colorsetpath) {
|
public java.util.Map<Integer, Color[]> loadColorSet(String colorsetpath) {
|
||||||
java.util.Map<Integer, Color[]> colors = new HashMap<Integer, Color[]>();
|
java.util.Map<Integer, Color[]> colors = new HashMap<Integer, Color[]>();
|
||||||
|
|
||||||
/* load colorset */
|
InputStream stream;
|
||||||
File cfile = new File(colorsetpath);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Scanner scanner = new Scanner(cfile);
|
/* load colorset */
|
||||||
|
File cfile = new File(colorsetpath);
|
||||||
|
if (cfile.exists()) {
|
||||||
|
stream = new FileInputStream(cfile);
|
||||||
|
} else {
|
||||||
|
stream = KzedMap.class.getResourceAsStream("/colors.txt");
|
||||||
|
}
|
||||||
|
|
||||||
|
Scanner scanner = new Scanner(stream);
|
||||||
int nc = 0;
|
int nc = 0;
|
||||||
while(scanner.hasNextLine()) {
|
while(scanner.hasNextLine()) {
|
||||||
String line = scanner.nextLine();
|
String line = scanner.nextLine();
|
||||||
@ -347,6 +359,7 @@ public class KzedMap extends Map {
|
|||||||
}
|
}
|
||||||
scanner.close();
|
scanner.close();
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
|
getDebugger().error("Could not load colors", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return colors;
|
return colors;
|
||||||
|
@ -1,72 +1,72 @@
|
|||||||
1 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
|
1 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
|
||||||
2 117 176 73 255 93 140 58 255 58 88 36 255 46 70 29 255
|
2 117 176 73 255 93 140 58 255 58 88 36 255 46 70 29 255
|
||||||
3 134 96 67 255 107 76 53 255 67 48 33 255 53 38 26 255
|
3 134 96 67 255 107 76 53 255 67 48 33 255 53 38 26 255
|
||||||
4 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
|
4 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
|
||||||
48 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
|
48 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
|
||||||
5 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
|
5 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
|
||||||
6 120 120 120 0 96 96 96 0 60 60 60 0 48 48 48 0
|
6 120 120 120 0 96 96 96 0 60 60 60 0 48 48 48 0
|
||||||
7 84 84 84 255 67 67 67 255 42 42 42 255 33 33 33 255
|
7 84 84 84 255 67 67 67 255 42 42 42 255 33 33 33 255
|
||||||
8 38 92 255 51 30 73 204 51 19 46 127 51 15 36 102 51
|
8 38 92 255 51 30 73 204 51 19 46 127 51 15 36 102 51
|
||||||
9 38 92 255 51 30 73 204 51 19 46 127 51 15 36 102 51
|
9 38 92 255 51 30 73 204 51 19 46 127 51 15 36 102 51
|
||||||
10 255 90 0 255 204 72 0 255 127 45 0 255 102 36 0 255
|
10 255 90 0 255 204 72 0 255 127 45 0 255 102 36 0 255
|
||||||
11 255 90 0 255 204 72 0 255 127 45 0 255 102 36 0 255
|
11 255 90 0 255 204 72 0 255 127 45 0 255 102 36 0 255
|
||||||
12 218 210 158 255 174 168 126 255 109 105 79 255 87 84 63 255
|
12 218 210 158 255 174 168 126 255 109 105 79 255 87 84 63 255
|
||||||
13 136 126 126 255 108 100 100 255 68 63 63 255 54 50 50 255
|
13 136 126 126 255 108 100 100 255 68 63 63 255 54 50 50 255
|
||||||
14 143 140 125 255 114 112 100 255 71 70 62 255 57 56 50 255
|
14 143 140 125 255 114 112 100 255 71 70 62 255 57 56 50 255
|
||||||
15 136 130 127 255 108 104 101 255 68 65 63 255 54 52 50 255
|
15 136 130 127 255 108 104 101 255 68 65 63 255 54 52 50 255
|
||||||
16 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
|
16 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
|
||||||
17 102 81 51 255 81 64 40 255 51 40 25 255 40 32 20 255
|
17 102 81 51 255 81 64 40 255 51 40 25 255 40 32 20 255
|
||||||
18 60 192 41 100 48 153 32 100 30 96 20 100 24 76 16 100
|
18 60 192 41 100 48 153 32 100 30 96 20 100 24 76 16 100
|
||||||
20 255 255 255 64 204 204 204 64 127 127 127 64 102 102 102 64
|
20 255 255 255 64 204 204 204 64 127 127 127 64 102 102 102 64
|
||||||
35 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
35 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
||||||
37 255 0 0 255 204 0 0 255 127 0 0 255 102 0 0 255
|
37 255 0 0 255 204 0 0 255 127 0 0 255 102 0 0 255
|
||||||
38 255 255 0 0 204 204 0 0 127 127 0 0 102 102 0 0
|
38 255 255 0 0 204 204 0 0 127 127 0 0 102 102 0 0
|
||||||
41 232 245 46 255 185 196 36 255 116 122 23 255 92 98 18 255
|
41 232 245 46 255 185 196 36 255 116 122 23 255 92 98 18 255
|
||||||
42 191 191 191 255 152 152 152 255 95 95 95 255 76 76 76 255
|
42 191 191 191 255 152 152 152 255 95 95 95 255 76 76 76 255
|
||||||
43 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
|
43 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
|
||||||
44 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
|
44 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
|
||||||
45 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
|
45 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
|
||||||
46 160 83 65 255 128 66 52 255 80 41 32 255 64 33 26 255
|
46 160 83 65 255 128 66 52 255 80 41 32 255 64 33 26 255
|
||||||
49 26 11 43 255 20 8 34 255 13 5 21 255 10 4 17 255
|
49 26 11 43 255 20 8 34 255 13 5 21 255 10 4 17 255
|
||||||
51 255 170 30 200 204 136 24 200 127 85 15 200 102 68 12 200
|
51 255 170 30 200 204 136 24 200 127 85 15 200 102 68 12 200
|
||||||
53 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
|
53 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
|
||||||
54 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255
|
54 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255
|
||||||
56 129 140 143 255 103 112 114 255 64 70 71 255 51 56 57 255
|
56 129 140 143 255 103 112 114 255 64 70 71 255 51 56 57 255
|
||||||
57 45 166 152 255 36 132 121 255 22 83 76 255 18 66 60 255
|
57 45 166 152 255 36 132 121 255 22 83 76 255 18 66 60 255
|
||||||
58 114 88 56 255 91 70 44 255 57 44 28 255 45 35 22 255
|
58 114 88 56 255 91 70 44 255 57 44 28 255 45 35 22 255
|
||||||
59 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
|
59 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
|
||||||
60 95 58 30 255 76 46 24 255 47 29 15 255 38 23 12 255
|
60 95 58 30 255 76 46 24 255 47 29 15 255 38 23 12 255
|
||||||
61 96 96 96 255 76 76 76 255 48 48 48 255 38 38 38 255
|
61 96 96 96 255 76 76 76 255 48 48 48 255 38 38 38 255
|
||||||
62 96 96 96 255 76 76 76 255 48 48 48 255 38 38 38 255
|
62 96 96 96 255 76 76 76 255 48 48 48 255 38 38 38 255
|
||||||
63 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255
|
63 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255
|
||||||
64 136 109 67 255 108 87 53 255 68 54 33 255 54 43 26 255
|
64 136 109 67 255 108 87 53 255 68 54 33 255 54 43 26 255
|
||||||
65 181 140 64 32 144 112 51 32 90 70 32 32 72 56 25 32
|
65 181 140 64 32 144 112 51 32 90 70 32 32 72 56 25 32
|
||||||
66 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
66 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||||
67 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
|
67 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
|
||||||
71 191 191 191 255 152 152 152 255 95 95 95 255 76 76 76 255
|
71 191 191 191 255 152 152 152 255 95 95 95 255 76 76 76 255
|
||||||
73 131 107 107 255 104 85 85 255 65 53 53 255 52 42 42 255
|
73 131 107 107 255 104 85 85 255 65 53 53 255 52 42 42 255
|
||||||
74 131 107 107 255 104 85 85 255 65 53 53 255 52 42 42 255
|
74 131 107 107 255 104 85 85 255 65 53 53 255 52 42 42 255
|
||||||
78 255 255 255 255 204 204 204 255 127 127 127 255 102 102 102 255
|
78 255 255 255 255 204 204 204 255 127 127 127 255 102 102 102 255
|
||||||
79 83 113 163 51 66 90 130 51 41 56 81 51 33 45 65 51
|
79 83 113 163 51 66 90 130 51 41 56 81 51 33 45 65 51
|
||||||
80 250 250 250 255 200 200 200 255 125 125 125 255 100 100 100 255
|
80 250 250 250 255 200 200 200 255 125 125 125 255 100 100 100 255
|
||||||
81 25 120 25 255 20 96 20 255 12 60 12 255 10 48 10 255
|
81 25 120 25 255 20 96 20 255 12 60 12 255 10 48 10 255
|
||||||
82 151 157 169 255 120 125 135 255 75 78 84 255 60 62 67 255
|
82 151 157 169 255 120 125 135 255 75 78 84 255 60 62 67 255
|
||||||
83 193 234 150 255 154 187 120 255 96 117 75 255 77 93 60 255
|
83 193 234 150 255 154 187 120 255 96 117 75 255 77 93 60 255
|
||||||
|
|
||||||
redstone torch off
|
redstone torch off
|
||||||
75 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0
|
75 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0
|
||||||
redstone torch on
|
redstone torch on
|
||||||
76 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0
|
76 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0
|
||||||
torch
|
torch
|
||||||
50 159 127 80 255 98 88 20 0 245 220 50 255 196 176 40 0
|
50 159 127 80 255 98 88 20 0 245 220 50 255 196 176 40 0
|
||||||
|
|
||||||
fence
|
fence
|
||||||
85 172 136 82 255 172 136 82 0 91 70 37 255 91 70 37 0
|
85 172 136 82 255 172 136 82 0 91 70 37 255 91 70 37 0
|
||||||
netherstone
|
netherstone
|
||||||
87 166 89 89 255 141 80 62 255 135 15 15 255 96 6 6 255
|
87 166 89 89 255 141 80 62 255 135 15 15 255 96 6 6 255
|
||||||
slowsand
|
slowsand
|
||||||
88 133 109 94 255 121 97 82 255 90 70 57 255 79 59 46 255
|
88 133 109 94 255 121 97 82 255 90 70 57 255 79 59 46 255
|
||||||
lightstone
|
lightstone
|
||||||
89 249 212 156 255 255 188 94 255 192 143 70 255 122 91 44 255
|
89 249 212 156 255 255 188 94 255 192 143 70 255 122 91 44 255
|
||||||
portal
|
portal
|
||||||
90 99 66 222 128 99 66 222 128 99 66 222 128 99 66 222 128
|
90 99 66 222 128 99 66 222 128 99 66 222 128 99 66 222 128
|
Loading…
Reference in New Issue
Block a user