mirror of
https://github.com/encounter/dynmap.git
synced 2026-03-30 11:08:39 -07:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 008052179f | |||
| 4b3d8a7c6b |
@@ -22,15 +22,6 @@
|
||||
<jar jarfile="${dist}/${pluginname}.jar">
|
||||
<fileset dir="${bin}"/>
|
||||
<fileset file="${src}/main/resources/plugin.yml"/>
|
||||
<fileset file="${src}/main/resources/configuration.txt"/>
|
||||
<fileset file="${src}/main/resources/custom-lightings.txt"/>
|
||||
<fileset file="${src}/main/resources/custom-perspectives.txt"/>
|
||||
<fileset file="${src}/main/resources/custom-shaders.txt"/>
|
||||
<fileset file="${src}/main/resources/lightings.txt"/>
|
||||
<fileset file="${src}/main/resources/models.txt"/>
|
||||
<fileset file="${src}/main/resources/perspectives.txt"/>
|
||||
<fileset file="${src}/main/resources/texture.txt"/>
|
||||
<fileset file="${src}/main/resources/worlds.txt"/>
|
||||
<zipfileset file="${src}/main/resources/colors.txt"/>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
@@ -54,18 +54,12 @@ Powered Rail
|
||||
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||
Detector Rail
|
||||
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||
Sticky Piston
|
||||
29 157 128 79 255 96 96 96 255 78 64 39 255 48 48 48 255
|
||||
Cobweb
|
||||
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||
Tall Grass
|
||||
31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255
|
||||
Dead Shrubs
|
||||
32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
||||
Piston
|
||||
33 157 128 79 255 96 96 96 255 78 64 39 255 48 48 48 255
|
||||
Piston Head
|
||||
34 157 128 79 255 96 96 96 255 78 64 39 255 48 48 48 255
|
||||
Wool
|
||||
35 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
||||
35:0 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
||||
@@ -233,37 +227,3 @@ Locked Chest
|
||||
95 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255
|
||||
Trap Door
|
||||
96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255
|
||||
Biome Rainforest - Dark Green
|
||||
[RAINFOREST] 49 67 21 255 39 53 17 255 24 34 10 255 19 27 8 255
|
||||
Biome Swampland - Brown
|
||||
[SWAMPLAND] 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
||||
Biome Seasonal Forest - Light Green
|
||||
[SEASONAL_FOREST] 51 165 42 255 41 131 33 255 26 82 21 255 20 65 17 255
|
||||
Biome Forest - Light Gray
|
||||
[FOREST] 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||
Biome Savanna - Dark Gray
|
||||
[SAVANNA] 58 58 58 255 47 47 47 255 29 29 29 255 23 23 23 255
|
||||
Biome Shrubland - Yellow
|
||||
[SHRUBLAND] 170 158 24 255 135 126 19 255 85 79 12 255 67 62 10 255
|
||||
Biome Taiga - Cyan
|
||||
[TAIGA] 34 102 131 255 27 81 104 255 17 51 65 255 13 40 52 255
|
||||
Biome Desert - Orange
|
||||
[DESERT] 204 111 48 255 162 89 38 255 102 56 24 255 81 44 19 255
|
||||
Biome Plains - Magenta
|
||||
[PLAINS] 166 66 175 255 133 53 140 255 83 33 87 255 66 26 69 255
|
||||
Biome Ice Desert - Dark Blue
|
||||
[ICE_DESERT] 26 33 103 255 20 26 80 255 13 17 50 255 9 14 40 255
|
||||
Biome Tundra - White
|
||||
[TUNDRA] 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
||||
Biome Hell - Pink
|
||||
[HELL] 190 115 135 255 151 92 108 255 95 57 67 255 75 46 53 255
|
||||
Biome Sky - Blue
|
||||
[SKY] 34 44 134 255 27 35 107 255 17 22 67 255 13 18 53 255
|
||||
[RAINFALL-0.0] 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
|
||||
[RAINFALL-1.0] 38 92 255 255 30 73 204 255 19 46 127 255 15 36 102 255
|
||||
[TEMPERATURE-0.0] 38 92 255 255 30 73 204 255 19 46 127 255 15 36 102 255
|
||||
[TEMPERATURE-0.5] 91 121 185 255 73 96 147 255 46 61 92 255 36 48 73 255
|
||||
[TEMPERATURE-0.8] 51 165 42 255 41 131 33 255 26 82 21 255 20 65 17 255
|
||||
[TEMPERATURE-0.9] 170 158 24 255 135 126 19 255 85 79 12 255 67 62 10 255
|
||||
[TEMPERATURE-0.95] 204 111 48 255 162 89 38 255 102 56 24 255 81 44 19 255
|
||||
[TEMPERATURE-1.0] 143 39 36 255 114 31 28 255 71 20 18 255 57 16 14 255
|
||||
|
||||
@@ -54,18 +54,12 @@ Powered Rail
|
||||
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||
Detector Rail
|
||||
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||
Sticky Piston
|
||||
29 157 128 79 255 96 96 96 255 78 64 39 255 48 48 48 255
|
||||
Cobweb
|
||||
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||
Tall Grass
|
||||
31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255
|
||||
Dead Shrubs
|
||||
32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
||||
Piston
|
||||
33 157 128 79 255 96 96 96 255 78 64 39 255 48 48 48 255
|
||||
Piston Head
|
||||
34 157 128 79 255 96 96 96 255 78 64 39 255 48 48 48 255
|
||||
Wool
|
||||
35 247 255 239 255 244 251 236 255 204 210 197 255 244 251 236 255
|
||||
35:0 247 255 239 255 244 251 236 255 204 210 197 255 244 251 236 255
|
||||
@@ -233,37 +227,3 @@ Locked Chest
|
||||
95 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255
|
||||
Trap Door
|
||||
96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255
|
||||
Biome Rainforest - Dark Green
|
||||
[RAINFOREST] 49 67 21 255 39 53 17 255 24 34 10 255 19 27 8 255
|
||||
Biome Swampland - Brown
|
||||
[SWAMPLAND] 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
||||
Biome Seasonal Forest - Light Green
|
||||
[SEASONAL_FOREST] 51 165 42 255 41 131 33 255 26 82 21 255 20 65 17 255
|
||||
Biome Forest - Light Gray
|
||||
[FOREST] 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||
Biome Savanna - Dark Gray
|
||||
[SAVANNA] 58 58 58 255 47 47 47 255 29 29 29 255 23 23 23 255
|
||||
Biome Shrubland - Yellow
|
||||
[SHRUBLAND] 170 158 24 255 135 126 19 255 85 79 12 255 67 62 10 255
|
||||
Biome Taiga - Cyan
|
||||
[TAIGA] 34 102 131 255 27 81 104 255 17 51 65 255 13 40 52 255
|
||||
Biome Desert - Orange
|
||||
[DESERT] 204 111 48 255 162 89 38 255 102 56 24 255 81 44 19 255
|
||||
Biome Plains - Magenta
|
||||
[PLAINS] 166 66 175 255 133 53 140 255 83 33 87 255 66 26 69 255
|
||||
Biome Ice Desert - Dark Blue
|
||||
[ICE_DESERT] 26 33 103 255 20 26 80 255 13 17 50 255 9 14 40 255
|
||||
Biome Tundra - White
|
||||
[TUNDRA] 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
||||
Biome Hell - Pink
|
||||
[HELL] 190 115 135 255 151 92 108 255 95 57 67 255 75 46 53 255
|
||||
Biome Sky - Blue
|
||||
[SKY] 34 44 134 255 27 35 107 255 17 22 67 255 13 18 53 255
|
||||
[RAINFALL-0.0] 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
|
||||
[RAINFALL-1.0] 38 92 255 255 30 73 204 255 19 46 127 255 15 36 102 255
|
||||
[TEMPERATURE-0.0] 38 92 255 255 30 73 204 255 19 46 127 255 15 36 102 255
|
||||
[TEMPERATURE-0.5] 91 121 185 255 73 96 147 255 46 61 92 255 36 48 73 255
|
||||
[TEMPERATURE-0.8] 51 165 42 255 41 131 33 255 26 82 21 255 20 65 17 255
|
||||
[TEMPERATURE-0.9] 170 158 24 255 135 126 19 255 85 79 12 255 67 62 10 255
|
||||
[TEMPERATURE-0.95] 204 111 48 255 162 89 38 255 102 56 24 255 81 44 19 255
|
||||
[TEMPERATURE-1.0] 143 39 36 255 114 31 28 255 71 20 18 255 57 16 14 255
|
||||
|
||||
@@ -54,18 +54,12 @@ Powered Rail
|
||||
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||
Detector Rail
|
||||
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||
Sticky Piston
|
||||
29 157 128 79 255 125 122 116 255 78 64 39 255 88 85 81 255
|
||||
Cobweb
|
||||
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||
Tall Grass
|
||||
31 111 185 79 255 86 158 53 255 65 131 40 255 57 105 21 255
|
||||
Dead Shrubs
|
||||
32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
||||
Piston
|
||||
33 157 128 79 255 125 122 116 255 78 64 39 255 88 85 81 255
|
||||
Piston Head
|
||||
34 157 128 79 255 125 122 116 255 78 64 39 255 88 85 81 255
|
||||
Wool
|
||||
35 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
||||
35:0 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
||||
@@ -233,37 +227,4 @@ Locked Chest
|
||||
95 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255
|
||||
Trap Door
|
||||
96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255
|
||||
Biome Rainforest - Dark Green
|
||||
[RAINFOREST] 49 67 21 255 39 53 17 255 24 34 10 255 19 27 8 255
|
||||
Biome Swampland - Brown
|
||||
[SWAMPLAND] 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
||||
Biome Seasonal Forest - Light Green
|
||||
[SEASONAL_FOREST] 51 165 42 255 41 131 33 255 26 82 21 255 20 65 17 255
|
||||
Biome Forest - Light Gray
|
||||
[FOREST] 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||
Biome Savanna - Dark Gray
|
||||
[SAVANNA] 58 58 58 255 47 47 47 255 29 29 29 255 23 23 23 255
|
||||
Biome Shrubland - Yellow
|
||||
[SHRUBLAND] 170 158 24 255 135 126 19 255 85 79 12 255 67 62 10 255
|
||||
Biome Taiga - Cyan
|
||||
[TAIGA] 34 102 131 255 27 81 104 255 17 51 65 255 13 40 52 255
|
||||
Biome Desert - Orange
|
||||
[DESERT] 204 111 48 255 162 89 38 255 102 56 24 255 81 44 19 255
|
||||
Biome Plains - Magenta
|
||||
[PLAINS] 166 66 175 255 133 53 140 255 83 33 87 255 66 26 69 255
|
||||
Biome Ice Desert - Dark Blue
|
||||
[ICE_DESERT] 26 33 103 255 20 26 80 255 13 17 50 255 9 14 40 255
|
||||
Biome Tundra - White
|
||||
[TUNDRA] 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
||||
Biome Hell - Pink
|
||||
[HELL] 190 115 135 255 151 92 108 255 95 57 67 255 75 46 53 255
|
||||
Biome Sky - Blue
|
||||
[SKY] 34 44 134 255 27 35 107 255 17 22 67 255 13 18 53 255
|
||||
[RAINFALL-0.0] 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
|
||||
[RAINFALL-1.0] 38 92 255 255 30 73 204 255 19 46 127 255 15 36 102 255
|
||||
[TEMPERATURE-0.0] 38 92 255 255 30 73 204 255 19 46 127 255 15 36 102 255
|
||||
[TEMPERATURE-0.5] 91 121 185 255 73 96 147 255 46 61 92 255 36 48 73 255
|
||||
[TEMPERATURE-0.8] 51 165 42 255 41 131 33 255 26 82 21 255 20 65 17 255
|
||||
[TEMPERATURE-0.9] 170 158 24 255 135 126 19 255 85 79 12 255 67 62 10 255
|
||||
[TEMPERATURE-0.95] 204 111 48 255 162 89 38 255 102 56 24 255 81 44 19 255
|
||||
[TEMPERATURE-1.0] 143 39 36 255 114 31 28 255 71 20 18 255 57 16 14 255
|
||||
|
||||
|
||||
+1
-38
@@ -25,12 +25,9 @@
|
||||
26 200 20 20 255 160 16 16 255 100 10 10 255 80 8 8 255
|
||||
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||
29 109 80 60 255 111 108 98 255 76 56 41 255 111 108 98 255
|
||||
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||
31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255
|
||||
32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
||||
33 109 80 60 255 111 108 98 255 76 56 41 255 111 108 98 255
|
||||
34 109 80 60 255 111 108 98 255 76 56 41 255 111 108 98 255
|
||||
35 247 255 239 255 244 251 236 255 204 210 197 255 244 251 236 255
|
||||
35:0 247 255 239 255 244 251 236 255 204 210 197 255 244 251 236 255
|
||||
35:1 227 128 52 255 224 126 51 255 187 105 42 255 224 126 51 255
|
||||
@@ -115,38 +112,4 @@
|
||||
93 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0
|
||||
94 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0
|
||||
95 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255
|
||||
96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255
|
||||
Biome Rainforest - Dark Green
|
||||
[RAINFOREST] 49 67 21 255 39 53 17 255 24 34 10 255 19 27 8 255
|
||||
Biome Swampland - Brown
|
||||
[SWAMPLAND] 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
||||
Biome Seasonal Forest - Light Green
|
||||
[SEASONAL_FOREST] 51 165 42 255 41 131 33 255 26 82 21 255 20 65 17 255
|
||||
Biome Forest - Light Gray
|
||||
[FOREST] 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||
Biome Savanna - Dark Gray
|
||||
[SAVANNA] 58 58 58 255 47 47 47 255 29 29 29 255 23 23 23 255
|
||||
Biome Shrubland - Yellow
|
||||
[SHRUBLAND] 170 158 24 255 135 126 19 255 85 79 12 255 67 62 10 255
|
||||
Biome Taiga - Cyan
|
||||
[TAIGA] 34 102 131 255 27 81 104 255 17 51 65 255 13 40 52 255
|
||||
Biome Desert - Orange
|
||||
[DESERT] 204 111 48 255 162 89 38 255 102 56 24 255 81 44 19 255
|
||||
Biome Plains - Magenta
|
||||
[PLAINS] 166 66 175 255 133 53 140 255 83 33 87 255 66 26 69 255
|
||||
Biome Ice Desert - Dark Blue
|
||||
[ICE_DESERT] 26 33 103 255 20 26 80 255 13 17 50 255 9 14 40 255
|
||||
Biome Tundra - White
|
||||
[TUNDRA] 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255
|
||||
Biome Hell - Pink
|
||||
[HELL] 190 115 135 255 151 92 108 255 95 57 67 255 75 46 53 255
|
||||
Biome Sky - Blue
|
||||
[SKY] 34 44 134 255 27 35 107 255 17 22 67 255 13 18 53 255
|
||||
[RAINFALL-0.0] 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
|
||||
[RAINFALL-1.0] 38 92 255 255 30 73 204 255 19 46 127 255 15 36 102 255
|
||||
[TEMPERATURE-0.0] 38 92 255 255 30 73 204 255 19 46 127 255 15 36 102 255
|
||||
[TEMPERATURE-0.5] 91 121 185 255 73 96 147 255 46 61 92 255 36 48 73 255
|
||||
[TEMPERATURE-0.8] 51 165 42 255 41 131 33 255 26 82 21 255 20 65 17 255
|
||||
[TEMPERATURE-0.9] 170 158 24 255 135 126 19 255 85 79 12 255 67 62 10 255
|
||||
[TEMPERATURE-0.95] 204 111 48 255 162 89 38 255 102 56 24 255 81 44 19 255
|
||||
[TEMPERATURE-1.0] 143 39 36 255 114 31 28 255 71 20 18 255 57 16 14 255
|
||||
96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255
|
||||
@@ -0,0 +1,354 @@
|
||||
# All paths in this configuration file are relative to Dynmap's data-folder: minecraft_server/plugins/dynmap/
|
||||
|
||||
components:
|
||||
- class: org.dynmap.ClientConfigurationComponent
|
||||
|
||||
- class: org.dynmap.InternalClientUpdateComponent
|
||||
sendhealth: true
|
||||
sendposition: true
|
||||
allowwebchat: true
|
||||
webchat-interval: 5
|
||||
hidewebchatip: false
|
||||
#- class: org.dynmap.JsonFileClientUpdateComponent
|
||||
# writeinterval: 1
|
||||
# sendhealth: true
|
||||
# sendposition: true
|
||||
# allowwebchat: false
|
||||
# hidewebchatip: false
|
||||
|
||||
- class: org.dynmap.SimpleWebChatComponent
|
||||
allowchat: true
|
||||
#- class: org.dynmap.herochat.HeroWebChatComponent
|
||||
# # Control which HeroChat channel messages from web are directed to
|
||||
# herochatwebchannel: Global
|
||||
# # Control which channels are monitored and reported to the web
|
||||
# herochatchannels:
|
||||
# - Global
|
||||
# #- Trade
|
||||
# #- Haggle
|
||||
|
||||
- class: org.dynmap.ClientComponent
|
||||
type: chat
|
||||
- class: org.dynmap.ClientComponent
|
||||
type: chatballoon
|
||||
focuschatballoons: false
|
||||
- class: org.dynmap.ClientComponent
|
||||
type: chatbox
|
||||
showplayerfaces: true
|
||||
messagettl: 5
|
||||
- class: org.dynmap.ClientComponent
|
||||
type: playermarkers
|
||||
showplayerfaces: true
|
||||
showplayerhealth: true
|
||||
#- class: org.dynmap.ClientComponent
|
||||
# type: digitalclock
|
||||
- class: org.dynmap.ClientComponent
|
||||
type: timeofdayclock
|
||||
showdigitalclock: true
|
||||
#showweather: true
|
||||
#- class: org.dynmap.regions.RegionsComponent
|
||||
# type: regions
|
||||
# name: WorldGuard
|
||||
# useworldpath: true
|
||||
# filename: regions.yml
|
||||
# basenode: regions
|
||||
# use3dregions: true
|
||||
# infowindow: '<div class="infowindow"><span style="font-size:120%;">%regionname% - %priority% (%parent%)</span><br /> Owners <span style="font-weight:bold;">%playerowners% %groupowners%</span><br />Members <span style="font-weight:bold;">%playermembers% %groupmembers%</span><br />Flags<br /><span style="font-weight:bold;">%flags%</span></div>'
|
||||
# regionstyle:
|
||||
# strokeColor: "#FF0000"
|
||||
# strokeOpacity: 0.8
|
||||
# strokeWeight: 3
|
||||
# fillColor: "#FF0000"
|
||||
# fillOpacity: 0.35
|
||||
#- class: org.dynmap.TestComponent
|
||||
# stuff: "This is some configuration-value"
|
||||
|
||||
# Treat hiddenplayers.txt as a whitelist for players to be shown on the map? (Default false)
|
||||
display-whitelist: false
|
||||
|
||||
# How often a tile gets rendered (in seconds).
|
||||
renderinterval: 1
|
||||
|
||||
# Tile hashing is used to minimize tile file updates when no changes have occurred - set to false to disable
|
||||
enabletilehash: true
|
||||
|
||||
render-triggers:
|
||||
# - chunkloaded
|
||||
# - playermove
|
||||
# - playerjoin
|
||||
- blockplaced
|
||||
- blockbreak
|
||||
|
||||
# The path where the tile-files are placed.
|
||||
tilespath: web/tiles
|
||||
|
||||
# The path where the web-files are located.
|
||||
webpath: web
|
||||
|
||||
# The network-interface the webserver will bind to (0.0.0.0 for all interfaces, 127.0.0.1 for only local access).
|
||||
webserver-bindaddress: 0.0.0.0
|
||||
|
||||
# The TCP-port the webserver will listen on.
|
||||
webserver-port: 8123
|
||||
|
||||
# Disables Webserver portion of Dynmap (Advanced users only)
|
||||
disable-webserver: false
|
||||
|
||||
# Period between tile renders for fullrender, in seconds (non-zero to pace fullrenders, lessen CPU load)
|
||||
timesliceinterval: 0.0
|
||||
|
||||
# Interval the browser should poll for updates.
|
||||
updaterate: 2000
|
||||
|
||||
showplayerfacesinmenu: true
|
||||
|
||||
# Set sidebaropened: true to pin menu sidebar opened
|
||||
#sidebaropened: true
|
||||
|
||||
joinmessage: "%playername% joined"
|
||||
quitmessage: "%playername% quit"
|
||||
spammessage: "You may only chat once every %interval% seconds."
|
||||
webprefix: "§2[WEB] "
|
||||
websuffix: "§f"
|
||||
|
||||
defaultzoom: 0
|
||||
defaultworld: world
|
||||
|
||||
# template world - this is used for worlds that exist but aren't defined in the worlds section.
|
||||
# Also, it supplies the "maps" section for worlds lacking a maps section, and the "center"
|
||||
# for worlds lacking a "center" section.
|
||||
templates:
|
||||
# Template for normal world
|
||||
normal:
|
||||
enabled: true
|
||||
center:
|
||||
x: 0
|
||||
y: 64
|
||||
z: 0
|
||||
maps:
|
||||
- class: org.dynmap.flat.FlatMap
|
||||
name: flat
|
||||
title: "Flat"
|
||||
prefix: flat
|
||||
colorscheme: default
|
||||
# To render a world as a "night view", set shadowstrength and ambientlight
|
||||
# shadowstrength: 1.0
|
||||
# ambientlight: 4
|
||||
# To render both night and day versions of tiles (when ambientlight is set), set true
|
||||
# night-and-day: true
|
||||
# Option to turn on transparency support (off by default) - slows render
|
||||
# transparency: true
|
||||
# Background color for map during the day
|
||||
# backgroundday: "#153E7E"
|
||||
# Background color for map during the night
|
||||
# backgroundnight: "#000000"
|
||||
# Backgrounc color for map (independent of night/day)
|
||||
# background: "#000000"
|
||||
- class: org.dynmap.kzedmap.KzedMap
|
||||
renderers:
|
||||
- class: org.dynmap.kzedmap.DefaultTileRenderer
|
||||
name: surface
|
||||
title: "Surface"
|
||||
prefix: t
|
||||
maximumheight: 127
|
||||
colorscheme: default
|
||||
# Add shadows to world (based on top-down shadows from chunk data)
|
||||
# shadowstrength: 1.0
|
||||
# To render a world as a "night view", set shadowstrength and ambientlight
|
||||
# ambientlight: 4
|
||||
# To render both night and day versions of tiles (when ambientlight is set), set true
|
||||
# night-and-day: true
|
||||
# Option to turn off transparency support (on by default) - speeds render
|
||||
# transparency: false
|
||||
# Background color for map during the day
|
||||
# backgroundday: "#153E7E"
|
||||
# Background color for map during the night
|
||||
# backgroundnight: "#000000"
|
||||
# Backgrounc color for map (independent of night/day)
|
||||
# background: "#000000"
|
||||
# Sets the icon to 'images/block_custom.png'
|
||||
# icon: custom
|
||||
#- class: org.dynmap.kzedmap.HighlightTileRenderer
|
||||
# prefix: ht
|
||||
# maximumheight: 127
|
||||
# colorscheme: default
|
||||
# highlight: # For highlighting multiple block-types.
|
||||
# - 56 # Highlight diamond-ore
|
||||
# - 66 # Highlight minecart track
|
||||
# highlight: 56 # For highlighting a single block-type.
|
||||
- class: org.dynmap.kzedmap.CaveTileRenderer
|
||||
name: cave
|
||||
title: "Cave"
|
||||
prefix: ct
|
||||
maximumheight: 127
|
||||
# Nether world template
|
||||
nether:
|
||||
enabled: true
|
||||
center:
|
||||
x: 0
|
||||
y: 64
|
||||
z: 0
|
||||
maps:
|
||||
- class: org.dynmap.flat.FlatMap
|
||||
name: flat
|
||||
title: "Flat"
|
||||
prefix: flat
|
||||
colorscheme: default
|
||||
# Map background color (day or night)
|
||||
background: "#300806"
|
||||
- class: org.dynmap.kzedmap.KzedMap
|
||||
renderers:
|
||||
- class: org.dynmap.kzedmap.DefaultTileRenderer
|
||||
name: nether
|
||||
title: "Surface"
|
||||
prefix: nt
|
||||
maximumheight: 127
|
||||
colorscheme: default
|
||||
# Map background color (day or night)
|
||||
background: "#300806"
|
||||
# Skylands world template
|
||||
skylands:
|
||||
enabled: true
|
||||
center:
|
||||
x: 0
|
||||
y: 64
|
||||
z: 0
|
||||
maps:
|
||||
- class: org.dynmap.flat.FlatMap
|
||||
name: flat
|
||||
title: "Flat"
|
||||
prefix: flat
|
||||
colorscheme: default
|
||||
# Background color for map during the day
|
||||
backgroundday: "#153E7E"
|
||||
# Background color for map during the night
|
||||
backgroundnight: "#000000"
|
||||
- class: org.dynmap.kzedmap.KzedMap
|
||||
renderers:
|
||||
- class: org.dynmap.kzedmap.DefaultTileRenderer
|
||||
name: skylands
|
||||
title: "Surface"
|
||||
prefix: st
|
||||
maximumheight: 127
|
||||
colorscheme: default
|
||||
# Background color for map during the day
|
||||
backgroundday: "#153E7E"
|
||||
# Background color for map during the night
|
||||
backgroundnight: "#000000"
|
||||
night-and-day: true
|
||||
shadowstrength: 1.0
|
||||
ambientlight: 4
|
||||
|
||||
# The maptypes Dynmap will use to render.
|
||||
worlds:
|
||||
# Worlds can be handled by templates, based on world type
|
||||
# You can override the properties of the template by specifying them in this section
|
||||
# for example 'Title: "My Awesome World"'
|
||||
#- name: world
|
||||
# title: "World"
|
||||
# Use 'enabled: false' to disable a certain world.
|
||||
# enabled: false
|
||||
# Use sendposition: false to prevent player positions from showing when on this world (if sendposition is globally enabled)
|
||||
# sendposition: false
|
||||
# Use sendhealth: false ot prevent player health from showing when on this world (if sendhealth is globally enabled)
|
||||
# sendhealth: false
|
||||
# # If world isn't contiguous chunks (due to teleporting, for example), fullrender needs to be given other locations to scan for tiles on each patch of chunks
|
||||
# fullrenderlocations:
|
||||
# - x: 10000
|
||||
# y: 64
|
||||
# z: 20000
|
||||
# - x: -15000
|
||||
# y: 64
|
||||
# z: -5000
|
||||
# Use 'template: mycustomtemplate' to use the properties specified in the template 'mycustomtemplate' to this world. Default it is set to the environment-name (normal or nether).
|
||||
# template: mycustomtemplate
|
||||
# Rest of comes from template - uncomment to tailor for world specifically
|
||||
# center:
|
||||
# x: 0
|
||||
# y: 64
|
||||
# z: 0
|
||||
# maps:
|
||||
# - class: org.dynmap.flat.FlatMap
|
||||
# name: flat
|
||||
# title: "Flat"
|
||||
# prefix: flat
|
||||
# colorscheme: default
|
||||
# # To render a world as a "night view", set shadowstrength and ambientlight
|
||||
# # shadowstrength: 1.0
|
||||
# # ambientlight: 4
|
||||
# # To render both night and day versions of tiles (when ambientlight is set), set true
|
||||
# # night-and-day: true
|
||||
# # Option to turn on transparency support (off by default) - slows render
|
||||
# # transparency: true
|
||||
# # Background color for map during the day
|
||||
# # backgroundday: "#153E7E"
|
||||
# # Background color for map during the night
|
||||
# # backgroundnight: "#000000"
|
||||
# # Backgrounc color for map (independent of night/day)
|
||||
# # background: "#000000"
|
||||
# - class: org.dynmap.kzedmap.KzedMap
|
||||
# renderers:
|
||||
# - class: org.dynmap.kzedmap.DefaultTileRenderer
|
||||
# name: surface
|
||||
# title: "Surface"
|
||||
# prefix: t
|
||||
# maximumheight: 127
|
||||
# colorscheme: default
|
||||
# # Add shadows to world (based on top-down shadows from chunk data)
|
||||
# # shadowstrength: 1.0
|
||||
# # To render a world as a "night view", set shadowstrength and ambientlight
|
||||
# # ambientlight: 4
|
||||
# # To render both night and day versions of tiles (when ambientlight is set), set true
|
||||
# # night-and-day: true
|
||||
# # Option to turn off transparency support (on by default) - speeds render
|
||||
# # transparency: false
|
||||
# # Background color for map during the day
|
||||
# # backgroundday: "#153E7E"
|
||||
# # Background color for map during the night
|
||||
# # backgroundnight: "#000000"
|
||||
# # Backgrounc color for map (independent of night/day)
|
||||
# # background: "#000000"
|
||||
# # Sets the icon to 'images/block_custom.png'
|
||||
# # icon: custom
|
||||
# #- class: org.dynmap.kzedmap.HighlightTileRenderer
|
||||
# # prefix: ht
|
||||
# # maximumheight: 127
|
||||
# # colorscheme: default
|
||||
# # highlight: # For highlighting multiple block-types.
|
||||
# # - 56 # Highlight diamond-ore
|
||||
# # - 66 # Highlight minecart track
|
||||
# # highlight: 56 # For highlighting a single block-type.
|
||||
# - class: org.dynmap.kzedmap.CaveTileRenderer
|
||||
# name: cave
|
||||
# title: "Cave"
|
||||
# prefix: ct
|
||||
# maximumheight: 127
|
||||
#
|
||||
# To just label world, and inherit rest from template, just provide name and title
|
||||
#- name: world2
|
||||
# title: "Second World"
|
||||
#
|
||||
#- name: nether
|
||||
# title: "Nether"
|
||||
# center:
|
||||
# x: 0
|
||||
# y: 64
|
||||
# z: 0
|
||||
# maps:
|
||||
# - class: org.dynmap.flat.FlatMap
|
||||
# name: flat
|
||||
# title: "Flat"
|
||||
# prefix: flat
|
||||
# colorscheme: default
|
||||
# - class: org.dynmap.kzedmap.KzedMap
|
||||
# renderers:
|
||||
# - class: org.dynmap.kzedmap.DefaultTileRenderer
|
||||
# name: nether
|
||||
# title: "Surface"
|
||||
# prefix: nt
|
||||
# maximumheight: 127
|
||||
# colorscheme: default
|
||||
|
||||
# Enables debugging.
|
||||
#debuggers:
|
||||
# - class: org.dynmap.debug.LogDebugger
|
||||
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.dynmap</groupId>
|
||||
<artifactId>dynmap</artifactId>
|
||||
<version>0.21</version>
|
||||
<version>0.18.1</version>
|
||||
<name>dynmap</name>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@@ -29,12 +29,6 @@
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/package.xml</descriptor>
|
||||
</descriptors>
|
||||
<!-- Hack for bug in maven-assembly: http://jira.codehaus.org/browse/MASSEMBLY-449 -->
|
||||
<archiverConfig>
|
||||
<fileMode>420</fileMode> <!-- 420(dec) = 644(oct) -->
|
||||
<directoryMode>493</directoryMode> <!-- 493(dec) = 755(oct) -->
|
||||
<defaultDirectoryMode>493</defaultDirectoryMode>
|
||||
</archiverConfig>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -24,11 +24,10 @@
|
||||
<outputDirectory>/dynmap/colorschemes</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/texturepacks</directory>
|
||||
<outputDirectory>/dynmap/texturepacks</outputDirectory></fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/renderdata</directory>
|
||||
<outputDirectory>/dynmap/renderdata</outputDirectory></fileSet>
|
||||
<directory>${project.basedir}</directory>
|
||||
<outputDirectory>/dynmap/</outputDirectory>
|
||||
<includes>
|
||||
<include>configuration.txt</include></includes></fileSet>
|
||||
</fileSets>
|
||||
<files>
|
||||
<file>
|
||||
|
||||
@@ -2,8 +2,6 @@ package org.dynmap;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.Material;
|
||||
|
||||
public class Armor {
|
||||
/**
|
||||
@@ -11,34 +9,22 @@ public class Armor {
|
||||
* We rely on getArmorContents() to return 4 armor pieces in the order
|
||||
* of: boots, pants, chest, helmet
|
||||
*/
|
||||
private static final int armorPoints[] = {3, 6, 8, 3};
|
||||
private static final double armorPoints[] = {1.5, 3.0, 4.0, 1.5};
|
||||
|
||||
public static final int getArmorPoints(Player player) {
|
||||
int currentDurability = 0;
|
||||
int baseDurability = 0;
|
||||
int baseArmorPoints = 0;
|
||||
ItemStack[] itm = new ItemStack[4];
|
||||
PlayerInventory inv = player.getInventory();
|
||||
itm[0] = inv.getBoots();
|
||||
itm[1]= inv.getLeggings();
|
||||
itm[2] = inv.getChestplate();
|
||||
itm[3] = inv.getHelmet();
|
||||
for(int i = 0; i < 4; i++) {
|
||||
if(itm[i] == null) continue;
|
||||
int dur = itm[i].getDurability();
|
||||
int max = itm[i].getType().getMaxDurability();
|
||||
if(max <= 0) continue;
|
||||
if(i == 2)
|
||||
max = max + 1; /* Always 1 too low for chestplate */
|
||||
else
|
||||
max = max - 3; /* Always 3 too high, versus how client calculates it */
|
||||
baseDurability += max;
|
||||
currentDurability += max - dur;
|
||||
baseArmorPoints += armorPoints[i];
|
||||
double baseArmorPoints = 0;
|
||||
ItemStack inventory[] = player.getInventory().getArmorContents();
|
||||
for(int i=0;i<inventory.length;i++) {
|
||||
final short maxDurability = inventory[i].getType().getMaxDurability();
|
||||
if(maxDurability < 0)
|
||||
continue;
|
||||
final short durability = inventory[i].getDurability();
|
||||
baseDurability += maxDurability;
|
||||
currentDurability += maxDurability - durability;
|
||||
baseArmorPoints += armorPoints[i];
|
||||
}
|
||||
int ap = 0;
|
||||
if(baseDurability > 0)
|
||||
ap = ((baseArmorPoints - 1) * currentDurability) / baseDurability + 1;
|
||||
return ap;
|
||||
return (int)(2*baseArmorPoints*currentDurability/baseDurability);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,14 +12,10 @@ public class AsynchronousQueue<T> {
|
||||
private Set<T> set = new HashSet<T>();
|
||||
private Handler<T> handler;
|
||||
private int dequeueTime;
|
||||
private int accelDequeueTime;
|
||||
private int accelDequeueThresh;
|
||||
|
||||
public AsynchronousQueue(Handler<T> handler, int dequeueTime, int accelDequeueThresh, int accelDequeueTime) {
|
||||
|
||||
public AsynchronousQueue(Handler<T> handler, int dequeueTime) {
|
||||
this.handler = handler;
|
||||
this.dequeueTime = dequeueTime;
|
||||
this.accelDequeueTime = accelDequeueTime;
|
||||
this.accelDequeueThresh = accelDequeueThresh;
|
||||
}
|
||||
|
||||
public boolean push(T t) {
|
||||
@@ -34,10 +30,15 @@ public class AsynchronousQueue<T> {
|
||||
|
||||
private T pop() {
|
||||
synchronized (lock) {
|
||||
T t = queue.pollFirst();
|
||||
if(t != null)
|
||||
set.remove(t);
|
||||
return t;
|
||||
try {
|
||||
T t = queue.removeFirst();
|
||||
if (!set.remove(t)) {
|
||||
// This should never happen.
|
||||
}
|
||||
return t;
|
||||
} catch (NoSuchElementException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,10 +88,7 @@ public class AsynchronousQueue<T> {
|
||||
if (t != null) {
|
||||
handler.handle(t);
|
||||
}
|
||||
if(set.size() >= accelDequeueThresh)
|
||||
sleep(accelDequeueTime);
|
||||
else
|
||||
sleep(dequeueTime);
|
||||
sleep(dequeueTime);
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package org.dynmap;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Cache<K, V> {
|
||||
private final int size;
|
||||
private int len;
|
||||
|
||||
private CacheNode head;
|
||||
private CacheNode tail;
|
||||
|
||||
private class CacheNode {
|
||||
public CacheNode prev;
|
||||
public CacheNode next;
|
||||
public K key;
|
||||
public V value;
|
||||
|
||||
public CacheNode(K key, V value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
prev = null;
|
||||
next = null;
|
||||
}
|
||||
|
||||
public void unlink() {
|
||||
if (prev == null) {
|
||||
head = next;
|
||||
} else {
|
||||
prev.next = next;
|
||||
}
|
||||
|
||||
if (next == null) {
|
||||
tail = prev;
|
||||
} else {
|
||||
next.prev = prev;
|
||||
}
|
||||
|
||||
prev = null;
|
||||
next = null;
|
||||
|
||||
len--;
|
||||
}
|
||||
|
||||
public void append() {
|
||||
if (tail == null) {
|
||||
head = this;
|
||||
tail = this;
|
||||
} else {
|
||||
tail.next = this;
|
||||
prev = tail;
|
||||
tail = this;
|
||||
}
|
||||
|
||||
len++;
|
||||
}
|
||||
}
|
||||
|
||||
private HashMap<K, CacheNode> map;
|
||||
|
||||
public Cache(int size) {
|
||||
this.size = size;
|
||||
len = 0;
|
||||
|
||||
head = null;
|
||||
tail = null;
|
||||
|
||||
map = new HashMap<K, CacheNode>();
|
||||
}
|
||||
|
||||
/*
|
||||
* returns value for key, if key exists in the cache otherwise null
|
||||
*/
|
||||
public V get(K key) {
|
||||
CacheNode n = map.get(key);
|
||||
if (n == null)
|
||||
return null;
|
||||
return n.value;
|
||||
}
|
||||
|
||||
/*
|
||||
* puts a new key-value pair in the cache if the key existed already, the
|
||||
* value is updated, and the old value is returned if the key didn't exist,
|
||||
* it is added; the oldest value (now pushed out of the cache) may be
|
||||
* returned, or null if the cache isn't yet full
|
||||
*/
|
||||
public V put(K key, V value) {
|
||||
CacheNode n = map.get(key);
|
||||
if (n == null) {
|
||||
V ret = null;
|
||||
|
||||
if (len >= size) {
|
||||
CacheNode first = head;
|
||||
first.unlink();
|
||||
map.remove(first.key);
|
||||
ret = first.value;
|
||||
}
|
||||
|
||||
CacheNode add = new CacheNode(key, value);
|
||||
add.append();
|
||||
map.put(key, add);
|
||||
|
||||
return ret;
|
||||
} else {
|
||||
n.unlink();
|
||||
V old = n.value;
|
||||
n.value = value;
|
||||
n.append();
|
||||
return old;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package org.dynmap.utils;
|
||||
package org.dynmap;
|
||||
|
||||
/**
|
||||
* Represents a static, thread-safe snapshot of chunk of blocks
|
||||
* Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering)
|
||||
*/
|
||||
public interface LegacyChunkSnapshot {
|
||||
public interface ChunkSnapshot {
|
||||
/**
|
||||
* Get block type for block at corresponding coordinate in the chunk
|
||||
*
|
||||
@@ -39,7 +39,6 @@ public class ClientComponent extends Component {
|
||||
return o;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected static final JSONArray convertList(List<?> l) {
|
||||
JSONArray o = new JSONArray();
|
||||
for(Object entry : l) {
|
||||
@@ -48,7 +47,6 @@ public class ClientComponent extends Component {
|
||||
return o;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected static final Object convert(Object o) {
|
||||
if (o instanceof Map<?, ?>) {
|
||||
return convertMap((Map<String, ?>)o);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.dynmap;
|
||||
|
||||
import static org.dynmap.JSONUtils.a;
|
||||
import static org.dynmap.JSONUtils.l;
|
||||
import static org.dynmap.JSONUtils.s;
|
||||
|
||||
import org.dynmap.Event.Listener;
|
||||
@@ -18,12 +19,11 @@ public class ClientConfigurationComponent extends Component {
|
||||
s(t, "joinmessage", c.getString("joinmessage", "%playername% joined"));
|
||||
s(t, "quitmessage", c.getString("quitmessage", "%playername% quit"));
|
||||
s(t, "spammessage", c.getString("spammessage", "You may only chat once every %interval% seconds."));
|
||||
s(t, "webprefix", unescapeString(c.getString("webprefix", "[WEB] ")));
|
||||
s(t, "webprefix", c.getString("webprefix", "[WEB] "));
|
||||
s(t, "defaultzoom", c.getInteger("defaultzoom", 0));
|
||||
s(t, "sidebaropened", c.getBoolean("sidebaropened", false));
|
||||
|
||||
DynmapWorld defaultWorld = null;
|
||||
String defmap = null;
|
||||
for(DynmapWorld world : plugin.mapManager.getWorlds()) {
|
||||
if (defaultWorld == null) defaultWorld = world;
|
||||
ConfigurationNode wn = world.configuration;
|
||||
@@ -33,17 +33,13 @@ public class ClientConfigurationComponent extends Component {
|
||||
s(wo, "center/x", wn.getFloat("center/x", 0.0f));
|
||||
s(wo, "center/y", wn.getFloat("center/y", 64.0f));
|
||||
s(wo, "center/z", wn.getFloat("center/z", 0.0f));
|
||||
s(wo, "bigworld", world.bigworld);
|
||||
s(wo, "extrazoomout", world.getExtraZoomOutLevels());
|
||||
a(t, "worlds", wo);
|
||||
|
||||
for(MapType mt : world.maps) {
|
||||
mt.buildClientConfiguration(wo, world);
|
||||
if(defmap == null) defmap = mt.getName();
|
||||
mt.buildClientConfiguration(wo);
|
||||
}
|
||||
}
|
||||
s(t, "defaultworld", c.getString("defaultworld", defaultWorld == null ? "world" : defaultWorld.world.getName()));
|
||||
s(t, "defaultmap", c.getString("defaultmap", defmap == null ? "surface" : defmap));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,9 +42,7 @@ public class ClientUpdateComponent extends Component {
|
||||
s(jp, "account", p.getName());
|
||||
/* Don't leak player location for world not visible on maps, or if sendposition disbaled */
|
||||
DynmapWorld pworld = MapManager.mapman.worldsLookup.get(p.getWorld().getName());
|
||||
/* Fix typo on 'sendpositon' to 'sendposition', keep bad one in case someone used it */
|
||||
if(configuration.getBoolean("sendposition", true) && configuration.getBoolean("sendpositon", true) &&
|
||||
(pworld != null) && pworld.sendposition) {
|
||||
if(configuration.getBoolean("sendpositon", true) && (pworld != null) && pworld.sendposition) {
|
||||
s(jp, "world", p.getWorld().getName());
|
||||
s(jp, "x", pl.getX());
|
||||
s(jp, "y", pl.getY());
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Color {
|
||||
return ((val >> 24) & 0xFF);
|
||||
}
|
||||
public final boolean isTransparent() {
|
||||
return ((val & 0xFF000000) == TRANSPARENT);
|
||||
return (val == TRANSPARENT);
|
||||
}
|
||||
public final void setTransparent() {
|
||||
val = TRANSPARENT;
|
||||
@@ -52,23 +52,4 @@ public class Color {
|
||||
public final int getComponent(int idx) {
|
||||
return 0xFF & (val >> ((3-idx)*8));
|
||||
}
|
||||
public final void setAlpha(int v) {
|
||||
val = (val & 0x00FFFFFF) | (v << 24);
|
||||
}
|
||||
/**
|
||||
* Scale each color component, based on the corresponding component
|
||||
*/
|
||||
public final void blendColor(Color c) {
|
||||
blendColor(c.val);
|
||||
}
|
||||
/**
|
||||
* Scale each color component, based on the corresponding component
|
||||
*/
|
||||
public final void blendColor(int argb) {
|
||||
int nval = (((((val >> 24) & 0xFF) * ((argb >> 24) & 0xFF)) / 255) << 24);
|
||||
nval = nval | (((((val >> 16) & 0xFF) * ((argb >> 16) & 0xFF)) / 255) << 16);
|
||||
nval = nval | (((((val >> 8) & 0xFF) * ((argb >> 8) & 0xFF)) / 255) << 8);
|
||||
nval = nval | (((val & 0xFF) * (argb & 0xFF)) / 255);
|
||||
val = nval;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,26 +8,19 @@ import java.util.HashMap;
|
||||
import java.util.Scanner;
|
||||
|
||||
import org.dynmap.debug.Debug;
|
||||
import org.bukkit.block.Biome;
|
||||
|
||||
public class ColorScheme {
|
||||
private static final HashMap<String, ColorScheme> cache = new HashMap<String, ColorScheme>();
|
||||
|
||||
public String name;
|
||||
/* Switch to arrays - faster than map */
|
||||
public final Color[][] colors; /* [blk-type][step] */
|
||||
public final Color[][][] datacolors; /* [bkt-type][blk-dat][step] */
|
||||
public final Color[][] biomecolors; /* [Biome.ordinal][step] */
|
||||
public final Color[][] raincolors; /* [rain * 63][step] */
|
||||
public final Color[][] tempcolors; /* [temp * 63][step] */
|
||||
public Color[][] colors; /* [blk-type][step] */
|
||||
public Color[][][] datacolors; /* [bkt-type][blk-dat][step] */
|
||||
|
||||
public ColorScheme(String name, Color[][] colors, Color[][][] datacolors, Color[][] biomecolors, Color[][] raincolors, Color[][] tempcolors) {
|
||||
public ColorScheme(String name, Color[][] colors, Color[][][] datacolors) {
|
||||
this.name = name;
|
||||
this.colors = colors;
|
||||
this.datacolors = datacolors;
|
||||
this.biomecolors = biomecolors;
|
||||
this.raincolors = raincolors;
|
||||
this.tempcolors = tempcolors;
|
||||
}
|
||||
|
||||
private static File getColorSchemeDirectory() {
|
||||
@@ -49,10 +42,6 @@ public class ColorScheme {
|
||||
File colorSchemeFile = new File(getColorSchemeDirectory(), name + ".txt");
|
||||
Color[][] colors = new Color[256][];
|
||||
Color[][][] datacolors = new Color[256][][];
|
||||
Color[][] biomecolors = new Color[Biome.values().length][];
|
||||
Color[][] raincolors = new Color[64][];
|
||||
Color[][] tempcolors = new Color[64][];
|
||||
|
||||
InputStream stream;
|
||||
try {
|
||||
Debug.debug("Loading colors from '" + colorSchemeFile + "'...");
|
||||
@@ -65,86 +54,30 @@ public class ColorScheme {
|
||||
if (line.startsWith("#") || line.equals("")) {
|
||||
continue;
|
||||
}
|
||||
/* Make parser less pedantic - tabs or spaces should be fine */
|
||||
String[] split = line.split("[\t ]");
|
||||
int cnt = 0;
|
||||
for(String s: split) { if(s.length() > 0) cnt++; }
|
||||
String[] nsplit = new String[cnt];
|
||||
cnt = 0;
|
||||
for(String s: split) { if(s.length() > 0) { nsplit[cnt] = s; cnt++; } }
|
||||
split = nsplit;
|
||||
|
||||
String[] split = line.split("\t");
|
||||
if (split.length < 17) {
|
||||
continue;
|
||||
}
|
||||
Integer id;
|
||||
Integer dat = null;
|
||||
boolean isbiome = false;
|
||||
boolean istemp = false;
|
||||
boolean israin = false;
|
||||
int idx = split[0].indexOf(':');
|
||||
if(idx > 0) { /* ID:data - data color */
|
||||
id = new Integer(split[0].substring(0, idx));
|
||||
dat = new Integer(split[0].substring(idx+1));
|
||||
}
|
||||
else if(split[0].charAt(0) == '[') { /* Biome color data */
|
||||
String bio = split[0].substring(1);
|
||||
idx = bio.indexOf(']');
|
||||
if(idx >= 0) bio = bio.substring(0, idx);
|
||||
isbiome = true;
|
||||
id = -1;
|
||||
for(Biome b : Biome.values()) {
|
||||
if(b.toString().equalsIgnoreCase(bio)) {
|
||||
id = b.ordinal();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(id < 0) { /* Not biome - check for rain or temp */
|
||||
if(bio.startsWith("RAINFALL-")) {
|
||||
try {
|
||||
double v = Double.parseDouble(bio.substring(9));
|
||||
if((v >= 0) && (v <= 1.00)) {
|
||||
id = (int)(v * 63.0);
|
||||
israin = true;
|
||||
}
|
||||
} catch (NumberFormatException nfx) {
|
||||
}
|
||||
}
|
||||
else if(bio.startsWith("TEMPERATURE-")) {
|
||||
try {
|
||||
double v = Double.parseDouble(bio.substring(12));
|
||||
if((v >= 0) && (v <= 1.00)) {
|
||||
id = (int)(v * 63.0);
|
||||
istemp = true;
|
||||
}
|
||||
} catch (NumberFormatException nfx) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
id = new Integer(split[0]);
|
||||
}
|
||||
Color[] c = new Color[5];
|
||||
Color[] c = new Color[4];
|
||||
|
||||
/* store colors by raycast sequence number */
|
||||
c[0] = new Color(Integer.parseInt(split[1]), Integer.parseInt(split[2]), Integer.parseInt(split[3]), Integer.parseInt(split[4]));
|
||||
c[3] = new Color(Integer.parseInt(split[5]), Integer.parseInt(split[6]), Integer.parseInt(split[7]), Integer.parseInt(split[8]));
|
||||
c[1] = new Color(Integer.parseInt(split[9]), Integer.parseInt(split[10]), Integer.parseInt(split[11]), Integer.parseInt(split[12]));
|
||||
c[2] = new Color(Integer.parseInt(split[13]), Integer.parseInt(split[14]), Integer.parseInt(split[15]), Integer.parseInt(split[16]));
|
||||
/* Blended color - for 'smooth' option on flat map */
|
||||
c[4] = new Color((c[1].getRed()+c[3].getRed())/2, (c[1].getGreen()+c[3].getGreen())/2, (c[1].getBlue()+c[3].getBlue())/2, (c[1].getAlpha()+c[3].getAlpha())/2);
|
||||
|
||||
if(isbiome) {
|
||||
if(istemp) {
|
||||
tempcolors[id] = c;
|
||||
}
|
||||
else if(israin) {
|
||||
raincolors[id] = c;
|
||||
}
|
||||
else if((id >= 0) && (id < biomecolors.length))
|
||||
biomecolors[id] = c;
|
||||
}
|
||||
else if(dat != null) {
|
||||
if(dat != null) {
|
||||
Color[][] dcolor = datacolors[id]; /* Existing list? */
|
||||
if(dcolor == null) {
|
||||
dcolor = new Color[16][]; /* Make 16 index long list */
|
||||
@@ -174,68 +107,12 @@ public class ColorScheme {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* And interpolate any missing rain and temperature colors */
|
||||
interpolateColorTable(tempcolors);
|
||||
interpolateColorTable(raincolors);
|
||||
} catch (RuntimeException e) {
|
||||
Log.severe("Could not load colors '" + name + "' ('" + colorSchemeFile + "').", e);
|
||||
return null;
|
||||
} catch (FileNotFoundException e) {
|
||||
Log.severe("Could not load colors '" + name + "' ('" + colorSchemeFile + "'): File not found.", e);
|
||||
}
|
||||
return new ColorScheme(name, colors, datacolors, biomecolors, raincolors, tempcolors);
|
||||
}
|
||||
|
||||
public static void interpolateColorTable(Color[][] c) {
|
||||
int idx = -1;
|
||||
for(int k = 0; k < c.length; k++) {
|
||||
if(c[k] == null) { /* Missing? */
|
||||
if((idx >= 0) && (k == (c.length-1))) { /* We're last - so fill forward from last color */
|
||||
for(int kk = idx+1; kk <= k; kk++) {
|
||||
c[kk] = c[idx];
|
||||
}
|
||||
}
|
||||
/* Skip - will backfill when we find next color */
|
||||
}
|
||||
else if(idx == -1) { /* No previous color, just backfill this color */
|
||||
for(int kk = 0; kk < k; kk++) {
|
||||
c[kk] = c[k];
|
||||
}
|
||||
idx = k; /* This is now last defined color */
|
||||
}
|
||||
else { /* Else, interpolate between last idx and this one */
|
||||
int cnt = c[k].length;
|
||||
for(int kk = idx+1; kk < k; kk++) {
|
||||
double interp = (double)(kk-idx)/(double)(k-idx);
|
||||
Color[] cc = new Color[cnt];
|
||||
for(int jj = 0; jj < cnt; jj++) {
|
||||
cc[jj] = new Color(
|
||||
(int)((1.0-interp)*c[idx][jj].getRed() + interp*c[k][jj].getRed()),
|
||||
(int)((1.0-interp)*c[idx][jj].getGreen() + interp*c[k][jj].getGreen()),
|
||||
(int)((1.0-interp)*c[idx][jj].getBlue() + interp*c[k][jj].getBlue()),
|
||||
(int)((1.0-interp)*c[idx][jj].getAlpha() + interp*c[k][jj].getAlpha()));
|
||||
}
|
||||
c[kk] = cc;
|
||||
}
|
||||
idx = k;
|
||||
}
|
||||
}
|
||||
}
|
||||
public Color[] getRainColor(double rain) {
|
||||
int idx = (int)(rain * 63.0);
|
||||
if((idx >= 0) && (idx < raincolors.length))
|
||||
return raincolors[idx];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
public Color[] getTempColor(double temp) {
|
||||
int idx = (int)(temp * 63.0);
|
||||
if((idx >= 0) && (idx < tempcolors.length))
|
||||
return tempcolors[idx];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
public static void reset() {
|
||||
cache.clear();
|
||||
return new ColorScheme(name, colors, datacolors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,12 +10,4 @@ public abstract class Component {
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
/* Substitute proper values for escape sequences */
|
||||
public static String unescapeString(String v) {
|
||||
/* Replace color code &color; */
|
||||
v = v.replaceAll("&color;", "\u00A7");
|
||||
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ public class ConfigurationNode implements Map<String, Object> {
|
||||
entries = map;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getObject(String path) {
|
||||
if (path.isEmpty())
|
||||
return entries;
|
||||
@@ -61,7 +60,6 @@ public class ConfigurationNode implements Map<String, Object> {
|
||||
return o;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getGeneric(String path, T def) {
|
||||
Object o = getObject(path, def);
|
||||
try {
|
||||
@@ -114,7 +112,6 @@ public class ConfigurationNode implements Map<String, Object> {
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> List<T> getList(String path) {
|
||||
try {
|
||||
List<T> list = (List<T>)getObject(path, null);
|
||||
@@ -142,7 +139,6 @@ public class ConfigurationNode implements Map<String, Object> {
|
||||
return new ConfigurationNode(v);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ConfigurationNode> getNodes(String path) {
|
||||
List<Object> o = getList(path);
|
||||
|
||||
@@ -169,7 +165,6 @@ public class ConfigurationNode implements Map<String, Object> {
|
||||
extendMap(this, other);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private final static void extendMap(Map<String, Object> left, Map<String, Object> right) {
|
||||
ConfigurationNode original = new ConfigurationNode(left);
|
||||
for(Map.Entry<String, Object> entry : right.entrySet()) {
|
||||
|
||||
+2
-3
@@ -1,11 +1,10 @@
|
||||
package org.dynmap.utils;
|
||||
|
||||
package org.dynmap;
|
||||
|
||||
/**
|
||||
* Represents a static, thread-safe snapshot of chunk of blocks
|
||||
* Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering)
|
||||
*/
|
||||
public class CraftChunkSnapshot implements LegacyChunkSnapshot {
|
||||
public class CraftChunkSnapshot implements ChunkSnapshot {
|
||||
private final int x, z;
|
||||
private final byte[] buf; /* Flat buffer in uncompressed chunk file format */
|
||||
private final byte[] hmap; /* Highest Y map */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user