Compare commits

..

174 Commits

Author SHA1 Message Date
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 4c50bd502c Fix typo in setMarkerSetLabel() API 2011-09-09 01:01:02 +08:00
Mike Primm 996343c5a3 Add /dmarker addicon command 2011-09-08 11:42:28 +08:00
Mike Primm 2f53b72779 Update jquery to 1.6.3 2011-09-08 11:06:20 +08: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 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 9da159f842 Add 'hidebydefault' option for Markers layers 2011-09-08 00:23:38 +08: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 7bee1dcae5 Fix markers being left on world changes 2011-09-06 09:05:25 +08: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 e0fcca4b7f Fix single map render message on single map render of day/night worlds 2011-09-06 04:41:08 +08:00
Mike Primm f99700d863 Fix double-quoted strings in parameters 2011-09-06 02:36:37 +08: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 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 f62d46cfbd Add hidebydefault setting to playermarkers component too 2011-08-26 14:23:32 +08:00
Mike Primm 3d385106e9 Add hidebydefault setting to playermarkers component too 2011-08-26 01:22:03 -05:00
Mike Primm bc357dd188 Handle multiple instances of same component type (regions) 2011-08-26 13:57:05 +08:00
Mike Primm c353d9aae6 Add hidebydefault option for regions layers 2011-08-26 13:57:05 +08: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 106e470898 Add playermarkers to hide/show-able layer group 2011-08-26 06:34:37 +08:00
Mike Primm 59b095628d Add control for hide/show of component layers (only regions for now) 2011-08-26 06:34:37 +08: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 d9ad51edd6 Use towns list in Towny worlds/* files to get valid towns (old towns
still in towns/* directory)
2011-08-26 03:59:35 +08:00
Mike Primm 316440a4e0 Disable IOImage cache use for image loads 2011-08-26 03:59:35 +08: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 04cc6aba43 Towny fixes - multiple areas on multiple worlds per town 2011-08-25 11:15:26 +08:00
Mike Primm 627cef720c Towny fixes - multiple areas on multiple worlds per town 2011-08-24 22:11:31 -05:00
Mike Primm ff4b036c6a Fix accessory face mixing 2011-08-24 14:25:42 +08:00
Mike Primm 586c41d23c Fix accessory face mixing 2011-08-24 01:23:05 -05:00
Mike Primm 76c8bc861d Merge remote branch 'upstream/master' 2011-08-24 01:02:47 -05:00
Mike Primm da32c2f0bd Add server-side generation of faces : fixes face accessory issues, IE8 2011-08-24 00:51:54 -05:00
Mike Primm 9564bd8a89 Add customstyle settings for per-region style, nation style for Towny, lots for Residence 2011-08-23 11:17:40 +08:00
Mike Primm 074952265f Add customstyle settings for per-region style, nation style for Towny, lots for Residence 2011-08-22 22:16:38 -05:00
Mike Primm 669d52f01b Merge remote branch 'upstream/master' 2011-08-22 20:34:34 -05:00
Mike Primm c37680b62c Add support for superperms/PermissionsBukkit/whatever-you-wanna-call-it 2011-08-23 08:21:38 +08:00
Mike Primm fae27f4cea Add support for superperms/PermissionsBukkit/whatever-you-wanna-call-it 2011-08-22 19:21:03 -05:00
Mike Primm 3b7fcc67ad Fix regionstyle attributes for region outlines and fill 2011-08-22 23:32:19 +08:00
Mike Primm 75d7068fbf Fix regionstyle attributes for region outlines and fill 2011-08-22 10:31:27 -05:00
Mike Primm 0ebabf5b61 First pass of Towny region support 2011-08-22 14:19:54 +08:00
Mike Primm d349a76660 First pass of Towny region support 2011-08-22 01:17:28 -05:00
Mike Primm 7e12574bd8 Add support in regions component for 'hiddenregions' (blacklist for regions) 2011-08-22 08:19:38 +08:00
Mike Primm 1284a8a6ed Merge remote branch 'upstream/master' 2011-08-21 19:00:14 -05:00
Mike Primm 8e22e40c16 Add support in regions component for 'hiddenregions' (blacklist for regions) 2011-08-21 18:58:38 -05:00
Mike Primm 929ca8911e Fix naming on Residence regions, make infowindow setting control popup content again 2011-08-22 04:58:21 +08:00
Mike Primm 82b0f2c4cd Fix naming on Residence regions, make infowindow setting control popup content again 2011-08-21 15:57:21 -05:00
Mike Primm 6e5482466d Switch chunkgenerate to onChunkPopulate event: chunk is better "cooked" by then 2011-08-21 10:33:09 +08:00
Mike Primm 45369006c3 Switch chunkgenerate to onChunkPopulate event: chunk is better "cooked" by then 2011-08-20 21:31:14 -05:00
Mike Primm 58d359fc1d Add setting for progressloginterval 2011-08-21 05:46:05 +08:00
Mike Primm c5c136a30d Add setting for progressloginterval 2011-08-20 16:45:21 -05:00
Mike Primm c327b98b97 Add progressloginterval setting - control how often progress messages done 2011-08-21 05:43:43 +08:00
Mike Primm 3f3ccf5344 Add progressloginterval setting - control how often progress messages done 2011-08-20 16:43:18 -05:00
Mike Primm 9b191bb3ab Add 'explosion' update trigger, add updated tile queue accelerator (to speed up processing if queue gets above a given threshold) 2011-08-21 05:31:07 +08:00
Mike Primm 43df59a88c Make sure we can clean up event listeners during reload (make /dynmap reload work) 2011-08-21 05:30:52 +08:00
Mike Primm 972d9b2ab7 Add 'explosion' update trigger, add updated tile queue accelerator (to speed up processing if queue gets above a given threshold) 2011-08-20 16:28:37 -05:00
Mike Primm 5ed6cf830b Make sure we can clean up event listeners during reload (make /dynmap reload work) 2011-08-20 15:21:39 -05:00
Mike Primm e8e4aa67ce Fix boundary condition that was causing some missed tiles on chunk triggers 2011-08-20 11:38:55 +08:00
Mike Primm e643292a7e Fix boundary condition that was causing some missed tiles on chunk triggers 2011-08-19 22:38:08 -05:00
Mike Primm f0a8300632 Merge remote branch 'upstream/master' 2011-08-19 21:36:35 -05:00
Mike Primm f24141587f Fix Residence region output in JSON mode 2011-08-20 00:29:55 +08:00
Mike Primm e2616c9159 Fix Residence region output in JSON mode 2011-08-19 11:27:38 -05:00
Mike Primm 83a9ff80d0 Add 'parallelrendercnt' - multi-core fullrender support (experimental) 2011-08-18 12:14:56 +08:00
Mike Primm fd2085b511 Add 'parallelrendercnt' - multi-core fullrender support (experimental) 2011-08-17 23:14:05 -05:00
Mike Primm ae9d1fde90 Turn off using temp file in ImageIO - our images are too small to do that 2011-08-17 10:26:07 +08:00
Mike Primm 7fd2d5bf10 Turn off using temp file in ImageIO - our images are too small to do that 2011-08-16 21:25:16 -05:00
Mike Primm e479d04c85 Merge remote branch 'origin/master' 2011-08-16 18:19:43 -05:00
Mike Primm 55dc6397e1 Fix logic on scroll buttons 2011-08-17 01:00:32 +08:00
Mike Primm d5d01cf5af Fix logic on scroll buttons 2011-08-16 11:59:08 -05:00
Mike Primm 98b3bdfde3 Add triggered update queue length to /dynmap stats 2011-08-16 13:48:00 +08:00
Mike Primm 4be423cfb8 Add triggered update queue length to /dynmap stats 2011-08-16 00:46:41 -05:00
Mike Primm 477a7d13de Add multiple quality levels for JPG encoding - adjust default to 0.85 2011-08-16 12:32:01 +08:00
Mike Primm 4616f6a5be Fix window resize exception - Leaflet expects 'map' at top level... 2011-08-16 08:08:59 +08:00
Mike Primm 829e1339a8 Change console fullrender to seed from world's center setting, vs 0,0,0 2011-08-15 21:10:44 +08:00
Mike Primm c9494a312d Fix exception if initial update has stale logoff for player+chat 2011-08-15 21:10:44 +08:00
Mike Primm 5b7ad0f4c9 Fix IE exceptions from debug code, canvas calls 2011-08-15 10:10:08 +08:00
Mike Primm 55720cfd4d Avoid exception try-catch on nominal path 2011-08-15 07:25:18 +08:00
Mike Primm 4cb5b9a956 Fix initial zoomout processing (unnecessary updates), extra tile invalidates 2011-08-15 07:25:17 +08:00
Mike Primm 6860d8952f More invalidate tightening up 2011-08-15 04:49:58 +08:00
Mike Primm 1aa3d07e6a Fix break in namedTile during integrate of updated Leaflet 2011-08-15 04:49:42 +08:00
Mike Primm 0c9cfedb6e Handle tile invalidates better for bigger-than-one-block cases (chunks) 2011-08-15 04:49:42 +08:00
Mike Primm 042544f22e Reapply updated Leaflet patch 2011-08-14 14:59:53 +08:00
Mike Primm f5d5171f86 Improve scaling of memory use with large numbers of tiles, prep for suspend/resume support 2011-08-14 14:27:20 +08:00
Mike Primm fb366ce36b Update rail and ladder models - work better with non-default textures 2011-08-14 13:13:24 +08:00
Mike Primm 9f4df9a76e Switch to using continuousWorld option in newer Leaflet - saves on override 2011-08-14 13:12:58 +08:00
Mike Primm 0bc760230f Update Leaflet (lots of fixes) 2011-08-14 13:12:58 +08:00
Mike Primm c524c39901 Add pistonmoved event handling, full rendering for piston and extension 2011-08-14 10:36:47 +08:00
Mike Primm 3da03c978b Add model for redstone repeater 2011-08-13 12:32:09 +08:00
Mike Primm 4316e1f3e4 Add support for single map render via /dynmap fullrender world:map, /dynmap radiusrender radius mapname 2011-08-13 11:48:26 +08:00
Mike Primm b800984e3f Fix alpha-blending on scaled textures, and mask textures 2011-08-13 11:03:16 +08:00
Mike Primm 17c2072b82 Fix armor calculation - bring in line with funky method used in MC UI 2011-08-13 05:36:48 +08:00
Mike Primm d008548306 Add support for JPEG encoding option for HDMaps 2011-08-12 14:48:52 +08:00
mikeprimm 49b38c10b7 Merge pull request #401 from mikeprimm/master
Fix typo in 'sendposition' setting - allow both 'sendposition' and 'sendpositon' in case someone worked around it
2011-08-10 20:38:52 -07:00
Mike Primm 053bd0e561 Fix typo in 'sendposition' setting - allow both 'sendposition' and 'sendpositon' in case someone worked around it 2011-08-10 22:37:41 -05:00
mikeprimm 4d3931709b Merge pull request #400 from mikeprimm/master
Add support for selectively hiding portions of worlds (opposite of visibilitylimits)
2011-08-10 20:18:20 -07:00
Mike Primm 166a5272fb Add support for selectively hiding portions of world (hiddenlimits) 2011-08-10 22:15:18 -05:00
mikeprimm 7e8e0411d9 Merge pull request #399 from mikeprimm/master
Add poly2d region support back to WorldGuard support
2011-08-10 18:48:36 -07:00
Mike Primm 6616b3eae5 Add poly2d region support back to WorldGuard 2011-08-10 20:47:14 -05:00
mikeprimm 0c99a6e7f4 Merge pull request #398 from mikeprimm/master
IE8 doesn't have indexOf, if you can believe that....
2011-08-10 16:10:35 -07:00
Mike Primm a5e3f36d97 Fix IE8 - missing indexOf(), if you can believe that.... fix is per
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/IndexOf
2011-08-10 18:07:59 -05:00
FrozenCow f5f9c3bb31 Use shift, not pop, for queue. 2011-08-10 23:32:33 +02:00
FrozenCow 91b9b456b5 Added tile queueing. 2011-08-10 22:39:57 +02:00
mikeprimm 0a60c35be0 Merge pull request #395 from mikeprimm/master
Handle texture packs that do not include all required files
2011-08-10 12:58:30 -07:00
Mike Primm 641406a68e Merge remote branch 'upstream/master' 2011-08-10 14:55:07 -05:00
Mike Primm 334f3d983a Add handling for texture packs that don't provide all needed files -
fall through to standard pack when needed
2011-08-10 14:54:25 -05:00
FrozenCow 04c3a432e1 Added extra configuration for maven-assembly to fix directory-permissions. 2011-08-10 15:54:19 +02:00
FrozenCow fdbce8df36 Only handle cuboid regions. 2011-08-10 15:14:48 +02:00
mikeprimm 81d68d5ac9 Merge pull request #391 from mikeprimm/master
Add permissions info to plugin.yml
2011-08-09 22:55:24 -07:00
Mike Primm 6383a7ef22 Add permissions info to plugin.yml 2011-08-10 00:52:55 -05:00
mikeprimm 1fcef60768 Merge pull request #390 from mikeprimm/master
Model for cactus - fix seams on edges, since cactus aren't quite full block
2011-08-09 18:46:19 -07:00
Mike Primm 3a38b44e79 Make model for cactus - they aren't quite full block 2011-08-09 20:45:08 -05:00
mikeprimm 82b7a87a7c Merge pull request #389 from mikeprimm/master
Check for raw biome lookup overflows - prevent array exceptions on some worlds
2011-08-08 22:20:06 -07:00
Mike Primm 48ba43aae5 Check for overflow on biome lookup - prevent exceptions on some worlds 2011-08-09 00:18:38 -05:00
Mike Primm 89525c38d5 Merge remote branch 'origin/master' 2011-08-08 23:41:15 -05:00
mikeprimm d468abe5a1 Merge pull request #387 from mikeprimm/master
Add id=3 leaves: apparently, alpha-map leaves migrated to this value
2011-08-08 07:21:27 -07:00
Mike Primm 9c44843884 Add leaves id=3: apparently alpha-map leaves migrated to this? 2011-08-08 09:20:10 -05:00
mikeprimm 2b26bdd5a4 Merge pull request #384 from mikeprimm/master
Add leafid + 12 values - not sure if needed, but no harm in it (for 0.20.1)
2011-08-07 21:01:13 -07:00
Mike Primm a76a734e16 Add mappings for leaves for +12 - not sure if needed, but can't hurt 2011-08-07 22:58:51 -05:00
mikeprimm 4fd3382493 Merge pull request #383 from mikeprimm/master
Fix subblock rendering of scaled down models (esp flat ones like rails, redstone) (for 0.20.1)
2011-08-07 20:12:43 -07:00
Mike Primm 4209a2c54d Fix subblock rendering of flat, scaled-down models (for 0.20.1) 2011-08-07 22:11:00 -05:00
mikeprimm 154057adcc Merge pull request #381 from mikeprimm/master
Handle leaf fade processing flag values in texture mapping
2011-08-07 08:35:17 -07:00
Mike Primm a641d2d831 Handle fade-processing bit values on leaves (N, N+4, N+8) 2011-08-07 10:29:54 -05:00
FrozenCow cd7e04fec3 Added another data-value (8) for leaves that occurs in parts of the trees in Skylands. 2011-08-07 16:55:22 +02:00
FrozenCow 4381d5838c Changed version to 0.21. 2011-08-06 20:04:53 +02:00
163 changed files with 5756 additions and 928 deletions
+25 -1
View File
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.dynmap</groupId>
<artifactId>dynmap</artifactId>
<version>0.20</version>
<version>0.22</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>
@@ -29,6 +47,12 @@
<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>
+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>
+25 -17
View File
@@ -2,6 +2,7 @@ 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 {
@@ -10,27 +11,34 @@ public class Armor {
* We rely on getArmorContents() to return 4 armor pieces in the order
* of: boots, pants, chest, helmet
*/
private static final double armorPoints[] = {1.5, 3.0, 4.0, 1.5};
private static final int armorPoints[] = {3, 6, 8, 3};
public static final int getArmorPoints(Player player) {
int currentDurability = 0;
int baseDurability = 0;
double baseArmorPoints = 0;
ItemStack inventory[] = player.getInventory().getArmorContents();
for(int i=0;i<inventory.length;i++) {
if(inventory[i] == null)
continue;
Material m = inventory[i].getType();
if(m == null)
continue;
final short maxDurability = m.getMaxDurability();
if(maxDurability < 0)
continue;
final short durability = inventory[i].getDurability();
baseDurability += maxDurability;
currentDurability += maxDurability - durability;
baseArmorPoints += armorPoints[i];
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];
}
return (int)Math.round(2*baseArmorPoints*currentDurability/baseDurability);
int ap = 0;
if(baseDurability > 0)
ap = ((baseArmorPoints - 1) * currentDurability) / baseDurability + 1;
return ap;
}
}
+14 -12
View File
@@ -12,10 +12,14 @@ public class AsynchronousQueue<T> {
private Set<T> set = new HashSet<T>();
private Handler<T> handler;
private int dequeueTime;
public AsynchronousQueue(Handler<T> handler, int dequeueTime) {
private int accelDequeueTime;
private int accelDequeueThresh;
public AsynchronousQueue(Handler<T> handler, int dequeueTime, int accelDequeueThresh, int accelDequeueTime) {
this.handler = handler;
this.dequeueTime = dequeueTime;
this.accelDequeueTime = accelDequeueTime;
this.accelDequeueThresh = accelDequeueThresh;
}
public boolean push(T t) {
@@ -30,15 +34,10 @@ public class AsynchronousQueue<T> {
private T pop() {
synchronized (lock) {
try {
T t = queue.removeFirst();
if (!set.remove(t)) {
// This should never happen.
}
return t;
} catch (NoSuchElementException e) {
return null;
}
T t = queue.pollFirst();
if(t != null)
set.remove(t);
return t;
}
}
@@ -88,7 +87,10 @@ public class AsynchronousQueue<T> {
if (t != null) {
handler.handle(t);
}
sleep(dequeueTime);
if(set.size() >= accelDequeueThresh)
sleep(accelDequeueTime);
else
sleep(dequeueTime);
}
} catch (Exception ex) {
+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;
@@ -42,7 +42,9 @@ 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());
if(configuration.getBoolean("sendpositon", true) && (pworld != null) && pworld.sendposition) {
/* 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) {
s(jp, "world", p.getWorld().getName());
s(jp, "x", pl.getX());
s(jp, "y", pl.getY());
File diff suppressed because it is too large Load Diff
+37 -11
View File
@@ -1,12 +1,13 @@
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.kzedmap.KzedMap;
import org.dynmap.utils.DynmapBufferedImage;
import org.dynmap.utils.FileLockManager;
import org.dynmap.utils.MapChunkCache;
@@ -32,6 +33,7 @@ public class DynmapWorld {
public ConfigurationNode configuration;
public List<Location> seedloc;
public List<MapChunkCache.VisibilityLimit> visibility_limits;
public List<MapChunkCache.VisibilityLimit> hidden_limits;
public AutoGenerateOption do_autogenerate;
public MapChunkCache.HiddenChunkStyle hiddenchunkstyle;
public int servertime;
@@ -104,11 +106,21 @@ public class DynmapWorld {
}
}
private static final String COORDSTART = "-0123456789";
private static class PNGFileFilter implements FilenameFilter {
String prefix;
public PNGFileFilter(String pre) { prefix = pre; }
String suffix;
public PNGFileFilter(String pre, MapType.ImageFormat fmt) {
if((pre != null) && (pre.length() > 0))
prefix = pre;
suffix = "." + fmt.getFileExt();
}
public boolean accept(File f, String n) {
if(n.endsWith(".png") && n.startsWith(prefix)) {
if(n.endsWith(suffix)) {
if((prefix != null) && (!n.startsWith(prefix)))
return false;
if((prefix == null) && (COORDSTART.indexOf(n.charAt(0)) < 0))
return false;
File fn = new File(f, n);
return fn.isFile();
}
@@ -141,11 +153,13 @@ public class DynmapWorld {
boolean neg_step_y;
String baseprefix;
int zoomlevel;
int background;
String zoomprefix;
String fnprefix;
String zfnprefix;
int bigworldshift;
boolean isbigmap;
MapType.ImageFormat fmt;
}
public boolean freshenZoomOutFilesByLevel(int zoomlevel) {
@@ -222,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;
@@ -241,17 +255,19 @@ 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;
pd.isbigmap = mt.isBigWorldMap(this);
pd.fmt = mt.getImageFormat();
if(pd.isbigmap) {
if(zoomlevel > 0) {
pd.zoomprefix += "_";
@@ -267,7 +283,7 @@ public class DynmapWorld {
pd.zfnprefix = "z" + pd.fnprefix;
}
maptab.put(p, pd);
maptab.put(p.prefix, pd);
}
}
return maptab;
@@ -282,15 +298,15 @@ public class DynmapWorld {
private String makeFilePath(PrefixData pd, int x, int y, boolean zoomed) {
if(pd.isbigmap)
return pd.baseprefix + "/" + (x >> pd.bigworldshift) + "_" + (y >> pd.bigworldshift) + "/" + (zoomed?pd.zfnprefix:pd.fnprefix) + x + "_" + y + ".png";
return pd.baseprefix + "/" + (x >> pd.bigworldshift) + "_" + (y >> pd.bigworldshift) + "/" + (zoomed?pd.zfnprefix:pd.fnprefix) + x + "_" + y + "." + pd.fmt.getFileExt();
else
return (zoomed?pd.zfnprefix:pd.fnprefix) + "_" + x + "_" + y + ".png";
return (zoomed?pd.zfnprefix:pd.fnprefix) + "_" + x + "_" + y + "." + pd.fmt.getFileExt();
}
private int processZoomDirectory(File dir, PrefixData pd) {
Debug.debug("processZoomDirectory(" + dir.getPath() + "," + pd.baseprefix + ")");
HashMap<String, ProcessTileRec> toprocess = new HashMap<String, ProcessTileRec>();
String[] files = dir.list(new PNGFileFilter(pd.fnprefix));
String[] files = dir.list(new PNGFileFilter(pd.fnprefix, pd.fmt));
if(files == null)
return 0;
for(String fn : files) {
@@ -418,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);
@@ -434,7 +460,7 @@ public class DynmapWorld {
try {
if(!zf.getParentFile().exists())
zf.getParentFile().mkdirs();
FileLockManager.imageIOWrite(zIm, "png", zf);
FileLockManager.imageIOWrite(zIm, pd.fmt, zf);
Debug.debug("Saved zoom-out tile at " + zf.getPath());
} catch (IOException e) {
Debug.error("Failed to save zoom-out tile: " + zf.getName(), e);
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -10,7 +10,7 @@ import org.dynmap.utils.MapChunkCache;
public abstract class MapTile {
protected DynmapWorld world;
public abstract boolean render(MapChunkCache cache);
public abstract boolean render(MapChunkCache cache, String mapname);
public abstract List<DynmapChunk> getRequiredChunks();
public abstract MapTile[] getAdjecentTiles();
@@ -51,4 +51,7 @@ public abstract class MapTile {
public abstract boolean isRawBiomeDataNeeded();
public abstract boolean isBlockTypeDataNeeded();
public abstract int tileOrdinalX();
public abstract int tileOrdinalY();
}
+39 -5
View File
@@ -1,20 +1,47 @@
package org.dynmap;
import java.io.File;
import java.util.List;
import org.bukkit.Location;
import org.dynmap.utils.MapChunkCache;
import org.json.simple.JSONObject;
public abstract class MapType {
public enum ImageFormat {
FORMAT_PNG("png", "png", 0.0f),
FORMAT_JPG75("jpg-q75", "jpg", 0.75f),
FORMAT_JPG80("jpg-q80", "jpg", 0.80f),
FORMAT_JPG85("jpg-q85", "jpg", 0.85f),
FORMAT_JPG("jpg", "jpg", 0.85f),
FORMAT_JPG90("jpg-q90", "jpg", 0.90f),
FORMAT_JPG95("jpg-q95", "jpg", 0.95f),
FORMAT_JPG100("jpg-q100", "jpg", 1.00f);
String id;
String ext;
float qual;
ImageFormat(String id, String ext, float quality) {
this.id = id;
this.ext = ext;
this.qual = quality;
}
public String getID() { return id; }
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);
public abstract MapTile[] getTiles(Location l0, Location l1);
public abstract MapTile[] getAdjecentTiles(MapTile tile);
public abstract List<DynmapChunk> getRequiredChunks(MapTile tile);
public abstract boolean render(MapChunkCache cache, MapTile tile, File outputFile);
public void buildClientConfiguration(JSONObject worldObject, DynmapWorld w) {
}
@@ -33,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();
@@ -41,6 +68,13 @@ public abstract class MapType {
public abstract boolean isBigWorldMap(DynmapWorld w);
/* Return number of zoom levels needed by this map (before extra levels from extrazoomout) */
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,94 @@
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 */
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;
}
if(api != null) {
/* Clean up API registered with plugin */
plugin.registerMarkerAPI(null);
api.cleanup(this.plugin);
api = null;
}
}
}
+144
View File
@@ -0,0 +1,144 @@
package org.dynmap;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import javax.imageio.ImageIO;
import org.bukkit.entity.Player;
import org.bukkit.event.Event.Type;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.event.player.PlayerLoginEvent;
import org.dynmap.MapType.ImageFormat;
import org.dynmap.debug.Debug;
import org.dynmap.utils.DynmapBufferedImage;
import org.dynmap.utils.FileLockManager;
/**
* Listen for player logins, and process player faces by fetching skins *
*/
public class PlayerFaces {
private DynmapPlugin plugin;
private File facesdir;
private File faces8x8dir;
private File faces16x16dir;
private File faces32x32dir;
private class LoadPlayerImages implements Runnable {
public String playername;
public LoadPlayerImages(String playername) {
this.playername = playername;
}
public void run() {
BufferedImage img = null;
try {
URL url = new URL("http://s3.amazonaws.com/MinecraftSkins/" + playername + ".png");
img = ImageIO.read(url); /* Load skin for player */
} catch (IOException iox) {
Debug.debug("Error loading skin for '" + playername + "' - " + iox);
}
if(img == null) {
try {
InputStream in = getClass().getResourceAsStream("/char.png");
img = ImageIO.read(in); /* Load generic skin for player */
in.close();
} catch (IOException iox) {
Debug.debug("Error loading default skin for '" + playername + "' - " + iox);
}
}
if(img == null) { /* No image to process? Quit */
return;
}
int[] faceaccessory = new int[64]; /* 8x8 of face accessory */
/* Get buffered image for face at 8x8 */
DynmapBufferedImage face8x8 = DynmapBufferedImage.allocateBufferedImage(8, 8);
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: see if anything is transparent (if so, apply accessory */
boolean transp = false;
for(int i = 0; i < 64; i++) {
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");
FileLockManager.getWriteLock(img_8x8);
try {
FileLockManager.imageIOWrite(face8x8.buf_img, ImageFormat.FORMAT_PNG, img_8x8);
} catch (IOException iox) {
Log.severe("Cannot write player icon " + img_8x8.getPath());
}
FileLockManager.releaseWriteLock(img_8x8);
/* Make 16x16 version */
DynmapBufferedImage face16x16 = DynmapBufferedImage.allocateBufferedImage(16, 16);
for(int i = 0; i < 16; i++) {
for(int j = 0; j < 16; j++) {
face16x16.argb_buf[i*16+j] = face8x8.argb_buf[(i/2)*8 + (j/2)];
}
}
/* Write 16x16 file */
File img_16x16 = new File(faces16x16dir, playername + ".png");
FileLockManager.getWriteLock(img_16x16);
try {
FileLockManager.imageIOWrite(face16x16.buf_img, ImageFormat.FORMAT_PNG, img_16x16);
} catch (IOException iox) {
Log.severe("Cannot write player icon " + img_16x16.getPath());
}
FileLockManager.releaseWriteLock(img_16x16);
DynmapBufferedImage.freeBufferedImage(face16x16);
/* Make 32x32 version */
DynmapBufferedImage face32x32 = DynmapBufferedImage.allocateBufferedImage(32, 32);
for(int i = 0; i < 32; i++) {
for(int j = 0; j < 32; j++) {
face32x32.argb_buf[i*32+j] = face8x8.argb_buf[(i/4)*8 + (j/4)];
}
}
/* Write 32x32 file */
File img_32x32 = new File(faces32x32dir, playername + ".png");
FileLockManager.getWriteLock(img_32x32);
try {
FileLockManager.imageIOWrite(face32x32.buf_img, ImageFormat.FORMAT_PNG, img_32x32);
} catch (IOException iox) {
Log.severe("Cannot write player icon " + img_32x32.getPath());
}
FileLockManager.releaseWriteLock(img_32x32);
DynmapBufferedImage.freeBufferedImage(face32x32);
DynmapBufferedImage.freeBufferedImage(face8x8);
/* TODO: signal update for player icon to client */
}
}
private class LoginListener extends PlayerListener {
@Override
public void onPlayerLogin(PlayerLoginEvent event) {
MapManager.scheduleDelayedJob(new LoadPlayerImages(event.getPlayer().getName()), 0);
}
}
public PlayerFaces(DynmapPlugin plugin) {
this.plugin = plugin;
plugin.registerEvent(Type.PLAYER_LOGIN, new LoginListener());
facesdir = new File(plugin.tilesDirectory, "faces");
facesdir.mkdirs(); /* Make sure directory exists */
faces8x8dir = new File(facesdir, "8x8");
faces8x8dir.mkdirs();
faces16x16dir = new File(facesdir, "16x16");
faces16x16dir.mkdirs();
faces32x32dir = new File(facesdir, "32x32");
faces32x32dir.mkdirs();
}
}
@@ -32,11 +32,10 @@ public class SimpleWebChatComponent extends Component {
if (configuration.getBoolean("allowchat", false)) {
PlayerChatListener playerListener = new PlayerChatListener();
PluginManager pm = plugin.getServer().getPluginManager();
pm.registerEvent(org.bukkit.event.Event.Type.PLAYER_CHAT, playerListener, org.bukkit.event.Event.Priority.Monitor, plugin);
pm.registerEvent(org.bukkit.event.Event.Type.PLAYER_LOGIN, playerListener, org.bukkit.event.Event.Priority.Monitor, plugin);
pm.registerEvent(org.bukkit.event.Event.Type.PLAYER_JOIN, playerListener, org.bukkit.event.Event.Priority.Monitor, plugin);
pm.registerEvent(org.bukkit.event.Event.Type.PLAYER_QUIT, playerListener, org.bukkit.event.Event.Priority.Monitor, plugin);
plugin.registerEvent(org.bukkit.event.Event.Type.PLAYER_CHAT, playerListener);
plugin.registerEvent(org.bukkit.event.Event.Type.PLAYER_LOGIN, playerListener);
plugin.registerEvent(org.bukkit.event.Event.Type.PLAYER_JOIN, playerListener);
plugin.registerEvent(org.bukkit.event.Event.Type.PLAYER_QUIT, playerListener);
}
}
+57 -13
View File
@@ -9,8 +9,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.imageio.ImageIO;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.World.Environment;
@@ -23,9 +21,7 @@ import org.dynmap.MapManager;
import org.dynmap.TileHashManager;
import org.dynmap.MapTile;
import org.dynmap.MapType;
import org.dynmap.MapType.MapStep;
import org.dynmap.debug.Debug;
import org.dynmap.kzedmap.KzedMap;
import org.dynmap.utils.DynmapBufferedImage;
import org.dynmap.utils.FileLockManager;
import org.dynmap.utils.MapChunkCache;
@@ -95,6 +91,35 @@ public class FlatMap extends MapType {
return new MapTile[] { new FlatMapTile(w, this, (int) Math.floor(l.getBlockX() / 128.0), (int) Math.floor(l.getBlockZ() / 128.0), 128) };
}
@Override
public MapTile[] getTiles(Location l0, Location l1) {
DynmapWorld w = MapManager.mapman.getWorld(l0.getWorld().getName());
int xmin, xmax, zmin, zmax;
if(l0.getBlockX() < l1.getBlockX()) {
xmin = l0.getBlockX() >> 7;
xmax = l1.getBlockX() >> 7;
}
else {
xmin = l1.getBlockX() >> 7;
xmax = l0.getBlockX() >> 7;
}
if(l0.getBlockZ() < l1.getBlockZ()) {
zmin = l0.getBlockZ() >> 7;
zmax = l1.getBlockZ() >> 7;
}
else {
zmin = l1.getBlockZ() >> 7;
zmax = l0.getBlockZ() >> 7;
}
ArrayList<MapTile> rslt = new ArrayList<MapTile>();
for(int i = xmin; i <= xmax; i++) {
for(int j = zmin; j < zmax; j++) {
rslt.add(new FlatMapTile(w, this, i, j, 128));
}
}
return rslt.toArray(new MapTile[rslt.size()]);
}
@Override
public MapTile[] getAdjecentTiles(MapTile tile) {
FlatMapTile t = (FlatMapTile) tile;
@@ -124,7 +149,6 @@ public class FlatMap extends MapType {
return result;
}
@Override
public boolean render(MapChunkCache cache, MapTile tile, File outputFile) {
FlatMapTile t = (FlatMapTile) tile;
World w = t.getWorld();
@@ -284,7 +308,7 @@ public class FlatMap extends MapType {
if(!outputFile.getParentFile().exists())
outputFile.getParentFile().mkdirs();
try {
FileLockManager.imageIOWrite(im.buf_img, "png", outputFile);
FileLockManager.imageIOWrite(im.buf_img, ImageFormat.FORMAT_PNG, outputFile);
} catch (IOException e) {
Debug.error("Failed to save image: " + outputFile.getPath(), e);
} catch (java.lang.NullPointerException e) {
@@ -315,7 +339,7 @@ public class FlatMap extends MapType {
if(!dayfile.getParentFile().exists())
dayfile.getParentFile().mkdirs();
try {
FileLockManager.imageIOWrite(im_day.buf_img, "png", dayfile);
FileLockManager.imageIOWrite(im_day.buf_img, ImageFormat.FORMAT_PNG, dayfile);
} catch (IOException e) {
Debug.error("Failed to save image: " + dayfile.getPath(), e);
} catch (java.lang.NullPointerException e) {
@@ -419,7 +443,7 @@ public class FlatMap extends MapType {
public String getPrefix() {
return prefix;
}
/* Get maps rendered concurrently with this map in this world */
public List<MapType> getMapsSharingRender(DynmapWorld w) {
return Collections.singletonList((MapType)this);
@@ -430,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;
}
@@ -496,7 +520,7 @@ public class FlatMap extends MapType {
}
@Override
public boolean render(MapChunkCache cache) {
public boolean render(MapChunkCache cache, String mapname) {
return map.render(cache, this, MapManager.mapman.getTileFile(this));
}
@@ -510,6 +534,22 @@ public class FlatMap extends MapType {
return map.getAdjecentTiles(this);
}
@Override
public int hashCode() {
return x ^ y ^ size ^ map.getName().hashCode();
}
@Override
public boolean equals(Object x) {
if(x instanceof FlatMapTile) {
return equals((FlatMapTile)x);
}
return false;
}
public boolean equals(FlatMapTile o) {
return (o.x == x) && (o.y == y) && (o.map == map);
}
@Override
public String getKey() {
return world.world.getName() + "." + map.getPrefix();
@@ -519,6 +559,9 @@ public class FlatMap extends MapType {
public boolean isBiomeDataNeeded() { return false; }
public boolean isRawBiomeDataNeeded() { return false; }
public boolean isBlockTypeDataNeeded() { return true; }
public int tileOrdinalX() { return x; }
public int tileOrdinalY() { return y; }
}
@Override
@@ -538,6 +581,7 @@ public class FlatMap extends MapType {
s(o, "mapzoomin", c.getInteger("mapzoomin", 3));
s(o, "mapzoomout", world.getExtraZoomOutLevels());
s(o, "compassview", "S"); /* Always from south */
s(o, "image-format", ImageFormat.FORMAT_PNG.getFileExt());
a(worldObject, "maps", o);
}
}
@@ -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];
}
}
+79 -13
View File
@@ -19,6 +19,7 @@ import org.dynmap.utils.MapChunkCache;
import org.json.simple.JSONObject;
public class HDMap extends MapType {
private String name;
private String prefix;
private HDPerspective perspective;
@@ -26,6 +27,13 @@ public class HDMap extends MapType {
private HDLighting lighting;
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";
public HDMap(ConfigurationNode configuration) {
name = configuration.getString("name", null);
@@ -83,7 +91,32 @@ public class HDMap extends MapType {
mapzoomout++;
scale = scale / 2.0;
}
}
String fmt = configuration.getString("image-format", "png");
/* Only allow png or jpg */
for(ImageFormat f : ImageFormat.values()) {
if(fmt.equals(f.getID())) {
imgformat = f;
break;
}
}
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; }
public HDPerspective getPerspective() { return perspective; }
@@ -94,6 +127,11 @@ public class HDMap extends MapType {
return perspective.getTiles(loc);
}
@Override
public MapTile[] getTiles(Location loc0, Location loc1) {
return perspective.getTiles(loc0, loc1);
}
@Override
public MapTile[] getAdjecentTiles(MapTile tile) {
return perspective.getAdjecentTiles(tile);
@@ -105,19 +143,11 @@ public class HDMap extends MapType {
}
@Override
public boolean render(MapChunkCache cache, MapTile tile, File bogus) {
if(tile instanceof HDMapTile)
return perspective.render(cache, (HDMapTile)tile);
else
return false;
}
@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;
}
@@ -181,6 +211,8 @@ public class HDMap extends MapType {
return lst;
}
@Override
public ImageFormat getImageFormat() { return imgformat; }
@Override
public void buildClientConfiguration(JSONObject worldObject, DynmapWorld world) {
@@ -197,6 +229,7 @@ public class HDMap extends MapType {
s(o, "bigmap", true);
s(o, "mapzoomout", (world.getExtraZoomOutLevels()+mapzoomout));
s(o, "mapzoomin", c.getInteger("mapzoomin", 2));
s(o, "image-format", imgformat.getFileExt());
perspective.addClientConfiguration(o);
shader.addClientConfiguration(o);
lighting.addClientConfiguration(o);
@@ -204,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;
}
}
@@ -119,7 +119,7 @@ public class HDMapManager {
/**
* Initialize shader states for all shaders for given tile
*/
public HDShaderState[] getShaderStateForTile(HDMapTile tile, MapChunkCache cache, MapIterator mapiter) {
public HDShaderState[] getShaderStateForTile(HDMapTile tile, MapChunkCache cache, MapIterator mapiter, String mapname) {
DynmapWorld w = MapManager.mapman.worldsLookup.get(tile.getWorld().getName());
if(w == null) return new HDShaderState[0];
ArrayList<HDShaderState> shaders = new ArrayList<HDShaderState>();
@@ -127,6 +127,9 @@ public class HDMapManager {
if(map instanceof HDMap) {
HDMap hdmap = (HDMap)map;
if(hdmap.getPerspective() == tile.perspective) {
/* If limited to one map, and this isn't it, skip */
if((mapname != null) && (!hdmap.getName().equals(mapname)))
continue;
shaders.add(hdmap.getShader().getStateInstance(hdmap, cache, mapiter));
}
}
+16 -11
View File
@@ -3,6 +3,7 @@ package org.dynmap.hdmap;
import org.dynmap.DynmapChunk;
import org.dynmap.DynmapWorld;
import org.dynmap.MapManager;
import org.dynmap.MapType;
import java.util.List;
import org.dynmap.MapTile;
@@ -21,25 +22,25 @@ public class HDMapTile extends MapTile {
@Override
public String getFilename() {
return getFilename("hdmap");
return getFilename("hdmap", MapType.ImageFormat.FORMAT_PNG);
}
public String getFilename(String prefix) {
return prefix + "/" + (tx >> 5) + '_' + (ty >> 5) + '/' + tx + "_" + ty + ".png";
public String getFilename(String prefix, MapType.ImageFormat format) {
return prefix + "/" + (tx >> 5) + '_' + (ty >> 5) + '/' + tx + "_" + ty + "." + format.getFileExt();
}
@Override
public String getDayFilename() {
return getDayFilename("hdmap");
return getDayFilename("hdmap", MapType.ImageFormat.FORMAT_PNG);
}
public String getDayFilename(String prefix) {
return prefix + "_day/" + (tx >> 5) + '_' + (ty >> 5) + '/' + tx + "_" + ty + ".png";
public String getDayFilename(String prefix, MapType.ImageFormat format) {
return prefix + "_day/" + (tx >> 5) + '_' + (ty >> 5) + '/' + tx + "_" + ty + "." + format.getFileExt();
}
@Override
public int hashCode() {
return perspective.getName().hashCode() ^ getWorld().hashCode();
return tx ^ ty ^ perspective.getName().hashCode() ^ getWorld().getName().hashCode();
}
@Override
@@ -47,11 +48,11 @@ public class HDMapTile extends MapTile {
if (obj instanceof HDMapTile) {
return equals((HDMapTile) obj);
}
return super.equals(obj);
return false;
}
public boolean equals(HDMapTile o) {
return o.tx == tx && o.ty == ty && o.getWorld().equals(getWorld()) && (perspective.equals(o.perspective));
return o.tx == tx && o.ty == ty && (perspective == o.perspective) && (o.getWorld() == getWorld());
}
public String getKey() {
@@ -75,8 +76,8 @@ public class HDMapTile extends MapTile {
@Override
public boolean isBlockTypeDataNeeded() { return MapManager.mapman.hdmapman.isBlockTypeDataNeeded(this); }
public boolean render(MapChunkCache cache) {
return perspective.render(cache, this);
public boolean render(MapChunkCache cache, String mapname) {
return perspective.render(cache, this, mapname);
}
public List<DynmapChunk> getRequiredChunks() {
@@ -86,4 +87,8 @@ public class HDMapTile extends MapTile {
public MapTile[] getAdjecentTiles() {
return perspective.getAdjecentTiles(this);
}
public int tileOrdinalX() { return tx; }
public int tileOrdinalY() { return ty; }
}

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