Compare commits

..

134 Commits

Author SHA1 Message Date
FrozenCow 67b5b7509f Changed version to 0.22.1. 2011-09-18 19:47:33 +02:00
Mike Primm 886248e115 Remove workaround for missing Bukkit biome data (fix integrated), add spawn point to fullrender seed list 2011-09-18 23:38:34 +08:00
Mike Primm bc17045196 Workaround explosion in getSnapshot in Bukkit when biome data requested on nether in 1.8 Bukkit 2011-09-17 13:52:09 +08:00
Mike Primm 7cf9f2f1e4 Code temporary fix to workaround Bukkit 1.8 raw biome issue (pending accept of pull CraftBukkit 457) 2011-09-17 11:57:09 +08:00
Mike Primm 7d89fe094a Fix bogus warning message on markers component 2011-09-17 06:54:12 +08:00
Mike Primm 8524eecad5 Make cactus semi-transparent (subtle lighting issues) 2011-09-16 23:49:13 +08:00
Mike Primm bee5da8e9f Wood color updates (Thanks Flobi!!) 2011-09-16 21:12:37 +08:00
Mike Primm e15d3cd8cc Add new biomes to colorschemes 2011-09-15 10:09:37 +08:00
Mike Primm 33add48697 Extend chunk load/generate fault in volume 2011-09-15 08:17:24 +08:00
Mike Primm 98d18260c4 Fix typo in flames.txt 2011-09-14 17:08:22 -05:00
Mike Primm 910be17c42 Add silverfish block data handling (stone, cobblestone, stone bricks) 2011-09-14 11:43:35 -05:00
Mike Primm 6299deee82 Swap red and brown mushrooms (had it right in HD - wiki is wrong) 2011-09-15 00:26:39 +08:00
Mike Primm ff57c9e183 Add 1.8 blocks to old colorschemes 2011-09-14 22:53:49 +08:00
Mike Primm ea5f9a8a96 Add control of label for playermarkers layer (label attribute) 2011-09-14 13:27:08 +08:00
Mike Primm afc6f429f0 Add sorting and ordering controls for layer control (layerprio attribute) 2011-09-14 13:02:02 +08:00
Mike Primm 36ea3c20ca Change background on layer control 2011-09-14 13:02:02 +08:00
Mike Primm aacdd77f3e Add support for spaces in world names via double-quotes on commands 2011-09-13 12:04:05 +08:00
Mike Primm a369f02083 Add /dmarker updateicon, /dmarker deleteicon - add APIs for updating icon file and deleting icons 2011-09-13 11:34:54 +08:00
Mike Primm 09637f293e Make marker API stay loaded across /dynmap reload (screws up API users otherwise) 2011-09-13 11:34:54 +08:00
Mike Primm e81564c1ae Fix lighting quirks with stairs and slabs 2011-09-13 06:51:38 +08:00
Mike Primm ebfe2a004b Add bukkit bug workaround (http://leaky.bukkit.org/issues/1227) - piston exceptions 2011-09-12 10:31:16 +08:00
Mike Primm 3076b28c24 Add workaround for bogus Bukkit piston events (http://leaky.bukkit.org/issues/1227) 2011-09-12 10:31:16 +08:00
Mike Primm e2746b7cbc Add open models for fence gates 2011-09-12 10:31:15 +08:00
Mike Primm 62bc4f2cd0 Merge remote branch 'upstream/master' 2011-09-11 18:33:01 -05:00
Mike Primm fd14f9bc84 Add 'portal' and 'minecart' standard icons for Markers 2011-09-11 18:31:04 -05:00
Mike Primm f824a17704 Add 'coord' client component - show world coords of mouse pointer 2011-09-12 06:49:22 +08:00
Mike Primm ba98145086 Add 'coord' client component - show world coords of mouse pointer 2011-09-11 17:48:04 -05:00
Mike Primm 571c2acfc3 Fix new stair and stem transparency 2011-09-12 03:56:48 +08:00
Mike Primm cab056ef5c Add pumpkin and melon stems 2011-09-12 03:56:46 +08:00
Mike Primm 8c4315be40 Fix new stair and stem transparency 2011-09-11 13:31:09 -05:00
Mike Primm c808ddcc45 Merge remote branch 'upstream/master' 2011-09-11 13:27:36 -05:00
Mike Primm d5153a6f4c Improve fence gate model 2011-09-12 02:25:39 +08:00
Mike Primm 352d1843e0 Add pumpkin and melon stems 2011-09-11 13:24:01 -05:00
Mike Primm 0f986b4c87 Improve fence gate model 2011-09-11 12:28:28 -05:00
Mike Primm b55989f696 Add full mushroom texture maps (exterior vs interior, stems) 2011-09-11 23:44:48 +08:00
Mike Primm b0227d5ce7 Add full mushroom texture maps (exterior vs interior, stems) 2011-09-11 10:40:27 -05:00
mikeprimm 32ccbf4792 Merge pull request #432 from mikeprimm/master
Add 1.8 textures and models
2011-09-10 23:22:34 -07:00
Mike Primm df3027dc8a Fix glass pane tops 2011-09-10 23:42:21 -05:00
Mike Primm d53ef57ae1 More 1.8 block support - gates, glass panes, iron fences, vines 2011-09-10 23:15:57 -05:00
Mike Primm 00f16304a4 Start 1.8 block textures and models 2011-09-10 15:53:38 -05:00
Mike Primm 3f19c1ab3a Merge remote branch 'upstream/master' 2011-09-10 00:24:19 -05:00
FrozenCow 9570f03ec6 Changed version to 0.23. 2011-09-09 21:02:40 +02:00
FrozenCow 03f62bd8f6 Made the different version numbers refer to version in pom.xml. 2011-09-09 20:35:22 +02:00
Mike Primm 6d2193d597 Add hide-by-default attribute to marker sets, /dmarker updateset 2011-09-09 11:05:00 +08:00
Mike Primm 3d868d4700 Add hide-by-default attribute to marker sets, /dmarker updateset 2011-09-08 22:02:32 -05:00
Mike Primm 4c50bd502c Fix typo in setMarkerSetLabel() API 2011-09-09 01:01:02 +08:00
Mike Primm e54c1fa7d8 Fix typo in setMarkerSetLabel() API 2011-09-08 11:59:56 -05:00
Mike Primm d6b5524aca Merge remote branch 'upstream/master' 2011-09-07 23:07:17 -05:00
Mike Primm 996343c5a3 Add /dmarker addicon command 2011-09-08 11:42:28 +08:00
Mike Primm 8a4e1ebfc2 Add /dmarker addicon command 2011-09-07 22:40:09 -05:00
Mike Primm 2f53b72779 Update jquery to 1.6.3 2011-09-08 11:06:20 +08:00
Mike Primm 009c3a9429 Update jquery to 1.6.3 2011-09-07 22:05:20 -05:00
Mike Primm cfa5f187e6 Add error handling for missing component javascript files 2011-09-08 10:46:33 +08:00
Mike Primm 91bc59d7f8 Fix message for version mismatch, and abort UI if it fails 2011-09-08 10:46:33 +08:00
Mike Primm a77f002054 Add error handling for missing component javascript files 2011-09-07 21:44:11 -05:00
Mike Primm 402d7f9542 Fix message for version mismatch, and abort UI if it fails 2011-09-07 21:07:30 -05:00
Mike Primm 6181aa8ba9 Add version check for javascript files versus plugin version 2011-09-08 09:47:00 +08:00
Mike Primm 9322c5426d Add support for showing spawn points as map markers 2011-09-08 09:47:00 +08:00
Mike Primm 6de49f89d6 Add version check for javascript files versus plugin version 2011-09-07 20:44:21 -05:00
Mike Primm 5adbe6bd5e Add support for showing spawn points as map markers 2011-09-07 20:30:53 -05:00
Mike Primm 9da159f842 Add 'hidebydefault' option for Markers layers 2011-09-08 00:23:38 +08:00
Mike Primm 89f63a9db2 Add 'hidebydefault' option for Markers layers 2011-09-07 11:22:44 -05:00
Mike Primm 771059bf5a Fix background colors when rendering zoomout with JPEG format 2011-09-06 14:19:49 +08:00
Mike Primm e7f30153b8 Add marker set commands - addset, deleteset, listsets 2011-09-06 14:19:49 +08:00
Mike Primm 21c68fa1b2 Fix background colors when rendering zoomout with JPEG format 2011-09-06 01:15:07 -05:00
Mike Primm 37a9809f67 Add marker set commands - addset, deleteset, listsets 2011-09-06 01:13:37 -05:00
Mike Primm 7bee1dcae5 Fix markers being left on world changes 2011-09-06 09:05:25 +08:00
Mike Primm dcb3e8e2ff Fix markers being left on world changes 2011-09-05 20:03:30 -05:00
Mike Primm 2f7890a40b Remove debug messages, adjust sign ID mapping 2011-09-06 07:53:49 +08:00
Mike Primm 36d983ba28 Add support for using signs to define markers 2011-09-06 07:53:48 +08:00
Mike Primm 20e409b71f Start sign support 2011-09-06 07:53:48 +08:00
Mike Primm 34ae7d21fd Remove debug messages, adjust sign ID mapping 2011-09-05 18:47:27 -05:00
Mike Primm 25f7dbb312 Add support for using signs to define markers 2011-09-05 18:36:43 -05:00
Mike Primm 7d2d0b4d87 Start sign support 2011-09-05 17:17:46 -05:00
Mike Primm e0fcca4b7f Fix single map render message on single map render of day/night worlds 2011-09-06 04:41:08 +08:00
Mike Primm b51da5d401 Fix single map render message on single map render of day/night worlds 2011-09-05 15:39:53 -05:00
Mike Primm 754bc6c51e Merge remote branch 'upstream/master' 2011-09-05 15:24:19 -05:00
Mike Primm f99700d863 Fix double-quoted strings in parameters 2011-09-06 02:36:37 +08:00
Mike Primm 270f64c594 Fix double-quoted strings in parameters 2011-09-05 13:35:12 -05:00
Mike Primm e86aa352df Make all /dmarker command match-on-label as well as id:<id> 2011-09-05 14:35:29 +08:00
Mike Primm f950fb4d85 Make all /dmarker command match-on-label as well as id:<id> 2011-09-05 01:34:31 -05:00
Mike Primm f0db205eb9 Complete first drop of /dmarker commands and client support 2011-09-04 23:40:00 -05:00
Mike Primm 9f8ab5da03 Add icons on to map display, and marker update logic 2011-09-04 14:11:48 -05:00
Mike Primm c034a10951 Finish revert 2011-09-04 02:07:15 -05:00
Mike Primm 6b301b2208 Merge remote branch 'origin/master' 2011-09-04 02:05:58 -05:00
Mike Primm 83642a6291 Put it back - not sure other fix did anything 2011-09-04 02:03:52 -05:00
Mike Primm cbe4ca0377 Fix player faces in sidebar, while still preserving load cache 2011-09-04 14:35:41 +08:00
Mike Primm eee6476d6a Fix player faces in sidebar, while still preserving load cache 2011-09-04 01:35:02 -05:00
Mike Primm 8bdce005c3 Merge remote branch 'upstream/master' 2011-09-04 01:31:46 -05:00
Mike Primm 3f585c84b7 Put markers in a component, add generic component update messages 2011-09-03 16:49:18 -05:00
Mike Primm dd8a84165b Add marker update/delete events for client 2011-09-03 01:06:00 -05:00
Mike Primm c486c42de8 Add default marker set 2011-09-02 23:02:23 -05:00
Mike Primm cdffc5824f Fix texture rotation for NE and SW rail corners 2011-09-03 03:23:34 +08:00
Mike Primm f6a4f3e619 Fix texture rotation for NE and SW rail corners 2011-09-02 14:22:13 -05:00
Mike Primm dcdcdd88aa Prevent trap if townBlocks is undefined in towny town file 2011-09-03 00:11:35 +08:00
Mike Primm a476b66c2f Prevent trap if townBlocks is undefined in towny town file 2011-09-02 09:19:27 -05:00
Mike Primm fba69e3d19 Frame out API and data handling for markers support 2011-09-01 01:01:51 -05:00
Mike Primm 0bd55b76d8 Yet another face fix - hopefully got the rules on accessories right
this time...
2011-08-31 07:15:44 +08:00
Mike Primm 704fc7fb32 Yet another face fix - hopefully got the rules on accessories right
this time...
2011-08-30 18:13:59 -05:00
FrozenCow d88763f179 Fixed playerfaces not showing in sidebar. 2011-08-30 21:46:22 +02:00
Mike Primm 56faab71e2 Handle Towny 0.74.0 configuration format 2011-08-30 13:29:36 +08:00
Mike Primm 9da3180e38 Handle Towny 0.74.0 configuration format 2011-08-30 00:28:28 -05:00
Mike Primm 85a564aa45 Handle Factions on worlds with no faction data properly 2011-08-30 13:04:54 +08:00
Mike Primm b9170db1c1 Support applying background color to JPG tiles (since no transparency) 2011-08-30 13:04:54 +08:00
Mike Primm 0e1158c77b Handle Factions on worlds with no faction data properly 2011-08-30 00:03:37 -05:00
Mike Primm 8ac000abec Support applying background color to JPG tiles (since no transparency) 2011-08-30 00:02:52 -05:00
Mike Primm f371cff011 Add support for 'http-reponse-headers' attribute to add custom response headers 2011-08-30 10:34:58 +08:00
Mike Primm 5088adb7eb Add support for 'http-reponse-headers' attribute to add custom response headers 2011-08-29 21:33:41 -05:00
Mike Primm d1ff472bda Add 'sidebaropened: pinned' option to allow sidebar to be pre-pinned but support unpinning 2011-08-30 10:01:07 +08:00
Mike Primm 7e37817b86 Add 'sidebaropened: pinned' option to allow sidebar to be pre-pinned but support unpinning 2011-08-29 21:00:05 -05:00
Mike Primm 611a935232 Fix multi-map KzedMap rendering (default cave not rendered issue) 2011-08-30 04:56:21 +08:00
Mike Primm 974cd33853 Fix multi-map KzedMap rendering (default cave not rendered issue) 2011-08-29 15:53:48 -05:00
Mike Primm fc1fec4af8 Split renderdata (generated data) from normal block data - to help
with custom block work
2011-08-30 03:23:11 +08:00
Mike Primm 13bf8d7733 Split renderdata (generated data) from normal block data - to help
with custom block work
2011-08-29 14:21:39 -05:00
Mike Primm f4de63e85e Add first pass of Factions support 2011-08-29 10:37:22 +08:00
Mike Primm af1f47df23 Add first pass of Factions support 2011-08-28 21:31:04 -05:00
Mike Primm 0755dd3377 Merge remote branch 'upstream/master' 2011-08-28 18:29:18 -05:00
Mike Primm f20c4a25a9 Merge remote branch 'origin/master' 2011-08-28 18:28:13 -05:00
Mike Primm cfc758fe7d Fix handling of non-standard town_block_size values 2011-08-28 23:12:47 +08:00
Mike Primm b20b9e1436 Fix handling of non-standard town_block_size values 2011-08-28 10:12:04 -05:00
Mike Primm 0c292dde12 Fix Towny support to handle 0.75.x and 0.74.x 2011-08-28 08:14:08 +08:00
Mike Primm ac650656b4 Fix Towny support to handle 0.75.x and 0.74.x 2011-08-27 19:13:34 -05:00
FrozenCow a3573c7a64 Added support for Towny Advanced 0.75 2011-08-27 20:51:47 +02:00
FrozenCow 069d4c0ce5 Changed version to 0.22. 2011-08-27 17:13:56 +02:00
Mike Primm 3d385106e9 Add hidebydefault setting to playermarkers component too 2011-08-26 01:22:03 -05:00
Mike Primm ace7fbf838 Handle multiple instances of same component type (regions) 2011-08-26 00:55:53 -05:00
Mike Primm aee7ea2d49 Add hidebydefault option for regions layers 2011-08-26 00:13:03 -05:00
Mike Primm c6cccf6899 Merge remote branch 'upstream/master' 2011-08-25 23:33:57 -05:00
Mike Primm 1a128a6d74 Add playermarkers to hide/show-able layer group 2011-08-25 17:31:34 -05:00
Mike Primm bfb12e4f81 Add control for hide/show of component layers (only regions for now) 2011-08-25 17:07:00 -05:00
Mike Primm 625b62fa36 Use towns list in Towny worlds/* files to get valid towns (old towns
still in towns/* directory)
2011-08-25 14:49:32 -05:00
Mike Primm c65b17d80b Disable IOImage cache use for image loads 2011-08-25 14:48:42 -05:00
Mike Primm 627cef720c Towny fixes - multiple areas on multiple worlds per town 2011-08-24 22:11:31 -05:00
Mike Primm 586c41d23c Fix accessory face mixing 2011-08-24 01:23:05 -05:00
139 changed files with 4171 additions and 215 deletions
+47 -2
View File
@@ -30,8 +30,13 @@ Iron Ore
15 136 130 127 255 108 104 101 255 68 65 63 255 54 52 50 255
Coal Ore
16 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
Wood
17 102 81 51 255 81 64 40 255 51 40 25 255 40 32 20 255
Wood - Normal
17 102 81 51 255 125 102 63 255 78 64 39 255 40 32 20 255
17:0 102 81 51 255 125 102 63 255 78 64 39 255 40 32 20 255
Wood - Spruce (Red/dark wood)
17:1 75 44 24 255 125 102 63 255 78 64 39 255 30 18 10 255
Wood - Birch (light wood)
17:2 191 191 191 255 125 102 63 255 78 64 39 255 76 76 76 255
Leaves
18 60 192 41 100 48 153 32 100 30 96 20 100 24 76 16 100
Sponge
@@ -120,6 +125,10 @@ Double Stone Slab - Wood
43:2 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
Double Stone Slab - Cobblestone
43:3 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
Double Stone Slab - Brick
43:4 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
Double Stone Slab - Stone Brick
43:5 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
Stone Slab
44 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
44:0 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
@@ -129,6 +138,10 @@ Stone Slab - Wood
44:2 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
Stone Slab - Cobblestone
44:3 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
Stone Slab - Brick
44:4 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
Stone Slab - Stone Brick
44:5 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
Brick
45 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
TNT
@@ -233,6 +246,32 @@ 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
Stone - Sliverfish
97 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
Stone Brick
98 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
Huge Brown Mushroom
99 204 153 120 255 145 109 85 255 114 86 67 255 73 64 58 255
Huge Red Mushroom
100 255 43 43 255 196 29 38 255 186 105 109 255 124 64 64 255
Iron Bars
101 191 191 191 96 152 152 152 96 95 95 95 96 76 76 76 96
Glass Pane
102 255 255 255 64 204 204 204 64 127 127 127 64 102 102 102 64
Melon
103 193 193 65 255 174 174 47 255 97 97 5 255 76 76 20 255
Pumpkin Stem
104 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
Melon Stem
105 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
Vines
106 60 192 41 100 48 153 32 100 30 96 20 100 24 76 16 100
Fence Gate
107 127 98 49 96 95 72 33 96 48 34 9 96 32 21 21 96
Brick Stairs
108 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
Stone Stairs
109 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 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
@@ -259,6 +298,12 @@ 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
Biome Ocean - Blue
[OCEAN] 34 44 134 255 27 35 107 255 17 22 67 255 13 18 53 255
Biome River - Medium Blue
[RIVER] 44 54 154 144 36 45 127 255 25 32 77 255 20 28 65 255
Biome Extreme Hills - Dark Brown
[EXTREME_HILLS] 38 22 12 255 30 18 10 255 19 11 6 255 15 9 5 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
+47 -2
View File
@@ -30,8 +30,13 @@ Iron Ore
15 136 130 127 255 108 104 101 255 68 65 63 255 54 52 50 255
Coal Ore
16 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
Wood
17 102 81 51 255 81 64 40 255 51 40 25 255 40 32 20 255
Wood - Normal
17 102 81 51 255 125 102 63 255 78 64 39 255 40 32 20 255
17:0 102 81 51 255 125 102 63 255 78 64 39 255 40 32 20 255
Wood - Spruce (Red/dark wood)
17:1 75 44 24 255 125 102 63 255 78 64 39 255 30 18 10 255
Wood - Birch (light wood)
17:2 191 191 191 255 125 102 63 255 78 64 39 255 76 76 76 255
Leaves
18 27 69 37 180 22 57 31 180 19 48 25 180 22 57 31 180
Sponge
@@ -120,6 +125,10 @@ Double Stone Slab - Wood
43:2 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
Double Stone Slab - Cobblestone
43:3 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
Double Stone Slab - Brick
43:4 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
Double Stone Slab - Stone Brick
43:5 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
Stone Slab
44 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
44:0 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
@@ -129,6 +138,10 @@ Stone Slab - Wood
44:2 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
Stone Slab - Cobblestone
44:3 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
Stone Slab - Brick
44:4 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
Stone Slab - Stone Brick
44:5 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
Brick
45 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
TNT
@@ -233,6 +246,32 @@ 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
Stone - Sliverfish
97 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
Stone Brick
98 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
Huge Brown Mushroom
99 204 153 120 255 145 109 85 255 114 86 67 255 73 64 58 255
Huge Red Mushroom
100 255 43 43 255 196 29 38 255 186 105 109 255 124 64 64 255
Iron Bars
101 191 191 191 96 152 152 152 96 95 95 95 96 76 76 76 96
Glass Pane
102 255 255 255 64 204 204 204 64 127 127 127 64 102 102 102 64
Melon
103 193 193 65 255 174 174 47 255 97 97 5 255 76 76 20 255
Pumpkin Stem
104 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
Melon Stem
105 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
Vines
106 60 192 41 100 48 153 32 100 30 96 20 100 24 76 16 100
Fence Gate
107 127 98 49 96 95 72 33 96 48 34 9 96 32 21 21 96
Brick Stairs
108 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
Stone Stairs
109 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 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
@@ -259,6 +298,12 @@ 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
Biome Ocean - Blue
[OCEAN] 34 44 134 255 27 35 107 255 17 22 67 255 13 18 53 255
Biome River - Medium Blue
[RIVER] 44 54 154 144 36 45 127 255 25 32 77 255 20 28 65 255
Biome Extreme Hills - Dark Brown
[EXTREME_HILLS] 38 22 12 255 30 18 10 255 19 11 6 255 15 9 5 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
+47 -2
View File
@@ -30,8 +30,13 @@ Iron Ore
15 136 130 127 255 108 104 101 255 68 65 63 255 54 52 50 255
Coal Ore
16 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
Wood
17 102 81 51 255 81 64 40 255 51 40 25 255 40 32 20 255
Wood - Normal
17 102 81 51 255 125 102 63 255 78 64 39 255 40 32 20 255
17:0 102 81 51 255 125 102 63 255 78 64 39 255 40 32 20 255
Wood - Spruce (Red/dark wood)
17:1 75 44 24 255 125 102 63 255 78 64 39 255 30 18 10 255
Wood - Birch (light wood)
17:2 191 191 191 255 125 102 63 255 78 64 39 255 76 76 76 255
Leaves
18 47 99 32 255 34 86 20 255 24 66 14 255 23 57 13 255
Sponge
@@ -120,6 +125,10 @@ Double Stone Slab - Wood
43:2 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
Double Stone Slab - Cobblestone
43:3 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
Double Stone Slab - Brick
43:4 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
Double Stone Slab - Stone Brick
43:5 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
Stone Slab
44 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
44:0 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
@@ -129,6 +138,10 @@ Stone Slab - Wood
44:2 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255
Stone Slab - Cobblestone
44:3 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255
Stone Slab - Brick
44:4 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
Stone Slab - Stone Brick
44:5 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
Brick
45 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
TNT
@@ -233,6 +246,32 @@ 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
Stone - Sliverfish
97 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
Stone Brick
98 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
Huge Brown Mushroom
99 204 153 120 255 145 109 85 255 114 86 67 255 73 64 58 255
Huge Red Mushroom
100 255 43 43 255 196 29 38 255 186 105 109 255 124 64 64 255
Iron Bars
101 191 191 191 96 152 152 152 96 95 95 95 96 76 76 76 96
Glass Pane
102 255 255 255 64 204 204 204 64 127 127 127 64 102 102 102 64
Melon
103 193 193 65 255 174 174 47 255 97 97 5 255 76 76 20 255
Pumpkin Stem
104 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
Melon Stem
105 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
Vines
106 60 192 41 100 48 153 32 100 30 96 20 100 24 76 16 100
Fence Gate
107 127 98 49 96 95 72 33 96 48 34 9 96 32 21 21 96
Brick Stairs
108 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
Stone Stairs
109 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 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
@@ -259,6 +298,12 @@ 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
Biome Ocean - Blue
[OCEAN] 34 44 134 255 27 35 107 255 17 22 67 255 13 18 53 255
Biome River - Medium Blue
[RIVER] 44 54 154 144 36 45 127 255 25 32 77 255 20 28 65 255
Biome Extreme Hills - Dark Brown
[EXTREME_HILLS] 38 22 12 255 30 18 10 255 19 11 6 255 15 9 5 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
+26
View File
@@ -14,6 +14,9 @@
15 231 174 113 255 193 145 94 255 161 121 79 255 193 145 94 255
16 56 60 70 255 46 50 58 255 39 42 49 255 46 50 58 255
17 119 97 74 255 99 81 62 255 83 68 52 255 99 81 62 255
17:0 119 97 74 255 99 81 62 255 83 68 52 255 99 81 62 255
17:1 75 44 24 255 125 102 63 255 78 64 39 255 30 18 10 255
17:2 191 191 191 255 125 102 63 255 78 64 39 255 76 76 76 255
18 27 69 37 180 22 57 31 180 19 48 25 180 22 57 31 180
19 193 193 65 255 174 174 47 255 97 97 5 255 76 76 20 255
20 178 217 223 90 148 181 186 90 124 151 155 90 148 181 186 90
@@ -59,11 +62,15 @@
43:1 192 178 110 255 160 148 92 255 134 124 77 255 160 148 92 255
43:2 109 80 60 255 91 67 50 255 76 56 41 255 91 67 50 255
43:3 118 112 96 255 98 93 80 255 82 78 67 255 98 93 80 255
43:4 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
43:5 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
44 122 112 99 254 101 93 82 254 85 78 69 254 101 93 82 254
44:0 122 112 99 254 101 93 82 254 85 78 69 254 101 93 82 254
44:1 192 178 110 255 160 148 92 255 134 124 77 255 160 148 92 255
44:2 109 80 60 255 91 67 50 255 76 56 41 255 91 67 50 255
44:3 118 112 96 255 98 93 80 255 82 78 67 255 98 93 80 255
44:4 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
44:5 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255
45 230 103 73 255 192 86 61 255 160 71 50 255 192 86 61 255
46 255 79 30 255 231 72 27 255 193 60 22 255 231 72 27 255
47 125 91 38 192 100 72 30 192 62 45 19 192 50 36 15 192
@@ -116,6 +123,19 @@
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
97 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
98 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255
99 204 153 120 255 145 109 85 255 114 86 67 255 73 64 58 255
100 255 43 43 255 196 29 38 255 186 105 109 255 124 64 64 255
101 191 191 191 96 152 152 152 96 95 95 95 96 76 76 76 96
102 255 255 255 64 204 204 204 64 127 127 127 64 102 102 102 64
103 193 193 65 255 174 174 47 255 97 97 5 255 76 76 20 255
104 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
105 146 192 0 255 116 153 0 255 73 96 0 255 58 76 0 255
106 60 192 41 100 48 153 32 100 30 96 20 100 24 76 16 100
107 127 98 49 96 95 72 33 96 48 34 9 96 32 21 21 96
108 170 86 62 255 136 68 49 255 85 43 31 255 68 34 24 255
109 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 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
@@ -142,6 +162,12 @@ 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
Biome Ocean - Blue
[OCEAN] 34 44 134 255 27 35 107 255 17 22 67 255 13 18 53 255
Biome River - Medium Blue
[RIVER] 44 54 154 144 36 45 127 255 25 32 77 255 20 28 65 255
Biome Extreme Hills - Dark Brown
[EXTREME_HILLS] 38 22 12 255 30 18 10 255 19 11 6 255 15 9 5 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
+19 -1
View File
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.dynmap</groupId>
<artifactId>dynmap</artifactId>
<version>0.21</version>
<version>0.22.1</version>
<name>dynmap</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -13,6 +13,24 @@
<url>https://github.com/FrozenCow/dynmap/issues</url>
</issueManagement>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>*.yml</include>
<include>*.txt</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>*.yml</exclude>
<exclude>*.txt</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+16 -3
View File
@@ -15,9 +15,20 @@
<include>CHANGELOG*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/web/</directory>
<outputDirectory>/dynmap/web/</outputDirectory>
<includes>
<include>version.js</include>
</includes>
<filtered>true</filtered>
</fileSet>
<fileSet>
<directory>${project.basedir}/web</directory>
<outputDirectory>/dynmap/web</outputDirectory>
<excludes>
<exclude>version.js</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${project.basedir}/colorschemes</directory>
@@ -32,7 +43,9 @@
</fileSets>
<files>
<file>
<source>${project.build.directory}/${artifactId}-${version}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>dynmap.jar</destName></file></files>
<source>${project.build.directory}/${artifactId}-${version}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>dynmap.jar</destName>
</file>
</files>
</assembly>
+6
View File
@@ -4,6 +4,8 @@ import java.io.IOException;
import java.io.Writer;
import org.bukkit.ChatColor;
import org.dynmap.markers.Marker;
import org.dynmap.markers.MarkerSet;
import org.json.simple.JSONAware;
import org.json.simple.JSONStreamAware;
@@ -77,4 +79,8 @@ public class Client {
}
}
public static class ComponentMessage extends Update {
public String type = "component";
/* Each subclass must provide 'ctype' string for component 'type' */
}
}
@@ -20,7 +20,8 @@ public class ClientConfigurationComponent extends Component {
s(t, "spammessage", c.getString("spammessage", "You may only chat once every %interval% seconds."));
s(t, "webprefix", unescapeString(c.getString("webprefix", "[WEB] ")));
s(t, "defaultzoom", c.getInteger("defaultzoom", 0));
s(t, "sidebaropened", c.getBoolean("sidebaropened", false));
s(t, "sidebaropened", c.getString("sidebaropened", "false"));
s(t, "dynmapversion", plugin.getDescription().getVersion());
DynmapWorld defaultWorld = null;
String defmap = null;
+122 -9
View File
@@ -18,6 +18,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.block.Block;
@@ -39,6 +40,7 @@ import org.bukkit.event.block.BlockPistonRetractEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.block.SignChangeEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityListener;
import org.bukkit.event.player.PlayerChatEvent;
@@ -49,6 +51,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.world.ChunkPopulateEvent;
import org.bukkit.event.world.SpawnChangeEvent;
import org.bukkit.event.world.WorldListener;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.plugin.Plugin;
@@ -59,6 +62,8 @@ import org.dynmap.debug.Debug;
import org.dynmap.debug.Debugger;
import org.dynmap.hdmap.HDBlockModels;
import org.dynmap.hdmap.TexturePack;
import org.dynmap.markers.MarkerAPI;
import org.dynmap.markers.impl.MarkerAPIImpl;
import org.dynmap.permissions.BukkitPermissions;
import org.dynmap.permissions.NijikokunPermissions;
import org.dynmap.permissions.OpPermissions;
@@ -85,6 +90,8 @@ public class DynmapPlugin extends JavaPlugin {
private HashMap<Event.Type, List<Listener>> event_handlers = new HashMap<Event.Type, List<Listener>>();
private MarkerAPIImpl markerapi;
public static File dataDirectory;
public static File tilesDirectory;
@@ -208,6 +215,7 @@ public class DynmapPlugin extends JavaPlugin {
permissions = new OpPermissions(new String[] { "fullrender", "cancelrender", "radiusrender", "resetstats", "reload" });
dataDirectory = this.getDataFolder();
/* Load block models */
HDBlockModels.loadModels(dataDirectory);
/* Load texture mappings */
@@ -278,11 +286,11 @@ public class DynmapPlugin extends JavaPlugin {
if (!configuration.getBoolean("disable-webserver", false)) {
startWebserver();
}
/* Print version info */
PluginDescriptionFile pdfFile = this.getDescription();
Log.info("version " + pdfFile.getVersion() + " is enabled" );
events.<Object>trigger("initialized", null);
}
@@ -303,6 +311,19 @@ public class DynmapPlugin extends JavaPlugin {
boolean checkbannedips = configuration.getBoolean("check-banned-ips", true);
int maxconnections = configuration.getInteger("max-sessions", 30);
if(maxconnections < 2) maxconnections = 2;
/* Load customized response headers, if any */
ConfigurationNode custhttp = configuration.getNode("http-response-headers");
HashMap<String, String> custhdrs = new HashMap<String,String>();
if(custhttp != null) {
for(String k : custhttp.keySet()) {
String v = custhttp.getString(k);
if(v != null) {
custhdrs.put(k, v);
}
}
}
HttpServer.setCustomHeaders(custhdrs);
if(allow_symlinks)
Log.verboseinfo("Web server is permitting symbolic links");
else
@@ -348,6 +369,8 @@ public class DynmapPlugin extends JavaPlugin {
}
playerfacemgr = null;
/* Don't clean up markerAPI - other plugins may still be accessing it */
Debug.clearDebuggers();
}
@@ -455,9 +478,14 @@ public class DynmapPlugin extends JavaPlugin {
Block b = event.getBlock();
Location loc = b.getLocation();
mapManager.sscache.invalidateSnapshot(loc);
BlockFace dir = event.getDirection();
BlockFace dir;
try { /* Workaround Bukkit bug = http://leaky.bukkit.org/issues/1227 */
dir = event.getDirection();
} catch (ClassCastException ccx) {
dir = BlockFace.NORTH;
}
if(onpiston) {
mapManager.touchVolume(loc, b.getRelative(dir, 2).getLocation());
mapManager.touchVolume(loc, b.getRelative(dir, 2).getLocation());
}
for(int i = 0; i < 2; i++) {
b = b.getRelative(dir, 1);
@@ -471,7 +499,12 @@ public class DynmapPlugin extends JavaPlugin {
Block b = event.getBlock();
Location loc = b.getLocation();
mapManager.sscache.invalidateSnapshot(loc);
BlockFace dir = event.getDirection();
BlockFace dir;
try { /* Workaround Bukkit bug = http://leaky.bukkit.org/issues/1227 */
dir = event.getDirection();
} catch (ClassCastException ccx) {
dir = BlockFace.NORTH;
}
if(onpiston) {
mapManager.touchVolume(loc, b.getRelative(dir, 1+event.getLength()).getLocation());
}
@@ -556,13 +589,13 @@ public class DynmapPlugin extends JavaPlugin {
/* Touch extreme corners */
int x = event.getChunk().getX() << 4;
int z = event.getChunk().getZ() << 4;
mapManager.touchVolume(new Location(event.getWorld(), x, 0, z), new Location(event.getWorld(), x+15, 127, z+15));
mapManager.touchVolume(new Location(event.getWorld(), x, 0, z), new Location(event.getWorld(), x+16, 128, z+16));
}
@Override
public void onChunkPopulate(ChunkPopulateEvent event) {
int x = event.getChunk().getX() << 4;
int z = event.getChunk().getZ() << 4;
mapManager.touchVolume(new Location(event.getWorld(), x, 0, z), new Location(event.getWorld(), x+15, 127, z+15));
mapManager.touchVolume(new Location(event.getWorld(), x, 0, z), new Location(event.getWorld(), x+16, 128, z+16));
}
@Override
public void onWorldLoad(WorldLoadEvent event) {
@@ -614,6 +647,44 @@ public class DynmapPlugin extends JavaPlugin {
}
}
/* Parse argument strings : handle quoted strings */
public static String[] parseArgs(String[] args, CommandSender snd) {
ArrayList<String> rslt = new ArrayList<String>();
/* Build command line, so we can parse our way - make sure there is trailing space */
String cmdline = "";
for(int i = 0; i < args.length; i++) {
cmdline += args[i] + " ";
}
boolean inquote = false;
StringBuilder sb = new StringBuilder();
for(int i = 0; i < cmdline.length(); i++) {
char c = cmdline.charAt(i);
if(inquote) { /* If in quote, accumulate until end or another quote */
if(c == '\"') { /* End quote */
inquote = false;
}
else {
sb.append(c);
}
}
else if(c == '\"') { /* Start of quote? */
inquote = true;
}
else if(c == ' ') { /* Ending space? */
rslt.add(sb.toString());
sb.setLength(0);
}
else {
sb.append(c);
}
}
if(inquote) { /* If still in quote, syntax error */
snd.sendMessage("Error: unclosed doublequote");
return null;
}
return rslt.toArray(new String[rslt.size()]);
}
private static final Set<String> commands = new HashSet<String>(Arrays.asList(new String[] {
"render",
"hide",
@@ -627,11 +698,20 @@ public class DynmapPlugin extends JavaPlugin {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if(cmd.getName().equalsIgnoreCase("dmarker")) {
return MarkerAPIImpl.onCommand(this, sender, cmd, commandLabel, args);
}
if (!cmd.getName().equalsIgnoreCase("dynmap"))
return false;
Player player = null;
if (sender instanceof Player)
player = (Player) sender;
/* Re-parse args - handle doublequotes */
args = parseArgs(args, sender);
if(args == null)
return false;
if (args.length > 0) {
String c = args[0];
if (!commands.contains(c)) {
@@ -755,7 +835,7 @@ public class DynmapPlugin extends JavaPlugin {
return false;
}
private boolean checkPlayerPermission(CommandSender sender, String permission) {
public boolean checkPlayerPermission(CommandSender sender, String permission) {
if (!(sender instanceof Player) || sender.isOp()) {
return true;
} else if (!permissions.has(sender, permission.toLowerCase())) {
@@ -1073,6 +1153,16 @@ public class DynmapPlugin extends JavaPlugin {
}
}
}
@Override
public void onSpawnChange(SpawnChangeEvent event) {
/* Call listeners */
List<Listener> ll = event_handlers.get(event.getType());
if(ll != null) {
for(Listener l : ll) {
((WorldListener)l).onSpawnChange(event);
}
}
}
};
private CustomEventListener ourCustomEventHandler = new CustomEventListener() {
@@ -1128,11 +1218,12 @@ public class DynmapPlugin extends JavaPlugin {
case BLOCK_SPREAD:
case BLOCK_PISTON_EXTEND:
case BLOCK_PISTON_RETRACT:
pm.registerEvent(type, ourBlockEventHandler, Event.Priority.Monitor, this);
pm.registerEvent(type, ourBlockEventHandler, Event.Priority.Monitor, this);
break;
case WORLD_LOAD:
case CHUNK_LOAD:
case CHUNK_POPULATED:
case SPAWN_CHANGE:
pm.registerEvent(type, ourWorldEventHandler, Event.Priority.Monitor, this);
break;
case CUSTOM_EVENT:
@@ -1150,4 +1241,26 @@ public class DynmapPlugin extends JavaPlugin {
}
ll.add(listener);
}
/**
* ** This is the public API for other plugins to use for accessing the Marker API **
* This method can return null if the 'markers' component has not been configured -
* a warning message will be issued to the server.log in this event.
*
* @return MarkerAPI, or null if not configured
*/
public MarkerAPI getMarkerAPI() {
if(markerapi == null) {
Log.warning("Marker API has been requested, but is not enabled. Uncomment or add 'markers' component to configuration.txt.");
}
return markerapi;
}
public boolean markerAPIInitialized() {
return (markerapi != null);
}
/**
* Register markers API - used by component to supply marker API to plugin
*/
public void registerMarkerAPI(MarkerAPIImpl api) {
markerapi = api;
}
}
+18 -4
View File
@@ -1,10 +1,12 @@
package org.dynmap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.World;
import org.bukkit.Location;
import org.dynmap.MapType.ImageFormat;
import org.dynmap.debug.Debug;
import org.dynmap.utils.DynmapBufferedImage;
import org.dynmap.utils.FileLockManager;
@@ -151,6 +153,7 @@ public class DynmapWorld {
boolean neg_step_y;
String baseprefix;
int zoomlevel;
int background;
String zoomprefix;
String fnprefix;
String zfnprefix;
@@ -233,7 +236,7 @@ public class DynmapWorld {
/* If level is above top needed for this map, skip */
if(zoomlevel > (this.extrazoomoutlevels + mt.getMapZoomOutLevels()))
continue;
List<String> pfx = mt.baseZoomFilePrefixes();
List<MapType.ZoomInfo> pfx = mt.baseZoomFileInfo();
int stepsize = mt.baseZoomFileStepSize();
int bigworldshift = mt.getBigWorldShift();
boolean neg_step_x = false;
@@ -252,13 +255,14 @@ public class DynmapWorld {
break;
}
int[] stepseq = mt.zoomFileStepSequence();
for(String p : pfx) {
for(MapType.ZoomInfo p : pfx) {
PrefixData pd = new PrefixData();
pd.stepsize = stepsize;
pd.neg_step_x = neg_step_x;
pd.neg_step_y = neg_step_y;
pd.stepseq = stepseq;
pd.baseprefix = p;
pd.baseprefix = p.prefix;
pd.background = p.background_argb;
pd.zoomlevel = zoomlevel;
pd.zoomprefix = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz".substring(0, zoomlevel);
pd.bigworldshift = bigworldshift;
@@ -279,7 +283,7 @@ public class DynmapWorld {
pd.zfnprefix = "z" + pd.fnprefix;
}
maptab.put(p, pd);
maptab.put(p.prefix, pd);
}
}
return maptab;
@@ -430,6 +434,16 @@ public class DynmapWorld {
/* blit scaled rendered tile onto zoom-out tile */
zIm.setRGB(((i>>1) != 0)?0:width/2, (i & 1) * height/2, width/2, height/2, argb, 0, width);
}
else if((pd.background != 0) && (pd.fmt != ImageFormat.FORMAT_PNG)) {
Arrays.fill(argb, pd.background);
/* blit scaled rendered tile onto zoom-out tile */
zIm.setRGB(((i>>1) != 0)?0:width/2, (i & 1) * height/2, width/2, height/2, argb, 0, width);
}
}
else if((pd.background != 0) && (pd.fmt != ImageFormat.FORMAT_PNG)) {
Arrays.fill(argb, pd.background);
/* blit scaled rendered tile onto zoom-out tile */
zIm.setRGB(((i>>1) != 0)?0:width/2, (i & 1) * height/2, width/2, height/2, argb, 0, width);
}
}
FileLockManager.getWriteLock(zf);
+19 -7
View File
@@ -268,12 +268,15 @@ public class MapManager {
activemaplist = map.getMapNamesSharingRender(world);
/* Build active map list */
activemaps = "";
for(String n : activemaplist) {
if((mapname != null) && (!mapname.equals(n)))
continue;
if(activemaps.length() > 0)
activemaps += ",";
activemaps += n;
if(mapname != null) {
activemaps = mapname;
}
else {
for(String n : activemaplist) {
if(activemaps.length() > 0)
activemaps += ",";
activemaps += n;
}
}
/* Mark all the concurrently rendering maps rendered */
renderedmaps.addAll(map.getMapsSharingRender(world));
@@ -285,6 +288,14 @@ public class MapManager {
renderQueue.add(mt);
}
}
/* Add spawn location too (helps with some worlds where 0,64,0 may not be generated */
Location sloc = world.world.getSpawnLocation();
for (MapTile mt : map.getTiles(sloc)) {
if (!found.getFlag(mt.tileOrdinalX(), mt.tileOrdinalY())) {
found.setFlag(mt.tileOrdinalX(), mt.tileOrdinalY(), true);
renderQueue.add(mt);
}
}
if(world.seedloc != null) {
for(Location seed : world.seedloc) {
for (MapTile mt : map.getTiles(seed)) {
@@ -790,7 +801,8 @@ public class MapManager {
public void pushUpdate(String worldName, Object update) {
DynmapWorld world = getWorld(worldName);
world.updates.pushUpdate(update);
if(world != null)
world.updates.pushUpdate(update);
}
public Object[] getWorldUpdates(String worldName, long since) {
+12 -2
View File
@@ -28,6 +28,12 @@ public abstract class MapType {
public String getFileExt() { return ext; }
public float getQuality() { return qual; }
};
public static class ZoomInfo {
public String prefix;
public int background_argb;
public ZoomInfo(String pre, int bg) { prefix = pre; background_argb = bg; }
}
public abstract MapTile[] getTiles(Location l);
@@ -54,7 +60,7 @@ public abstract class MapType {
X_MINUS_Y_MINUS
}
public abstract MapStep zoomFileMapStep();
public abstract List<String> baseZoomFilePrefixes();
public abstract List<ZoomInfo> baseZoomFileInfo();
public abstract int baseZoomFileStepSize();
/* How many bits of coordinate are shifted off to make big world directory name */
public abstract int getBigWorldShift();
@@ -64,7 +70,11 @@ public abstract class MapType {
public int getMapZoomOutLevels() { return 0; }
public ImageFormat getImageFormat() { return ImageFormat.FORMAT_PNG; }
public int getBackgroundARGBNight() { return 0; }
public int getBackgroundARGBDay() { return 0; }
/**
* Step sequence for creating zoomed file: first index is top-left, second top-right, third bottom-left, forth bottom-right
* Values correspond to tile X,Y (0), X+step,Y (1), X,Y+step (2), X+step,Y+step (3)
@@ -0,0 +1,95 @@
package org.dynmap;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.event.world.SpawnChangeEvent;
import org.bukkit.event.world.WorldListener;
import org.bukkit.event.world.WorldLoadEvent;
import org.dynmap.markers.Marker;
import org.dynmap.markers.MarkerIcon;
import org.dynmap.markers.MarkerSet;
import org.dynmap.markers.impl.MarkerAPIImpl;
import org.dynmap.markers.impl.MarkerSignManager;
/**
* Markers component - ties in the component system, both on the server and client
*/
public class MarkersComponent extends ClientComponent {
private MarkerAPIImpl api;
private MarkerSignManager signmgr;
private MarkerIcon spawnicon;
private String spawnlbl;
public MarkersComponent(DynmapPlugin plugin, ConfigurationNode configuration) {
super(plugin, configuration);
/* Register API with plugin, if needed */
api = (MarkerAPIImpl)plugin.getMarkerAPI();
if(plugin.markerAPIInitialized()) {
api = (MarkerAPIImpl)plugin.getMarkerAPI();
}
else {
api = MarkerAPIImpl.initializeMarkerAPI(plugin);
plugin.registerMarkerAPI(api);
}
/* If configuration has enabled sign support, prime it too */
if(configuration.getBoolean("enablesigns", false)) {
signmgr = MarkerSignManager.initializeSignManager(plugin);
}
/* If we're posting spawn point markers, initialize and add world listener */
if(configuration.getBoolean("showspawn", false)) {
String ico = configuration.getString("spawnicon", MarkerIcon.WORLD);
spawnlbl = configuration.getString("spawnlabel", "Spawn");
spawnicon = api.getMarkerIcon(ico); /* Load it */
if(spawnicon == null) {
spawnicon = api.getMarkerIcon(MarkerIcon.WORLD);
}
WorldListener wl = new WorldListener() {
public void onWorldLoad(WorldLoadEvent event) {
World w = event.getWorld(); /* Get the world */
Location loc = w.getSpawnLocation(); /* Get location of spawn */
if(loc != null)
addUpdateWorld(w, loc);
}
public void onSpawnChange(SpawnChangeEvent event) {
World w = event.getWorld(); /* Get the world */
Location loc = w.getSpawnLocation(); /* Get location of spawn */
if(loc != null)
addUpdateWorld(w, loc);
}
};
plugin.registerEvent(org.bukkit.event.Event.Type.WORLD_LOAD, wl);
plugin.registerEvent(org.bukkit.event.Event.Type.SPAWN_CHANGE, wl);
/* Initialize already loaded worlds */
for(DynmapWorld w : plugin.getMapManager().getWorlds()) {
World world = w.world;
Location loc = world.getSpawnLocation();
if(loc != null)
addUpdateWorld(world, loc);
}
}
}
private void addUpdateWorld(World w, Location loc) {
MarkerSet ms = api.getMarkerSet(MarkerSet.DEFAULT);
if(ms != null) {
String spawnid = "_spawn_" + w.getName();
Marker m = ms.findMarker(spawnid); /* See if defined */
if(m == null) { /* Not defined yet, add it */
ms.createMarker(spawnid, spawnlbl, w.getName(), loc.getX(), loc.getY(), loc.getZ(),
spawnicon, false);
}
else {
m.setLocation(w.getName(), loc.getX(), loc.getY(), loc.getZ());
}
}
}
@Override
public void dispose() {
if(signmgr != null) {
MarkerSignManager.terminateSignManager(this.plugin);
signmgr = null;
}
/* Don't unregister API - other plugins might be using it, and we want to keep non-persistent markers */
}
}
+12 -7
View File
@@ -56,16 +56,21 @@ public class PlayerFaces {
int[] faceaccessory = new int[64]; /* 8x8 of face accessory */
/* Get buffered image for face at 8x8 */
DynmapBufferedImage face8x8 = DynmapBufferedImage.allocateBufferedImage(8, 8);
int[] bgcolor = new int[1];
img.getRGB(0, 0, 1, 1, bgcolor, 0, 1); /* Get BG color (for accessory face) */
img.getRGB(8, 8, 8, 8, face8x8.argb_buf, 0, 8); /* Read face from image */
img.getRGB(40, 8, 8, 8, faceaccessory, 0, 8); /* Read face accessory from image */
/* Apply accessory to face: first element is transparency color so only ones not matching it */
/* Apply accessory to face: see if anything is transparent (if so, apply accessory */
boolean transp = false;
for(int i = 0; i < 64; i++) {
if(faceaccessory[i] != bgcolor[0])
face8x8.argb_buf[i] = faceaccessory[i];
else if(face8x8.argb_buf[i] == bgcolor[0])
face8x8.argb_buf[i] = 0;
if((faceaccessory[i] & 0xFF000000) == 0) {
transp = true;
break;
}
}
if(transp) {
for(int i = 0; i < 64; i++) {
if((faceaccessory[i] & 0xFF000000) != 0)
face8x8.argb_buf[i] = faceaccessory[i];
}
}
/* Write 8x8 file */
File img_8x8 = new File(faces8x8dir, playername + ".png");
+4 -4
View File
@@ -454,11 +454,11 @@ public class FlatMap extends MapType {
return Collections.singletonList(name);
}
public List<String> baseZoomFilePrefixes() {
ArrayList<String> s = new ArrayList<String>();
s.add(getPrefix() + "_128");
public List<ZoomInfo> baseZoomFileInfo() {
ArrayList<ZoomInfo> s = new ArrayList<ZoomInfo>();
s.add(new ZoomInfo(getPrefix() + "_128", 0));
if(night_and_day)
s.add(getPrefix()+"_day_128");
s.add(new ZoomInfo(getPrefix()+"_day_128", 0));
return s;
}
@@ -31,11 +31,11 @@ public class HDBlockModels {
public static class HDScaledBlockModels {
private short[][][] modelvectors;
public final short[] getScaledModel(int blocktype, int blockdata) {
public final short[] getScaledModel(int blocktype, int blockdata, int blockrenderdata) {
if(modelvectors[blocktype] == null) {
return null;
}
return modelvectors[blocktype][blockdata];
return modelvectors[blocktype][(blockrenderdata>=0)?blockrenderdata:blockdata];
}
}
+53 -5
View File
@@ -28,6 +28,8 @@ public class HDMap extends MapType {
private ConfigurationNode configuration;
private int mapzoomout;
private MapType.ImageFormat imgformat;
private int bgcolornight;
private int bgcolorday;
public static final String IMGFORMAT_PNG = "png";
public static final String IMGFORMAT_JPG = "jpg";
@@ -100,7 +102,20 @@ public class HDMap extends MapType {
if(imgformat == null) {
Log.severe("HDMap '"+name+"' set invalid image-format: " + fmt);
imgformat = ImageFormat.FORMAT_PNG;
}
}
/* Get color info */
String c = configuration.getString("background");
if(c != null) {
bgcolorday = bgcolornight = parseColor(c);
}
c = configuration.getString("backgroundday");
if(c != null) {
bgcolorday = parseColor(c);
}
c = configuration.getString("backgroundnight");
if(c != null) {
bgcolornight = parseColor(c);
}
}
public HDShader getShader() { return shader; }
@@ -128,11 +143,11 @@ public class HDMap extends MapType {
}
@Override
public List<String> baseZoomFilePrefixes() {
ArrayList<String> s = new ArrayList<String>();
s.add(prefix);
public List<ZoomInfo> baseZoomFileInfo() {
ArrayList<ZoomInfo> s = new ArrayList<ZoomInfo>();
s.add(new ZoomInfo(prefix, getBackgroundARGBNight()));
if(lighting.isNightAndDayEnabled())
s.add(prefix + "_day");
s.add(new ZoomInfo(prefix + "_day", getBackgroundARGBDay()));
return s;
}
@@ -222,4 +237,37 @@ public class HDMap extends MapType {
a(worldObject, "maps", o);
}
private static int parseColor(String c) {
int v = 0;
if(c.startsWith("#")) {
c = c.substring(1);
if(c.length() == 3) { /* #rgb */
try {
v = Integer.valueOf(c, 16);
} catch (NumberFormatException nfx) {
return 0;
}
v = 0xFF000000 | ((v & 0xF00) << 12) | ((v & 0x0F0) << 8) | ((v & 0x00F) << 4);
}
else if(c.length() == 6) { /* #rrggbb */
try {
v = Integer.valueOf(c, 16);
} catch (NumberFormatException nfx) {
return 0;
}
v = 0xFF000000 | (v & 0xFFFFFF);
}
}
return v;
}
public int getBackgroundARGBDay() {
return bgcolorday;
}
public int getBackgroundARGBNight() {
return bgcolornight;
}
}
@@ -20,6 +20,10 @@ public interface HDPerspectiveState {
* Get current block data
*/
int getBlockData();
/**
* Get current block render data
*/
int getBlockRenderData();
/**
* Get direction of last block step
*/
@@ -22,6 +22,7 @@ import org.dynmap.Log;
import org.dynmap.MapManager;
import org.dynmap.MapTile;
import org.dynmap.MapType;
import org.dynmap.MapType.ImageFormat;
import org.dynmap.TileHashManager;
import org.dynmap.debug.Debug;
import org.dynmap.utils.MapIterator.BlockStep;
@@ -79,7 +80,9 @@ public class IsoHDPerspective implements HDPerspective {
private static final int CHEST_BLKTYPEID = 54;
private static final int FENCE_BLKTYPEID = 85;
private static final int REDSTONE_BLKTYPEID = 55;
private static final int IRONFENCE_BLKTYPEID = 101;
private static final int GLASSPANE_BLKTYPEID = 102;
private static final int FENCEGATE_BLKTYPEID = 107;
private enum ChestData {
SINGLE_WEST, SINGLE_SOUTH, SINGLE_EAST, SINGLE_NORTH, LEFT_WEST, LEFT_SOUTH, LEFT_EAST, LEFT_NORTH, RIGHT_WEST, RIGHT_SOUTH, RIGHT_EAST, RIGHT_NORTH
};
@@ -95,6 +98,7 @@ public class IsoHDPerspective implements HDPerspective {
private class OurPerspectiveState implements HDPerspectiveState {
int blocktypeid = 0;
int blockdata = 0;
int blockrenderdata = -1;
int lastblocktypeid = 0;
Vector3D top, bottom;
int px, py;
@@ -133,39 +137,51 @@ public class IsoHDPerspective implements HDPerspective {
mapiter = mi;
this.isnether = isnether;
}
private final void updateSemitransparentLight() {
BlockStep [] steps = { BlockStep.Y_PLUS, BlockStep.X_MINUS, BlockStep.X_PLUS,
BlockStep.Z_MINUS, BlockStep.Z_PLUS };
emitlevel = skylevel = 0;
for(BlockStep s : steps) {
mapiter.stepPosition(s);
int v = mapiter.getBlockEmittedLight();
if(v > emitlevel) emitlevel = v;
v = mapiter.getBlockSkyLight();
if(v > skylevel) skylevel = v;
mapiter.unstepPosition(s);
}
}
/**
* Update sky and emitted light
*/
private final void updateLightLevel() {
/* Look up transparency for current block */
BlockTransparency bt = HDTextureMap.getTransparency(blocktypeid);
if(bt == BlockTransparency.TRANSPARENT) {
skylevel = mapiter.getBlockSkyLight();
emitlevel = mapiter.getBlockEmittedLight();
}
else if(HDTextureMap.getTransparency(lastblocktypeid) != BlockTransparency.SEMITRANSPARENT) {
mapiter.unstepPosition(laststep); /* Back up to block we entered on */
if(mapiter.getY() < 128) {
emitlevel = mapiter.getBlockEmittedLight();
skylevel = mapiter.getBlockSkyLight();
} else {
emitlevel = 0;
skylevel = 15;
}
mapiter.stepPosition(laststep);
}
else {
mapiter.unstepPosition(laststep); /* Back up to block we entered on */
if(mapiter.getY() < 128) {
mapiter.stepPosition(BlockStep.Y_PLUS); /* Look above */
emitlevel = mapiter.getBlockEmittedLight();
skylevel = mapiter.getBlockSkyLight();
mapiter.stepPosition(BlockStep.Y_MINUS);
} else {
emitlevel = 0;
skylevel = 15;
}
mapiter.stepPosition(laststep);
switch(bt) {
case TRANSPARENT:
skylevel = mapiter.getBlockSkyLight();
emitlevel = mapiter.getBlockEmittedLight();
break;
case OPAQUE:
if(HDTextureMap.getTransparency(lastblocktypeid) != BlockTransparency.SEMITRANSPARENT) {
mapiter.unstepPosition(laststep); /* Back up to block we entered on */
if(mapiter.getY() < 128) {
emitlevel = mapiter.getBlockEmittedLight();
skylevel = mapiter.getBlockSkyLight();
} else {
emitlevel = 0;
skylevel = 15;
}
mapiter.stepPosition(laststep);
}
else {
mapiter.unstepPosition(laststep); /* Back up to block we entered on */
updateSemitransparentLight();
mapiter.stepPosition(laststep);
}
break;
case SEMITRANSPARENT:
updateSemitransparentLight();
break;
}
}
/**
@@ -193,6 +209,10 @@ public class IsoHDPerspective implements HDPerspective {
* Get current block data
*/
public final int getBlockData() { return blockdata; }
/**
* Get current block render data
*/
public final int getBlockRenderData() { return blockrenderdata; }
/**
* Get direction of last block step
*/
@@ -320,20 +340,25 @@ public class IsoHDPerspective implements HDPerspective {
}
private int generateFenceBlockData(MapIterator mapiter) {
int blockdata = 0;
int id;
/* Check north */
if(mapiter.getBlockTypeIDAt(BlockStep.X_MINUS) == FENCE_BLKTYPEID) { /* Fence? */
id = mapiter.getBlockTypeIDAt(BlockStep.X_MINUS);
if((id == FENCE_BLKTYPEID) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
blockdata |= 1;
}
/* Look east */
if(mapiter.getBlockTypeIDAt(BlockStep.Z_MINUS) == FENCE_BLKTYPEID) { /* Fence? */
id = mapiter.getBlockTypeIDAt(BlockStep.Z_MINUS);
if((id == FENCE_BLKTYPEID) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
blockdata |= 2;
}
/* Look south */
if(mapiter.getBlockTypeIDAt(BlockStep.X_PLUS) == FENCE_BLKTYPEID) { /* Fence? */
id = mapiter.getBlockTypeIDAt(BlockStep.X_PLUS);
if((id == FENCE_BLKTYPEID) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
blockdata |= 4;
}
/* Look west */
if(mapiter.getBlockTypeIDAt(BlockStep.Z_PLUS) == FENCE_BLKTYPEID) { /* Fence? */
id = mapiter.getBlockTypeIDAt(BlockStep.Z_PLUS);
if((id == FENCE_BLKTYPEID) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
blockdata |= 8;
}
return blockdata;
@@ -443,6 +468,42 @@ public class IsoHDPerspective implements HDPerspective {
}
return 0;
}
/**
* Generate block render data for glass pane and iron fence.
* - bit 0 = X-minus axis
* - bit 1 = Z-minus axis
* - bit 2 = X-plus axis
* - bit 3 = Z-plus axis
*
* @param mapiter - iterator
* @param typeid - ID of our material (test is for adjacent material OR nontransparent)
* @return
*/
private int generateIronFenceGlassBlockData(MapIterator mapiter, int typeid) {
int blockdata = 0;
int id;
/* Check north */
id = mapiter.getBlockTypeIDAt(BlockStep.X_MINUS);
if((id == typeid) || ((id > 0) && (HDTextureMap.getTransparency(id) == BlockTransparency.OPAQUE))) {
blockdata |= 1;
}
/* Look east */
id = mapiter.getBlockTypeIDAt(BlockStep.Z_MINUS);
if((id == typeid) || ((id > 0) && (HDTextureMap.getTransparency(id) == BlockTransparency.OPAQUE))) {
blockdata |= 2;
}
/* Look south */
id = mapiter.getBlockTypeIDAt(BlockStep.X_PLUS);
if((id == typeid) || ((id > 0) && (HDTextureMap.getTransparency(id) == BlockTransparency.OPAQUE))) {
blockdata |= 4;
}
/* Look west */
id = mapiter.getBlockTypeIDAt(BlockStep.Z_PLUS);
if((id == typeid) || ((id > 0) && (HDTextureMap.getTransparency(id) == BlockTransparency.OPAQUE))) {
blockdata |= 8;
}
return blockdata;
}
private final boolean handleSubModel(short[] model, HDShaderState[] shaderstate, boolean[] shaderdone) {
boolean firststep = true;
@@ -473,22 +534,27 @@ public class IsoHDPerspective implements HDPerspective {
skiptoair = false;
}
else if(nonairhit || (blocktypeid != 0)) {
blockdata = mapiter.getBlockData();
switch(blocktypeid) {
case FENCE_BLKTYPEID: /* Special case for fence - need to fake data so we can render properly */
blockdata = generateFenceBlockData(mapiter);
blockrenderdata = generateFenceBlockData(mapiter);
break;
case CHEST_BLKTYPEID: /* Special case for chest - need to fake data so we can render */
blockdata = generateChestBlockData(mapiter);
blockrenderdata = generateChestBlockData(mapiter);
break;
case REDSTONE_BLKTYPEID: /* Special case for redstone - fake data for wire pattern */
blockdata = generateRedstoneWireBlockData(mapiter);
blockrenderdata = generateRedstoneWireBlockData(mapiter);
break;
case IRONFENCE_BLKTYPEID: /* Special case for iron fence - fake data for adjacent block info */
case GLASSPANE_BLKTYPEID: /* Special case for glass pane - fake data for adjacent block info */
blockrenderdata = generateIronFenceGlassBlockData(mapiter, blocktypeid);
break;
default:
blockdata = mapiter.getBlockData();
break;
blockrenderdata = -1;
break;
}
/* Look up to see if block is modelled */
short[] model = scalemodels.getScaledModel(blocktypeid, blockdata);
short[] model = scalemodels.getScaledModel(blocktypeid, blockdata, blockrenderdata);
if(model != null) {
return handleSubModel(model, shaderstate, shaderdone);
}
@@ -733,27 +799,27 @@ public class IsoHDPerspective implements HDPerspective {
Vector3D blocks[] = new Vector3D[] { new Vector3D(), new Vector3D() };
/* Get ordered point - 0=minX,Y,Z, 1=maxX,Y,Z */
if(loc0.getBlockX() < loc1.getBlockX()) {
blocks[0].x = loc0.getBlockX();
blocks[0].x = loc0.getBlockX() - 1;
blocks[1].x = loc1.getBlockX() + 1;
}
else {
blocks[0].x = loc1.getBlockX();
blocks[0].x = loc1.getBlockX() - 1;
blocks[1].x = loc0.getBlockX() + 1;
}
if(loc0.getBlockY() < loc1.getBlockY()) {
blocks[0].y = loc0.getBlockY();
blocks[0].y = loc0.getBlockY() - 1;
blocks[1].y = loc1.getBlockY() + 1;
}
else {
blocks[0].y = loc1.getBlockY();
blocks[0].y = loc1.getBlockY() - 1;
blocks[1].y = loc0.getBlockY() + 1;
}
if(loc0.getBlockZ() < loc1.getBlockZ()) {
blocks[0].z = loc0.getBlockZ();
blocks[0].z = loc0.getBlockZ() - 1;
blocks[1].z = loc1.getBlockZ() + 1;
}
else {
blocks[0].z = loc1.getBlockZ();
blocks[0].z = loc1.getBlockZ() - 1;
blocks[1].z = loc0.getBlockZ() + 1;
}
Vector3D corner = new Vector3D();
@@ -965,6 +1031,9 @@ public class IsoHDPerspective implements HDPerspective {
DynmapBufferedImage dayim[] = new DynmapBufferedImage[numshaders];
int[][] argb_buf = new int[numshaders][];
int[][] day_argb_buf = new int[numshaders][];
boolean isjpg[] = new boolean[numshaders];
int bgday[] = new int[numshaders];
int bgnight[] = new int[numshaders];
for(int i = 0; i < numshaders; i++) {
HDShader shader = shaderstate[i].getShader();
@@ -979,6 +1048,9 @@ public class IsoHDPerspective implements HDPerspective {
dayim[i] = DynmapBufferedImage.allocateBufferedImage(tileWidth, tileHeight);
day_argb_buf[i] = dayim[i].argb_buf;
}
isjpg[i] = shaderstate[i].getMap().getImageFormat() != ImageFormat.FORMAT_PNG;
bgday[i] = shaderstate[i].getMap().getBackgroundARGBDay();
bgnight[i] = shaderstate[i].getMap().getBackgroundARGBNight();
}
/* Create perspective state object */
@@ -990,6 +1062,7 @@ public class IsoHDPerspective implements HDPerspective {
double ybase = tile.ty * tileHeight;
boolean shaderdone[] = new boolean[numshaders];
boolean rendered[] = new boolean[numshaders];
for(int x = 0; x < tileWidth; x++) {
ps.px = x;
for(int y = 0; y < tileHeight; y++) {
@@ -1012,10 +1085,20 @@ public class IsoHDPerspective implements HDPerspective {
rendered[i] = true;
}
shaderstate[i].getRayColor(rslt, 0);
argb_buf[i][(tileHeight-y-1)*tileWidth + x] = rslt.getARGB();
if(isjpg[i] && rslt.isTransparent()) {
argb_buf[i][(tileHeight-y-1)*tileWidth + x] = bgnight[i];
}
else {
argb_buf[i][(tileHeight-y-1)*tileWidth + x] = rslt.getARGB();
}
if(day_argb_buf[i] != null) {
shaderstate[i].getRayColor(rslt, 1);
day_argb_buf[i][(tileHeight-y-1)*tileWidth + x] = rslt.getARGB();
if(isjpg[i] && rslt.isTransparent()) {
day_argb_buf[i][(tileHeight-y-1)*tileWidth + x] = bgday[i];
}
else {
day_argb_buf[i][(tileHeight-y-1)*tileWidth + x] = rslt.getARGB();
}
}
}
}
@@ -74,6 +74,7 @@ public class TexturePack {
private static final int BLOCKINDEX_BLANK = -1;
private static final int BLOCKINDEX_GRASSMASK = 38;
private static final int BLOCKINDEX_PISTONSIDE = 108;
private static final int BLOCKINDEX_GLASSPANETOP = 148;
private static final int BLOCKINDEX_REDSTONE_NSEW_TONE = 164;
private static final int BLOCKINDEX_REDSTONE_EW_TONE = 165;
private static final int BLOCKINDEX_REDSTONE_NSEW = 180;
@@ -84,7 +85,8 @@ public class TexturePack {
private static final int BLOCKINDEX_MOVINGLAVA = 260;
private static final int BLOCKINDEX_PISTONEXTSIDE = 261;
private static final int BLOCKINDEX_PISTONSIDE_EXT = 262;
private static final int MAX_BLOCKINDEX = 262;
private static final int BLOCKINDEX_PANETOP_X = 263;
private static final int MAX_BLOCKINDEX = 263;
private static final int BLOCKTABLELEN = MAX_BLOCKINDEX+1;
private static class LoadedImage {
@@ -120,12 +122,15 @@ public class TexturePack {
private List<Integer> blockids;
private int databits;
private BlockTransparency bt;
private boolean userender;
private static HDTextureMap[] texmaps;
private static BlockTransparency transp[];
private static boolean userenderdata[];
private static void initializeTable() {
texmaps = new HDTextureMap[16*BLOCKTABLELEN];
transp = new BlockTransparency[BLOCKTABLELEN];
userenderdata = new boolean[BLOCKTABLELEN];
HDTextureMap blank = new HDTextureMap();
for(int i = 0; i < texmaps.length; i++)
texmaps[i] = blank;
@@ -136,6 +141,7 @@ public class TexturePack {
private HDTextureMap() {
blockids = Collections.singletonList(Integer.valueOf(0));
databits = 0xFFFF;
userender = false;
faces = new int[] { BLOCKINDEX_BLANK, BLOCKINDEX_BLANK, BLOCKINDEX_BLANK, BLOCKINDEX_BLANK, BLOCKINDEX_BLANK, BLOCKINDEX_BLANK };
for(int i = 0; i < texmaps.length; i++) {
@@ -143,11 +149,12 @@ public class TexturePack {
}
}
public HDTextureMap(List<Integer> blockids, int databits, int[] faces, BlockTransparency trans) {
public HDTextureMap(List<Integer> blockids, int databits, int[] faces, BlockTransparency trans, boolean userender) {
this.faces = faces;
this.blockids = blockids;
this.databits = databits;
this.bt = trans;
this.userender = userender;
}
public void addToTable() {
@@ -159,11 +166,15 @@ public class TexturePack {
}
}
transp[blkid] = bt; /* Transparency is only blocktype based right now */
userenderdata[blkid] = userender; /* Ditto for using render data */
}
}
public static HDTextureMap getMap(int blkid, int blkdata) {
return texmaps[(blkid<<4) + blkdata];
public static HDTextureMap getMap(int blkid, int blkdata, int blkrenderdata) {
if(userenderdata[blkid])
return texmaps[(blkid<<4) + blkrenderdata];
else
return texmaps[(blkid<<4) + blkdata];
}
public static BlockTransparency getTransparency(int blkid) {
@@ -424,6 +435,15 @@ public class TexturePack {
terrain_argb[BLOCKINDEX_PISTONSIDE][native_scale*i + j];
}
}
/* Build glass pane top in NSEW config (we use model to clip it) */
terrain_argb[BLOCKINDEX_PANETOP_X] = new int[native_scale*native_scale];
System.arraycopy(terrain_argb[BLOCKINDEX_GLASSPANETOP], 0, terrain_argb[BLOCKINDEX_PANETOP_X], 0, native_scale*native_scale);
for(i = native_scale*7/16; i < native_scale*9/16; i++) {
for(j = 0; j < native_scale; j++) {
terrain_argb[BLOCKINDEX_PANETOP_X][native_scale*i + j] = terrain_argb[BLOCKINDEX_PANETOP_X][native_scale*j + i];
}
}
img.flush();
}
@@ -704,6 +724,7 @@ public class TexturePack {
line = line.substring(6);
BlockTransparency trans = BlockTransparency.OPAQUE;
String[] args = line.split(",");
boolean userenderdata = false;
for(String a : args) {
String[] av = a.split("=");
if(av.length < 2) continue;
@@ -759,12 +780,15 @@ public class TexturePack {
Log.severe("Texture mapping has invalid transparency setting - " + av[1] + " - line " + rdr.getLineNumber() + " of " + txtname);
}
}
else if(av[0].equals("userenderdata")) {
userenderdata = av[1].equals("true");
}
}
/* If no data bits, assume all */
if(databits < 0) databits = 0xFFFF;
/* If we have everything, build block */
if(blkids.size() > 0) {
HDTextureMap map = new HDTextureMap(blkids, databits, faces, trans);
HDTextureMap map = new HDTextureMap(blkids, databits, faces, trans, userenderdata);
map.addToTable();
cnt++;
}
@@ -795,7 +819,7 @@ public class TexturePack {
*/
public final void readColor(final HDPerspectiveState ps, final MapIterator mapiter, final Color rslt, final int blkid, final int lastblocktype, final boolean biome_shaded) {
int blkdata = ps.getBlockData();
HDTextureMap map = HDTextureMap.getMap(blkid, blkdata);
HDTextureMap map = HDTextureMap.getMap(blkid, blkdata, ps.getBlockRenderData());
BlockStep laststep = ps.getLastBlockStep();
int textid = map.faces[laststep.ordinal()]; /* Get index of texture source */
if(textid < 0) {

Some files were not shown because too many files have changed in this diff Show More