Compare commits

...
2099 Commits
Author SHA1 Message Date
Ben Woo 981d368058 Merge pull request #3338 from Multiverse/feat/relative-positioning
Add back support for relative position with ~ in destination coordinates
2025-09-22 20:10:26 +08:00
Ben Woo 7507099a4e Merge pull request #3341 from Multiverse/api/unloadedworldlocation-final
Make UnloadedWorldLocation non-final to allow extending
2025-09-22 20:08:52 +08:00
Ben Woo 29b58b1655 Make UnloadedWorldLocation non-final to allow extending 2025-09-22 19:57:10 +08:00
Ben Woo a1081c1b6b Merge pull request #3340 from Multiverse/feat/generator-test
Improve generator plugin detection and add an option to disable it
2025-09-22 19:55:36 +08:00
Ben Woo 3152b62668 Merge pull request #3339 from Multiverse/fix/worlds-old-exist
Fix issue when trying to backup `worlds.yml.old` and file already exists
2025-09-22 19:51:57 +08:00
Ben Woo 0082cc9852 Improve generator plugin detection and add an option to disable it 2025-09-22 19:51:18 +08:00
Ben Woo f60b656bed Fix issue when trying to backup worlds.yml.old and file already exists 2025-09-22 19:27:58 +08:00
Ben Woo da5f5de5cd Add localization for position parse error messages 2025-09-20 21:33:16 +08:00
Ben Woo e9aacecc2f Add back support for relative position with ~ in destination coordinates 2025-09-20 20:31:13 +08:00
Ben Woo fa3adbe605 Merge pull request #3332 from Multiverse/fix/delete-fail-message
Fix message when delete failed due to invalid world folder
2025-09-06 13:11:39 +08:00
Ben Woo e33b2f7025 Fix message when delete failed due to invalid world folder 2025-09-06 13:07:03 +08:00
Ben Woo a9cc577754 Merge pull request #3330 from ElFrod0/config-server-properties-path
Configurable server.properties path
2025-08-31 10:34:48 +08:00
Ben Woo 02344a31cf Add api status annotation for new server-properties-path config 2025-08-31 10:30:33 +08:00
ElFrod0 2f4871ef71 Add newline for consistency 2025-08-29 19:40:41 +02:00
ElFrod0 9750fad4b7 Update fresh config for tests 2025-08-29 19:35:21 +02:00
ElFrod0 df77372d96 Configurable server.properties file location 2025-08-29 19:33:49 +02:00
Ben Woo 039af3c219 Merge pull request #3327 from Multiverse/5.3
5.3
2025-08-29 10:34:05 +08:00
Ben Woo 09ec4f87ef Merge pull request #3328 from Multiverse/fix/mvapi-not-started
Pass in config object directly into spawn config class instead of using mvapi
2025-08-27 14:06:11 +08:00
Ben Woo f996f22f4b Pass in config object directly into spawn config class instead of using mvapi 2025-08-27 14:02:37 +08:00
Ben Woo b230c5ae9c Merge pull request #3326 from Multiverse/fix/spawning-config-order
Maintain spawn category config order between config saves
2025-08-27 13:50:30 +08:00
Ben Woo 2561107697 Merge pull request #3325 from Multiverse/feat/disable-apply-spawn
Add option to disable mv handling of spawn rate and limit
2025-08-27 13:48:42 +08:00
Ben Woo 70babc8656 Maintain spawn category config order between config saves 2025-08-27 13:46:59 +08:00
Ben Woo bd09d6c950 Merge pull request #3324 from Multiverse/chore/deps
Fix some dependency issues
2025-08-27 13:35:17 +08:00
Ben Woo b94de763ca Depend on latest paper api version 2025-08-27 12:40:52 +08:00
Ben Woo 22ca57543f Change mockbukkit version to fix test issues 2025-08-27 12:40:25 +08:00
Ben Woo 25c70170d9 Add option to disable mv handling of spawn rate and limit 2025-08-27 12:35:09 +08:00
Ben Woo 9926041c2f Merge pull request #3321 from KioProject123/fix/spawn-location-angle
fix spawn location angle
2025-08-18 15:06:10 +08:00
KioProject 1c99898d0d fix 2025-08-18 13:49:01 +08:00
KioProject 41e0261eee fix spawn location angle 2025-08-18 13:13:25 +08:00
Ben Woo 642f3ab1b8 Merge pull request #3320 from MrXiaoM/patch-1
Fix adventure dep in spigot-based server
2025-08-17 22:57:20 +08:00
人間工作 57d1844756 fix NoClassDefFoundError in spigot-based server 2025-08-17 22:09:17 +08:00
Ben Woo 73e1650fc3 Merge pull request #3318 from Multiverse/fix/match-invalid-regex
Properly handle error from invalid regex string in matcher
2025-08-11 13:08:49 +08:00
Ben Woo 800709ca95 Properly annotate parameters for matcher classes 2025-08-11 12:43:38 +08:00
Ben Woo 935cbad21c Properly handle error from invalid wildcard string in matcher 2025-08-11 12:40:05 +08:00
Ben Woo 0e2a27b298 Merge pull request #3317 from Multiverse/fix/remove-logging
Fix unwanted warning logging for matcher
2025-08-11 12:28:59 +08:00
Ben Woo baaa175423 Properly handle error from invalid regex string in matcher 2025-08-11 12:24:36 +08:00
Ben Woo e2b7a31191 Fix unwanted warning logging for matcher 2025-08-11 12:15:16 +08:00
Ben Woo afa2825bc7 Merge pull request #3315 from Multiverse/feat/load-folder-check
Add folder checking before loading world
2025-07-31 16:32:37 +08:00
Ben Woo 21b4f6b087 Add folder checking before loading world 2025-07-31 15:25:14 +08:00
Ben Woo a771652c8f Merge pull request #3291 from Multiverse/5.2
5.2
2025-07-28 10:11:52 +08:00
Ben Woo e89b4f19ee Merge pull request #3314 from Multiverse/fix/debug-permissions
Fix debug-permission comment spacing
2025-07-27 14:23:34 +08:00
Ben Woo eb8ef32a94 Fix debug-permission comment spacing 2025-07-27 12:38:50 +08:00
Ben Woo f9d783bc5c Merge pull request #3311 from Multiverse/refactor/remove-deprecate
Deprecate other removeWorld methods in favour of using RemoveWorldOpt…
2025-07-27 11:36:20 +08:00
Ben Woo 87dd4168cd Merge pull request #3313 from Multiverse/fix/save-flush
Use newer save method with chunk flushing when possible
2025-07-27 11:35:35 +08:00
Ben Woo 2da6ece606 Merge pull request #3312 from Multiverse/chore/bump-deps
Bump dependencies
2025-07-27 11:35:08 +08:00
Ben Woo cbb3a7a518 Merge pull request #3310 from Multiverse/fix/spawn-command
Fix spawn command using deprecated teleport method
2025-07-27 11:34:32 +08:00
Ben Woo 57796d295b Bump dependencies 2025-07-26 12:26:38 +08:00
Ben Woo 09314e8bce Use newer save method with chunk flushing when possible 2025-07-26 12:08:23 +08:00
Ben Woo 907a6dd5c0 Fix spawn command using deprecated teleport method 2025-07-26 11:50:53 +08:00
Ben Woo a50bd807b6 Deprecate other removeWorld methods in favour of using RemoveWorldOptions 2025-07-26 11:50:02 +08:00
Ben Woo 02081b4654 Merge pull request #3305 from Multiverse/fix/text-format-null
Fix ChatTextFormatter handling null strings
2025-07-26 10:44:56 +08:00
Ben Woo 156ec7911d Merge pull request #3308 from Multiverse/fix/world-name-dot
Fix v4 config migration when world name contains dot
2025-07-26 10:44:10 +08:00
Ben Woo 2b95c62a84 Fix v4 config migration when world name contains dot 2025-07-24 22:56:08 +08:00
Ben Woo 539d5c43d1 Merge pull request #3306 from Multiverse/chore/update-game-version
Update supported game version for 1.21.7 and 1.21.8
2025-07-23 14:19:35 +08:00
Ben Woo 1664690472 Update supported game version for 1.21.7 and 1.21.8 2025-07-23 14:08:42 +08:00
Ben Woo 455396713e Fix ChatTextFormatter handling null strings 2025-07-21 22:44:45 +08:00
Ben Woo 8bc3a593d0 Merge pull request #3303 from Multiverse/feat/remove-options
Add options to remove a world without unloading or saving the bukkit …
2025-07-20 15:05:33 +08:00
Ben Woo 5177f290ae Merge pull request #3304 from Multiverse/refactor/wm-cleanup
Refactor/wm cleanup
2025-07-20 15:05:11 +08:00
Ben Woo 5118864bb8 Use our ChatTextFormatter to remove colour from string 2025-07-20 14:56:18 +08:00
Ben Woo 654da03add Remove unnecessary casting 2025-07-20 14:54:41 +08:00
Ben Woo 61229356ad Mark initAllWorlds as internal api 2025-07-20 14:53:16 +08:00
Ben Woo fa5aa41547 Add options to remove a world without unloading or saving the bukkit world 2025-07-20 14:49:57 +08:00
Ben Woo 04f07657eb Merge pull request #3301 from Multiverse/feat/import-bukkit
Improve support for importing worlds already loaded on the server
2025-07-20 11:44:45 +08:00
Ben Woo eea2af169f Improve support for importing worlds already loaded on the server 2025-07-19 23:33:51 +08:00
Ben Woo 6d393723ff Merge pull request #3299 from Multiverse/feat/skip-folder-check
Add option to skip folder check on import
2025-07-19 23:08:28 +08:00
Ben Woo 9137ef04d2 Merge pull request #3300 from Multiverse/feat/load-env-check
Add an environment check when loading a world that already exist in b…
2025-07-19 23:06:56 +08:00
Ben Woo 878c4bea3d Add option to skip folder check on import 2025-07-19 23:05:17 +08:00
Ben Woo 021d86e21c Add an environment check when loading a world that already exist in bukkit 2025-07-19 22:59:15 +08:00
Ben Woo 3e9425c8f1 Merge pull request #3297 from Multiverse/feat/matcher
Implement StringMatcher api
2025-07-18 15:02:20 +08:00
Ben Woo cc60b9c938 Implement StringMatcher api 2025-07-18 14:46:59 +08:00
Ben Woo d3cc950a97 Merge pull request #3296 from Multiverse/feat/attempt-causeby
Add causeBy chaining for Attempt
2025-07-18 11:09:41 +08:00
Ben Woo 5e97b1169b Merge pull request #3294 from Multiverse/fix/removed-property
Add warning on removed animals and monsters world properties
2025-07-18 11:07:39 +08:00
Ben Woo c3f4f117e5 Merge pull request #3293 from Multiverse/fix/delete-tab-complete
Tab complete to include unloaded worlds for delete command
2025-07-18 11:06:54 +08:00
Ben Woo 814901b1c1 Merge pull request #3292 from Multiverse/fix/spawn-egg
Always allow spawner egg to align with v4 behaviour
2025-07-18 11:06:31 +08:00
Ben Woo 7c6b1d07b0 Add causeBy chaining for Attempt 2025-07-18 11:04:41 +08:00
Ben Woo c389a41cdc Add warning on removed animals and monsters world properties 2025-07-17 12:38:33 +08:00
Ben Woo 2db9ae7c66 Tab complete to include unloaded worlds for delete command 2025-07-17 11:59:24 +08:00
Ben Woo b80aea4c38 Always allow spawner egg to align with v4 behaviour 2025-07-17 11:54:56 +08:00
Ben Woo 35b129701f Merge pull request #3285 from Multiverse/feat/joinlocation-bypass
Add bypass permission for join location
2025-07-15 13:46:45 +08:00
Ben Woo d92fe17c4f Merge branch 'main' into feat/joinlocation-bypass
# Conflicts:
#	src/main/java/org/mvplugins/multiverse/core/listeners/MVPlayerListener.java
2025-07-15 13:40:51 +08:00
Ben Woo 488e258e3f Merge pull request #3290 from Multiverse/fix/gamerule-tab-complete
Fix gamerule tab complete when legacy alias is enabled
2025-07-14 11:26:11 +08:00
Ben Woo d096d1a941 Fix gamerule command flag group name 2025-07-14 11:22:17 +08:00
Ben Woo 3ef4271e63 Fix gamerule tab complete when legacy alias is enabled 2025-07-14 11:18:25 +08:00
Ben Woo 0a33d35b2b Merge pull request #3288 from Multiverse/fix/bukkit-compatility
Fix PlayerSpawnLocationEvent may not be available on bukkit
2025-07-11 11:13:09 +08:00
Ben Woo b4fedea1db Fix PlayerSpawnLocationEvent may not be available on bukkit 2025-07-11 11:06:54 +08:00
Ben Woo 4d92964dda Merge pull request #3287 from Multiverse/fix/worldkey
Fix missing world placeholder in BUKKIT_CREATION_FAILED message
2025-07-09 18:07:57 +08:00
Ben Woo 3443b175ff Fix missing world placeholder in BUKKIT_CREATION_FAILED message 2025-07-09 17:40:11 +08:00
Ben Woo ad3fe9e114 Merge pull request #3284 from Multiverse/fix/teleport-fail-message
Make teleport failure message more descriptive
2025-07-07 11:05:14 +08:00
Ben Woo d1660d7e81 Add bypass permission for join location 2025-07-07 10:41:38 +08:00
Ben Woo 7750b61103 Make teleport failure message more descriptive 2025-07-07 10:19:26 +08:00
Ben Woo eeb1019bbb Merge pull request #3276 from Multiverse/fix/locale-lowercase
Fix message key lowercase issues if java environment is non-english
2025-06-28 17:05:09 +08:00
Ben Woo 6bbaad8bdb Merge pull request #3277 from Multiverse/fix/config-comment
Fix config.yml comment spacing
2025-06-28 17:04:48 +08:00
Missing_Love 1ef4470979 Update multiverse-core_zh.properties (#3274)
* Update multiverse-core_zh.properties

* Update multiverse-core_zh.properties
2025-06-28 17:03:41 +08:00
Ben Woo 3110f462ac Fix config.yml comment spacing 2025-06-28 17:02:10 +08:00
Ben Woo 170e1ac347 Fix message key lowercase issues if java environment is non-english 2025-06-27 18:09:27 +08:00
Ben Woo 86b95034cc Merge pull request #3275 from Multiverse/chore/dbo-1.21.6
Update dbo supported version list with 1.21.6
2025-06-27 12:39:20 +08:00
Ben Woo 8f6d4d5960 Update dbo supported version list with 1.21.6 2025-06-27 12:28:21 +08:00
Ben Woo a34d2f810b Merge pull request #3273 from Multiverse/docs/donate-links
Update donation links to our github sponsor and open collective
2025-06-26 21:09:50 +08:00
Ben Woo db002ab2b1 Update donation links to our github sponsor and open collective 2025-06-26 21:07:33 +08:00
Ben Woo c9c8a1a9c6 Merge pull request #3272 from Tisment/main
Translation of the plugin to Spanish
2025-06-26 20:00:17 +08:00
Tisment cdc22bc533 Created the file multiverse-core_es.properties 2025-06-24 11:40:02 +02:00
Ben Woo 1efe98ab46 Merge pull request #3271 from Multiverse/fix/setspawn-save
Fix setspawn command not saving the updated location to file immediately
2025-06-23 20:29:20 +08:00
Ben Woo 989242810d Fix setspawn command not saving the updated location to file immediately 2025-06-23 19:08:36 +08:00
Ben Woo 29d3c0c8c1 Merge pull request #3244 from Multiverse/5.1
5.1
2025-06-23 12:02:22 +08:00
Ben Woo 97cc7e53f0 Merge pull request #3266 from Multiverse/chore/1.21.6
Add 1.21.6 as supported version for Modrinth and Hangar
2025-06-23 11:08:10 +08:00
Ben Woo 4c4544340a Merge pull request #3270 from Multiverse/fix/dot-world-name
Fix world not loading when the world name has `.` in it
2025-06-22 17:06:54 +08:00
Ben Woo 755fab05ba Add tests for world name with dot 2025-06-22 17:02:50 +08:00
Ben Woo 5f295fd57b Fix world not loading when the world name has . in it 2025-06-22 16:49:14 +08:00
Ben Woo 86b888a68e Add 1.21.6 as supported version for modrinth and hanger 2025-06-20 22:10:42 +08:00
Ben Woo 4fd8350a96 Merge pull request #3265 from Multiverse/feat/destination-sender
Add support for destination parse with sender context
2025-06-20 15:06:30 +08:00
Ben Woo 5702426ddd Fix config test due to destination parsing 2025-06-20 15:01:01 +08:00
Ben Woo 9c562d09ea Add support for destination parse with sender context 2025-06-20 14:20:50 +08:00
Ben Woo 59d1c44c23 Merge pull request #3264 from Multiverse/feat/sender-string-parse
Add support config string parsing with sender context
2025-06-20 14:03:06 +08:00
Ben Woo 1082f73be7 Add support config string parsing with sender context 2025-06-20 12:13:14 +08:00
Ben Woo 1372626b50 Merge pull request #3263 from Multiverse/feat/config-alias-name
Add support for alias name in config node
2025-06-20 12:01:24 +08:00
Ben Woo c09dacb8ec Add support for alias name in config node 2025-06-20 11:11:07 +08:00
Ben Woo 518d64882c Merge pull request #3262 from Multiverse/feat/api-qol
Add qol methods whenLoaded and isLoaded to MultiverseCoreApi
2025-06-16 19:44:30 +08:00
Ben Woo 4f08b9a446 Add qol methods whenLoaded and isLoaded to MultiverseCoreApi 2025-06-16 11:02:19 +08:00
Ben Woo a3b7dd542d Mark CoreConfig#getConfig() as internal use only 2025-06-16 11:01:33 +08:00
Ben Woo c68936f06d Merge pull request #3261 from Multiverse/refactor/destination-suggestion
Streamline destination suggestions with helper methods to directly parse to string
2025-06-15 22:02:19 +08:00
Ben Woo b91214f958 Streamline destination suggestions with helper methods to directly parse to string 2025-06-15 21:55:01 +08:00
Ben Woo ff26ffd9c5 Merge pull request #3258 from Multiverse/feat/sender-context
Implement sender context for config node suggestions
2025-06-15 21:21:31 +08:00
Ben Woo 058a7c97cb Implement SenderNodeSuggester to builders 2025-06-15 21:19:30 +08:00
Ben Woo a50965509d Implement sender context for config node suggestions 2025-06-10 22:48:20 +08:00
Ben Woo 3356724481 Merge pull request #3256 from Multiverse/fix/generator-tab-complete
Improve generator provider tab-complete logic
2025-06-10 11:30:59 +08:00
Ben Woo 8dcdf68b9f Merge pull request #3257 from Whitebrim/patch-1
lang: fix deposit/withdraw (en)
2025-06-10 11:30:45 +08:00
Ben Woo ae0f25a0f8 Merge pull request #3255 from Whitebrim/main
Translation to Russian
2025-06-10 11:30:30 +08:00
Whitebrim 148f513bc2 lang: fix deposit/withdraw (en) 2025-06-10 03:38:57 +03:00
Whitebrim 29f60bcde5 lang: fix deposit/withdraw 2025-06-10 03:36:45 +03:00
Ben Woo e9ddb24706 Improve generator provider tab-complete logic 2025-06-09 23:16:43 +08:00
Whitebrim 71e815a9bd Create multiverse-core_ru.properties
Translated to Russian
2025-06-07 21:17:47 +03:00
Ben Woo a55ce680df Merge pull request #3254 from Multiverse/fix/world-chart
Fix bstats world chart
2025-06-07 13:42:40 +08:00
Ben Woo 3e47460c3b Fix bstats world chart 2025-06-07 13:36:57 +08:00
Ben Woo abd6983eee Merge pull request #3253 from Multiverse/fix/donate-colour
Add green colour to donate and enable message
2025-06-07 00:16:12 +08:00
Ben Woo ce263b5b1f Merge pull request #3252 from Multiverse/feat/improve-context
Feat/improve context
2025-06-07 00:15:53 +08:00
Ben Woo 7f15a28a69 Add green colour to donate and enable message 2025-06-07 00:00:03 +08:00
Ben Woo 4ddcb3f0bf Fix teleport command tab complete for in-game with player arg 2025-06-06 23:48:24 +08:00
Ben Woo d76a6a6ca6 Refactor issuer aware context handling to extract our similar logic 2025-06-06 23:08:20 +08:00
Ben Woo e9a20254b0 Merge pull request #3249 from Multiverse/feat/passengers
Add support for passenger and vehicle teleports
2025-06-06 20:32:24 +08:00
Ben Woo 42a8d33824 Fix some javadocs of the new attempt methods 2025-06-06 20:19:19 +08:00
Ben Woo d89f00a607 Merge pull request #3250 from Multiverse/chore/annotations
Add ApiStatus annotations to new and deprecated api
2025-06-06 20:12:43 +08:00
Ben Woo 41c8c17bc9 Fix config test 2025-06-06 20:07:57 +08:00
Ben Woo a3a621945a Add ApiStatus annotations to new and deprecated api 2025-06-06 20:06:20 +08:00
Ben Woo 71eedd392d Add support for passenger and vehicle teleports 2025-06-06 20:01:30 +08:00
Ben Woo ccfcae9dd0 Merge pull request #3247 from Multiverse/fix/vanila-selector
Hotfix for vanilla selector params getting cut off by comma separation
2025-06-03 22:09:53 +08:00
Ben Woo f50849422b Merge pull request #3248 from Multiverse/chore/issue-template-update
Update issue template new dumps command, and fix typos
2025-06-02 22:43:47 +08:00
Ben Woo 8786a09b8f Update issue template new dumps command, and fix typos 2025-06-02 22:25:55 +08:00
Ben Woo 07b750f11c Hotfix for vanilla selector params getting cut off by comma separation 2025-06-02 21:45:29 +08:00
Ben Woo ba78b7da3a Merge pull request #3245 from Multiverse/feat/chat-color
Use kyori adventure whenever possible to support rgb formatting
2025-06-02 13:07:38 +08:00
Ben Woo 38231ef0d4 Use kyori adventure whenever possible to support rgb formatting 2025-06-02 13:01:03 +08:00
Ben Woo 232d18f8da Merge pull request #3237 from Multiverse/feat/setspawn-safety
Add location safety check for setspawn command
2025-06-02 11:07:17 +08:00
Ben Woo 530a8a9c2c Merge pull request #3243 from Multiverse/feat/time-placeholder
Implement time formatting for world time placeholder
2025-06-02 11:07:06 +08:00
Ben Woo 38bbe8103c Merge pull request #3241 from Multiverse/fix/entry-fee-message
Fix vault economy not showing payment message
2025-06-02 10:55:13 +08:00
Ben Woo d2af009d9f Fix entry check messages 2025-06-02 10:51:43 +08:00
Ben Woo 8a96c7b610 Don't show seconds for default 12h and 24h format 2025-06-02 10:47:22 +08:00
Ben Woo bb2da157da Fix minecraft time calculation 2025-06-02 10:47:03 +08:00
Ben Woo 1c521e0f79 Implement time formatting for world time placeholder 2025-06-01 23:39:04 +08:00
Ben Woo aab13c1ec6 Add support for multiple params in placeholder 2025-06-01 23:38:12 +08:00
Ben Woo fd72d6a9b8 Add locale keys for economy recipt messages 2025-06-01 20:40:15 +08:00
Ben Woo d73e90e46e Fix negative deposit issue 2025-06-01 20:39:48 +08:00
Ben Woo 913f131b3b Cleanup double to int conversion for item economy 2025-06-01 20:32:11 +08:00
Ben Woo 795aeab7a3 Fix vault economy not showing payment message 2025-06-01 16:22:36 +08:00
Ben Woo 2ee01adb6b Fix negative entry fee display in /mv info command 2025-06-01 15:37:15 +08:00
Ben Woo b4e246ffb3 Merge pull request #3240 from Multiverse/fix/chat-prefix-colour
Fix chat prefix colour codes not applying
2025-06-01 10:09:21 +08:00
Ben Woo 64995a0bfd Fix chat prefix colour codes not applying 2025-06-01 09:58:37 +08:00
Ben Woo 3173b5fc18 Merge pull request #3236 from Multiverse/fix/locale-key
Fix content display wrong locale key
2025-05-31 16:22:48 +08:00
Ben Woo ae4d33d7b1 Fix PlayerLocation context logic 2025-05-31 16:20:51 +08:00
Ben Woo d5b2cc884b Support localization for setspawn command output 2025-05-31 16:20:34 +08:00
Ben Woo 50f6152a71 Fix sendError message type 2025-05-31 15:48:57 +08:00
Ben Woo c84ae0493c Add location safety check for setspawn command 2025-05-31 15:48:47 +08:00
Ben Woo e1dadc045f Fix content display wrong locale key 2025-05-31 13:53:46 +08:00
Ben Woo 15812081e0 Merge pull request #3230 from xiaohuang2004/patch-1
Update multiverse-core_zh.properties
2025-05-31 09:58:02 +08:00
Ben Woo 5365ebd939 Fix Localization test 2025-05-31 09:56:14 +08:00
Ben Woo e06770a55f Fix zh property file location 2025-05-31 09:56:04 +08:00
Ben Woo a931c63ba9 Merge pull request #3233 from Multiverse/fix/worldborder-permissions
Add permission for world border
2025-05-16 16:55:01 +08:00
Ben Woo 47fae91a29 Add permission for world border 2025-05-16 16:50:06 +08:00
Ben Woo df010c4978 Merge pull request #3231 from Multiverse/feat/generator
Implement generator info command
2025-05-14 14:50:55 +08:00
Ben Woo 8060e12d57 Merge pull request #3232 from Multiverse/fix/config-comments
Fix some config comment typos
2025-05-14 14:50:14 +08:00
Ben Woo dd8a74c19e Fix some config comment typos 2025-05-14 14:47:46 +08:00
Huang Jinjie f0992dae25 Update multiverse-core_zh.properties
I read Multiverse Core Changelog and found it support message outputs with localisation support. However, my client still display English which has been set to Chinese. I searched the code and don't found a Chinese simplified translation file. So I translate it base on the multiverse-core_en.property. I don't know exactly how to operate it, so I commit the file directly and hope the plugin can support Chinese in next version. If it can be accepted, I will continue to translate other add-one Multiverse plugins. Thanks!
2025-05-14 14:02:17 +08:00
Ben Woo 2935d13cd0 Implement generator info command 2025-05-09 22:56:53 +08:00
Ben Woo d484c539a9 Merge pull request #3228 from Multiverse/feat/config-command
Improve comments for first-spawn and join-destination
2025-05-09 19:07:32 +08:00
Ben Woo 3c511417a5 Improve comments for first-spawn and join-destination 2025-05-09 19:04:32 +08:00
Ben Woo ad6c44bec3 Merge pull request #3227 from Multiverse/fix/event-executor
Fix event executor on spigot
2025-05-09 18:28:25 +08:00
Ben Woo dd155507e6 More isolated error handling for each event method registration 2025-05-09 18:20:38 +08:00
Ben Woo 866a7415b6 Fix event executor on spigot 2025-05-08 22:48:43 +08:00
Ben Woo 230ffd59d4 Merge pull request #3226 from Multiverse/fix/import-issue-on-spigot
Fix adventure text import issues on spigot
2025-05-07 08:25:56 +08:00
Ben Woo ca4e3e11d2 Fix adventure text import issues on spigot 2025-05-07 08:22:35 +08:00
Ben Woo 395c3098c4 Merge pull request #3225 from Multiverse/fix/skip-wrong-class
Fix wrong skip class for AsyncPlayerChatEvent
2025-05-06 15:12:02 +08:00
Ben Woo b0219fbb5b Fix wrong skip class for AsyncPlayerChatEvent 2025-05-06 15:04:33 +08:00
Ben Woo dbeba59561 Merge pull request #3224 from Multiverse/feat/world-border-command
Implement `/mv worldborder` commands
2025-05-06 14:58:32 +08:00
Ben Woo 4104a2db59 Merge pull request #3223 from Multiverse/feat/allow-advancement
Implement world property to disable advancement grant
2025-05-06 14:56:47 +08:00
Ben Woo 1f97a8960a Implement /mv worldborder commands 2025-05-06 14:56:05 +08:00
Ben Woo 8597dd63ca Fix world config in tests due to new allow-advancement-grant property 2025-05-06 11:01:38 +08:00
Ben Woo 3fcfb4d11e Merge pull request #3222 from Multiverse/feat/async-chat-event
Implement paper's AsyncChatEvent for world prefix chat
2025-05-06 10:48:50 +08:00
Ben Woo 72e3ba99c6 Implement world property to disable advancement grant 2025-05-06 10:48:22 +08:00
Ben Woo 27417c53d7 Implement paper's AsyncChatEvent for world prefix chat 2025-05-05 23:08:44 +08:00
Ben Woo db97b6e678 Merge pull request #3221 from Multiverse/feat/dynamic-listener
Implement dynamic listener api
2025-05-05 22:09:48 +08:00
Ben Woo ac050bfb37 Add comments for event-priority config options 2025-05-05 22:07:32 +08:00
Ben Woo 5e75b1cd17 Implement dynamic listener api 2025-05-05 21:57:04 +08:00
Ben Woo 565ed9f1fc Merge pull request #3220 from Multiverse/feat/auto-import
Add option to disable auto import of worlds on init/reload
2025-05-05 00:14:57 +08:00
Ben Woo 41ab66b704 Add option to disable auto import of worlds on init/reload 2025-05-04 22:52:31 +08:00
Ben Woo a9d81bd5a2 Merge pull request #3219 from Multiverse/feat/config-cmd-locale
Implement localisation for config command output
2025-05-04 17:27:08 +08:00
Ben Woo 98095927a9 Implement localisation for config command output 2025-05-04 15:40:36 +08:00
Ben Woo 2e1e8685e9 Tweaks to string message for DimensionFormat 2025-05-04 15:40:12 +08:00
Ben Woo 087fdbbb2c Fix MessageReplacement instanceof parsing at the wrong place 2025-05-04 15:39:32 +08:00
Ben Woo 42cd9ec18d Merge pull request #3217 from Multiverse/fix/unregister
Fix incorrect way of unregistering MultiverseCoreApi from service manager
2025-05-03 20:21:09 +08:00
Ben Woo f63861b1d4 Fix incorrect way of unregistering MultiverseCoreApi from service manager 2025-05-03 20:13:31 +08:00
Ben Woo 3233ae556c Merge pull request #3215 from Multiverse/feat/world-name-format
Implement automatic link of respawn world from nether/end to overworld
2025-05-03 20:03:12 +08:00
Ben Woo d1e1ea56d1 Merge pull request #3216 from Multiverse/fix/displaypermerrors-mgrate
Fix displaypermerrors config migration
2025-05-03 20:02:38 +08:00
Ben Woo 7eede2daeb Fix displaypermerrors config migration 2025-05-03 19:21:18 +08:00
Ben Woo 468399ad84 Add javadoc for DimensionFinder 2025-05-03 19:14:12 +08:00
Ben Woo 200e8cbc30 Improve respawn related config comments 2025-05-03 19:13:54 +08:00
Ben Woo 69ab331a6f Merge pull request #3213 from Multiverse/feat/keep-files
Add option to keep files during world regen
2025-05-03 18:55:00 +08:00
Ben Woo dcb8a354cf Merge pull request #3214 from Multiverse/chore/clone-command-test
Fix clone command test due to World#save being unimplemented
2025-05-03 17:05:07 +08:00
Ben Woo e625e4750f Fix comments in DeleteWorldOptions#keepFiles 2025-05-03 17:04:32 +08:00
Ben Woo dbcbcad6d1 Fix clone command test due to World#save being unimplemented 2025-05-03 17:02:47 +08:00
Ben Woo 84916fe25b Fix saveBukkitWorld parameter name 2025-05-03 17:02:27 +08:00
Ben Woo 535da5e39b Implement automatic link of respawn world from nether/end to overworld 2025-05-03 16:59:57 +08:00
Ben Woo cd2869863f Fix delete world test due to api changes 2025-05-03 14:29:57 +08:00
Ben Woo b9766f87c9 Merge pull request #3212 from Multiverse/fix/clone-default-save
Default save bukkit world before clone to true
2025-05-03 14:23:11 +08:00
Ben Woo 32829531d3 Add option to keep files during world regen 2025-05-03 14:22:50 +08:00
Ben Woo aa82743c25 Default save bukkit world before clone to true 2025-05-03 11:44:04 +08:00
Ben Woo 47e9076c9e Merge pull request #3211 from Multiverse/feat/unload-bukkit
Add `--no-unload-bukkit-world` flag to unload command
2025-05-02 22:15:56 +08:00
Ben Woo 841ad8f55d Merge pull request #3210 from Multiverse/feat/clone-save
Add an option to force save world to disk before cloning world
2025-05-02 22:15:33 +08:00
Ben Woo 407e778841 Add --no-unload-bukkit-world flag to unload command 2025-05-02 22:13:48 +08:00
Ben Woo 5b85e2f119 Add an option to force save world to disk before cloning world 2025-05-02 21:58:28 +08:00
Ben Woo 49bdb568cc Merge pull request #3209 from Multiverse/feat/bukkit-yml
Implement bukkit-yml-path config option
2025-05-02 21:28:00 +08:00
Ben Woo a4e7282a0b Implement bukkit-yml-path config option 2025-05-02 21:24:46 +08:00
Ben Woo 1cfd9e6905 Load all config nodes before calling onSetValue 2025-05-02 21:24:27 +08:00
Ben Woo 064e4a0ed8 Merge pull request #3207 from Multiverse/fix/purge-entities
Actually implement the auto-purge-entities config option
2025-05-02 19:59:30 +08:00
Ben Woo 65d199c65a Merge pull request #3208 from Multiverse/fix/gha-no-release
GHA do not build of upload if there is no release
2025-05-02 19:56:21 +08:00
Ben Woo cb61c81836 GHA do not build of upload if there is no release 2025-05-02 19:53:56 +08:00
Ben Woo 25e1751283 Merge pull request #3206 from Multiverse/fix/api-service
Refactor and properly unregister MultiverseCoreApi from service manager
2025-05-02 19:47:21 +08:00
Ben Woo e417e0479c Actually implement the auto-purge-entities config option 2025-05-02 19:43:54 +08:00
Ben Woo fe4cada82d Refactor and properly unregister MultiverseCoreApi from service manager 2025-05-02 17:29:25 +08:00
Ben Woo c92d04376c Merge pull request #3205 from Multiverse/feat/gha
Github release action improvements
2025-05-02 16:54:43 +08:00
Ben Woo a24a3a54f4 Add a dispatch create release action 2025-05-02 16:53:41 +08:00
Ben Woo 8b4e339665 Fix dispatch javadoc java version 2025-05-02 16:31:01 +08:00
Ben Woo 6c96f506c8 Upload javadoc for pre-release as well 2025-05-02 16:28:00 +08:00
Ben Woo 28475e442d Use tag name instead of publish name for release builds 2025-05-02 16:27:10 +08:00
Ben Woo 59e6fdbfa5 Merge pull request #3204 from Multiverse/chore/trigger
Trigger MV5 release build
2025-05-01 17:20:58 +08:00
Ben Woo 2848889395 Trigger MV5 release build 2025-05-01 17:12:40 +08:00
Ben Woo 3df1e5a547 Merge pull request #3203 from Multiverse/feat/gamemode-flight-enforcement
Feat/gamemode flight enforcement
2025-04-30 23:24:48 +08:00
Ben Woo 0739ac3a70 Merge pull request #3201 from Multiverse/fix/double-load-unload
Fix logic error where bukkit load and unload is called twice
2025-04-30 23:24:31 +08:00
Ben Woo c4a692ad70 Add config option for flight enforcement 2025-04-30 21:09:36 +08:00
Ben Woo 1535238770 Fix gamemode enforcement config not applying 2025-04-30 21:07:05 +08:00
Ben Woo efd8b4b34e Merge pull request #3200 from Multiverse/fix/who-invalid-world
Fix who command null exception when invalid world is specified
2025-04-30 19:54:08 +08:00
Ben Woo 88125ecf9c Merge pull request #3202 from Multiverse/fix/severe-logging
Remove unnecessary severe logging in create command
2025-04-30 19:52:25 +08:00
Ben Woo 675e590ccf Remove unnecessary severe logging in create command 2025-04-30 19:24:34 +08:00
Ben Woo afd89dbb51 Fix logic error where bukkit load and unload is called twice 2025-04-30 19:20:51 +08:00
Ben Woo c961c9ff57 Fix who command null exception when invalid world is specified 2025-04-30 17:53:16 +08:00
Ben Woo 2d02658730 Merge pull request #3196 from Multiverse/benwoo1110-patch-1
Release MV5
2025-04-29 10:43:07 +08:00
Ben Woo dfd4b88031 Update README.md 2025-04-29 09:51:59 +08:00
Ben Woo 52e0b1288a Merge pull request #3195 from Multiverse/fix/publish
Remove onarandombox publish repo as its already in our gradle plugin
2025-04-29 09:40:08 +08:00
Ben Woo d1dd8d7493 Remove onarandombox publish repo as its already in our gradle plugin 2025-04-29 09:37:28 +08:00
Ben Woo ca73265f88 Merge pull request #2824 from Multiverse/MV5
MV5
2025-04-29 09:29:59 +08:00
Ben Woo 5bdec28099 Prep for release 2025-04-29 08:56:31 +08:00
Ben Woo bd0a3dd3fb Update to an even cooler banner 2025-04-28 23:11:56 +08:00
Ben Woo 7a9994004c Add wiki website link 2025-04-28 22:46:38 +08:00
Ben Woo 45b9dd3622 Introduce a cool new banner 2025-04-28 22:45:17 +08:00
Ben Woo 269bbf8783 Improve mv modify messages 2025-04-28 20:32:55 +08:00
Ben Woo fa5bbec9e3 Improve passing of location object and error handling 2025-04-25 17:08:12 +08:00
Ben Woo ee3a1f3a79 Rename NullLocation to NullSpawnLocation 2025-04-25 16:10:16 +08:00
Ben Woo b9e29fddea Fix entity spawn config modify value optional 2025-04-20 16:59:34 +08:00
Ben Woo c9a0dd368d Implement materials tab complete 2025-04-19 15:19:26 +08:00
Ben Woo 2db3589f05 Add shutdownDependencyInjection to MultiverseModule 2025-04-13 13:52:49 +08:00
Ben Woo 702ef3c569 Abstract out MultiverseModuleBinder 2025-04-13 12:49:51 +08:00
Ben Woo 0f21b61529 Better organise test resource files into folders 2025-04-13 12:44:22 +08:00
Ben Woo a568ab66dd Better organise test resource files into folders 2025-04-13 12:06:40 +08:00
Ben Woo 15dfc164e6 Remove ACF overrides as it has been fixed upstream 2025-04-13 12:00:31 +08:00
Ben Woo bbb5ecba1d Add spawn limit setting 2025-04-13 11:54:40 +08:00
Ben Woo 63b5393dea Refactor worldRef for spawn config 2025-04-13 11:44:26 +08:00
Ben Woo 1b8abc2ddd Rename mobsSpawnConfig to entitySpawnConfig 2025-04-13 11:39:29 +08:00
Ben Woo 8ee4e00181 Add support for controlling non-living entity spawn 2025-04-13 11:33:03 +08:00
Ben Woo 757057de39 Fix permissions of newly added commands 2025-04-11 23:51:49 +08:00
Ben Woo 5ce2eedbfd Fix import command syntax 2025-04-11 23:51:22 +08:00
Ben Woo fca6951d36 Fix clone command syntax 2025-04-10 22:51:53 +08:00
Ben Woo dc83349537 Add default failure logging for config load methods 2025-04-10 22:51:46 +08:00
Ben Woo c159b16860 Don't set ticks per spawn for SpawnCategory MISC 2025-04-10 22:50:57 +08:00
Ben Woo 4fba35b68f Automatically set default value of ListConfigNode to an ArrayList 2025-04-10 22:50:08 +08:00
Ben Woo 4ca8cfcaa1 Parse quotes for tab complete as well 2025-04-09 13:38:36 +08:00
Ben Woo 58de984524 Fix edge cases with parseQuotesInArgs and add tests 2025-04-09 13:08:02 +08:00
Ben Woo b615213907 Fix entity spawn config syntax 2025-04-09 10:53:59 +08:00
Ben Woo 807f7c1b66 Merge branch 'main' into MV5
# Conflicts:
#	build.gradle
2025-04-09 10:53:12 +08:00
Ben Woo 77994b991f Fix info command flag tab complete when in console 2025-04-09 10:16:24 +08:00
Ben Woo 677dd475f7 Improve entity spawn config info command output 2025-04-09 10:15:40 +08:00
Ben Woo 0e6a63d60e Fix InjectionTest commands number 2025-04-09 09:39:07 +08:00
Ben Woo 4fc4d7613a PlayerFinder use REPatterns for uuid and comma 2025-04-09 09:38:14 +08:00
Ben Woo 3cf1a9f33b Check null input for addonToCommaSeperated 2025-04-09 09:35:16 +08:00
Ben Woo c1b60c148e Use reflection to get spawn category of entity types 2025-04-09 09:03:23 +08:00
Ben Woo 9a3b28f5f5 Refactor list suggester to use addonToCommaSeperated util method 2025-04-09 09:02:46 +08:00
Ben Woo 6aebd2904f Do not need to set generator if generator string is empty 2025-04-08 23:46:36 +08:00
Ben Woo d0671a25d6 Merge pull request #3192 from Multiverse/ben/mv5/revamp-mobs-spawn
Ben/mv5/revamp mobs spawn
2025-04-08 23:41:47 +08:00
Ben Woo 8e17d2a6bd Add todo on spawn reasoning filter 2025-04-08 23:41:08 +08:00
Ben Woo af7a71753f Fix minor purge entity syntax issues 2025-04-08 23:38:07 +08:00
Ben Woo c0dd1518e1 Add purge entities commands 2025-04-08 23:30:43 +08:00
Ben Woo 3b5a1c1988 Implement MobsSpawnConfigCommand fully 2025-04-08 22:44:09 +08:00
Ben Woo 774c2b2327 Merge pull request #3191 from Multiverse/chore/gha-game-version
Update gha supported game version to 1.21.5
2025-04-08 21:44:25 +08:00
Ben Woo 71b1662b55 Update gha supported game version to 1.21.5 2025-04-08 21:40:29 +08:00
Ben Woo 9317f4cd6b Merge pull request #3190 from Multiverse/fix/javadoc-action
Fix gha javadoc cp path
2025-04-08 21:10:40 +08:00
Ben Woo 00b4a9bab4 Fix gha javadoc cp path 2025-04-08 21:05:38 +08:00
Ben Woo 48a091842a Merge pull request #3188 from Multiverse/ben/fix-gha-publish 2025-04-08 20:48:13 +08:00
Ben Woo 7e9ca7cc79 Refactor spawning to use MobsSpawnConfig with SpawnCategory support 2025-04-08 17:19:32 +08:00
Ben Woo d333cf55d1 Use isBooleanProp on MultiverseWorld getters 2025-04-08 14:23:12 +08:00
Ben Woo cb45ae1590 Reduce wait time for async teleport test 2025-04-08 14:19:27 +08:00
Ben Woo 3c85f1324d Add support for command args with spaces by using quotes 2025-04-08 14:16:27 +08:00
Ben Woo ee3f26b2f3 Refactor destination parsing to have error reasoning 2025-04-08 13:45:18 +08:00
Ben Woo 67f5e47dc9 Add a script to automatically convert locale properties to enum value 2025-04-08 13:30:39 +08:00
Ben Woo 8b530854f6 Use UnloadedWorldLocation for all destinations and fix some edge cases 2025-04-08 10:59:03 +08:00
Ben Woo 91e503e904 Refactor all commands to use FlagBuilder and fix legacy alias bugs 2025-04-07 23:26:37 +08:00
Ben Woo cf287ab9bf Implement new way of having flags with FlagBuilder class 2025-04-06 19:53:47 +08:00
Ben Woo ad51e92d90 Fix config tests 2025-04-06 19:48:41 +08:00
Ben Woo 40f80e8040 Make showLegacyAliases false by default 2025-04-06 19:48:32 +08:00
Ben Woo 5efbeaba92 Implement option to disable legacy aliases 2025-04-06 18:08:03 +08:00
Ben Woo e5eb9a7eba Refactor migrator action to its own package 2025-04-06 14:44:20 +08:00
Ben Woo 0ea7375fe9 Merge pull request #3189 from Multiverse/ben/mv5/mvanchor
Refactor anchors with MultiverseAnchor class and better location handling
2025-04-06 10:18:09 +08:00
Ben Woo 7db9e99fd7 Refactor anchors with MultiverseAnchor class and better location handling 2025-04-06 00:09:20 +08:00
Ben Woo da3248894e Use UnloadedWorldLocation for LocationManipulation 2025-04-06 00:06:23 +08:00
Ben Woo 8934133874 Implement equals, hashcode and string for UnloadedWorldLocation 2025-04-06 00:06:02 +08:00
Ben Woo 0ec184ce4d Improve error handling for location with unloaded worlds 2025-04-05 16:27:16 +08:00
Ben Woo 57ff66ab27 Improve localization for exceptions 2025-04-05 13:19:26 +08:00
Ben Woo 8bfa604584 Improve biome provider and generator error handling 2025-04-05 12:05:10 +08:00
Ben Woo c541c27485 Fix gha gradle publish command 2025-04-02 20:35:49 +08:00
Ben Woo fd02e00da6 Merge pull request #3187 from Multiverse/ben/publish-repo 2025-04-02 16:44:55 +08:00
Ben Woo 729ee19585 Remove need for QueuedCommandAction functional interface 2025-03-29 22:35:08 +08:00
Ben Woo e14853dc11 Use onarandombox repo for publishing 2025-03-29 17:46:15 +08:00
Ben Woo c439412a3c Common class to compile reusable regex pattern 2025-03-29 17:11:24 +08:00
Ben Woo 035728e37f Merge pull request #3185 from Multiverse/ben/mv5/protocol-version
Refactor protocol version to derive from plugin's version string
2025-03-29 16:45:57 +08:00
Ben Woo 4728449137 Remove need for MinBackwardsCompatibleVersion 2025-03-28 15:23:50 +08:00
Ben Woo e94cc41ca8 Refactor protocol version to derive from plugin's version string 2025-03-26 22:56:14 +08:00
Ben Woo ab4856c81e Merge pull request #3184 from Multiverse/ben/mv5/attempt-aggregate
Better handling for a list of attempts with AttemptsAggregate
2025-03-26 21:54:07 +08:00
Ben Woo 7861ac7d63 Remove unused of Async class 2025-03-26 21:42:48 +08:00
Ben Woo cf37956784 Add docs for AsyncAttempt 2025-03-26 21:40:58 +08:00
Ben Woo 0b39e94047 Implement runnable method and add javadocs to AttemptsAggregate 2025-03-26 21:30:50 +08:00
Ben Woo 0dce6293d5 Better handling for a list of attempts with AttemptsAggregate 2025-03-25 22:56:34 +08:00
Ben Woo 8b181cbe43 Add missing world properties in /mv info 2025-03-25 17:48:54 +08:00
Ben Woo 290a12ce02 Refactor method of getting only the world alias without fallback 2025-03-25 17:40:01 +08:00
Ben Woo 8eab3c13ef Add support for localize Message within ContentDisplay api 2025-03-25 17:19:46 +08:00
Ben Woo bf3fba58e2 Implement mv world events - Load, Unload, Clone, Regen, Remove 2025-03-25 15:19:18 +08:00
Ben Woo 34991a722a Minor codestyle and null checking cleanup 2025-03-25 13:45:04 +08:00
Ben Woo cca6c16928 Merge branch 'ben/mv5/dest-packet' into MV5 2025-03-25 12:22:07 +08:00
Ben Woo 1b379bb426 Cleanup hasAnySpawnPermission to remove duplicated code 2025-03-25 12:21:20 +08:00
Ben Woo 294c69524f Include its Destination object in DestinationSuggestionPacket to simplify code 2025-03-25 12:14:26 +08:00
Jeremy Wood 441e6da0ca Merge pull request #3183 from Multiverse/dtm/mv5/cleanup-2
Various cleanup & reorganizing
2025-03-24 23:58:50 -04:00
Jeremy Wood 09da352175 Reorganize config.functions package into config.nodes. 2025-03-24 23:35:59 -04:00
Jeremy Wood 552533f82e Move confighandle.node package to config package. 2025-03-24 23:26:42 -04:00
Jeremy Wood 8ddbadf6fc Move confighandle.migration package to config package. 2025-03-24 23:25:08 -04:00
Jeremy Wood 92297ceba9 Move confighandle.functions package to config package. 2025-03-24 23:24:44 -04:00
Jeremy Wood 766496459d Move confighandle package contents to config.handle. 2025-03-24 23:19:59 -04:00
Jeremy Wood 510c4b287c Revert "Mark everything under commandtools package as Internal."
This reverts commit 8cb35006
2025-03-24 22:29:46 -04:00
Jeremy Wood bc9122cf7e Rename commandtools package to command. 2025-03-24 22:26:35 -04:00
Jeremy Wood 8cb3500690 Mark everything under commandtools package as Internal. 2025-03-24 22:20:13 -04:00
Jeremy Wood 1a8c2c3045 Use lambda expression in AnchorManager. 2025-03-24 22:19:42 -04:00
Jeremy Wood 9295318794 Fix unmodifiable set in AnchorManager. 2025-03-24 22:19:41 -04:00
Ben Woo 81ea96019a CommandQueuePayload's OTP should be a String instead of int 2025-03-24 21:10:16 +08:00
Ben Woo 818c416d81 Fix listeners test 2025-03-24 20:23:22 +08:00
Ben Woo c020a298ef Implement QueuedCommandAction functional interface 2025-03-24 20:22:05 +08:00
Ben Woo d960ec048c Remove MVLocalesListener as it is handled by ACF 2025-03-24 20:11:05 +08:00
Ben Woo f4bca52712 Remove need for OpenBukkitCommandIssuer 2025-03-24 19:48:34 +08:00
Ben Woo 2f73856d17 Refactor configuration to confighandle package 2025-03-24 19:41:15 +08:00
Ben Woo 2608a12cf3 Merge pull request #3181 from Multiverse/ben/mv5/cleanup
Ben/mv5/cleanup
2025-03-22 12:23:52 +08:00
Ben Woo dc3acc8e08 Rename MVCoreConfig to CoreConfig 2025-03-16 11:29:25 +08:00
Ben Woo f5aa3f3de5 Add javadocs to various classes 2025-03-16 11:09:03 +08:00
Ben Woo e43f7de881 Refactor ConfirmMode to config package 2025-03-16 10:11:38 +08:00
Ben Woo 96f17784ec Cleanup DumpService 2025-03-16 10:08:32 +08:00
Ben Woo 02b3fa60c6 Merge pull request #3179 from Multiverse/ben/mv5/run-queue
Refactor runQueuedCommand to relay failure reason to caller
2025-03-16 10:07:51 +08:00
Ben Woo caa35ed6e3 Refactor runQueuedCommand to relay failure reason to caller 2025-03-15 09:42:34 +08:00
Ben Woo dc9a386af1 Implement a default command exception handler to show stacktrace 2025-03-08 12:58:31 +08:00
Ben Woo 120b51e9e6 Minor refactor to PlayerPortalEvent 2025-03-08 10:59:31 +08:00
Ben Woo 626e6d01ee Implement alias tab completion for destinations 2025-03-06 21:07:56 +08:00
Ben Woo ac2ca92d33 Remove colour code when resolving alias name in commands 2025-03-06 20:43:45 +08:00
Ben Woo 781dc35e52 Use runTaskLater instead of scheduleSyncDelayTask 2025-03-06 19:55:35 +08:00
Ben Woo ac8896ed6d Use Try class instead of catching throwable for ConfirmCommand 2025-03-06 19:55:10 +08:00
Ben Woo ca7ac564da Make destination classes final 2025-03-05 21:33:46 +08:00
Ben Woo 4551eae74f Fix MVDebugModeEvent not being called 2025-03-05 20:22:01 +08:00
Ben Woo dd279910bd Fix config test 2025-03-03 22:38:29 +08:00
Ben Woo ef47a70089 Default firstSpawnOverride to false 2025-03-02 16:56:09 +08:00
Ben Woo a2d7bbc58c Merge branch 'main' into MV5 2025-03-01 22:05:14 +08:00
Ben Woo 0ed41e3776 Merge branch 'main' into MV5 2025-03-01 22:04:42 +08:00
Ben Woo babcec1f5d Rename WorldPurger to LegacyWorldPurger 2025-02-28 22:35:27 +08:00
Ben Woo 9e25e1d00b Merge pull request #3176 from Multiverse/ben/update-gradle-action
Update gradle gha deps to v4
2025-02-28 22:30:19 +08:00
Ben Woo e9e0407dbc Refactor null name with hidden method 2025-02-28 22:29:48 +08:00
Ben Woo cfd7be25af Ensure VersionMigrator is applied in the correct order 2025-02-28 17:28:54 +08:00
Ben Woo 74e595b236 Add destination and debug mode tab completion for /mv config 2025-02-28 17:15:24 +08:00
Ben Woo f46449fb99 Fix possible null issue with gamerule completion 2025-02-28 17:10:15 +08:00
Ben Woo 54ebdcb38b Refactor config handling to only serialise and deserialise on load and save 2025-02-26 23:02:16 +08:00
Ben Woo 1a3baf2a98 Remove old dep relocations 2025-02-26 20:06:59 +08:00
Ben Woo 02127fa123 Update to 1.0.2 of gradle plugins. 2025-02-26 20:04:26 +08:00
Ben Woo 16f8f3cd00 Fix spectator mode not flying 2025-02-25 20:36:11 +08:00
Ben Woo a9fd4db245 Add debug block for checking safe location 2025-02-25 14:24:49 +08:00
Ben Woo f966266bdc Merge pull request #3177 from Multiverse/zax71/main/updated-readme 2025-02-24 11:58:24 +08:00
Zax71 c5b4b88647 Change available for to available on in badges and fix release/pre-release badges 2025-02-23 09:21:46 +00:00
Ben Woo fe0be3e6ec Fix destination's velocity not applying 2025-02-23 16:02:21 +08:00
Ben Woo 733a561cf8 Add teleport test for when finer permission is disabled 2025-02-23 15:41:39 +08:00
Ben Woo 61e2d008fe Refactor permission checking with scope enum 2025-02-23 15:38:16 +08:00
Ben Woo 95bd8492d2 Add time to placeholderApi 2025-02-23 13:45:57 +08:00
Ben Woo 5db01b860d Fix mv anchor tab completion 2025-02-23 13:39:29 +08:00
Ben Woo e3409be81b Update gradle gha deps to v4 2025-02-22 13:16:43 +08:00
Ben Woo bb9591ce10 Merge pull request #3172 from Multiverse/zax71/mv5/legacy-gamerule-names
Add back legacy gamerule commands
2025-02-17 19:22:13 +08:00
Ben Woo ab65c01408 Fix remove command tab complete 2025-02-17 19:18:23 +08:00
Zax71 a47125d29b Add back legacy gamerule commands 2025-02-16 12:28:24 +00:00
Ben Woo 3160ac32b4 Urlencode mclogs payload 2025-02-15 16:29:28 +08:00
Ben Woo 2de0c32d32 Add command context for MultiverseWorld array 2025-02-15 15:23:54 +08:00
Ben Woo fb7e496e4e Move addonToCommaSeperated to StringFormatter class 2025-02-15 15:23:54 +08:00
Ben Woo 9956142bba Merge pull request #3169 from Multiverse/zax71/MV5/confirm-command-custom-timeout
Add config option for `/mv confirm` timeout
2025-02-13 13:35:42 +08:00
Ben Woo 188a60ade7 Remove validDuration from ConfirmQueuePayload and directly reference config value 2025-02-13 13:27:49 +08:00
Zax71 b701da15ff Got the config done but DI is hard 2025-02-12 19:19:34 +00:00
Ben Woo eb20386bac Add reflection method to get field value from field name 2025-02-06 22:10:16 +08:00
Ben Woo 757ea6038f Merge pull request #3168 from Multiverse/dtm/mv5/gradle-plugins
Use build logic from custom gradle plugins.
2025-02-03 22:26:30 +08:00
Ben Woo 288a87d551 Fix tests issues with Biome.values() 2025-02-03 22:05:30 +08:00
Ben Woo e6313ceeb9 Add biome tab completion and docs 2025-02-03 21:59:39 +08:00
Jeremy Wood 74c311be96 Update to 1.0.1 of gradle plugins. 2025-02-03 08:43:20 -05:00
Jeremy Wood 0ffb55c4b9 Use build logic from custom gradle plugins. 2025-02-02 20:22:53 -05:00
Ben Woo f76c3e106a Remove unused AsyncSafetyTeleporter in MVPlayerListener 2025-01-31 20:12:41 +08:00
Ben Woo e83f9093f5 Fix tests due to biome string change 2025-01-28 13:22:45 +08:00
Ben Woo 40cafbd743 Add support for custom biome provider plugins 2025-01-28 13:11:07 +08:00
Ben Woo 13d75b1645 Use try with loading api service 2025-01-28 12:02:33 +08:00
Ben Woo 95ca397072 Implement Try<Void> for config save methods 2025-01-28 12:02:33 +08:00
Ben Woo cdfea86283 Add tests for spawn command 2025-01-28 12:02:33 +08:00
Ben Woo 06e7b30963 Use player.performCommand and check returns true 2025-01-28 12:02:33 +08:00
Ben Woo 761455aeb9 Fix teleporter not parsed correctly 2025-01-28 12:02:33 +08:00
Ben Woo c6797363f5 Implement using generator settings when creating world 2025-01-28 12:01:12 +08:00
Jeremy Wood a7ca4499c3 Merge pull request #3164 from Multiverse/dtm/mv5/more-fixes-2
More DumpsCommand cleanup.
2025-01-27 15:30:50 -05:00
Ben Woo e910e88b35 Fallback to WorldManager#getDefaultWorld when removing players from world 2025-01-28 00:20:46 +08:00
Ben Woo 92548a3617 Ensure mapAsyncAttempt is not forcing mapper AsyncAttempt to run synced 2025-01-28 00:10:31 +08:00
Ben Woo 92b13a5057 Make finer teleport config option apply to spawn permissions as well 2025-01-27 23:36:26 +08:00
Ben Woo 4cad57f749 Refactor all config node variables to be camelcase 2025-01-27 23:21:55 +08:00
Jeremy Wood 5cb7fc87c9 Use sealed classes for HttpAPIClient and implementations. 2025-01-27 10:15:53 -05:00
Ben Woo 1eaa76cb3a mapAsyncAttempt should call thenApply instead of thenApplyAsync 2025-01-27 23:04:20 +08:00
Jeremy Wood 72a7b2b511 Reduce complexity of DumpsLogPoster. 2025-01-27 10:00:30 -05:00
Jeremy Wood 35c4392033 Increase ThrowsCount checkstyle to permit max of 2. 2025-01-27 09:59:01 -05:00
Ben Woo df11141d17 Fix protocol version inequality (again lol) 2025-01-25 17:05:42 +08:00
Ben Woo f8b41cea91 Fix isIteratingOverLevelsMethod being null 2025-01-25 17:05:14 +08:00
Ben Woo c4f5ae366c Fix protocol version logic 2025-01-25 15:32:54 +08:00
Ben Woo d6ea37777f Rename getServiceProvider to getServiceLocator 2025-01-25 12:29:49 +08:00
Ben Woo 547c123075 Fix MultiversePlugin abstract methods should be public 2025-01-25 12:13:13 +08:00
Ben Woo 5d09bce8f4 Revamp how submodules should depend on mvcore 2025-01-25 11:55:43 +08:00
Ben Woo 18fd97410e Cleanup MultiverseCoreApi tests 2025-01-25 10:10:37 +08:00
Ben Woo 1ffdc4ad75 Add more common api getters and expose PluginServiceLocator 2025-01-25 10:10:24 +08:00
Ben Woo 0fceff073c Fix comment style in PluginServiceLocator 2025-01-25 09:52:57 +08:00
Ben Woo dee05cb21f Suggesting destination use CommandSender instead of CommandIssuer 2025-01-25 09:51:24 +08:00
Ben Woo 2b70c8bfa5 Merge pull request #3157 from Multiverse/zax71/mv5/whoCommandAutoWorld
`/mv who` command auto world
2025-01-25 09:40:47 +08:00
Ben Woo 3861737918 Merge pull request #3162 from Multiverse/ben/mv5/server-props
Read server.properties files to get default world
2025-01-25 09:32:12 +08:00
Ben Woo ee15740d75 Read server.properties files to get default world 2025-01-25 09:25:00 +08:00
Ben Woo 164e0ffd09 Fix javadoc error with p tag 2025-01-25 09:24:25 +08:00
Ben Woo 878d1d86f3 Merge remote-tracking branch 'origin/MV5' into MV5 2025-01-25 09:19:46 +08:00
Ben Woo 548dc7dae7 Removed unused sendPlayerToDefaultWorld method 2025-01-25 09:17:47 +08:00
Ben Woo 367b9096c5 Fix more sonarcloud nitpicks 2025-01-25 09:17:47 +08:00
Ben Woo 12c9911434 Convert GameRuleValue class to a record 2025-01-25 09:17:46 +08:00
Ben Woo d6f63ee2e9 Private constructor for TestingMode to prevent instantiation 2025-01-25 09:17:46 +08:00
Ben Woo 580e876009 Merge pull request #3161 from Multiverse/dtm/mv5/more-fixes
More checkstyle and sonarqube fixes.
2025-01-25 09:16:22 +08:00
Ben Woo 7aacd73460 Op should have teleport permissions 2025-01-25 09:15:45 +08:00
Jeremy Wood c692632b7f Reduce complexity of DumpsCommand.
Moves most logic to DumpsService.
2025-01-24 13:27:55 -05:00
Jeremy Wood 68595d4acf Extract LogPoster out of DumpsCommand. 2025-01-24 11:21:16 -05:00
Jeremy Wood 78d0e14ffd Add reusable page and filter flags. 2025-01-24 10:29:23 -05:00
Jeremy Wood 28f609858f Rename flags package to flag. 2025-01-24 10:03:44 -05:00
Jeremy Wood 9d72c7b22d Reduce complexity of CreateCommand. 2025-01-24 09:22:34 -05:00
Jeremy Wood d6f4bca6d1 Slightly lower complexity of AnchorManager. 2025-01-24 09:22:34 -05:00
Jeremy Wood 1397d14c4e Slightly lower complexity of RegenWorldOptions. 2025-01-24 09:22:34 -05:00
Ben Woo 0002582991 Convert GameRuleValue class to a record 2025-01-24 09:22:34 -05:00
Ben Woo 21b8008297 Private constructor for TestingMode to prevent instantiation 2025-01-24 09:22:33 -05:00
Ben Woo 906fac1e62 Make bypass gamemode and playerlimit permission false even when oped 2025-01-24 22:18:23 +08:00
Ben Woo 8096a4e185 Use ACFUtil for random instance 2025-01-24 21:27:02 +08:00
Jeremy Wood d3274cced7 Merge pull request #3159 from Multiverse/dtm/mv5/sonarqube-fixes
Checkstyle/Sonarqube fixes.
2025-01-24 00:04:43 -05:00
Jeremy Wood 949c4704f4 Reuse random in RegenWorldOptions. 2025-01-23 23:59:44 -05:00
Jeremy Wood 6d32393145 Remove instance initializer on HashMap. 2025-01-23 23:57:21 -05:00
Jeremy Wood 54f03256f7 Fix potential source of infinite recursion. 2025-01-23 23:55:36 -05:00
Jeremy Wood 715d1cb59b Fix checkstyle and sonarqube issues found in AnchorManager. 2025-01-23 23:45:19 -05:00
Jeremy Wood abe9ddd638 Update a few places using common replacements. 2025-01-23 23:44:53 -05:00
Jeremy Wood fb75953468 Fix many checkstyle and sonarqube issues on commands. 2025-01-23 23:41:59 -05:00
Jeremy Wood 417090489c Add common replacement keys. 2025-01-23 22:23:46 -05:00
Jeremy Wood f6e91fbc03 Disable checkstyle indentation module forceStrictCondition. 2025-01-23 19:53:49 -05:00
Jeremy Wood d7c1954a39 Merge pull request #3158 from Multiverse/ben/mv5/revamp-api
Ben/mv5/revamp api
2025-01-23 18:22:09 -05:00
Ben Woo ddc4785fed Dont call registerConditions in constructor 2025-01-23 23:14:32 +08:00
Ben Woo 402fa87e32 Refactor classes to reduce public exposure 2025-01-23 23:01:36 +08:00
Ben Woo 525171a69a De-interface all classes and remove api package 2025-01-23 22:29:08 +08:00
Zax71 c5a8134bce Switch to using @Flags("resolve=issuerAware") 2025-01-20 15:22:39 +00:00
Ben Woo d9cf3f50ee Merge pull request #3156 from Multiverse/zax71/mv5/improvedLocation 2025-01-20 12:38:53 +08:00
Zax71 9a55e35055 Add /mvw alias for /mv who 2025-01-19 17:33:18 +00:00
Zax71 9660b0c689 Allow not specifying a world to /mv who 2025-01-19 17:31:15 +00:00
Zax71 96b174c78a Improve syntax for /mv setspawn 2025-01-19 16:55:44 +00:00
Zax71 a269c0292f Add /mvss alias and state pitch and yaw when setting 2025-01-19 16:51:40 +00:00
Ben Woo 365b871cf1 Send correct price formatting when player has not enough money 2025-01-19 22:46:13 +08:00
Ben Woo 31524f9d0e Remove FilesManipulator and merge with FileUtils 2025-01-19 22:34:10 +08:00
Ben Woo b646937d23 Make config set methods return Try<Void> 2025-01-19 22:25:39 +08:00
Ben Woo d6a70bbb9b Fix MultiverseWorld#isLoadedWorld returning wrong value 2025-01-19 15:58:12 +08:00
Ben Woo 55cd6b7c59 Make WorldConfigNodes reference MultiverseWorld instead of LoadedMultiverseWorld 2025-01-19 15:51:42 +08:00
Ben Woo 4362453f90 Implement MVWorldPropertyChangeEvent 2025-01-19 15:29:04 +08:00
Ben Woo 36aa144121 Implement MVRespawnEvent as Cancellable and remove respawn method 2025-01-19 14:43:34 +08:00
Ben Woo bb91a74308 Make ItemEconomy a service 2025-01-19 14:36:38 +08:00
Ben Woo b8db6e2645 Implement MultiverseCoreApi 2025-01-18 15:51:26 +08:00
Ben Woo 449f85ee5c Ensure all imports in api does not import other multiverse.core packages 2025-01-18 15:16:41 +08:00
Ben Woo c1e6614423 Implement generator as an api 2025-01-18 15:13:41 +08:00
Ben Woo b17afbd8e0 Merge pull request #3155 from Multiverse/ben/mv5/api
Ben/mv5/api
2025-01-18 14:59:22 +08:00
Ben Woo b3e633b119 Fix and remove some useless todos 2025-01-18 14:57:13 +08:00
Ben Woo 4eb9ff6dae Remove old tests 2025-01-18 14:36:10 +08:00
Ben Woo e3fded9373 Major refactor to support developer api 2025-01-18 14:34:35 +08:00
Ben Woo 53c9cbe81c More configuration option for respawning 2025-01-18 11:37:00 +08:00
Ben Woo b68e8a2cef Localise teleport "you" message 2025-01-17 20:14:59 +08:00
Ben Woo 5742670a90 Implement better spawn command permission checking and tab complete 2025-01-17 20:14:21 +08:00
Ben Woo b66498545a Log unknown world flag 2025-01-17 20:13:18 +08:00
Ben Woo 7a6d328d5a Fix minor issues with teleport CommandCompletion 2025-01-17 18:57:14 +08:00
Ben Woo 2cfcdad4de Improve teleport tab complete handling 2025-01-17 16:50:41 +08:00
Ben Woo 4dc61634bd Don't log permission checks for console 2025-01-17 16:47:24 +08:00
Ben Woo 51731cd178 Only suggest destination that sender have permission for 2025-01-17 15:21:51 +08:00
Ben Woo 14a541cc49 Fix debug permission config not applying 2025-01-17 15:20:17 +08:00
Ben Woo 9d54cc48dd Properly register world and teleport permissions 2025-01-17 11:36:17 +08:00
Ben Woo ed5a13b269 Implement default-respawn-to-world-spawn config option and refactor respawn event 2025-01-16 20:55:27 +08:00
Ben Woo 971a159eae Fix config tests 2025-01-16 19:43:06 +08:00
Ben Woo 83e197aacd Implement config option for debug permission 2025-01-16 19:40:26 +08:00
Ben Woo 9884ec2e82 Fix tests by adding new anchor-respawn property to worlds.yml files 2025-01-16 13:16:58 +08:00
Ben Woo 52a4059f98 Fix typo in anchor respawn method name 2025-01-16 13:16:01 +08:00
Ben Woo c49653ebc8 Add world property toggle allow anchor spawn 2025-01-16 11:00:44 +08:00
Ben Woo 9be7c75dcc Defaults mv dumps to use paste.dev as paste.gg is down 2025-01-16 10:46:01 +08:00
Ben Woo 5b97c3fd1c Fix mv dumps unable to get latest.log if world-container is changed 2025-01-16 10:10:33 +08:00
Ben Woo 3a9eb88197 Merge pull request #3151 from Multiverse/ben/mv5/block-safety
ben/mv5/block-safety
2025-01-16 09:50:31 +08:00
Ben Woo d83d6c6483 Improve safe location search config comments 2025-01-16 09:42:40 +08:00
Ben Woo 6fb620cac6 Fix failing tests caused by new class and config changes 2025-01-16 09:39:38 +08:00
Ben Woo cb2ab3e437 Shift all to use AdvancedBlockSafety and deprecate old BlockSafety 2025-01-16 09:31:53 +08:00
Ben Woo 03dc8e4245 Rename the broken config file and regen a new one 2025-01-15 19:07:00 +08:00
Ben Woo 2df1f39ef9 Implement rest of block safety methods 2025-01-15 14:11:01 +08:00
Ben Woo 3b9a91c010 Implement better search algo that search from the nearest block outwards 2025-01-15 12:43:44 +08:00
Ben Woo 64e7baec3c Implement initial new algorithm for safe location 2025-01-14 23:10:35 +08:00
Ben Woo 06feb84ba9 Add test for worlds.yml with weird formatting 2025-01-13 23:55:01 +08:00
Ben Woo b5f1b32a3d Fix serialisation issues with string and list items 2025-01-13 23:53:57 +08:00
Ben Woo 647e116bc5 Refactor config handles and make world properties alphabetical order 2025-01-13 23:16:32 +08:00
Ben Woo 874b604294 Check if current location is safe before searching around 2025-01-13 19:27:52 +08:00
Ben Woo 1f8a7975ce Add more tests for world config manager 2025-01-13 14:31:17 +08:00
Ben Woo 293417125a Refactor and add config file assertion for config.yml testing 2025-01-13 14:18:30 +08:00
Ben Woo 5b09097fd2 Fix not removing old serialisation tags if file is crlf 2025-01-13 14:17:50 +08:00
Ben Woo c03679d20e Fix new config file not having version number 2025-01-13 14:16:49 +08:00
Ben Woo ef21d83c35 Fix config handle reset not using serialiser 2025-01-13 07:04:31 +08:00
Ben Woo 89871cd418 Ensure onSetValue is ran when setting up nodes 2025-01-12 22:49:15 +08:00
Ben Woo 7d90a11d9c Remove invalid command condition in delete command 2025-01-12 22:34:23 +08:00
Ben Woo ec19f3e786 Defer world operations if world is ticking 2025-01-12 22:33:46 +08:00
Ben Woo de879c7af2 Implement tab-complete for world property respawn-world 2025-01-12 21:57:02 +08:00
Ben Woo f707f29249 Improve worlds config tests with node to node yaml comparison 2025-01-12 18:07:01 +08:00
Ben Woo 4798ddda63 Fix world migration issues with alias and spawnrate 2025-01-12 18:06:01 +08:00
Ben Woo 4f28d38dc1 Fix test failing with lowercase enum 2025-01-12 15:26:23 +08:00
Ben Woo 2356bfa7fc Save all enums in config as lowercased 2025-01-12 15:22:23 +08:00
Ben Woo 643fa604d1 Fix certain config options resetting on reload 2025-01-12 15:21:59 +08:00
Ben Woo a982875558 Fix some english 2025-01-12 14:53:24 +08:00
Ben Woo 803345d09d Fix regen command test by disabling confirm 2025-01-12 12:24:29 +08:00
Ben Woo f1d98a68c5 Implement otp for queue command and confirm mode 2025-01-12 12:16:07 +08:00
Ben Woo 2c82c279e2 Implement option to disable finer teleport permission checking 2025-01-12 10:54:45 +08:00
Ben Woo 1e33689d7b Implement concurrent teleport limit 2025-01-12 10:50:32 +08:00
Ben Woo 8793aa506b Implement new config options for future features 2025-01-12 09:31:39 +08:00
Ben Woo 6d08d1551b Improve first spawn and join location with PlayerSpawnLocationEvent 2025-01-11 09:48:14 +08:00
Ben Woo 2949b96a46 Improve message output for tp command with proper fail reason 2025-01-10 23:58:28 +08:00
Ben Woo cdb5fc0560 Implement option to resolve world by alias for commands and destinations 2025-01-10 23:01:55 +08:00
Ben Woo f37ee00030 Implement --unsafe flag for spawn command 2025-01-10 21:32:44 +08:00
Ben Woo df7b9a3e5b Implement correct default scale for nether and end environment 2025-01-10 21:11:41 +08:00
Ben Woo bb6d236495 Merge pull request #3150 from Multiverse/ben/mv5/revamp-teleport
Ben/mv5/revamp teleport
2025-01-10 20:29:21 +08:00
Ben Woo 7c2b7e5a47 Fix a test for ConfigTeleportInterceptTest 2025-01-10 20:24:02 +08:00
Ben Woo 5f15cce3f3 Add tests for multiple player teleport 2025-01-10 20:21:19 +08:00
Ben Woo 199da71be0 Add docs for new AsyncSafetyTeleporter 2025-01-10 20:13:49 +08:00
Ben Woo 303ac039e0 Add default serialisers for all number types 2025-01-10 20:01:49 +08:00
Ben Woo 067a88eec1 Fix scale double migration 2025-01-10 19:57:21 +08:00
Ben Woo 34ea244e82 Add tests for setPropertyString 2025-01-10 19:48:42 +08:00
Ben Woo 68717d592c Implement double serialization to fix scale config node 2025-01-10 13:23:59 +08:00
Ben Woo c0c9814c10 Improve config node deserialization handling 2025-01-10 13:23:15 +08:00
Ben Woo 0f1a9eb8f7 Fix double migrator action class name 2025-01-10 13:19:03 +08:00
Ben Woo d9aae1ade7 Remove unused TeleportResult.Success enum 2025-01-09 22:36:09 +08:00
Ben Woo 3e69dd4877 Fix teleport test build error 2025-01-09 22:29:35 +08:00
Ben Woo 918d54f466 Only allow proper true/false strings to be parsed 2025-01-09 21:28:46 +08:00
Ben Woo 25e704d6ce Implement test for teleport command 2025-01-09 20:54:49 +08:00
Ben Woo d8d8607592 Convert all usage of AsyncSafetyTeleporter to new api 2025-01-09 20:52:16 +08:00
Ben Woo 2e309cab0d Refactor safety teleporter with AsyncSafetyTeleporterAction 2025-01-08 22:49:11 +08:00
Ben Woo 97b6d240fc Implement attempt thenRun and thenAccept 2025-01-08 22:48:27 +08:00
Ben Woo 9e38142c4f Make file utils a service and optimise server folder file search 2025-01-08 09:34:11 +08:00
Ben Woo 5dddfbebc9 Merge pull request #3149 from Multiverse/ben/mv5/single-biome
Add support for creating worlds with single biome
2025-01-05 23:10:13 +08:00
Ben Woo ddedf2cbdd Fix failed tests caused by new biome property 2025-01-05 23:02:21 +08:00
Ben Woo 71e47d22ef Add support for creating worlds with single biome 2025-01-05 22:55:34 +08:00
Ben Woo 08ac65e372 Add missing SPAWN_FAILED message key 2025-01-05 11:15:18 +08:00
Ben Woo 50ed9e29d8 Merge pull request #3147 from Multiverse/ben/mv5/regen-test
Implement tests for regen command
2025-01-05 10:48:52 +08:00
Ben Woo e492c2801e Implement more tests for regen command 2025-01-05 10:43:55 +08:00
Ben Woo 5259f6a503 Fix spawn location in world config should use SpawnLocation class not bukkit Location 2025-01-04 10:21:47 +08:00
Ben Woo 17bb856242 Add --unsafe flag to teleport command 2025-01-04 10:09:17 +08:00
Ben Woo df1cb2ccc2 Fix config typo in auto-purge-entities comments 2025-01-04 09:50:05 +08:00
Ben Woo 5a90d51e36 Implement tests for regen command 2025-01-03 21:35:21 +08:00
Ben Woo b8f2ebdab7 Enable tests for counting number of commands as a service 2025-01-03 20:37:15 +08:00
Ben Woo 78b9ad532b Fix anchor command inheriting from CoreCommand 2025-01-03 20:36:48 +08:00
Ben Woo 88bb593b84 Refactor and implement tests for create and delete command 2025-01-03 20:27:09 +08:00
Ben Woo f67777b9a7 Allow delete world command to delete unloaded worlds 2025-01-03 20:26:43 +08:00
Ben Woo a5ba42285f Fix crash when CommandManager calling Plugin#getConfig before config is migrated 2025-01-03 20:15:13 +08:00
Ben Woo 33e440ffec Fix regen command random seed flag 2025-01-03 18:13:38 +08:00
Ben Woo 8fdb13765e Fix regen command syntax description and minor notes 2025-01-02 22:59:19 +08:00
Ben Woo 88171da0ab Fix invalid gamerule error 2025-01-02 22:58:24 +08:00
Ben Woo 7db5f8c30c Merge pull request #3146 from Multiverse/ben/mv5/improve-locales
Implement configurable default and per-player locale
2025-01-02 20:50:16 +08:00
Ben Woo 69ab1d3953 Ensure parent locales field is using the same instance in CommandManager 2025-01-02 20:48:37 +08:00
Ben Woo 92f3225144 Merge pull request #3145 from Multiverse/ben/mv5/check-command
Actually implement check command
2025-01-02 20:44:23 +08:00
Ben Woo 1885298222 Implement more detailed localization config tests 2025-01-01 22:23:13 +08:00
Ben Woo 7ae9d2671e Add config methods for the 2 new locale config nodes 2025-01-01 22:22:46 +08:00
Ben Woo c6ceba8ea5 Implement configurable default and per-player locale 2025-01-01 11:34:11 +08:00
Ben Woo 22e18545ed Actually implement check command 2024-12-31 12:04:16 +08:00
Ben Woo f20b4f285f Bump mockbukkit with canGenerateStructures method support 2024-12-31 11:27:06 +08:00
Ben Woo d06407fcde Merge pull request #3142 from Multiverse/ben/mv5/teleport-intercept
Properly implement teleport intercept config option
2024-12-20 23:12:03 +08:00
Ben Woo 8410175f60 Merge pull request #3137 from Multiverse/ben/mv5/command-permissions
Implement more customisable way of doing permission checking
2024-12-20 23:11:43 +08:00
Ben Woo 3bdc7f428b Merge pull request #3140 from Multiverse/ben/mv5/command-tests
Ben/mv5/command tests
2024-12-20 23:09:32 +08:00
Ben Woo a5009bf8a5 Merge pull request #3141 from Multiverse/ben/mv5/flag-group
Allow customisation of flag group prefix used
2024-12-20 23:08:57 +08:00
Ben Woo 018e15483d Improve teleport intercept config comment 2024-12-12 18:37:21 +08:00
Ben Woo d8b56b9feb Properly implement teleport intercept config option 2024-12-12 10:39:35 +08:00
Ben Woo 63b6ab225f Allow customisation of flag group prefix used 2024-12-11 19:47:56 +08:00
Ben Woo 0700d481d1 Add test for config command 2024-12-11 17:23:34 +08:00
Ben Woo 80ad788028 Abstract common action for command testing to a base class 2024-12-11 17:23:19 +08:00
Ben Woo f55bacc83d Improve error handling for string parser 2024-12-11 17:22:40 +08:00
Ben Woo 12ed1885d8 Implement better permission checking for spawn command 2024-12-11 15:59:38 +08:00
Ben Woo 8e64b18102 Merge pull request #3136 from Multiverse/ben/mv5/gamerule-value
Improve gamerule value suggestion
2024-12-07 14:26:30 +08:00
Ben Woo 32f609e9ad Teleport command no longer need to override hasPermission 2024-11-29 22:57:49 +08:00
Ben Woo ea87f2a30b Implement more customisable way of doing permission checking 2024-11-29 22:51:20 +08:00
Ben Woo 75a98f9c67 Improve gamerule value suggestion 2024-11-27 16:48:31 +08:00
Ben Woo 974887d13f Throw error if number parsing fails 2024-11-27 15:23:24 +08:00
Ben Woo c6983a5f44 Ensure value is not null for the relevant PropertyModifyAction 2024-11-27 15:07:35 +08:00
Ben Woo 0d6daa1cd6 Improve MultiverseWorld command context error handling 2024-11-27 15:06:39 +08:00
Ben Woo 6a351fd38a Backup old mv4's worlds config to worlds.yml.old 2024-11-27 11:58:59 +08:00
Ben Woo 6c6553bf85 Delete old entryfee path from world config during migration 2024-11-27 11:58:18 +08:00
Ben Woo 7e8ba18ba1 Fix worlds config file name from worlds2 to worlds 2024-11-27 11:57:38 +08:00
Jeremy Wood aac076f19a Ignore ordering for potential worlds list test. 2024-11-25 09:23:51 -08:00
Ben Woo ecf0260a9f Revert "Remove unused MVPlayerTouchedPortalEvent"
This reverts commit 9781e8350c.
2024-11-24 13:39:28 +08:00
Ben Woo 470e657e3e Merge pull request #3133 from Multiverse/ben/mv5/events
Ben/mv5/events
2024-11-24 13:28:09 +08:00
Ben Woo d0774614c8 Rename MVDumpsDebugInfoEvent methods to reflect the class name change 2024-11-24 13:26:22 +08:00
Ben Woo 8d852c5269 Add todo for MVWorldPropertyChangeEvent 2024-11-24 11:21:13 +08:00
Ben Woo e93e2aa5f4 Implement MVWorldDeleteEvent event 2024-11-24 11:21:01 +08:00
Ben Woo 07ed9fbc48 Cleanup MVConfigReloadEvent and deprecate MVRespawnEvent 2024-11-23 21:28:05 +08:00
Ben Woo c0ceb4f993 Rename MVVersionEvent to MVDumpsDebugInfoEvent for clarity 2024-11-23 21:25:23 +08:00
Ben Woo 9781e8350c Remove unused MVPlayerTouchedPortalEvent 2024-11-23 21:24:30 +08:00
Ben Woo b1afd8f786 Implement MVTeleportDestinationEvent event 2024-11-23 21:24:14 +08:00
Ben Woo 668856dccc Add temporary publishing repo 2024-11-23 18:06:53 +08:00
Ben Woo e59089f706 Fix mvimport description locale 2024-11-22 20:52:17 +08:00
Ben Woo 295259a456 Merge pull request #3132 from Multiverse/ben/mv5/merge-main
Ben/mv5/merge main
2024-11-22 20:51:45 +08:00
Ben Woo 8ebb5cff5a Merge branch 'main' into ben/mv5/merge-main
# Conflicts:
#	src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java
2024-11-22 17:14:17 +08:00
Ben Woo 8a28bcafec Expose MV's completion and context instances in CommandManager 2024-11-21 22:28:48 +08:00
Ben Woo 0cc1676e6c Fix finer permission checking filter 2024-11-21 22:28:10 +08:00
Ben Woo b434903739 Merge pull request #3131 from Multiverse/ben/mv5/NewAndRemovedWorlds
Use a record NewAndRemovedWorlds instead of generic tuple for clarity
2024-11-21 22:10:41 +08:00
Ben Woo 5b3477af3e Merge pull request #3117 from Multiverse/ben/pr-comment-artifact
Comment build artifact in PR
2024-11-21 21:36:51 +08:00
Ben Woo e2050c825e Merge pull request #3130 from Multiverse/ben/mv5/improve-destination
Refactor to remove need for ParsedDestination and add destination tests
2024-11-21 11:52:08 +08:00
Ben Woo faf8d1a7d0 Merge pull request #3129 from Multiverse/ben/mv5/material-converter
Re-add MaterialConverter class and add tests
2024-11-21 11:49:24 +08:00
Ben Woo e15dd7e69b Implement DestinationInstance#getIdentifier shortcut 2024-11-21 10:56:41 +08:00
Ben Woo cee6a4879a Implement ExactDestination#fromLocation 2024-11-21 09:57:07 +08:00
Ben Woo f5b5148f82 Use a record NewAndRemovedWorlds instead of generic tuple for clarity 2024-11-21 09:46:57 +08:00
Ben Woo d3f6b11fe5 Refactor to remove need for ParsedDestination and add destination tests 2024-11-20 22:25:33 +08:00
Ben Woo 1eeb265f4e Merge pull request #3127 from Multiverse/ben/mv5/testssss
More testsss
2024-11-20 21:48:37 +08:00
Ben Woo 2f8d23390a Merge pull request #3128 from Multiverse/fix-publish-repo 2024-11-19 07:08:32 +08:00
Jeremy Wood c4d01b65b7 Publish to correct repo url based on version. 2024-11-18 15:36:47 -05:00
Ben Woo d415a7fc5c Re-add MaterialConverter class and add tests 2024-11-17 15:05:12 +08:00
Ben Woo 0b89738ec0 Update to mockbukkit 4.0 2024-11-16 17:03:11 +08:00
Jeremy Wood e33fc93a1d Merge pull request #3126 from Multiverse/ben/fix-publish
Fix gha publish command
2024-11-16 02:29:27 -05:00
Ben Woo 656b318be3 Fix gha publish command 2024-11-16 15:27:32 +08:00
Jeremy Wood 562dece6f9 Merge pull request #3125 from Multiverse/jwood/reposilite
Publish to new repo using temp url.
2024-11-16 02:02:19 -05:00
Jeremy Wood fa30b432a9 Publish to new repo using temp url. 2024-11-15 23:19:53 -05:00
Ben Woo 20af0350aa Implement tests for WorldNameChecker class 2024-11-14 20:39:56 +08:00
Ben Woo 30e8b93786 Fix null and empty world name checking 2024-11-14 20:39:35 +08:00
Ben Woo b7d067123c Implement more detailed world manager tests 2024-11-14 19:50:08 +08:00
Ben Woo 38dd0018e7 Fix and refactor cloneWorld hasWorldFolder check 2024-11-14 19:48:51 +08:00
Ben Woo e889e406ae Fix bstats shadowing and archive name build issues 2024-11-14 15:28:17 +08:00
Jeremy Wood 83b6236ed7 Merge pull request #3124 from Multiverse/ben/javadoc-latest
Add latest dir for javadoc
2024-11-14 00:51:18 -05:00
Ben Woo 41cab5b290 Improve replace_latest description 2024-11-14 13:40:53 +08:00
Ben Woo 99a716ccaa latest boolean 2024-11-14 13:38:42 +08:00
Ben Woo ecca904aef Add latest dir for javadoc 2024-11-14 13:26:32 +08:00
Ben Woo a2a740f371 Merge pull request #3123 from Multiverse/ben/javadoc
Javadoc with github action
2024-11-14 12:32:51 +08:00
Ben Woo c66b1a2b96 Add manual dispatch action for javadoc 2024-11-14 12:25:13 +08:00
Ben Woo 52b2170f8f Deploy javadoc to github pages on release 2024-11-14 12:22:30 +08:00
Ben Woo 4264c0c9d2 Merge pull request #3119 from Multiverse/ben/mv5/java-21
Make test run on java 21 for latest mockbukkit to work
2024-11-10 16:29:55 +08:00
Ben Woo 061b90ce90 Config gha to use java 21 for build 2024-10-14 14:23:45 +08:00
Ben Woo 38aa534cf5 Bump mockbukkit to latest 1.21 version 2024-10-14 14:19:29 +08:00
Ben Woo 234d42f1f1 Make tests run on java 21 instead of 17 2024-10-14 14:18:39 +08:00
Ben Woo a226ae5d4a Merge pull request #3098 from Multiverse/ben/mv5/anchorcommands
Implement anchor commands
2024-10-14 10:58:11 +08:00
Ben Woo 1ba0505c4b Merge pull request #3109 from Multiverse/ben/mv5/entryfee-currency
Properly implement entryfee for world config
2024-10-14 10:57:35 +08:00
Ben Woo bc27f0548a Merge pull request #3106 from Multiverse/ben/mv5/remove-old-serial
Remove old SerializationConfig dependency
2024-10-14 10:56:12 +08:00
Ben Woo 17d376d4d4 Bump upload artifact action to v4 2024-10-13 10:54:38 +08:00
Ben Woo 1547ea84c6 Comment build artifact in PR 2024-10-13 10:54:19 +08:00
Ben Woo c8e50ff7fc Merge pull request #3115 from Multiverse/ben/mv5/config-improvements
Ben/mv5/config improvements
2024-10-12 13:56:59 +08:00
Ben Woo 5a9b9771bc Merge pull request #3116 from Multiverse/ben/mv5/fix-version-test
Fix version command test
2024-10-12 13:56:45 +08:00
Ben Woo 7def05e112 Fix version command test 2024-10-12 13:50:45 +08:00
Ben Woo 42cfd9dcc4 Fix enforcementHandler being null in WorldConfigNodes 2024-10-12 13:43:49 +08:00
Ben Woo 7868a1971e Dont need to deserialize enum if it is already an enum 2024-10-12 13:43:17 +08:00
Ben Woo 9c929fccca Fix modify command string parsing 2024-10-12 13:42:15 +08:00
Ben Woo 18f4600ca4 Merge pull request #3107 from Multiverse/ben/mv5/version-cmd-test
Add tests for version command
2024-10-12 13:37:47 +08:00
Ben Woo 1ea3531d26 Merge pull request #3104 from Multiverse/ben/mv5/multi-plugin-hk2-support
multi plugin hk2 support
2024-10-12 13:36:47 +08:00
Ben Woo 11e2deaa23 Properly implement entryfee for world config 2024-09-18 21:12:17 +08:00
Ben Woo a68b78e5a4 Make contract for core specific listeners and commands 2024-09-15 13:36:29 +08:00
Ben Woo c3674e0a2f Revamp hk2 injection to support injection in dependent plugins 2024-09-15 13:36:29 +08:00
Ben Woo 64584cc6cf Fix gradle group id 2024-09-15 13:36:29 +08:00
Ben Woo 7368ff257c Add tests for version command 2024-09-15 13:34:35 +08:00
Ben Woo 54736baf33 Remove old SerializationConfig dependency 2024-09-15 13:30:36 +08:00
Ben Woo 1528fdfed1 Merge pull request #3105 from Multiverse/ben/mv5/papi-dep
Update placeholderAPI repo and version
2024-09-15 10:44:04 +08:00
Ben Woo c05d1401ea Update placeholderAPI repo and version 2024-09-15 09:43:41 +08:00
Ben Woo 4be2034588 Merge pull request #3093 from Multiverse/Zax71/MV5/implement-1420 2024-09-10 14:19:20 +08:00
Ben Woo 7bde4c1033 Merge pull request #3057 from Multiverse/zax71/MV5/spawnCommand
Add `/mv spawn` and `/mv setspawn`
2024-08-30 14:27:15 +08:00
Ben Woo f00e2964f3 Proper spawn permission checking 2024-08-30 14:23:45 +08:00
Ben Woo 1ec4e4b8f0 Improve setspawn command location param 2024-08-30 13:55:39 +08:00
Ben Woo 330d4fbe39 Improve spawn command messaging 2024-08-30 13:06:27 +08:00
Ben Woo 8cbf2bc050 Merge branch 'MV5' into zax71/MV5/spawnCommand 2024-08-30 12:29:50 +08:00
Ben Woo 77350539a7 Merge pull request #3095 from Multiverse/zax71/mv5/legacy-aliases
Add legacy aliases to all commands
2024-08-30 12:27:49 +08:00
Ben Woo d530c2aa4d Fix some formatting issues. 2024-08-30 12:25:50 +08:00
Ben Woo d83ecd3b94 Merge pull request #3097 from Multiverse/ben/mv5/getWorld-bukkit
Fix WorldManager#getWorld from bukkit World not mapping to worldname
2024-08-29 11:14:01 +08:00
Ben Woo fe79580e86 Merge pull request #3099 from Multiverse/ben/mv5/AsyncAttempt
Add onFailure methods to AsyncAttempt class
2024-08-29 11:00:28 +08:00
Ben Woo e0d0ee0ad0 Add onFailure methods to AsyncAttempt class. 2024-08-28 20:01:03 +08:00
Ben Woo 1d1f5940d7 Implement anchor commands 2024-08-28 19:15:03 +08:00
Ben Woo ad3a6fc8fc Fix WorldManager#getWorld from bukkit World not mapping to worldname 2024-08-28 17:56:36 +08:00
Ben Woo 533e843cdb Merge pull request #3055 from Multiverse/zax71/MV5/whoCommand
Add `/mv who` and `/mv whoall`
2024-08-28 17:53:08 +08:00
Ben Woo 833c33e26e Merge pull request #3094 from Multiverse/zax71/mv5/mvm-coloring 2024-08-28 10:21:58 +08:00
Zax71 949ba46a16 Add legacy aliases 2024-08-27 19:59:21 +01:00
Zax71 62c9497365 Fix colouring on /mv modify 2024-08-27 19:30:41 +01:00
Zax71 fef9ba44cd Allow /mv list to show world names instead of aliases 2024-08-27 18:51:30 +01:00
Ben Woo 38f97a81c8 Merge pull request #3091 from Multiverse/1.21.1-update
Update to 1.21.1
2024-08-25 10:09:26 +08:00
Zax71 e13349949a Update to 1.21.1 2024-08-23 12:08:41 +01:00
Ben Woo 2d059eabc3 Merge pull request #3084 from Multiverse/ben/fix-getTo-null 2024-08-13 10:19:25 +08:00
Ben Woo 006fe56d18 Fix edge case where PlayerTeleportEvent getTo is null 2024-08-12 21:41:39 +08:00
Ben Woo 2cf8b6961c Merge pull request #3082 from Multiverse/1.21-update 2024-08-08 08:10:15 +08:00
Zax71 9c519e1ea4 Maybe don't be so dumb this time 2024-08-07 15:42:55 +01:00
Ben Woo f1db561262 Merge pull request #3081 from Multiverse/1.21-update
Change versions to support 1.21
2024-08-07 22:07:19 +08:00
Zax71 f0cf1b7d4c Change versions to support 1.21 2024-08-07 13:10:26 +01:00
Ben Woo 7b20cd6443 Merge branch 'MV5' into zax71/MV5/whoCommand 2024-03-12 10:39:36 +08:00
Ben Woo 278c51d056 Merge pull request #3056 from Multiverse/zax71MV5/versionCommand
Add `/mv version`
2024-03-12 10:38:12 +08:00
Zax71 caed081f82 Update Ben's name 2024-03-08 18:03:42 +00:00
Zax71 6982d8e7ba Add null check for world 2024-03-08 18:02:15 +00:00
Zax71 1a508a5d14 Add logic for spawn and setspawn 2024-03-08 17:58:45 +00:00
Zax71 631ed2973a Rename to /mv spawn tp in preparation for /mv spawn set 2024-02-24 18:10:30 +00:00
Zax71 39c533e808 Use safetyTeleporter and add i18n 2024-02-24 17:56:54 +00:00
Zax71 b1a5907d0c /mv spawn basic features 2024-02-24 17:38:40 +00:00
Zax71 7276da7665 Implement i18n 2024-02-24 13:48:57 +00:00
Zax71 90b8729129 Add Ben and Zax71 to authors 2024-02-24 13:37:23 +00:00
Zax71 c24f198ed0 Add /mv version 2024-02-24 13:36:13 +00:00
Zax71 c640a251b6 Add i18n and tell user when a world is empty when using /mv who 2024-02-24 13:03:12 +00:00
Zax71 a6f4f2d2d5 Add /mv who and /mv whoall 2024-02-24 12:26:05 +00:00
Ben Woo 0c37c9e934 Merge pull request #3033 from Multiverse/ben/mv5/list-value-node
Implement ListValueNode and modify actions
2023-09-25 22:24:42 +08:00
Ben Woo 454bcd36e5 Refactor and fix checkstyles for some listeners 2023-09-25 14:09:09 +08:00
Ben Woo af7d5a8cb0 Remove useless MultiverseCoreListener 2023-09-25 14:08:51 +08:00
Ben Woo a44361f5e4 Merge pull request #3034 from Multiverse/zax71/MV5/gameruleCommandMerge
Zax71/mv5/gamerule command merge
2023-09-25 13:31:20 +08:00
Ben Woo 8d508358f7 Implement gamerule reset 2023-09-25 12:29:29 +08:00
Zax71 7c6d7d5883 Merge /mv gamerule and /mv gamerules 2023-09-24 10:34:11 +01:00
Ben Woo c78dbcd395 Implement ListValueNode and modify actions 2023-09-24 11:11:48 +08:00
Ben Woo b2c1aafb62 Make sure nodes is not null and fix some checkstyles 2023-09-23 10:14:10 +08:00
Ben Woo d08e6fae38 Merge pull request #3032 from Multiverse/zax71/MV5/GeneratorsCommand
Add `/mv generators` command
2023-09-23 09:52:17 +08:00
Ben Woo d6ccbd9eee Fix some checkstyles for generator command 2023-09-23 09:50:22 +08:00
Ben Woo d880ea95ed Merge pull request #3031 from Multiverse/ben/mv5/issuer-methods
Support more variety of message payload for MVCommandIssuer
2023-09-23 09:41:07 +08:00
Ben Woo 38aa2acf8e Merge pull request #3030 from Multiverse/zax71/MV5/InfoCommand
Add `/mv info`
2023-09-23 09:40:41 +08:00
Ben Woo 5845fdd541 Merge pull request #3027 from Multiverse/ben/mv5/config-suggest-parser
Implement autocomplete and string parsing for config handling
2023-09-23 09:39:15 +08:00
Ben Woo 01cfcc5684 Merge pull request #3019 from Multiverse/ben/mv5/teleporter
Ben/mv5/teleporter
2023-09-23 09:38:55 +08:00
Ben Woo 62a4e7e27d Merge pull request #3028 from Multiverse/ben/mv5/remove-unsafecallwrapper
Remove UnsafeCallWrapper as now we use varv Try
2023-09-23 09:38:39 +08:00
Zax71 ac174dcf66 Add /mv generators 2023-09-22 19:03:19 +01:00
Ben Woo 4095829eca Replace properties method in MVConfig to StringPropertyHandle 2023-09-22 23:09:31 +08:00
Ben Woo 13dc1bd0d0 Support more variety of message payload for MVCommandIssuer 2023-09-22 17:44:44 +08:00
Ben Woo 3a6c52337f Add more properties to info command and refactor 2023-09-22 17:20:41 +08:00
Ben Woo 61e3ffb7e5 Add null value formatting for MapContentProvider 2023-09-22 17:20:13 +08:00
Ben Woo 41f9989eef Fix more checkstyles and use LinkedHashMap for info command 2023-09-22 16:09:04 +08:00
Ben Woo 896524b57a Check some checkstyles for info command 2023-09-22 15:46:54 +08:00
Zax71 42ca91d05b Add /mv info 2023-09-21 18:54:49 +01:00
Ben Woo 5db5b948cc Fix some related checkstyles 2023-09-21 11:47:20 +08:00
Ben Woo 2e5679491c Remove UnsafeCallWrapper as now we use varv Try 2023-09-21 11:36:55 +08:00
Ben Woo 980d6784df Merge branch 'MV5' into ben/mv5/teleporter
# Conflicts:
#	src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java
2023-09-21 11:23:05 +08:00
Ben Woo a2f6e201d0 Add injection test for AsyncSafetyTeleporter 2023-09-21 11:20:23 +08:00
Ben Woo f2e193eda3 Improve node suggest javadocs 2023-09-20 23:39:04 +08:00
Ben Woo 4084cd4af1 Move property handling to a separate class 2023-09-20 23:35:10 +08:00
Ben Woo 6fe87fbc7b Implement autocomplete and string parsing for config handling 2023-09-20 16:32:25 +08:00
Ben Woo 6611ec4457 Make defaultValue a supplier and fix some checkstyle in ConfigNode 2023-09-20 13:45:14 +08:00
Ben Woo e4bff69372 Pass multiverse core instance directly into WorldConfigNodes 2023-09-20 12:39:59 +08:00
Ben Woo 5dba08dd1b Merge pull request #3025 from Multiverse/ben/mv5/fix-remove-locale
Fix remove success message key
2023-09-20 12:34:02 +08:00
Ben Woo 2e0ce517a8 Merge pull request #3026 from Multiverse/ben/mv5/enum-completion
Implement lowercased enum completion and fix some checkstyles
2023-09-20 12:33:47 +08:00
Ben Woo 7fcfa64538 Merge pull request #3024 from Multiverse/ben/mv5/mv-world-oncontext
Ben/mv5/mv world oncontext
2023-09-20 12:33:33 +08:00
Ben Woo cce041877f Cleanup NodeGroup with docs and annotation 2023-09-20 12:31:34 +08:00
Ben Woo 6ba51fa573 Implement lowercased enum completion and fix some checkstyles 2023-09-20 12:25:03 +08:00
Ben Woo bbfc1a05e8 Cleanup MultiverseCommand and add docs 2023-09-20 12:18:04 +08:00
Ben Woo 80fcf8fe19 Fix remove success message key 2023-09-20 12:10:02 +08:00
Ben Woo b99de26deb Use MultiverseWorld instead of worldname string for RemoveCommand 2023-09-20 12:06:08 +08:00
Ben Woo fb240a19fa Add context resolving for MultiverseWorld class 2023-09-20 12:02:29 +08:00
Ben Woo 180680f297 Add method to get MultiverseWorld from a bukkit world. 2023-09-20 12:01:26 +08:00
Ben Woo 91f9842b24 Merge pull request #3022 from Multiverse/dtm/mv5/teleporter_attempt
Add AsyncAttempt.
2023-09-14 22:34:34 +08:00
Ben Woo bf8244e587 Refactor some async attempt handling 2023-09-14 11:30:35 +08:00
Ben Woo 94bcca914f Add warning of player still in world while unloading 2023-09-14 11:26:07 +08:00
Ben Woo 23b429940c Fully implement AsyncResult 2023-09-14 11:03:45 +08:00
Jeremy Wood 3df46bc55c Add AsyncAttempt for example purposes. 2023-09-13 16:16:47 -04:00
Ben Woo 2f3306aa97 Add class level docs for AsyncResult 2023-09-14 00:37:33 +08:00
Ben Woo 82c84c2c7c Implement AsyncResult, a wrapper for CompletableFuture 2023-09-14 00:36:22 +08:00
Ben Woo 2642d940ba Clearer docs for tolerance and radius for getSafeLocation 2023-09-13 23:32:10 +08:00
Ben Woo 404ab738c0 Fix imports 2023-09-13 23:21:23 +08:00
Ben Woo bc1a2ff8a1 Merge branch 'MV5' into ben/mv5/teleporter
# Conflicts:
#	src/main/java/org/mvplugins/multiverse/core/commands/DeleteCommand.java
#	src/main/java/org/mvplugins/multiverse/core/commands/RegenCommand.java
#	src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java
#	src/main/java/org/mvplugins/multiverse/core/commands/UnloadCommand.java
#	src/main/java/org/mvplugins/multiverse/core/destination/core/CannonDestination.java
#	src/main/java/org/mvplugins/multiverse/core/destination/core/ExactDestination.java
#	src/main/java/org/mvplugins/multiverse/core/destination/core/WorldDestination.java
#	src/main/java/org/mvplugins/multiverse/core/listeners/MVPlayerListener.java
#	src/main/java/org/mvplugins/multiverse/core/permissions/CorePermissionsChecker.java
#	src/main/java/org/mvplugins/multiverse/core/world/LoadedMultiverseWorld.java
#	src/main/java/org/mvplugins/multiverse/core/world/helpers/PlayerWorldTeleporter.java
2023-09-13 23:04:36 +08:00
Jeremy Wood db0d5da5ce Merge pull request #3020 from Multiverse/ben/mv5/nuke-worldmanager
Nuke the old world manager
2023-09-13 09:55:32 -04:00
Ben Woo fbab3bc269 Nuke the old world manager 2023-09-12 23:05:51 +08:00
Ben Woo ba93195671 Move logic of teleporting players out of world from world manager 2023-09-12 18:07:12 +08:00
Ben Woo 9ddfa59712 Merge branch 'MV5' into ben/mv5/teleporter
# Conflicts:
#	src/main/java/org/mvplugins/multiverse/core/commands/TeleportCommand.java
2023-09-12 17:25:50 +08:00
Ben Woo 6f014838e9 Cleanup commands checkstyle and flags 2023-09-12 17:22:20 +08:00
Ben Woo ef2b42d9a0 Check for destination's checkTeleportSafety 2023-09-12 16:36:43 +08:00
Ben Woo 245fac98e5 Implement new AsyncSafetyTeleporter 2023-09-12 16:33:43 +08:00
Ben Woo 0e43444523 Merge pull request #3018 from Multiverse/ben/mv5/player-world-action
Implement player world actions and some refactor
2023-09-12 14:20:42 +08:00
Ben Woo f9bd7f136d Split PlayerWorldAction to PlayerWorldTeleporter and EnforcementHandler 2023-09-12 13:13:54 +08:00
Ben Woo a45849799d Implement player world actions and some refactor 2023-09-12 12:45:09 +08:00
Ben Woo 80dba5068c Merge pull request #2991 from zax71/MV5-always-spawn-location
Implement JoinDestination and EnableJoinDestination config options
2023-09-12 11:38:10 +08:00
Ben Woo b78941c0a0 Refactor join-destination config and use async teleport 2023-09-12 11:33:50 +08:00
Ben Woo dc3ec52d74 Merge branch 'MV5' into MV5-always-spawn-location 2023-09-12 11:27:38 +08:00
Ben Woo 57b27ce6e6 Fix hk2 ServiceLocatorGenerator 2023-09-12 11:16:30 +08:00
Ben Woo d6c8d5381f Merge branch 'MV5' into MV5-always-spawn-location
# Conflicts:
#	src/main/java/org/mvplugins/multiverse/core/config/MVCoreConfigNodes.java
#	src/main/java/org/mvplugins/multiverse/core/listeners/MVPlayerListener.java
2023-09-12 10:38:04 +08:00
Ben Woo 5178d68828 Merge pull request #3017 from Multiverse/dtm/checkstyle/imports
Fix import order check.
2023-09-12 10:26:49 +08:00
Ben Woo f6ba48c5f2 Apply new import order changes 2023-09-12 10:24:58 +08:00
Jeremy Wood ede47e834b Fix import order check. 2023-09-11 22:17:47 -04:00
Ben Woo df7e333610 Merge pull request #3016 from Multiverse/ben/mv5/repackage
Move package to org.mvplugins.multiverse.core
2023-09-12 01:03:17 +08:00
Ben Woo 48f9e65321 Change third party relocate to org.mvplugins.multiverse.external. 2023-09-12 01:02:00 +08:00
Ben Woo 474630d1ff Move package to org.mvplugins.multiverse.core 2023-09-12 00:56:20 +08:00
Ben Woo 1812315033 Merge pull request #3015 from Multiverse/ben/mv5/import-refactor
Optimise all imports
2023-09-12 00:45:18 +08:00
Ben Woo e31ef1428c Fix import order checkstyle and remove comment 2023-09-12 00:43:46 +08:00
Ben Woo 256ac67cf1 Optimise all imports 2023-09-12 00:41:17 +08:00
Ben Woo 9dbe7e20ad Merge pull request #3014 from Multiverse/ben/mv5/a-lot-of-checkstyle
Fix a lot of checkstyles throughout
2023-09-12 00:29:14 +08:00
Ben Woo e005b266ea Add a todo about the todo checkstyle to enable todo warning after mv 2023-09-12 00:19:27 +08:00
Ben Woo 1dfdb611c6 Set back throw count to 0 2023-09-12 00:15:13 +08:00
Ben Woo dd4b01f922 Fix a lot of checkstyles throughout 2023-09-12 00:07:25 +08:00
Ben Woo 39f3805ef3 Fix all imports once and for all 2023-09-11 23:09:34 +08:00
Jeremy Wood d3fa42a035 Merge pull request #3013 from Multiverse/world-revamp-continue
Continue revamping World/WorldManager.
2023-09-11 10:42:47 -04:00
Ben Woo 46d115b2f3 Fix LocalizationTest 2023-09-11 22:13:48 +08:00
Ben Woo 690d956ce2 Merge branch 'MV5' into world-revamp-continue 2023-09-11 22:11:32 +08:00
Ben Woo ffec23c9ed Add docs and fix more checkstyles 2023-09-11 21:52:16 +08:00
Jeremy Wood d77fb43536 Add continue-on-error to step as well. 2023-09-11 08:48:23 -04:00
Jeremy Wood 86e2ab45fb Change checkstyle workflow back to PR annotations without failure. 2023-09-11 08:44:05 -04:00
Jeremy Wood 5a474d7efa Merge pull request #3010 from Multiverse/ben/mv5/nested-locale-message
Add support for nested Message within MessageReplacement and fix some checkstyles
2023-09-11 08:30:09 -04:00
Jeremy Wood ca9b244a89 Merge pull request #3011 from Multiverse/ben/mv5/upstream-checkstyle
Upstream checkstyle changes from world revamp
2023-09-11 08:13:42 -04:00
Ben Woo 329901afa6 Remove public from config nodes and remove names that are the same as path 2023-09-11 17:06:06 +08:00
Ben Woo 61570b1a7f Merge pull request #3012 from Multiverse/ben/mv5/improve-world-purge
Cleanup world purger and add docs
2023-09-11 16:48:31 +08:00
Ben Woo aa063007e8 Fix some checktyle issue in WorldPurger 2023-09-11 16:47:39 +08:00
Ben Woo 58c13c1f73 Copy spawn location when cloning world 2023-09-11 16:42:27 +08:00
Ben Woo c0f2168ba4 Copy spawn location only if seed didnt change on regen 2023-09-11 16:40:03 +08:00
Ben Woo ef0cb4b893 Do not apply spawn location if it's a null location 2023-09-11 16:39:34 +08:00
Ben Woo c2ff8a467f Make unsettable properties have null name 2023-09-11 16:38:49 +08:00
Ben Woo 404a2f4183 Cleanup adjust spawn logic 2023-09-11 16:03:36 +08:00
Ben Woo a4a5be20f9 Use .get() for world folder, since it should fail if null 2023-09-11 15:49:27 +08:00
Ben Woo 481933b948 Add support for removing players before unloading world 2023-09-11 15:39:06 +08:00
Ben Woo 379e0172c4 Fix regen world keeping seed not working 2023-09-11 15:38:28 +08:00
Ben Woo d8334ad71a Refactor world results and add docs 2023-09-11 14:35:56 +08:00
Ben Woo ba7b6ae951 Upstream checkstyle changes from world revamp 2023-09-11 13:40:50 +08:00
Ben Woo 1745c16bec Add support for nested Message within MessageReplacement and fix some checkstyles 2023-09-11 13:37:38 +08:00
Ben Woo 7490996ecb Make getWorldConfig return an Option 2023-09-11 11:49:52 +08:00
Ben Woo bf7a708fb3 Reorder and add more world blacklisted names 2023-09-11 11:41:40 +08:00
Ben Woo d02cd63244 Merge pull request #3008 from Multiverse/ben/mv5/results
Revamp results to support value returns
2023-09-11 10:55:08 +08:00
Jeremy Wood 089655fada Fix some more checkstyle issues. 2023-09-10 13:35:25 -04:00
Jeremy Wood 8ffd716190 Fix some checkstyle issues. 2023-09-10 13:34:36 -04:00
Ben Woo 99846b5567 Add javadocs and fix some checkstyles 2023-09-10 23:00:15 +08:00
Ben Woo 6f9f9085fd Refactor world results to remove success reason 2023-09-10 22:29:42 +08:00
Ben Woo 656d9ac208 Refactor map Attempt methods 2023-09-10 22:17:10 +08:00
Ben Woo 2fe6297b1d Fix unintended changes to result 2023-09-10 21:45:30 +08:00
Ben Woo c8fed72137 Refactor to Result<S, F> and Attempt<T, F> 2023-09-10 21:37:36 +08:00
Ben Woo f9877201f5 Revamp results to support value returns 2023-09-10 19:43:56 +08:00
Zax71andBen Woo d1bc67204b Update src/main/java/com/onarandombox/MultiverseCore/config/MVCoreConfigNodes.java
Co-authored-by: Ben Woo <30431861+benwoo1110@users.noreply.github.com>
2023-09-10 12:15:05 +01:00
Zax71 c8e1143e32 Implement requested changes 2023-09-10 10:22:13 +01:00
Ben Woo e318f1e86f Cleanup world purger and add docs 2023-09-10 15:03:05 +08:00
Ben Woo b780f5c2f3 Update gamerules command to new world manager api 2023-09-10 14:10:40 +08:00
Ben Woo 1740137d1e Merge branch 'MV5' into world-revamp-continue
# Conflicts:
#	src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandCompletions.java
2023-09-10 14:05:41 +08:00
Ben Woo 323145ebf0 Merge pull request #3006 from Multiverse/ben/mv5/config-migrate
Implement worlds.yml config migrate
2023-09-10 14:04:03 +08:00
Ben Woo 1a2b88599a Merge pull request #3007 from Multiverse/dtm/mv5/world-revamp-continue-tweaks
WorldManager tweaks.
2023-09-10 14:01:18 +08:00
Ben Woo 903941eb01 Fix wildcard imports for worldmanager 2023-09-10 13:59:01 +08:00
Ben Woo b8c10c412d Improve gamerules command with filter and page flag 2023-09-10 13:56:50 +08:00
Ben Woo 95a1fddbe5 Fix some regression on command flag registering and completion 2023-09-10 13:54:44 +08:00
Jeremy Wood 1eb33c6972 Clean up some return counts in WorldManager. 2023-09-10 01:35:53 -04:00
Ben Woo b2ed43ba22 Add docs to new migration classes 2023-09-10 12:23:20 +08:00
Ben Woo c61c98ff5e Remove serializable including whitespace and newline 2023-09-10 12:03:35 +08:00
Ben Woo 13b9419b85 Improve and fix minor migration regressions 2023-09-10 11:55:00 +08:00
Jeremy Wood e81296015e Ignore DeclarationOrder check. 2023-09-09 23:54:05 -04:00
Jeremy Wood 6b40c3a190 Add interface for keeping world settings for options. 2023-09-09 23:53:45 -04:00
Ben Woo fcbaffc821 Implement basic config migration for worlds.yml 2023-09-10 00:50:58 +08:00
Jeremy Wood f556f6f98a Refactor populateWorldFromConfig to be smaller. 2023-09-09 11:48:54 -04:00
Jeremy Wood c340f16f63 Use different parameter number checks for methods and constructors. 2023-09-09 11:28:24 -04:00
Jeremy Wood 700b0cc81c Allow checkstyle suppression trailing comments. 2023-09-09 11:25:17 -04:00
Jeremy Wood 34b55e4b4d Merge pull request #3004 from Multiverse/dtm/mv5/world-revamp-continue-tweaks
Tweaks for world revamp
2023-09-09 11:19:22 -04:00
Jeremy Wood df0db292ed Fix incorrect world name var. 2023-09-09 11:19:10 -04:00
Jeremy Wood c1d2fe48f0 Reduce Result boilerplate in WorldManager. 2023-09-09 11:14:01 -04:00
Jeremy Wood ba5c054298 Add a bunch of missing package-info.java. 2023-09-09 10:54:10 -04:00
Jeremy Wood 503d054859 Temporarily reduce severity of PackageName check. 2023-09-09 10:52:59 -04:00
Jeremy Wood 6fd56e56e1 Create private message replacement methods in WorldManager. 2023-09-09 10:51:52 -04:00
Jeremy Wood 1affa421d3 Only report on warning/error. 2023-09-09 10:28:55 -04:00
Jeremy Wood 09e1e11016 Give pr write permission to checkstyle workflow. 2023-09-09 10:26:20 -04:00
Jeremy Wood 7a8bd674d2 Fix more checkstyle issues in WorldManager. 2023-09-09 10:23:13 -04:00
Ben Woo ac3666cf7c Merge pull request #3003 from Multiverse/ben/mv5/world-revamp-codestyle
Loosen up some codestyle
2023-09-09 22:21:45 +08:00
Jeremy Wood f5dc049b35 Loosen ClassFanOutComplexity check. 2023-09-09 10:14:59 -04:00
Jeremy Wood ffb578039f Try github-pr-review reporter for checkstyle workflow. 2023-09-09 10:02:10 -04:00
Jeremy Wood 654c12b627 Make checkstyle concessions. 2023-09-09 09:59:00 -04:00
Ben Woo c71bdd83d6 Merge pull request #2997 from Multiverse/better-flag-handling
Better flag handling
2023-09-09 20:05:21 +08:00
Ben Woo b70960d39c Add javadocs to new command flag methods 2023-09-09 20:02:50 +08:00
Ben Woo 2f65bf4597 Merge pull request #2992 from zax71/MV5-gamerules-command
Implement `/mv gamerules` command
2023-09-09 19:54:21 +08:00
Zax71 ee4a8c8ec9 Fix (some) of the checkstyle violations 2023-09-09 12:27:44 +01:00
Zax71 48ff8d8bd1 Switch to ContentDisplay API 2023-09-09 12:16:48 +01:00
Ben Woo 0f105b1777 pain: Add docs to the new world related classes 2023-09-09 13:46:32 +08:00
Ben Woo 4cbe2eaca9 Loosen up some codestyle 2023-09-09 12:32:37 +08:00
Ben Woo 8e95c22c4d Refactor and fix some world manager code style 2023-09-09 12:31:43 +08:00
Ben Woo 5c7c9ba465 Improve world config management with parsing of new and removed worlds on reload 2023-09-09 00:41:36 +08:00
Ben Woo b4617c1c1f Eradicate all reference of offline world 2023-09-08 23:41:26 +08:00
Ben Woo f0d2499dd2 Refactor multiverse world class and getters naming 2023-09-08 23:19:43 +08:00
Ben Woo 17f2f58c1d Fix clone command newworld replacement id 2023-09-08 23:10:47 +08:00
Ben Woo 27ff3b7a7b Merge pull request #3001 from Multiverse/dtm/mv5/world-revamp-continue-patch
Apply basic checkstyle fixes.
2023-09-08 22:43:14 +08:00
Jeremy Wood 8f439abd1b Merge remote-tracking branch 'origin/world-revamp-continue' into dtm/mv5/world-revamp-continue-patch
# Conflicts:
#	src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldManager.java
2023-09-08 09:13:41 -04:00
Jeremy Wood 035005bac3 Apply basic checkstyle fixes to DataStore. 2023-09-08 09:08:30 -04:00
Jeremy Wood 324328f254 Apply basic checkstyle fixes to WorldConfigManager. 2023-09-08 09:07:46 -04:00
Jeremy Wood 7582a84cc6 Apply basic checkstyle fixes to WorldConfigNodes. 2023-09-08 09:07:21 -04:00
Ben Woo cadb931d4c Fix adjust spawn not applying 2023-09-08 21:05:57 +08:00
Jeremy Wood 93d23115ff Apply basic checkstyle fixes to WorldConfig. 2023-09-08 09:04:23 -04:00
Jeremy Wood 58d37e93ee Apply basic checkstyle fixes to NullLocation. 2023-09-08 09:03:10 -04:00
Jeremy Wood 11edd8e631 Apply basic checkstyle fixes to WorldPurger. 2023-09-08 09:02:17 -04:00
Jeremy Wood caba4100a3 Apply basic checkstyle fixes to OfflineWorld. 2023-09-08 08:59:36 -04:00
Jeremy Wood 7726cf3485 Apply basic checkstyle fixes to MVWorld. 2023-09-08 08:58:43 -04:00
Jeremy Wood 1ca6b20755 Apply basic checkstyle fixes to WorldManager. 2023-09-08 08:52:35 -04:00
Ben Woo 9c703ff329 Fix clone world ignore file 2023-09-08 19:51:08 +08:00
Ben Woo 0513865f43 Use Try<Void> for config loading and saving 2023-09-08 19:43:04 +08:00
Ben Woo f1ee2ee227 Merge branch 'MV5' into world-revamp-continue 2023-09-08 15:50:59 +08:00
Jeremy Wood 4f987da090 Merge remote-tracking branch 'origin/main' into MV5 2023-09-08 01:43:37 -04:00
Jeremy Wood 17129f68d2 Merge pull request #3000 from Multiverse/dtm/checkstyle/fix_lparen
Fix lparen issues in checkstyle.
2023-09-08 01:43:03 -04:00
Jeremy Wood e00b06692f Remove LPAREN from SeparatorWrap check. 2023-09-08 01:42:21 -04:00
Jeremy Wood c4063ed5e7 Merge pull request #2999 from Multiverse/dtm/mv5/merge_main
Merge main into MV5.
2023-09-08 01:26:46 -04:00
Jeremy Wood 25a5013a6c Merge remote-tracking branch 'origin/main' into dtm/mv5/merge_main 2023-09-08 01:22:29 -04:00
Jeremy Wood a2339fac2f Merge pull request #2998 from Multiverse/dtm/checkstyle/fix_checkstyle
Soften up checkstyle significantly.
2023-09-08 01:21:33 -04:00
Jeremy Wood 227cddab7c Soften up checkstyle significantly. 2023-09-08 01:19:06 -04:00
Ben Woo f9c6c441e1 Add back /mvtp shorthand command 2023-09-07 23:54:51 +08:00
Ben Woo 3cdf9736ec Refactor a better method of registering and using command flags 2023-09-07 23:31:54 +08:00
Ben Woo 89c6eb41cb Refactor clone world into multiple smaller methods 2023-09-07 22:53:53 +08:00
Ben Woo 7ab8f219dd Better copy folder implementation with try 2023-09-07 22:05:45 +08:00
Ben Woo 6ebcd40a50 Implement remaining locales for clone and regen 2023-09-07 12:20:28 +08:00
Ben Woo 6427881c98 Finish up clone command 2023-09-07 12:07:01 +08:00
Ben Woo 3ef72a993a Implement configurable transfer of data during regen 2023-09-07 11:50:30 +08:00
Ben Woo 9cb8724db2 Finish up regen world 2023-09-07 11:38:29 +08:00
Ben Woo a0fa27f926 Merge branch 'MV5' into world-revamp-continue 2023-09-07 10:30:35 +08:00
Ben Woo 0b7f3246a1 Remove GHA test checkstyle args 2023-09-07 10:30:11 +08:00
Ben Woo 7060e60ddd Merge branch 'MV5' into world-revamp-continue 2023-09-07 10:25:44 +08:00
Ben Woo a292c1bf7d Bump dependencies 2023-09-07 10:21:21 +08:00
Ben Woo 0c3d529285 Merge branch 'main' into MV5
# Conflicts:
#	config/mv_checks.xml
2023-09-07 10:04:54 +08:00
Ben Woo e84fb1f1ba Merge pull request #2996 from Multiverse/mockbukkit-bump
Bump MockBukkit with the onDisable fix
2023-09-07 10:04:05 +08:00
Ben Woo b51cd645bb Bump MockBukkit with the onDisable fix 2023-09-07 09:48:47 +08:00
Ben Woo ff88b30959 Merge pull request #2995 from Multiverse/dtm/no_gradle_checkstyle
Remove checkstyle from gradle.
2023-09-07 09:22:20 +08:00
Jeremy Wood fa6a01d690 Remove checkstyle from gradle. 2023-09-06 18:01:13 -04:00
Jeremy Wood 5f9a002a07 Merge pull request #2994 from Multiverse/dtm/checkstyle_upgrade
Upgrade Checkstyle & Rules.
2023-09-06 17:55:37 -04:00
Jeremy Wood 3198fcc4b1 Fix job name in pr.checkstyle.yml. 2023-09-06 17:54:19 -04:00
Jeremy Wood d50e8c1dde Remove checkstyle debug flag. 2023-09-06 17:49:59 -04:00
Jeremy Wood 87271aa4eb Revert "Test change that fails checkstyle."
This reverts commit 5b8984a492.
2023-09-06 17:49:41 -04:00
Jeremy Wood 5b8984a492 Test change that fails checkstyle. 2023-09-06 17:46:50 -04:00
Jeremy Wood 49fcadf434 Use the correct file extension for checkstyle config. 2023-09-06 17:43:25 -04:00
Jeremy Wood 950fe1217a Add reviewdog debug flag for checkstyle action. 2023-09-06 17:42:17 -04:00
Jeremy Wood 8b895d41f7 Add workflow for running and reporting checkstyle. 2023-09-06 17:37:31 -04:00
Jeremy Wood dcbcca9a62 Remove extra check. 2023-09-06 17:23:15 -04:00
Jeremy Wood bc830ee780 Configure Whitespace checkstyle. 2023-09-06 17:22:50 -04:00
Jeremy Wood 407dcb3125 Configure Regexp checkstyle. 2023-09-06 13:41:41 -04:00
Jeremy Wood 405a033d85 Configure Size Violations checkstyle. 2023-09-06 13:40:19 -04:00
Ben Woo 3f075169a4 Implement basic regen command 2023-09-07 00:27:25 +08:00
Ben Woo af2fc7c630 Implement basic clone command 2023-09-07 00:07:46 +08:00
Jeremy Wood 073d13cf4d Configure Naming Conventions checkstyle. 2023-09-06 12:05:47 -04:00
Jeremy Wood e8e8c4aff6 Configure Modifiers checkstyle. 2023-09-06 11:40:17 -04:00
Ben Woo 12aedc1942 Merge pull request #2993 from Multiverse/fix-binding
Fix binding plugin and bump MockBukkit
2023-09-06 23:33:11 +08:00
Ben Woo b78ea7c7ba Whoops wrong mockbukkit version 2023-09-06 23:22:38 +08:00
Ben Woo dbf0aeeb4c Add papermc repo for mockbukkit 2023-09-06 23:19:24 +08:00
Ben Woo 7246d433bc Fix binding plugin and bump MockBukkit 2023-09-06 23:07:16 +08:00
Jeremy Wood 67f2f1f6b0 Configure Miscellaneous checkstyle. 2023-09-06 10:03:44 -04:00
Jeremy Wood d7f236492b Configure Metrics checkstyle. 2023-09-06 09:43:37 -04:00
Jeremy Wood 086c3e8af0 Configure Imports checkstyle. 2023-09-06 09:26:00 -04:00
Jeremy Wood c62c1278ec Configure Coding checkstyle. 2023-09-06 09:17:31 -04:00
Jeremy Wood 1d47473cd3 Configure Class Design checkstyle. 2023-09-06 08:22:01 -04:00
Jeremy Wood f725723932 Configure Block Checks checkstyle. 2023-09-06 07:57:36 -04:00
Jeremy Wood 28edf86c96 Configure Annotation checkstyle. 2023-09-06 01:15:33 -04:00
Jeremy Wood ab2dd9d316 Configure Javadoc checkstyle. 2023-09-06 01:05:13 -04:00
Jeremy Wood e04b0faa85 Upgrade checkstyle to version 10.12.2. 2023-09-05 23:52:20 -04:00
Jeremy Wood 6a309f04dc Update dtd reference in mv_checks.xml. 2023-09-05 23:33:56 -04:00
Ben Woo f056dcdbc9 Better error handling of world folder deletion 2023-09-06 00:13:53 +08:00
Ben Woo d01a884025 Cleanup WorldManager and improve on locale results 2023-09-05 23:47:58 +08:00
Ben Woo eb5bb4e234 Implement locale error messages for wm result 2023-09-05 18:57:35 +08:00
Ben Woo 8fc2371077 Filter away already loaded worlds for getPotentialWorlds 2023-09-05 15:57:10 +08:00
Ben Woo fda0e038f5 Implement getPotentialWorlds 2023-09-05 15:54:51 +08:00
Ben Woo 80ff02a92b Improve import world result 2023-09-05 15:42:45 +08:00
Ben Woo e8ca95505b Implement new generator API 2023-09-05 15:17:27 +08:00
Ben Woo ec0000bc8a Fix wrong context optional check and arg being null 2023-09-05 00:21:32 +08:00
Ben Woo 82f47af924 Completely remove the old WorldManager from startup 2023-09-05 00:08:38 +08:00
Ben Woo fe26ccb1eb Make spawning amount apply and rename it 2023-09-04 23:58:47 +08:00
Ben Woo f519639893 Fix weather and spawning 2023-09-04 23:48:35 +08:00
Ben Woo 5278eccad2 Fix imports for reload command 2023-09-04 23:30:26 +08:00
Ben Woo 32fb25854f Migrate portal, entity and worldpurger to new wm 2023-09-04 23:30:13 +08:00
Ben Woo c253dc1322 Fix gamerule command permission 2023-09-04 21:51:22 +08:00
zax71 1ac54b7e1d Add i18n 2023-09-04 13:08:39 +01:00
zax71 3b7a801a0c Implement JoinDestination and EnableJoinDestination config options 2023-09-04 12:30:50 +01:00
Ben Woo 0a62081d03 Move weather handling to new wm 2023-09-04 13:37:29 +08:00
Ben Woo 0824108109 Move chat prefix to new wm and fix more imports 2023-09-04 11:33:53 +08:00
Ben Woo c62aa91db7 Move world listener to handle new world manager 2023-09-04 11:27:25 +08:00
Ben Woo 90eb1c882b Dumps command use new wm and fix some imports 2023-09-04 10:48:08 +08:00
Ben Woo 891f7ca136 Remove old wm reference in bstats, tests and placeholders 2023-09-04 10:34:32 +08:00
Ben Woo 55703e6f39 Merge pull request #2989 from zax71/MV5-fix-dumps-command
Fix /mv dumps to support ANSI and UTF-8 encoded log files
2023-09-04 09:59:30 +08:00
Ben Woo f280e2076c Minor cleanup 2023-09-04 09:54:00 +08:00
zax71 17dff457b2 Chore: codestyle changes 2023-09-03 17:36:14 +01:00
Ben Woo 4eb8dfbc67 Move command completion, context, conditions to new world manager api 2023-09-04 00:16:44 +08:00
Ben Woo 08b87cba39 Move destination to new world manager api 2023-09-03 23:42:38 +08:00
Ben Woo 791d8b653c Allow permission check for offline worlds 2023-09-03 23:40:08 +08:00
Ben Woo 6f673066a8 Fix list command permissions checking 2023-09-03 23:38:22 +08:00
Ben Woo f524c5bdde Implement proper spawn location 2023-09-03 23:25:10 +08:00
Ben Woo dc75e87223 Move entrycheck, playerlistener and worldnamechecker to api 2023-09-03 22:21:28 +08:00
Ben Woo d77d7032dd Update list command and fix importWorld bug 2023-09-03 16:15:55 +08:00
Ben Woo fa4391e543 Merge branch 'MV5' into world-revamp-continue 2023-09-03 15:52:56 +08:00
Ben Woo 046840f0d9 refactor: Remove deprecated and unused classes 2023-09-03 15:52:02 +08:00
Ben Woo 3356757c13 Implement proper reloading of worlds config 2023-09-03 15:39:57 +08:00
Ben Woo dff192f3ce Make MVWorld constructor non-public 2023-09-03 14:55:39 +08:00
Ben Woo f2a3d3f85a Refactor newMVWorld instance creation 2023-09-03 14:53:51 +08:00
Ben Woo 550dae92e9 Implement more world manager features 2023-09-03 14:35:27 +08:00
zax71 1fef714b8f Fix /mv dumps to support ANSI and UTF-8 encoded log files 2023-09-02 19:08:09 +01:00
zax71 b42b77b0bf implement /mv gamerules command 2023-09-02 18:04:31 +01:00
Ben Woo b154606922 Finish basic CRUD for new world management 2023-09-03 00:51:07 +08:00
Ben Woo 7828c92926 Add entryfee, spawning and spawn location 2023-09-02 23:07:39 +08:00
Ben Woo 1f7b8ffa96 Add remaining world properties methods 2023-09-02 22:30:06 +08:00
Ben Woo 35993419ca Implement basic load, unload and remove world 2023-09-02 21:59:53 +08:00
Ben Woo a8fbeb53d4 Update bukkit world when world config node set 2023-09-02 17:04:30 +08:00
Ben Woo e1eae48bc7 Implement basic create and delete world 2023-09-02 16:54:33 +08:00
Ben Woo 5dd22b5d9b Basic mvworld and offline world 2023-09-02 16:12:34 +08:00
Ben Woo 07b543a845 Implement AddWorldOptions to condense method parameters 2023-09-02 15:19:30 +08:00
Ben Woo f7295e2c2e Cleanup TODO messages 2023-09-02 14:50:10 +08:00
Ben Woo a7644b6866 Merge pull request #2975 from zax71/MV5-version-command
Implement `/mv dumps` command
2023-09-01 23:52:45 +08:00
Ben Woo 381f440a6b Merge branch 'MV5' into MV5-version-command 2023-09-01 23:42:55 +08:00
Ben Woo 4300d83c90 Merge pull request #2986 from zax71/MV5-coord-command
Add `/mv coordinates` command
2023-09-01 23:42:04 +08:00
Ben Woo adcbcdb7df Merge pull request #2987 from Multiverse/new-config-migrate
Do not migrate if new config file is created
2023-09-01 23:41:51 +08:00
Ben Woo b57b70aa28 Merge pull request #2988 from Multiverse/world-config-props
World config props
2023-09-01 23:41:38 +08:00
Ben Woo 7a8f468f98 Minor refactor to dumps command 2023-09-01 23:39:36 +08:00
Ben Woo 867f4a447d Better error handling for finding files in server directory 2023-09-01 23:33:30 +08:00
Ben Woo 55aac81258 Merge branch 'MV5' into pr/2975
# Conflicts:
#	src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorldManager.java
2023-09-01 23:28:05 +08:00
Ben Woo 194dc8ef8a Fix error message i18n path key 2023-09-01 23:26:23 +08:00
Ben Woo c7c344730b Minor refactor to coord command and fix tests 2023-09-01 23:21:57 +08:00
Zax71andBen Woo f8b75c0781 Update src/main/java/com/onarandombox/MultiverseCore/commands/CoordinatesCommand.java
Co-authored-by: Ben Woo <30431861+benwoo1110@users.noreply.github.com>
2023-09-01 23:20:09 +08:00
Zax71 dc89161a04 refactor: rename permission 2023-09-01 23:20:08 +08:00
zax71 90522a014e Add /mv coordinates 2023-09-01 23:20:08 +08:00
Ben Woo 6effeacd1b Add getWorldConfig method 2023-09-01 11:20:25 +08:00
Ben Woo 42eadd91a5 Adda remaining properties methods to WorldConfig 2023-09-01 11:00:59 +08:00
Ben Woo 1b2f8889ce Do not migrate if new config file is created 2023-09-01 00:03:29 +08:00
Ben Woo 1e9f19b01f Merge pull request #2841 from Multiverse/list-command
feat: Implement list command
2023-08-31 23:58:56 +08:00
Ben Woo da1d059b84 Update list command to new api changes 2023-08-31 23:55:40 +08:00
Ben Woo 55805aa618 Merge branch 'MV5' into list-command
# Conflicts:
#	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
2023-08-31 23:34:10 +08:00
Ben Woo d1ff487a00 Merge pull request #2984 from Multiverse/worlds-config
Worlds config
2023-08-31 23:27:10 +08:00
Ben Woo 5208028e65 Add todo on comparing config file 2023-08-31 23:25:30 +08:00
Ben Woo 55fd08e0b1 Remove stray white spacing 2023-08-31 23:22:23 +08:00
Ben Woo 904bd8634a Improve tests for world config file 2023-08-31 23:21:27 +08:00
Ben Woo 02b02530bd Revert delete command changes 2023-08-31 23:02:19 +08:00
Ben Woo 5fca5b18b8 Remove from commands and add to tests 2023-08-31 22:58:33 +08:00
Ben Woo aa412b1060 Add todo for loading worlds 2023-08-31 15:17:51 +08:00
Ben Woo 54c8bac3d3 Config node automatically use the enum node serializer 2023-08-31 15:16:41 +08:00
Ben Woo decf20f95f Add basic tests for world config 2023-08-31 14:59:31 +08:00
Ben Woo 6888783d01 Implement world blacklist config 2023-08-31 14:21:33 +08:00
Ben Woo c569bc797f Implement node serialisation 2023-08-31 14:21:33 +08:00
Ben Woo 5dba9b5904 Starting to shift worlds.yml to new config api 2023-08-31 14:21:32 +08:00
Ben Woo 55b21bf17e Fix config tests 2023-08-31 14:14:55 +08:00
Ben Woo 4ff1663353 Temp fix to fix tests 2023-08-31 14:03:03 +08:00
zax71 ac6d42549d Reorder logic to make it more readable 2023-08-30 17:40:52 +01:00
zax71 b500afd8f0 Whitespace fixes 2023-08-30 17:28:04 +01:00
zax71 0c79c6577e Rename Services and LogsType enums 2023-08-30 17:26:15 +01:00
zax71 2b7d1412b5 Remove uploading message and print out directly 2023-08-30 17:23:19 +01:00
zax71 560a6d4d7e Fix whitespace 2023-08-30 17:16:51 +01:00
zax71 8444383f16 Update command syntax 2023-08-30 17:15:17 +01:00
zax71 de77d09eaa Move getBukkitConfig() and getServerProperties()` into FileUtils.java 2023-08-30 17:13:31 +01:00
zax71 69fdfcfd9f Fix syntax 2023-08-30 17:03:28 +01:00
Ben Woo cbf44cb918 Merge pull request #2928 from Multiverse/perm-revamp-3
feat: Revamp teleport world entry checking
2023-08-30 23:38:58 +08:00
Jeremy Wood cb7ee2fc26 Merge pull request #2974 from Multiverse/update-readme
docs: Improve the readme badges
2023-08-30 11:28:34 -04:00
zax71 bf663a76dc Add debug logging (in /mv debug 3) 2023-08-30 11:55:23 +01:00
zax71 4f756a4c2d Change flags used 2023-08-30 11:52:28 +01:00
Ben Woo d2b18b8545 Merge pull request #2982 from Multiverse/enum-flag
Specific flag builder for enum to streamline context and completion
2023-08-29 16:40:33 +08:00
Ben Woo 3800513dc5 Merge pull request #2983 from Multiverse/conditions-id
Fix command conditions not registering and lowercased
2023-08-29 12:16:17 +08:00
Ben Woo 74e7a1c9f3 Merge branch 'MV5' into perm-revamp-3 2023-08-29 10:55:52 +08:00
Ben Woo 0ddb5563be Fix command conditions not registering and lowercased 2023-08-29 10:54:22 +08:00
Ben Woo bf8bca3244 Specific flag builder for enum to streamline context and completion 2023-08-29 10:44:25 +08:00
Jeremy Wood 59d211ce92 Replace dependencies that were dropped accidentally. 2023-08-28 15:42:16 -04:00
Jeremy Wood cba5f7c9d1 Fix up MV5 gradle configurations. 2023-08-28 15:33:41 -04:00
Jeremy Wood 542f321889 Merge remote-tracking branch 'origin/main' into MV5
# Conflicts:
#	.github/workflows/promote_release.yml
#	.github/workflows/release.yml
#	build.gradle
#	src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java
2023-08-28 15:31:34 -04:00
zax71 fa81f5b573 paste.gg and mclo.gs default 2023-08-28 16:45:57 +01:00
Jeremy Wood 2143930fac Merge pull request #2980 from Multiverse/remove-modirnth-plugin
Remove modrinth gradle plugin
2023-08-28 09:57:01 -04:00
zax71 5af06d9a0f Switch from hastebin to pastes.dev and fix non multi-file services 2023-08-28 14:38:42 +01:00
Ben Woo 5f12aa53b4 Remove modrinth gradle plugin 2023-08-28 00:15:39 +08:00
Jeremy Wood 1d371fb625 Merge pull request #2979 from Multiverse/hangar-api
Update hangar plugin deps bcu they changed the API
2023-08-27 12:09:40 -04:00
Ben Woo 320dc82b83 Update hangar plugin deps bcu they changed the API 2023-08-27 18:21:16 +08:00
Ben Woo e06536acd6 Command manager already a parent class field 2023-08-27 13:48:03 +08:00
Ben Woo 39c702a5fc Remove custom sendMessage method 2023-08-27 13:46:47 +08:00
Ben Woo 317b2c679f Minor code style fixes 2023-08-27 13:45:06 +08:00
Ben Woo 5e9739bda9 Merge branch 'MV5' into pr/2975
# Conflicts:
#	src/main/java/com/onarandombox/MultiverseCore/configuration/node/NodeGroup.java
2023-08-27 13:19:32 +08:00
Ben Woo 954e304f3a Merge pull request #2977 from zax71/codestyle-changes 2023-08-26 19:26:51 +08:00
zax71 1f7ad9d27f Add i18n 2023-08-26 11:53:15 +01:00
zax71 f261d88b4a Fix codestyle 2023-08-26 11:28:58 +01:00
zax71 949eb44447 Invert --include-plugin-list to --exclude-plugin-list 2023-08-26 11:25:10 +01:00
zax71 4750839497 Yeet all the wildcard imports 2023-08-26 11:19:11 +01:00
zax71 260777303c Implement /mv dumps command 2023-08-25 19:52:45 +01:00
Ben Woo 3683f93522 docs: Improve the readme badges 2023-08-25 13:25:53 +08:00
Jeremy Wood 288474cd20 Merge pull request #2973 from Multiverse/generic-test
feat: Generify test action
2023-08-24 22:40:54 -04:00
Ben Woo 16ceaa4c40 feat: Generify test action 2023-08-25 10:23:54 +08:00
Jeremy Wood e9f55e43ee Merge pull request #2972 from Multiverse/dtm/fix_pom_deps
Fix dependency set for maven pom.
2023-08-24 22:00:15 -04:00
Jeremy Wood 31f4f20bd8 Allow tests to see compileOnly dependencies. 2023-08-24 13:50:04 -04:00
Jeremy Wood bae909a9e8 Mark runtime dependency as provided in pom. 2023-08-24 13:49:48 -04:00
Jeremy Wood ee5408764f Fix dependency set for maven pom. 2023-08-24 13:28:02 -04:00
Ben Woo e2e0574baa Merge pull request #2971 from zax71/hangar-readme-badge
Add Hangar README.md badge
2023-08-24 23:49:00 +08:00
zax71 e1b6bf75b0 Add Hangar README.md badge 2023-08-24 16:44:53 +01:00
Ben Woo 7017689758 Merge pull request #2970 from Multiverse/optional-deps
feat: Add optional deps references
2023-08-24 22:52:47 +08:00
Ben Woo 58d51f57e5 feat: Add optional deps references 2023-08-24 22:45:36 +08:00
Jeremy Wood ccd417db3e Merge pull request #2969 from Multiverse/dtm/manual_hangar
Switch to manual only prereleases on Hangar.
2023-08-24 08:46:40 -04:00
Jeremy Wood 0eb67bee9c Switch to manual only prereleases on Hangar. 2023-08-24 08:44:39 -04:00
Ben Woo 9b22bdf2ab Merge pull request #2967 from Multiverse/generic-action
Generify actions and add hangar upload
2023-08-24 19:31:50 +08:00
Ben Woo 91e5d343cd Generify actions and add hangar upload 2023-08-24 17:04:57 +08:00
Ben Woo 743feea807 Merge pull request #2965 from Multiverse/fix-cancel-logic 2023-08-23 19:43:48 +08:00
Ben Woo d5d1c94566 fix: Cancel condition for platform upload 2023-08-23 13:00:47 +08:00
Ben Woo f67d8efb44 Merge pull request #2964 from Multiverse/actions-better 2023-08-23 11:45:00 +08:00
Ben Woo 70132c0da4 fix: Remove debug echos 2023-08-23 11:09:23 +08:00
Ben Woo 9c3914d409 Run upload to platform even if the other fails 2023-08-23 11:05:25 +08:00
Ben Woo db89482e29 fix: Use github output instead of env 2023-08-23 11:04:36 +08:00
Ben Woo fdb9125f3a Merge pull request #2963 from Multiverse/update-action
chore: Use major versioning for actions that supports
2023-08-23 10:58:20 +08:00
Ben Woo c3b17d33c3 chore: Use major versioning for actions that supports 2023-08-23 10:49:49 +08:00
Jeremy Wood e9d8db668f Merge pull request #2961 from Multiverse/update-semantic-action-version
fix: Version failing if more than pre.10
2023-08-22 13:43:10 -04:00
Ben Woo 60a4b6fc89 fix: Version failing if more than pre.10 2023-08-22 23:45:48 +08:00
Jeremy Wood f59267374f Merge pull request #2960 from Multiverse/revamp-actions
feat: Revamp github actions workflow
2023-08-22 10:29:24 -04:00
Ben Woo b1c0e94a4b fix: Update for production 2023-08-22 21:38:23 +08:00
Ben Woo 61254bfccb feat: Revamp github actions workflow 2023-08-22 21:35:10 +08:00
Ben Woo 3f5a17e39a Merge pull request #2958 from Multiverse/modrinth-label
chore: Add modrinth label to readme
2023-08-22 12:18:38 +08:00
Ben Woo 7c6f1b5fc4 chore: Add modrinth label to readme 2023-08-22 12:08:15 +08:00
Jeremy Wood 06b87801fe Merge pull request #2957 from Multiverse/directory-issue
fix: DBO file path issue
2023-08-21 23:59:54 -04:00
Ben Woo a92e5c95aa fix: DBO file path issue 2023-08-22 11:56:28 +08:00
Jeremy Wood 590972c933 Merge pull request #2956 from Multiverse/modrinth-versioning
Fix versioning
2023-08-21 23:51:26 -04:00
Ben Woo 007b7149a1 fix: DBO release type 2023-08-22 11:37:00 +08:00
Ben Woo 8b18ccbd1d fix: Modrinth task versioning 2023-08-22 11:36:20 +08:00
Jeremy Wood 73e0b30836 Merge pull request #2955 from Multiverse/tag-input-inconsistent
fix: Tag name and input inconsistency
2023-08-21 23:29:55 -04:00
Ben Woo 42c8e414c2 fix: Tag name and input inconsistency 2023-08-22 11:27:30 +08:00
Ben Woo 82a274bad2 Merge pull request #2954 from Multiverse/fix-release-type
fix: Release mode for release promotion
2023-08-22 11:14:08 +08:00
Ben Woo 8aa01026ea fix: Release mode for release promotion 2023-08-22 11:12:13 +08:00
Ben Woo 750d1ea4fa Merge pull request #2953 from Multiverse/fix-download-artifact
fix: Download artifact wrong file version
2023-08-22 11:02:38 +08:00
Ben Woo 586ac4a90e fix: Download artifact wrong file version 2023-08-22 10:56:59 +08:00
Jeremy Wood 816d5f86d6 Merge pull request #2952 from Multiverse/fix-version
fix: Version of fetch-gh-release-asset
2023-08-21 22:50:46 -04:00
Ben Woo 7e8ebfb8cd fix: Version of fetch-gh-release-asset 2023-08-22 10:47:50 +08:00
Jeremy Wood 350d228975 Merge pull request #2951 from Multiverse/release-actions
Revamp release actions
2023-08-21 22:44:19 -04:00
Ben Woo 2126efe27c fix: Remove error echo message 2023-08-22 10:24:52 +08:00
Ben Woo 3330bd3031 feat: Remove PR labeler and change "no version bump" to "no release" 2023-08-22 09:48:46 +08:00
Ben Woo 4f5b4126f4 Merge branch 'main' into release-actions 2023-08-21 23:26:04 +08:00
Ben Woo c4a80d7b78 feat: use new semantic release action for release promote 2023-08-21 23:22:35 +08:00
Ben Woo d31f7e9d87 fix: Modrinth upload action missing steps 2023-08-21 23:15:25 +08:00
Ben Woo 356d67edf4 feat: Use new semantic release action 2023-08-21 23:00:00 +08:00
Jeremy Wood 8865cfb53f Merge pull request #2948 from Multiverse/fix-null-teleporter
Fix teleporter reference being null
2023-08-20 23:23:15 -04:00
Ben Woo bf72328c37 feat: Complete release actions to DBO and Modrinth 2023-08-20 22:16:20 +08:00
Ben Woo 9a80620aa1 Fix teleporter reference being null 2023-08-20 20:26:52 +08:00
Ben Woo 982eb28f2a Merge pull request #2950 from Multiverse/dbo-upload
Add github action for DBO upload
2023-08-20 19:52:41 +08:00
Ben Woo 4ecd65a589 Add github action for DBO upload 2023-08-20 19:51:02 +08:00
Ben Woo 5fbe16ed5a Merge pull request #2949 from Multiverse/fix-regen-args
Fix regen args parsing logic
2023-08-20 19:50:40 +08:00
Ben Woo 582d256f38 Fix regen args parsing logic 2023-08-19 12:11:13 +08:00
Jeremy Wood 26e587805d Merge pull request #2947 from Multiverse/modrinth-for-promote-release
Upload to modrinth when manually promote release
2023-08-15 23:56:19 -04:00
Ben Woo 3ad2322db7 Upload to modrinth when manually promote release 2023-08-15 23:28:39 +08:00
Jeremy Wood 8764108edd Merge pull request #2946 from Multiverse/force-release
Remove line break from README.md
2023-08-15 10:52:13 -04:00
Jeremy Wood 5fa8e9acf6 Remove line break from README.md
This is just to force a new prerelease.
2023-08-15 10:51:47 -04:00
Jeremy Wood 0ead2da16f Merge pull request #2945 from Multiverse/modrinth-game-version
Fix add missing game version for modrinth
2023-08-15 10:46:59 -04:00
Ben Woo fd4bc7cf60 Fix add missing game version for modrinth 2023-08-15 22:35:10 +08:00
Jeremy Wood ad296fde1f Merge pull request #2944 from Multiverse/fix-modrinth-gha
Fix modrinth gha upload
2023-08-15 10:25:59 -04:00
Ben Woo 6f39a2c97d Fix modrinth gha upload 2023-08-15 14:54:16 +08:00
Jeremy Wood befb2b54d8 Merge pull request #2880 from Multiverse/modrinth-upload
feat: Add automatic Modrinth upload
2023-08-14 11:44:26 -04:00
Zax71 efcd14830e Remove unused GITHUB_TOKEN 2023-08-11 20:24:01 +01:00
Zax71 491bb2467f Add 1.20 to supported versions 2023-08-04 16:28:05 +01:00
Zax71 dfbe81c785 Implement requested changes 2023-08-03 11:11:29 +01:00
Ben Woo 8df371c90c refactor: Rename CheckResult to Result 2023-06-29 11:05:08 +08:00
Ben Woo ad47ab2340 feat: Revamp world entry checking 2023-06-29 11:05:08 +08:00
Ben Woo bd78b441ba Merge pull request #2929 from Multiverse/config_update
feat: Extract generic handler for config with ConfigurationSection
2023-06-29 11:03:14 +08:00
Ben Woo 3b384dbe6d docs: Add docs to new config classes 2023-06-28 20:18:26 +08:00
Ben Woo d1370bfb8c feat: Extract generic handler for config with ConfigurationSection 2023-06-28 19:41:33 +08:00
Ben Woo 314ce11630 Merge pull request #2930 from Multiverse/bump_papi
chore: Bump papi to 2.11.3
2023-06-28 19:40:19 +08:00
Ben Woo c2b943cf0a chore: Bump papi to 2.11.3 2023-06-28 19:37:36 +08:00
Zax71 986bafc13d Merge branch 'main' into modrinth-upload 2023-06-27 16:52:29 +01:00
Zax71 9b4613ce84 Support 1.13+ 2023-06-27 16:50:46 +01:00
Jeremy Wood 48e875d13e Merge pull request #2908 from Multiverse/dumptruckman/fix_classifier
Remove the published jar classifier for maven publish.
2023-04-05 08:48:36 -04:00
Jeremy Wood 14b54d5269 Remove the published jar classifier for maven publish.
Fixes #2906.
2023-04-05 08:38:37 -04:00
Ben Woo 33457ac5d5 Merge pull request #2904 from Multiverse/config-validation
Use Try<Void> for config validation
2023-04-03 10:57:24 +08:00
Ben Woo fac79e0780 fix: Double print error message for getting config value 2023-03-31 23:10:46 +08:00
Ben Woo 16e81ec141 refactor: Use Try<Void> for config validation 2023-03-31 23:08:56 +08:00
Ben Woo ffb238bf24 fix: Enable unstable api help for UsageCommand 2023-03-30 23:51:00 +08:00
Ben Woo 14472f5740 Merge pull request #2903 from Multiverse/improve-config-revamp
Improve config revamp
2023-03-30 23:41:44 +08:00
Ben Woo d9cf933d14 Merge pull request #2898 from Multiverse/async-teleport
feat: Add support for async teleport
2023-03-30 23:32:37 +08:00
Jeremy Wood 1c24b17c90 Merge pull request #2872 from Multiverse/new-readme-2
Update README.md
2023-03-30 08:42:10 -04:00
Jeremy Wood 15ac39c3c2 Merge pull request #2897 from Multiverse/teleport-queue
refactor: Move teleport queue into seperate class
2023-03-30 08:41:29 -04:00
Jeremy Wood 8a05b3b815 Merge pull request #2899 from Multiverse/remove-serverfolder
refactor: Remove serverFolder value
2023-03-30 08:35:55 -04:00
benwoo1110 bfedc268d4 refactor: Improve setProperty onFailure output 2023-03-30 17:29:39 +08:00
benwoo1110 272c950f3e fix: Resolve context for MVCommandIssuer class 2023-03-30 13:54:13 +08:00
Jeremy Wood aac01b9e7e Merge pull request #2900 from Multiverse/better-revamp-config
refactor: Abstract handle class and improve node handling
2023-03-30 01:43:41 -04:00
Jeremy Wood 259189f23e Use specific exception for not found node. 2023-03-30 01:41:25 -04:00
Jeremy Wood 2a5b670ce6 Merge remote-tracking branch 'origin/MV5' into better-revamp-config 2023-03-30 01:06:00 -04:00
Jeremy Wood b8c95dc71a Merge pull request #2895 from Multiverse/revamp-config
Revamp config
2023-03-30 01:05:27 -04:00
Jeremy Wood 3ffc63a003 Merge remote-tracking branch 'origin/MV5' into revamp-config
# Conflicts:
#	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
#	src/test/java/org/mvplugins/multiverse/core/inject/InjectionTest.kt
2023-03-30 01:02:26 -04:00
Jeremy Wood 3d7af96b41 Merge pull request #2902 from Multiverse/dumptruckman/localized_exceptions
Add localizable message bundles and exceptions.
2023-03-30 00:52:40 -04:00
Jeremy Wood dab8ac2bf8 Set up locales before registering commands. 2023-03-30 00:14:45 -04:00
Jeremy Wood 5dcc0651e4 Add MVCorei18n#bundle for creating Message objects. 2023-03-29 23:59:19 -04:00
Jeremy Wood 2cb134bdeb Add base exception class MultiverseException.
Allows for localized messages to be contained in our exceptions.
2023-03-29 23:58:41 -04:00
Jeremy Wood 032a8c366d Add send message methods to MVCommandIssuer. 2023-03-29 23:45:44 -04:00
Jeremy Wood 1f8f68c383 Add kotlin mockito dependency for tests. 2023-03-29 15:18:08 -04:00
Jeremy Wood 979e80e1bd Use a custom implementation of BukkitCommandIssuer. 2023-03-29 13:09:18 -04:00
Jeremy Wood 224435f6cd Add Message for bundling messages with their arguments. 2023-03-29 12:53:40 -04:00
Jeremy Wood 40d5417629 Make PluginLocales injectable. 2023-03-29 00:51:54 -04:00
Jeremy Wood c32b2a4b51 Update Javadoc for MVConfig. 2023-03-28 17:36:02 -04:00
Jeremy Wood e5bb6bc23b Use Try<Void> rather than Try<Boolean> for ConfigHandle#set. 2023-03-28 17:25:48 -04:00
Jeremy Wood 94251be048 Change call order in FileConfigHandle.get for consistency. 2023-03-28 17:02:20 -04:00
Jeremy Wood 0cc3f93e0b Use Option instead of Optional for ValueNode#getName.
Also clean up nullability annotations in ConfigNode and co.
2023-03-28 16:38:35 -04:00
Jeremy Wood 63078270bf Use Option instead of Optional in NodeGroup. 2023-03-28 16:22:50 -04:00
Ben Woo a19fe76cbc chore: Add docs and remove some unused methods 2023-03-28 17:50:00 +08:00
Ben Woo 5cc5e6828f refactor: Allow for nullable NodeGroup 2023-03-28 17:15:15 +08:00
Ben Woo 90a3388728 refactor: Abstract handle class and improve node handling 2023-03-28 16:56:30 +08:00
Ben Woo 33fcf1ba26 refactor: Remove serverFolder value 2023-03-28 14:38:44 +08:00
Ben Woo f76b9b0670 feat: Add support for async teleport 2023-03-28 12:20:30 +08:00
Ben Woo 985f2e8823 refactor: Move teleport queue into seperate class 2023-03-28 11:32:04 +08:00
Jeremy Wood 9bbf42f993 Rename test methods. 2023-03-27 09:51:27 -04:00
Jeremy Wood 55390952c9 Add additional test set up more idiomatically. 2023-03-27 08:39:18 -04:00
Ben Woo 2f834ebfd6 fix: Relocation of acf dependency 2023-03-27 18:30:38 +08:00
Ben Woo 8f9df0294d chore: Improve logging in ConfigHandle 2023-03-27 18:29:34 +08:00
Ben Woo a5ae29c91a test: Implement test for config 2023-03-27 14:10:49 +08:00
Ben Woo 624d5ad117 fix: Get version without default fallback 2023-03-27 14:10:22 +08:00
Ben Woo 98fc0178aa fix: Migrate from old config on every load 2023-03-27 14:09:36 +08:00
Jeremy Wood 61cd593844 Fix a couple nits. 2023-03-27 01:03:21 -04:00
Jeremy Wood 7b39d78bfd Remove MultiverseCore dependency from DebugCommand. 2023-03-27 00:53:36 -04:00
Jeremy Wood 5a0957d894 Remove unused MultiverseConfigurationException. 2023-03-27 00:51:55 -04:00
Ben Woo 9f1ddcc81e refactor: Remove use of MVCoreConfigProvider 2023-03-27 12:25:13 +08:00
Ben Woo a8c8ef7a6b refactor: Move MVCoreConfigNodes to a non-static context 2023-03-27 11:39:11 +08:00
Ben Woo ce9d53c6e9 refactor: Rename to MVCoreConfig 2023-03-27 11:14:58 +08:00
Ben Woo 7af22c451e chore Remove unused MultiverseCoreConfiguration.java 2023-03-27 10:49:07 +08:00
Ben Woo db9879af8d refactor: Move DefaultMVConfig and MVConfigNodes to config package 2023-03-27 10:48:46 +08:00
Ben Woo f05092076f fix: Don't need to check version before removing serialisation value 2023-03-27 10:39:29 +08:00
Ben Woo 346ac94737 Merge branch 'main' into new-readme-2 2023-03-27 10:16:41 +08:00
Jeremy Wood 7f9c45d8e1 Use DI for new config. 2023-03-26 19:16:14 -04:00
Jeremy Wood a45e95c7fd Merge remote-tracking branch 'origin/MV5' into revamp-config
# Conflicts:
#	build.gradle
#	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
#	src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java
#	src/main/java/com/onarandombox/MultiverseCore/api/MVConfig.java
#	src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandCompletions.java
#	src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandContexts.java
#	src/main/java/com/onarandombox/MultiverseCore/listeners/MVChatListener.java
#	src/main/java/com/onarandombox/MultiverseCore/listeners/MVEntityListener.java
#	src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java
#	src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorld.java
#	src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorldManager.java
2023-03-26 19:09:37 -04:00
Jeremy Wood 43c6945710 Merge pull request #2886 from Multiverse/dumptruckman/inject
Implement simple dependency injection using hk2.
2023-03-26 16:12:16 -04:00
Jeremy Wood edea4aff4b Fix PAPI registration. 2023-03-26 14:48:30 -04:00
Jeremy Wood 44dacdceb1 Use consistency for exception param names. 2023-03-26 14:11:05 -04:00
Jeremy Wood 75998ae2c3 Remove EagerlyLoaded. 2023-03-26 14:10:26 -04:00
Jeremy Wood 16db616546 Remove EagerlyLoaded from SimpleMVWorldManager. 2023-03-26 14:09:40 -04:00
Jeremy Wood 4c94af5f08 Remove EagerlyLoaded from UnsafeCallWrapper. 2023-03-26 14:08:58 -04:00
Jeremy Wood e91bcb9658 Remove EagerlyLoaded from MVPermissions. 2023-03-26 14:08:28 -04:00
Jeremy Wood 0836badea6 Remove EagerlyLoaded from SimpleSafeTTeleporter. 2023-03-26 14:02:06 -04:00
Jeremy Wood 426d7639bb Remove EagerlyLoaded from SimpleLocationManipulation. 2023-03-26 14:01:02 -04:00
Jeremy Wood a74aeb53d0 Remove EagerlyLoaded from SimpleBlockSafety. 2023-03-26 14:00:22 -04:00
Jeremy Wood 52a2ff78c8 Remove EagerlyLoaded from MVEconomist. 2023-03-26 13:59:15 -04:00
Jeremy Wood 6f86416310 Remove EagerlyLoaded from MVCoreConfigProvider. 2023-03-26 13:55:21 -04:00
Jeremy Wood 1f134d4501 Use Provider for MultiverseCorePlaceholders in MultiverseCore. 2023-03-26 13:52:36 -04:00
Jeremy Wood 573b424efe Use vavr for registering listeners. 2023-03-26 13:51:54 -04:00
Jeremy Wood f2347cb620 Use Provider for MetricsConfigurator in MultiverseCore. 2023-03-26 13:33:01 -04:00
zax71 6d351300de chore: remove Modrinth for now
Signed-off-by: zax71 <zabax32@gmail.com>
2023-03-26 18:26:23 +01:00
Jeremy Wood a8ec599b35 Remove direct getService usage for DestinationsProvider. 2023-03-26 13:18:20 -04:00
Jeremy Wood a8b44dff78 Remove additional direct getService usage for MVCommandProvider. 2023-03-26 13:09:43 -04:00
Jeremy Wood e8a33c0cdf Remove EagerlyLoaded from MVCommandManager. 2023-03-26 13:01:08 -04:00
Jeremy Wood 8b244e7d3b Remove EagerlyLoaded from AnchorManager. 2023-03-26 12:45:14 -04:00
Jeremy Wood 472742dde8 Manually initialize metrics. 2023-03-25 16:49:04 -04:00
Ben Woo cd260b0f5e feat: Fully implement working migration and validation 2023-03-26 00:31:36 +08:00
Jeremy Wood 372569ed6c Don't eagerly load MultiverseCorePlaceholders. 2023-03-25 09:38:15 -04:00
Jeremy Wood aa023f3c44 Use injection in MultiverseCorePlaceholders. 2023-03-25 09:28:27 -04:00
Jeremy Wood 93ac4fffcc Merge remote-tracking branch 'origin/MV5' into dumptruckman/inject
# Conflicts:
#	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
2023-03-25 08:42:20 -04:00
Jeremy Wood 750460fff0 Eagerly load core services. 2023-03-25 00:27:30 -04:00
Jeremy Wood add73be4fc Rename AutoLoadedService to EagerlyLoaded. 2023-03-25 00:17:08 -04:00
Jeremy Wood c65a945203 Fix listener registration. 2023-03-25 00:15:56 -04:00
Jeremy Wood cbc3bace58 Remove InjectionFeature loading. 2023-03-25 00:02:48 -04:00
Jeremy Wood 376fc8db18 Revert "Add API for creating auto-registering services."
This reverts commit b2171717ad.
2023-03-24 23:32:14 -04:00
Jeremy Wood 4aa1782cfd Revert "Add automatic listener registration through ListenerFeature."
This reverts commit d03063f2b9.
2023-03-24 23:31:58 -04:00
Jeremy Wood e38796f492 Revert "Add automatic command registration through BaseCommandFeature."
This reverts commit 0c97aea3dc.
2023-03-24 23:31:37 -04:00
Jeremy Wood 5d2e68a362 Revert "Add automatic destination registration through DestinationFeature."
This reverts commit c6a2cee050.
2023-03-24 23:31:30 -04:00
Ben Woo 358404b407 feat: Add a runnable when value is set. 2023-03-24 23:42:49 +08:00
Ben Woo 3ccdfd7cf5 refactor: Move to configuration package and rename MVSettings -> ConfigHandle 2023-03-24 22:32:10 +08:00
Ben Woo 274a7ed82b docs: Add more docstrings to methods implemented 2023-03-24 22:26:38 +08:00
Ben Woo ba2be24362 docs: Fix inheritDoc more typo 2023-03-24 22:20:56 +08:00
Ben Woo c8ae27894e refactor: Change name to optional and fix inheritDoc typo 2023-03-24 22:20:03 +08:00
Ben Woo cb5877b206 docs: Add docstrings to methods implemented 2023-03-24 22:09:10 +08:00
Ben Woo d126b3d31a feat: Add config for papi hook 2023-03-24 15:47:12 +08:00
Ben Woo 2edf955332 refactor: Rename config methods to align with new structure 2023-03-24 14:39:58 +08:00
Ben Woo 136bd3cbe2 fix: Clean up config migration logging 2023-03-24 14:16:03 +08:00
Ben Woo 433160f187 fix: Java 11 compatibility with instanceof pattern 2023-03-24 14:12:26 +08:00
Ben Woo e3e3c039c3 feat: Fully implement config command 2023-03-24 13:00:29 +08:00
Ben Woo d321851f0d fix: Donation and migration of various node path 2023-03-24 00:14:16 +08:00
Ben Woo 7759a37b4e feat: Implement config names and basic config command 2023-03-23 23:59:19 +08:00
Ben Woo f1a9d3a723 Merge remote-tracking branch 'origin/MV5' into revamp-config 2023-03-22 22:53:50 +08:00
Ben Woo 9ae2cddfda refactor: Flip boolean for custom portal search config 2023-03-22 22:53:16 +08:00
Ben Woo 6cc169cb55 feat: Fully replace with new config api 2023-03-22 22:48:24 +08:00
Ben Woo 783038ffb4 feat: Implement get/set methods from previous MVConfig class 2023-03-18 23:27:57 +08:00
Ben Woo db0e9f3142 feat: Implement migration from old mv config.yml 2023-03-18 23:09:10 +08:00
Zax71andBen Woo 95c3b034ec feat: Add PlaceholderAPI Support (#2888)
* feat:Add PlaceholderAPI Support

Signed-off-by: zax71 <zabax32@gmail.com>

* Implement requested changes

Signed-off-by: zax71 <zabax32@gmail.com>

* Add separate world functionality and half-baked i18n support.

Signed-off-by: zax71 <zabax32@gmail.com>

* refactor: Simplify papi world parsing

* Fix spelling and remove unused i18n.

Signed-off-by: zax71 <zabax32@gmail.com>

* chore: Add warnings

* chore: Remove unused imports

* chore: Setup papi before log enable message

---------

Signed-off-by: zax71 <zabax32@gmail.com>
Co-authored-by: Ben Woo <30431861+benwoo1110@users.noreply.github.com>
2023-03-16 20:18:36 +08:00
Ben Woo 9ce648d06a refactor: Version migrator code 2023-03-16 11:18:31 +08:00
Jeremy Wood 2a504f4360 Add annotation processing for tests. 2023-03-12 17:30:46 -04:00
Jeremy Wood 1d5d7a9ce2 Add hamkrest test dependency. 2023-03-12 17:04:38 -04:00
Jeremy Wood 0601c05761 Revert "Simplify PluginInjection by removing unneeded population."
This reverts commit f7bd538049.
2023-03-12 00:02:46 -05:00
Jeremy Wood c6a2cee050 Add automatic destination registration through DestinationFeature. 2023-03-11 23:56:49 -05:00
Jeremy Wood 0c97aea3dc Add automatic command registration through BaseCommandFeature. 2023-03-11 23:46:15 -05:00
Jeremy Wood 7dcada0c2d MultiverseCore#getAllServices should not instantiate services. 2023-03-11 23:37:03 -05:00
Jeremy Wood d03063f2b9 Add automatic listener registration through ListenerFeature. 2023-03-11 12:30:09 -05:00
Jeremy Wood 485d2428ed Rename PluginService to AutoLoadedService. 2023-03-11 11:40:37 -05:00
Jeremy Wood b2171717ad Add API for creating auto-registering services. 2023-03-11 11:37:33 -05:00
Jeremy Wood 49c23d31b0 MultiverseCore#getService should not instantiate services. 2023-03-11 11:24:24 -05:00
Jeremy Wood f7bd538049 Simplify PluginInjection by removing unneeded population. 2023-03-11 11:05:35 -05:00
Jeremy Wood 9f650d683d Add PluginService and InjectionFeature loading. 2023-03-10 02:07:44 -05:00
Jeremy Wood b40ded9806 Fix relocations and exported maven dependencies. 2023-03-09 15:57:55 -05:00
Jeremy Wood 93b82ae825 Inject MVCoreConfigProvider directly into MultiverseCore. 2023-03-09 11:34:41 -05:00
Jeremy Wood ecec80dfe3 Correctly rename hk2 metadata file. 2023-03-09 11:31:32 -05:00
Jeremy Wood 2f1a3bcc22 Use Provider for MVCoreConfigProvider in MultiverseCore. 2023-03-09 09:24:55 -05:00
Jeremy Wood 1ea88615c7 Don't rename hk2 metadata file. 2023-03-09 09:05:03 -05:00
Jeremy Wood 7fe50d2171 Temporarily throw exception on enable to reveal testing issue. 2023-03-09 08:53:37 -05:00
Jeremy Wood a81e045598 Use getter in MultiverseCore for config provider. 2023-03-09 08:52:51 -05:00
Jeremy Wood eac2fa53cb Stop relocating and minimizing for hk2. 2023-03-09 08:50:16 -05:00
Jeremy Wood 0f1d1adeb2 Remove Service/Contract from MVConfig and impl. 2023-03-09 08:49:29 -05:00
Jeremy Wood d4f43853f5 Skip checkstyle and javadoc in test workflow. 2023-03-08 23:52:39 -05:00
Jeremy Wood d7f907b40c Enable full exception format for gradle test. 2023-03-08 23:52:24 -05:00
Jeremy Wood 686c4a4b16 Simplify config provider usage. 2023-03-08 23:02:17 -05:00
Jeremy Wood ea07a490a6 Update Java version used in GHA. 2023-03-08 15:19:50 -05:00
Jeremy Wood 3d1c3f81f6 Fix relocations and minimize shadow jar. 2023-03-08 13:50:07 -05:00
Jeremy Wood 7fc78d81bc Remove faulty javadoc from CannonDestination. 2023-03-08 13:48:03 -05:00
Jeremy Wood 47002061db Remove some unused imports. 2023-03-08 13:37:41 -05:00
Jeremy Wood 1ea6df4a27 Merge remote-tracking branch 'origin/MV5' into dumptruckman/inject
# Conflicts:
#	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/CloneCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/DeleteCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/GameruleCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/LoadCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/RootCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java
#	src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java
2023-03-08 13:32:59 -05:00
Jeremy Wood 23693835ca Remove PluginDataFolder. 2023-03-08 13:19:31 -05:00
Jeremy Wood 8e7e0ef566 Replace all service getters with DI. 2023-03-08 13:16:18 -05:00
Jeremy Wood dd93223eb1 Use DI for command classes. 2023-03-08 08:43:40 -05:00
Jeremy Wood e6f304fd25 Use specific dependencies in SimpleMVWorldManager and SimpleMVWorld. 2023-03-08 07:39:18 -05:00
Jeremy Wood b6a0d272df Use specific dependencies in UnsafeCallWrapper. 2023-03-07 19:02:11 -05:00
Jeremy Wood 177adf80cb Use specific dependencies in SimpleSafeTTeleporter. 2023-03-07 19:00:06 -05:00
Jeremy Wood 160f49bbae Use specific dependencies in MVPermissions. 2023-03-07 18:54:33 -05:00
Jeremy Wood 397101f712 Use specific dependencies in DestinationsProvider. 2023-03-07 18:49:13 -05:00
Jeremy Wood d1f59e3d86 Use specific dependencies in SimpleBlockSafety. 2023-03-07 18:40:37 -05:00
Jeremy Wood bab0ccd3f2 Use specific dependencies in AnchorManager. 2023-03-07 17:00:24 -05:00
Jeremy Wood 015c58421d Add MVCoreConfigProvider#getConfigUnsafe. 2023-03-07 16:58:29 -05:00
Jeremy Wood a57a83a047 Add injectable wrapper for plugin data folder. 2023-03-07 16:49:14 -05:00
Jeremy Wood 6362a97aaf Move configuration loading/saving into injectable MVCoreConfigProvider. 2023-03-07 16:10:34 -05:00
Jeremy Wood 0db90dc0b9 Set up DI for primary dependencies of MultiverseCore. 2023-03-07 14:39:11 -05:00
Jeremy Wood 6a434746c9 Also bind plugin logger in PluginBinder. 2023-03-07 14:16:58 -05:00
Ben Woo c76652f0a2 feat: Test out new commentedconfiguration 2023-03-07 23:33:35 +08:00
Ben Woo e314539847 dep: Bump CommentedConfiguration to 1.0.1 2023-03-07 23:32:09 +08:00
Jeremy Wood de6b25db35 Also bind MultiverseCore to MVCore and MVPlugin. 2023-03-07 02:24:00 -05:00
Jeremy Wood 40637e6a88 Enable basic dependency injection. 2023-03-07 01:59:48 -05:00
Jeremy Wood 7ad0b04787 Abstract TestWithMockBukkit out of MockBukkitTest. 2023-03-07 00:20:26 -05:00
Jeremy Wood 00554fefc3 Add vavr dependency. 2023-03-06 22:55:36 -05:00
Jeremy Wood 0082287a5d Enable hk2 annotation processing. 2023-03-06 20:41:27 -05:00
Ben Woo 84730e0fcd Merge branch 'main' into MV5 2023-03-06 19:43:46 +08:00
Ben Woo 9dba558ffd Merge pull request #2884 from Lildirt/ld/command-i18n
i18n for strings directly in commands
2023-03-06 16:45:40 +08:00
Lildirt 1f1c8240d9 i18n: move RootCommand further down 2023-03-05 13:00:31 -05:00
Jeremy Wood 4576ca99c9 Add hk2 dependency. 2023-03-04 10:26:49 -05:00
Lildirt eaa8b1ee56 i18n: last bit of colorizing 2023-03-03 12:23:50 -05:00
Lildirt 10c910f00f i18n: fix prompt message mappings 2023-03-03 12:23:43 -05:00
Lildirt 3bd6712f0e i18n: Move mv-core.debug 2023-03-03 12:23:36 -05:00
Lildirt 6a5e8d2522 i18n: Register root command 2023-03-03 12:23:11 -05:00
Lildirt 1dadaa1a73 i18n: use error message levels 2023-03-03 12:23:11 -05:00
Lildirt ef3a50f32b i18n: section out the string file with comments 2023-03-03 12:22:58 -05:00
Lildirt ac31a66a45 i18n: Preserve original string colorization. 2023-03-03 12:22:58 -05:00
Lildirt 992ce7cff5 i18n: more sections & missing confirm description 2023-03-03 12:22:58 -05:00
Lildirt fd237243a4 i18n: Usage command 2023-03-03 12:22:58 -05:00
Lildirt 0512fa1820 i18n: Unload command 2023-03-03 12:22:58 -05:00
Lildirt a9896df2a7 i18n: Teleport command 2023-03-03 12:22:58 -05:00
Lildirt 216adf5fa9 i18n: MV Root command 2023-03-03 12:22:58 -05:00
Lildirt 12f6ceb622 i18n: Remove command 2023-03-03 12:22:58 -05:00
Lildirt ca0f6febb5 i18n: Reload command 2023-03-03 12:22:58 -05:00
Lildirt 3e468dba4d i18n: Regen command 2023-03-03 12:22:58 -05:00
Lildirt 8b450910ba i18n: Load command 2023-03-03 12:22:58 -05:00
Lildirt 38002261b7 i18n: Import command 2023-03-03 12:22:58 -05:00
Lildirt 9e5fb2cf4b i18n: Gamerule command 2023-03-03 12:22:58 -05:00
Lildirt fa0e9f4268 i18n: Delete command 2023-03-03 12:22:58 -05:00
Lildirt 5e4e925bb1 i18n: Clone command 2023-03-03 12:21:19 -05:00
Lildirt c9bb6180bd i18n: Check command 2023-03-03 12:21:14 -05:00
Jeremy Wood 8a69d6ad43 Merge pull request #2883 from Multiverse/artifact_pr_build
build: Add artifacting of PR build
2023-03-03 11:30:37 -05:00
Ben Woo 3b44ea218d build: Fix PR build number 2023-03-03 23:28:55 +08:00
Ben Woo 68c97f7ae6 build: Add artifacting of PR build 2023-03-03 23:21:36 +08:00
Ben Woo 3f6c3047d8 fix: Restore locales setup method (#2881) 2023-03-03 22:23:39 +08:00
Jeremy Wood e4fd23709f Merge pull request #2882 from Multiverse/dumptruckman/fix_mock_bukkit
Downgrade MockBukkit to 2.141.0.
2023-03-03 08:29:57 -05:00
Jeremy Wood a255f55b6f Downgrade MockBukkit to 2.141.0. 2023-03-03 08:27:12 -05:00
Jeremy Wood e0e2a0f0c2 Merge pull request #2879 from Multiverse/dumptruckman/new_tests
Add new test module using Kotlin and JUnit 5.
2023-03-02 08:56:39 -05:00
Jeremy Wood a4e84ad581 Use ServerMock instead of Server. 2023-03-02 08:36:43 -05:00
Jeremy Wood 65cb3f7037 Put test method after tearDown. 2023-03-02 08:35:52 -05:00
Jeremy Wood fc7509cca6 Use a better test method name. 2023-03-02 08:35:30 -05:00
zax71 68411ae6bf Add correct number of newlines
Signed-off-by: zax71 <zabax32@gmail.com>
2023-03-02 12:54:20 +00:00
zax71 2c5e86c689 Add Modrinth Upload 2023-03-02 12:37:07 +00:00
Jeremy Wood eebb4a4a6d Implement initial test using MockBukkit. 2023-03-02 02:22:47 -05:00
Jeremy Wood 698d1c7954 Switch to JUnit 5 for new tests. 2023-03-02 02:10:36 -05:00
Jeremy Wood ed73fd059e Add Kotlin dependency for tests only. 2023-03-02 02:07:38 -05:00
Jeremy Wood 87225b1c65 Move old tests to old-test. 2023-03-02 01:20:38 -05:00
Jeremy Wood 6362d9fb17 Merge pull request #2878 from Multiverse/dumptruckman/merge_main
Merge main branch into MV5
2023-03-02 00:58:37 -05:00
Jeremy Wood d5ba55716b Merge remote-tracking branch 'origin/main' into dumptruckman/merge_main
# Conflicts:
#	build.gradle
2023-03-02 00:56:34 -05:00
Jeremy Wood 4eca331430 Merge pull request #2877 from Multiverse/dumptruckman/separate_test_deps
Use a separate API version for running tests.
2023-03-02 00:53:24 -05:00
Jeremy Wood b6574245b8 Remove junit exclusion from compileOnly bukkit. 2023-03-02 00:48:54 -05:00
Jeremy Wood 85d744d79f Run tests against spigot-api 1.19.3. 2023-03-02 00:44:32 -05:00
Jeremy Wood e536dff1a8 Use a separate bukkit dependency for tests. 2023-03-02 00:37:30 -05:00
Jeremy Wood 39287f55ef Delete CODEOWNERS. 2023-03-01 23:36:41 -05:00
Ben WooandJeremy Wood d5ebde53b9 Add maven central to repositories (#2859)
Co-authored-by: Jeremy Wood <farachan@gmail.com>
2023-03-02 12:32:07 +08:00
Jeremy Wood 101ddae443 Create CODEOWNERS. 2023-02-28 23:03:50 -05:00
Ben Woo e58de8d74d Merge pull request #2843 from Multiverse/help-command
feat: Implement help command
2023-02-28 23:21:36 +08:00
Ben Woo 974afb4751 feat: Implement help command 2023-02-28 23:16:09 +08:00
Ben Woo d819153690 Merge pull request #2842 from Multiverse/file-locales
feat: Improve locale support
2023-02-28 23:13:23 +08:00
Ben Woo 7dbd29b838 refactor: Shift classes and add javadocs 2023-02-28 23:07:19 +08:00
Ben Woo 560e3ab201 refactor: Make FileResClassLoader usable for other file paths. 2023-02-28 23:07:19 +08:00
Ben Woo ffc4c600c5 feat: Enable per player locale support 2023-02-28 23:07:18 +08:00
Ben Woo 44904eaef4 feat: Allow for custom locale folder path 2023-02-28 23:07:18 +08:00
Ben Woo 47a92deffd refactor: Use '&' for chat color formatting 2023-02-28 23:07:17 +08:00
Ben Woo b4549c6791 feat: Add support for loading locales from plugin dir 2023-02-28 23:07:17 +08:00
zax71 c3eb0ee8bd Center Logo 2023-02-26 14:00:37 +00:00
zax71 6a8c0b6255 Update README.md 2023-02-26 13:56:56 +00:00
Jeremy Wood 2b97f7310f Use pull_request_target for auto labeler. 2023-02-25 20:39:56 -05:00
Jeremy Wood 073091525b Label PRs automatically as prerelease. 2023-02-25 20:34:19 -05:00
Jeremy Wood 79b9c12319 Change job name for manually promoting releases. 2023-02-25 20:29:04 -05:00
Jeremy Wood 01f745b027 Skip checking PR labels. 2023-02-25 19:39:14 -05:00
Jeremy Wood 9725bdfeeb Use ref input. 2023-02-25 14:02:01 -05:00
Jeremy Wood cdf9767959 Use target_commitish for GITHUA_SHA. 2023-02-25 13:41:26 -05:00
Jeremy Wood 66e21da6b2 Add version to publish action as well. 2023-02-25 13:39:59 -05:00
Jeremy Wood 87b14d3944 Add publish and upload. 2023-02-25 13:34:24 -05:00
Jeremy Wood 7bbeb90320 Remove dry_run. 2023-02-25 13:34:10 -05:00
Jeremy Wood cd895d03dc Remove extra } in bump_version_scheme. 2023-02-25 13:32:08 -05:00
Jeremy Wood ee2a304148 Reorder version bump types. 2023-02-25 13:31:49 -05:00
Jeremy Wood 06e9e33da4 Workflow requires version bump type. 2023-02-25 13:28:36 -05:00
Jeremy Wood 7065ffaea2 Remove checkstyle from promote workflow. 2023-02-25 13:24:24 -05:00
Jeremy Wood 1bc4e68ff9 Use promote scheme for manual workflow. 2023-02-25 13:20:40 -05:00
Jeremy Wood 4e53d13290 Add workflow for manually promoting a release. 2023-02-25 13:10:53 -05:00
Jeremy Wood 90344d36df Merge pull request #2867 from Multiverse/no_version_bump
Use "no version bump" label instead of "no release".
2023-02-24 13:19:16 -05:00
Jeremy Wood f36a56e854 Use "no version bump" label instead of "no release". 2023-02-24 13:17:39 -05:00
Jeremy Wood 5d4bacc80e Merge pull request #2866 from Multiverse/test_prerelease_2
Remove space to test pre-releases
2023-02-24 12:40:57 -05:00
Jeremy Wood d88bf6e137 Remove space to test pre-releases 2023-02-24 12:40:36 -05:00
Jeremy Wood 63f5d769d8 Merge pull request #2865 from Multiverse/prerelease-test
Add space to trigger release.
2023-02-24 11:57:39 -05:00
Jeremy Wood 9a9bfc03b9 Add space to trigger release. 2023-02-24 11:57:02 -05:00
Jeremy Wood 28112ef4d8 Merge pull request #2864 from Multiverse/simplify_release_name
Drop "Release" prefix on release names.
2023-02-24 11:46:47 -05:00
Jeremy Wood 7e5a3238b8 Drop "Release" prefix on release names. 2023-02-24 11:44:06 -05:00
Jeremy Wood 3279a6a38d Merge pull request #2863 from Multiverse/prerelease_snapshot
Check if the tag name contains pre instead of checking PR labels.
2023-02-24 11:34:18 -05:00
Jeremy Wood b64e48769d Check if the tag name contains pre instead of checking PR labels. 2023-02-24 11:29:28 -05:00
Jeremy Wood ff8002fc13 Merge pull request #2862 from Multiverse/prerelease_snapshot
Publish prerelease versions as snapshots.
2023-02-24 11:21:09 -05:00
Jeremy Wood 2af835f0c3 Publish prerelease versions as snapshots. 2023-02-24 11:15:36 -05:00
Jeremy Wood bf25b65f09 Merge pull request #2861 from Multiverse/test_prerelease
Test prerelease workflow.
2023-02-24 10:53:54 -05:00
Jeremy Wood 52eb3d820f Test out the prerelease action. 2023-02-24 09:58:10 -05:00
Ben Woo d90210d70f Merge pull request #2855 from Multiverse/gradle-build
build: Make MV5 build with gradle
2023-02-20 20:34:56 +08:00
Ben Woo ec254c2989 build: Make MV5 build with gradle 2023-02-20 20:29:08 +08:00
Ben Woo 36549294b7 Merge branch 'main' into gradle-build 2023-02-20 20:25:47 +08:00
Jeremy Wood 908fcb1e44 Merge pull request #2854 from Multiverse/dumptruckman/fix_release_8
Combine release and publish into a single workflow.
2023-02-20 07:20:05 -05:00
Jeremy Wood 73cd26aea3 Combine release and publish into a single workflow. 2023-02-20 07:17:37 -05:00
Jeremy Wood 758d25812b Merge pull request #2853 from Multiverse/fix-gha-release
Fix upload release artifact
2023-02-20 06:42:31 -05:00
Ben Woo fa0ef421c7 Merge branch 'main' into fix-gha-release 2023-02-20 14:57:52 +08:00
Ben Woo e936a6271f Fix upload release artifact 2023-02-20 14:57:01 +08:00
Jeremy Wood 7362e543da Merge pull request #2851 from Multiverse/dumptruckman/fix_release_7
Use new action for uploading artifact.
2023-02-20 00:58:06 -05:00
Jeremy Wood 8a46d70301 Use new action for uploading artifact. 2023-02-20 00:57:21 -05:00
Jeremy Wood a168e5cb48 Merge pull request #2850 from Multiverse/dumptruckman/fix_release_6
Massage the strange release upload url.
2023-02-20 00:38:53 -05:00
Jeremy Wood ae578f9491 Massage the strange release upload url. 2023-02-20 00:36:45 -05:00
Jeremy Wood e72122378d Merge pull request #2849 from Multiverse/dumptruckman/fix_release_5
Fix name of consumed output variable on get_release in more places.
2023-02-20 00:06:05 -05:00
Jeremy Wood fd2ea3df09 Remove tag prefix. 2023-02-20 00:04:43 -05:00
Jeremy Wood e94e071c6e Fix name of consumed output variable on get_release in more places. 2023-02-19 23:58:26 -05:00
Jeremy Wood 0e19236cdc Merge pull request #2848 from Multiverse/dumptruckman/fix_release_4
Use lowercase artifact id.
2023-02-19 23:53:45 -05:00
Jeremy Wood 1c12756acf Use lowercase artifact id. 2023-02-19 23:51:14 -05:00
Jeremy Wood bcfde80c07 Merge pull request #2847 from Multiverse/dumptruckman/fix_release_3
Fix name for consumed output variable on get_release.
2023-02-19 23:39:16 -05:00
Jeremy Wood 8dc9e864eb Fix name for consumed output variable on get_release. 2023-02-19 23:37:25 -05:00
Jeremy Wood fec820f4ba Merge pull request #2846 from Multiverse/dumptruckman/fix_release_2
Use PAT to create release.
2023-02-19 23:27:49 -05:00
Jeremy Wood ff9ffad302 Use organization PAT for creating release. 2023-02-19 23:25:10 -05:00
Jeremy Wood fc2cb6aeae Move publish jobs back into publish action. 2023-02-19 23:24:44 -05:00
Jeremy Wood d2776ef448 Merge pull request #2844 from Multiverse/dumptruckman/fix_release
Fix build & publish.
2023-02-19 22:55:44 -05:00
Jeremy Wood 36ef41b710 Release and publish in the same action. 2023-02-19 22:51:30 -05:00
Jeremy Wood 9258ebd8c7 Remove Intellij gradle plugin. :( 2023-02-19 21:57:13 -05:00
Jeremy Wood d528cbcafd Merge pull request #2826 from Multiverse/dumptruckman/gradle
Switch from Maven to Gradle.
2023-02-19 20:48:01 -05:00
Jeremy Wood 760c193b0e Readd test workflow. 2023-02-19 19:36:20 -05:00
Jeremy Wood 7c6edcb081 Fix the required label names. 2023-02-19 19:09:02 -05:00
Jeremy Wood 009a94f74d Publish releases. 2023-02-19 19:03:45 -05:00
Jeremy Wood bd6fb4e51c Correctly disable useless IntelliJ plugin tasks. 2023-02-19 19:03:40 -05:00
Jeremy Wood 2fdef44744 Create release on push to main branch. 2023-02-19 19:03:40 -05:00
Jeremy Wood 5b991f44e2 Require release related label on PRs against main branch. 2023-02-19 19:03:39 -05:00
zax71 871ba16b67 Implement requested changes 2023-02-19 19:03:39 -05:00
zax71 e90c50d170 Add Caching to GitHub actions and update README.md to reflect Gradle 2023-02-19 19:03:39 -05:00
zax71 d1be3bd0be Update GitHub Actions to Gradle 2023-02-19 19:03:37 -05:00
Jeremy Wood 4d40b3f7e4 Switch from Maven to Gradle. 2023-02-19 19:02:52 -05:00
Ben Woo 20ba6f130a feat: Implement remove and import command (#2839)
* feat: Implement remove and import command

* chore: Improve some description strings
2023-02-18 14:03:05 +08:00
Ben Woo d8fff0ae15 chore: Up protocol version to 50 2023-02-18 14:03:04 +08:00
Ben Woo 3da1b7e8c4 refactor: Remove AbstractMVPlugin entirely 2023-02-16 11:12:03 +08:00
Ben Woo 79ae8754dc feat: Properly cleanup AbstractMVPlugin 2023-02-16 10:46:01 +08:00
Ben Woo 3fc3663d5d feat: Improve SpawnLocation toString
This helps in debug logs not showing world=null for spawn location
2023-02-15 20:27:59 +08:00
Ben Woo 5d1d71baf2 refactor: Add shortcut methods to ParsedDestination 2023-02-15 19:47:11 +08:00
Ben Woo 71367d2d69 fix: Arg pop issue with * worlds selection 2023-02-15 14:06:41 +08:00
Ben Woo 72415cdae5 feat: Implement list command 2023-02-15 12:17:04 +08:00
Ben Woo 09d8790804 chore: Refactor and fix some bugs with content display 2023-02-15 12:16:24 +08:00
Ben Woo 53f453b7ac refactor: Reorder gamerules completion alphabetically 2023-02-15 11:24:56 +08:00
Ben Woo 9a255555a6 feat: Set default completions 2023-02-15 11:24:09 +08:00
Ben Woo 28d71f7bc1 feat: Add support for comma separated MVWorlds 2023-02-15 11:10:35 +08:00
Ben Woo bf5ab8d1b3 refactor!: Remove MVPlayerSession (#2838)
Remove teleport / message cooldown along with it
2023-02-15 10:30:05 +08:00
Ben Woo c05d866f2f refactor: Remove buscript entirely (#2837) 2023-02-15 10:28:56 +08:00
Zax71andBen Woo 9cf2c68fe8 feat: Implement gamerule command (#2840)
* Feat: Add /gamerule

Signed-off-by: Ben Woo <30431861+benwoo1110@users.noreply.github.com>

* Chore: Accept sugguestion

Co-authored-by: Ben Woo <30431861+benwoo1110@users.noreply.github.com>

* Chore: Implement (most) suggestions from Ben

* feat: Implement gamerule context

* feat: Implement MVworld[] array context

* feat: Implement context for gamerule value

---------

Signed-off-by: Ben Woo <30431861+benwoo1110@users.noreply.github.com>
Co-authored-by: Ben Woo <30431861+benwoo1110@users.noreply.github.com>
2023-02-15 10:25:53 +08:00
Ben Woo 15ae0ea54f fix: Improve error handling for regex filter 2023-02-14 00:30:44 +08:00
Ben Woo 1e711ac258 fix: Missing pop arg when resolving mvworld 2023-02-14 00:19:30 +08:00
Ben Woo 706338bb0c feat: Add support for issuer with queued command 2023-02-13 23:59:46 +08:00
Ben Woo 1c89b6458f feat: Improve content display API
- Change ContentProvider to return a list instead of add to existing
- Add prefix for inline handler
- Change from CommandSender to BukkitCommandIssuer, prep for locale
2023-02-13 23:31:26 +08:00
Ben Woo 7978193d88 feat: Add support for resolving MVWorld based on issuer 2023-02-13 16:42:15 +08:00
Ben Woo 9efbbe7a4b feat: Add ContentFilter context 2023-02-13 16:38:15 +08:00
Ben Woo afaed87a67 refactor: Split into abstract MultiverseCommand and MultiverseCoreCommand 2023-02-10 21:58:11 +08:00
Ben Woo f3addfbf4e refactor: Use better nesting for locales key 2023-02-10 17:11:05 +08:00
Ben Woo 19ad1db5fb feat: Add reload command 2023-02-10 16:09:31 +08:00
Ben Woo 16096acc34 refactor: Make world name condition check id clearer 2023-02-09 17:09:28 +08:00
Ben Woo 1f907d93af refactor: Cleanup player finder
Add a getMulti method without command sender
2023-02-09 14:21:41 +08:00
Ben Woo aed0e178ea feat: Add support for teleporting multiple players 2023-02-09 14:16:29 +08:00
Ben Woo 6694c02650 refactor!: Rename back to MVWorldManager 2023-02-09 14:02:00 +08:00
Ben Woo 10ef838d3f feat: Implement create, delete, clone, regen, load and unload (#2835)
* feat: Implement create, delete, clone, regen, load and unload

* chore: Some formatting update

* chore: Implement suggested command changes

* feat: Add world name validation

* feat: Implement locale support for create command

* fix: World exist checking should include unloaded worlds

* fix: Add default null to generator output

* fix: Allow Unloaded worlds to be cloned

* chore: Make annotation order consistent
2023-02-09 13:50:36 +08:00
Ben Woo 5b25cf4f6c chore: Update vault and json dependency 2023-02-08 16:41:25 +08:00
Ben Woo 24596419e5 refactor!: Reorganise the entire MV 2023-02-08 16:19:33 +08:00
Ben Woo a403380375 refactor!: MultiverseCore plugin mess 2023-02-08 15:33:59 +08:00
Ben Woo a6ee8a55ca refactor!: Move queue command manager to command manager class 2023-02-08 14:00:20 +08:00
Ben Woo 6fba6715ba refactor!: Remove deprecated world purger 2023-02-08 13:54:38 +08:00
Ben Woo 6495b72a53 refactor!: Remove unused messaging classes 2023-02-08 13:54:20 +08:00
Ben Woo 5dba9f156d refactor!: Remove old command handler and commands 2023-02-08 13:41:38 +08:00
Ben Woo a8590df9d4 feat: Implementation of new destination API (#2833)
* feat: Basic implementation of new destination API

* feat!: Move all destinations to new API

* feat: Fully implement teleport and check command

* chore: Improve autocomplete permission checking

* chore: Fine tune tab completion

* chore: Implement suggested changes

* docs: Add javadocs to added api methods
2023-02-08 12:43:59 +08:00
Chris 1877479094 Update github actions dependencies (#2825)
* Update Actions

* Trigger Test Build

* Fix build

* Remove Test build Trigger
2023-02-08 12:37:01 +08:00
Ben Woo 747cab75fd feat: Implement command flag system (#2827)
* feat: Implement command flag system

* docs: Add javadocs and annotation

* chore: Implement suggested improvements

* chore: Add shortcuts for flaggroup in MultiverseCommand

* chore: Add check if flaggroup already registered
2023-02-06 21:04:34 +08:00
Ben Woo fe8118854e refactor!: Remove deprecated debug log 2023-02-04 16:49:11 +08:00
Ben Woo 3377c1dbe5 refactor!: Remove deprecated logging (#2523) 2023-02-03 22:45:55 +08:00
Ben Woo 3ec22fc578 refactor!: Remove deprecated WorldManager methods (#2526) 2023-02-03 22:40:42 +08:00
Ben Woo 17351e66c1 refactor!: Remove deprecated getStaticConfig (#2525) 2023-02-03 22:39:23 +08:00
Ben Woo 0166b8d139 refactor!: Remove deprecated LocationManipulation class (#2528) 2023-02-03 22:38:51 +08:00
Ben Woo 2acca7f330 refactor!: Remove deprecated PlayChatEvent option (#2828) 2023-02-03 22:33:44 +08:00
Ben Woo 4ad6c53ba9 refactor!: Remove redundant MapInitializeEvent (#2507) 2023-02-03 22:11:38 +08:00
Ben Woo 0117159159 feat: @benwoo1110 Revamp content display API
commit 1211dfb057
Author: Ben Woo <30431861+benwoo1110@users.noreply.github.com>
Date:   Tue Aug 17 16:29:31 2021 +0800

    Implement suggested improvements.

    * Use singleton pattern for DefaultContentFilter with getInstance method.
    * Have a default SendHandler.
    * Don't need streams for small dataset.
    * Private WorldListContentParser class to improve readability.

commit 562eed8255
Author: Ben Woo <30431861+benwoo1110@users.noreply.github.com>
Date:   Tue Aug 17 00:26:57 2021 +0800

    Revamp content display API.
2023-02-03 20:23:53 +08:00
Ben Woo ccf802e32f perf: Update to use json-smart 2023-02-03 20:15:46 +08:00
Ben Woo 83f5a4a701 fix: Remove unused TravelAgent class 2023-02-03 19:50:04 +08:00
Ben Woo a034eaa555 feat: Implement basic localisation 2023-02-02 17:06:36 +08:00
Ben Woo 3fb99bc156 feat: Add ACF dependency and prep command migration 2023-02-02 16:49:45 +08:00
Ben Woo 9d34e5d75c fix: Replace deprecated EntityCreatePortalEvent with PortalCreateEvent
Use PortalCreateEvent which allows better checking of nether portal creation.
2023-02-02 15:13:00 +08:00
Ben Woo 27c2f7b9e9 feat: Update to 1.16.5-R0.1-SNAPSHOT dependency 2023-02-02 15:01:07 +08:00
Ben Woo 697fee8c4c chore: Bump version to 5.0.0-SNAPSHOT for continued development. 2023-02-02 14:21:11 +08:00
Ben Woo 20ce469aec Merge pull request #2765 from Multiverse/java17
Bump notnull-instrumenter-maven-plugin
2022-03-07 12:19:25 +08:00
Kermina Awad 70c91f777f bump notnull-instrumenter-maven-plugin
fixes compiling on Java 17
2022-03-06 22:42:38 -05:00
Ben Woo cc24f38d83 Merge pull request #2763 from Multiverse/bitly_domain
Remove j.mp Domain from BitlyURLShortener
2022-03-06 13:55:25 +08:00
nicegamer7 5ec27db284 remove j.mp domain from BitlyURLShortener 2022-03-05 09:35:10 -05:00
Ben Woo 5d6bc806f0 Merge pull request #2747 from KisaragiEffective/feature/use-collections-static-methods
use Collections' factory method instead of static field
2022-01-17 16:42:18 +08:00
Kisaragi 5868ad64b4 use Collections' factory method instead of static field
this resolves some unchecked generics warning
2021-12-31 00:46:21 +09:00
nicegamer7 ac6fcf5ed6 Merge pull request #2728 from Multiverse/benwoo1110-patch-2
More typo fixes to issue template.
2021-10-11 22:38:00 -04:00
Ben Woo 231824fd34 More typo fixes to issue template. 2021-10-08 11:58:43 +08:00
Ben Woo a3e7efcc58 Merge pull request #2727 from Artuto/fix-bug-report-issue-template
Fix Bug Report issue template
2021-10-08 11:53:30 +08:00
Artuto a649307a29 Fix Bug Report issue template 2021-10-07 22:52:22 -05:00
nicegamer7 b0235757cc Merge pull request #2719 from Multiverse/issue-forms
Use new issue forms.
2021-10-07 22:41:15 -04:00
Ben Wooandnicegamer7 06ee82a745 Update .github/ISSUE_TEMPLATE/feature-request.yml
Co-authored-by: nicegamer7 <kerminaawad@gmail.com>
2021-10-08 10:38:06 +08:00
Ben Wooandnicegamer7 d2cad7ca8d Update .github/ISSUE_TEMPLATE/feature-request.yml
Co-authored-by: nicegamer7 <kerminaawad@gmail.com>
2021-10-08 10:38:00 +08:00
nicegamer7 2390aa8f92 Merge pull request #2717 from Multiverse/fix-dest-velocity
Fix velocity not applying.
2021-10-07 22:36:47 -04:00
nicegamer7 674c4a4a06 Merge pull request #2720 from Multiverse/link-license
Link licence to LICENSE.md and add badge.
2021-10-07 21:48:05 -04:00
Ben Woo 768402088a Link licence to LICENSE.md and add badge. 2021-10-01 21:47:31 +08:00
Ben Woo 084033cc90 Use new issue forms. 2021-10-01 21:34:18 +08:00
Ben Woo 51801b1b36 Fix velocity not apply. 2021-10-01 15:11:03 +08:00
Jeremy Wood 71054197f2 Bump version to 4.3.2-SNAPSHOT for continued development. 2021-09-18 01:27:33 -04:00
Jeremy Wood 610f96415f Release version 4.3.1. 2021-09-18 01:18:40 -04:00
Jeremy Wood 34fa336f00 Revert "Add pipeline stuff."
This reverts commit 719ade19f7.
2021-08-25 09:40:58 -04:00
Jeremy Wood d92d62bce9 Revert "Fix task file path."
This reverts commit cf14d41d19.
2021-08-25 09:40:58 -04:00
Jeremy Wood cf14d41d19 Fix task file path. 2021-08-25 09:38:13 -04:00
Jeremy Wood 719ade19f7 Add pipeline stuff. 2021-08-25 09:37:22 -04:00
Ben Woo 1a8a97daf1 Merge pull request #2675 from Multiverse/replace_travis_badge
Replace Travis Badge with Github Actions.
2021-07-22 10:12:35 +08:00
nicegamer7 d9dffa8e6d replace travis badge 2021-07-21 22:11:09 -04:00
nicegamer7 973588defb Merge pull request #2175 from JLLeitschuh/fix/JLL/use_https_to_resolve_dependencies
[SECURITY] Use HTTPS to resolve dependencies in Maven Build
2021-07-19 20:14:17 -04:00
nicegamer7 c704c1ca3a Merge branch 'main' into fix/JLL/use_https_to_resolve_dependencies 2021-07-19 20:12:25 -04:00
Ben Woo c33a268b91 Merge pull request #2672 from Multiverse/fix_java16_tests
Fix Tests on Java 16 and code cleanup.
2021-07-19 10:31:31 +08:00
Kermina Awad 9821f1d9c8 clean up test files 2021-07-18 13:51:53 -04:00
Kermina Awad be6e0b67be don't run tests in parallel 2021-07-18 13:22:04 -04:00
Kermina Awad b9b1fa6164 remove PowerMockito 2021-07-18 13:17:15 -04:00
Kermina Awad 28585dd6f9 remove unnecessary stub 2021-07-18 13:12:09 -04:00
Ben Woo 47ca7b821b Move to GitHub actions (#2671)
* Remove use of travis.

* Add basic github action maven build.
2021-07-17 09:31:20 +08:00
nicegamer7 9ce2dfd100 Merge pull request #2445 from benwoo1110/fix-help
Fix issue where special chars cause PatternSyntaxException
2021-07-16 09:51:21 -04:00
Ben Woo 473ccd09d7 Don't need to toLowerCase filter. 2021-07-16 21:38:57 +08:00
Ben WooandJeremy Wood cc2e1d44b2 Implement new content display system. (#2584)
* Implement new content display system.

* Add @FunctionalInterface annotation to displaytools interfaces.

* Use static factory method to create Builder with contents.

* Use T for generic type since it's static method.

* Rename Builder#display to show and require CommandSender.

* Rename package from displaytools to display.

* Move DisplayHandler impls into their own package.

* Overload ContentDisplay#forContent with defaults for list and map.

* Pass CommandSender to send command.

This system is much more versatile when a single ContentDisplay instance
can be used for multiple players.

* Rename ContentDisplay#send to #show.

* Split DisplaySettings into separate classes.

Co-authored-by: Jeremy Wood <farachan@gmail.com>
2021-07-07 10:25:07 +08:00
Jeremy Wood 2e8f159d38 Merge pull request #2666 from Multiverse/https
Ensure https is used for repository.
2021-07-06 14:12:46 -04:00
Jeremy Wood 6581d16125 Merge pull request #2519 from Multiverse/readme-update
Update readme with more project details
2021-07-06 13:59:35 -04:00
Jeremy Wood 562bc56e83 Merge pull request #2664 from ccuser44/main
Create LICENSE.md
2021-07-06 13:56:16 -04:00
Ben Woo 4493cd7916 Ensure https is used for repository. 2021-07-06 23:27:53 +08:00
nicegamer7 1cd9e45915 Merge pull request #2663 from Multiverse/fix-portal-search
Set defaultportalsearch to true by default.
2021-07-05 15:16:01 -04:00
ccuser44 acb6bc6dd6 Create LICENSE.md 2021-07-05 11:39:50 +03:00
Ben Woo b7b17c5d21 Set defaultportalsearch to true by default. 2021-07-05 11:28:52 +08:00
Jeremy Wood bbd9211845 Bump version to 4.3.1-SNAPSHOT for continued development. 2021-06-23 15:47:52 -04:00
Jeremy Wood fc6796e20f Release version 4.3.0. 2021-06-23 08:56:24 -04:00
Jeremy Wood 6040a27126 Merge pull request #2635 from Multiverse/fix/version_cmd_perms
Change default permission for version command. Seriously wth.
2021-06-04 13:00:39 -04:00
Jeremy Wood 1c483148dc Change default permission for version command. Seriously wth. 2021-06-04 13:00:04 -04:00
nicegamer7 128442c062 Merge pull request #2622 from Multiverse/queue-system-cleanup
Queue system cleanup
2021-05-16 11:29:23 -04:00
Kermina Awad 141854f076 correct some javadoc typos 2021-05-16 11:21:20 -04:00
xSavior_of_God f72cc6764b Fix creation and import Exploit (#2353)
Through this fix you can avoid deleting of important folders.
2021-05-16 12:56:14 +08:00
benwoo1110 d95ecfaa8e Update some CommandQueueManager docs to be clearer. 2021-04-28 14:01:30 +08:00
benwoo1110 6c96f4e974 Ensure DummyCommandBlockSender isnt used for Op. 2021-04-28 13:58:43 +08:00
Ben Woo 28cee291c6 Merge pull request #2581 from Multiverse/regen-keep-gamerules
Add ability to keep gamerules setting on world regen.
2021-04-28 10:43:09 +08:00
Ben Woo 155f32c00f Add ability to keep gamerules on world regen. 2021-04-27 23:44:24 +08:00
Ben Woo 071ba05d81 Merge pull request #2585 from Multiverse/Revamp-queue-command-
Implement new queue command system.
2021-04-27 23:10:59 +08:00
Ben Woo 2ee5aea06b Merge pull request #2580 from Multiverse/per-search-and-reflect
Improve portal search radius
2021-04-27 10:57:46 +08:00
Ben Woo 3bb8de6d33 Improve portal search radius.
* Fix portal search radius not respected after travel agent removed.
* Set portal search radius for entity entering portals.
2021-04-26 22:52:24 +08:00
Ben Woo 79ac01da34 Merge pull request #2619 from Multiverse/general_cleanup
General Cleanup
2021-04-25 11:55:56 +08:00
Kermina Awad 6e4fbb0ece correct a copy-paste error introduced in #2588 2021-04-24 14:51:24 -04:00
Kermina Awad 167ed5e0d3 update VaultAPI repo 2021-04-24 14:49:28 -04:00
Kermina Awad 91f3304f78 add to Buscript failed to load message 2021-04-24 14:13:40 -04:00
Kermina Awad 7928e73a32 enable minimizeJar for maven-shade-plugin 2021-04-24 14:08:25 -04:00
Kermina Awad d61d186544 update bStats Metrics class 2021-04-24 14:08:09 -04:00
nicegamer7 dc356e88d0 Merge pull request #2582 from Multiverse/unload-message
Update unload message logging.
2021-04-24 13:49:12 -04:00
Kermina Awad d0d5574580 update unload message logging another time 2021-04-24 13:48:09 -04:00
Ben Woo 29617059b3 Merge pull request #2611 from Turbotailz/patch-1
Make prefixchat config option default to 'false'
2021-04-06 13:10:02 +08:00
Sam Goodger bf05fc81dd Make prefixchat config option default to 'false'
This may seem like a really negligible change but having this option default to `true` actually causes a lot of pain for support in other plugins that deal with prefixes (LuckPerms and Essentials being the main victims). Users always come in guns blazing, screaming at us because they don't know how to remove the world name from their chat. It's such a simple solution, yet no one thinks that of all plugins, it would be Multiverse that is tainting their beloved chat format.

Please consider updating this default setting. It will save a lot of us trouble in the future 🙏
2021-04-06 14:19:38 +10:00
nicegamer7 a2c5bf70f0 Merge pull request #2597 from Multiverse/cleanup
Cleanup
2021-03-18 10:52:28 -04:00
benwoo1110 ea19006465 Fix selector log level. 2021-03-18 16:40:47 +08:00
benwoo1110 89f685ff9a Add missing javadocs in DestinationFactory. 2021-03-10 17:45:39 +08:00
benwoo1110 ecc76033dc Remove redundant line that was moved to WorldNameChecker. 2021-03-10 17:41:56 +08:00
Ben Woo e843b0711d Merge pull request #2590 from Multiverse/small-wm-updates
Small WorldManager updates
2021-03-10 06:41:18 +08:00
Ben Woo eddfaf7df0 Merge pull request #2593 from Multiverse/destination-id
Add method to get registered destination identifiers.
2021-03-10 06:39:31 +08:00
nicegamer7 d1150ab5f8 Merge pull request #2591 from Multiverse/uuid-regex
Make UUID regex less restrictive.
2021-03-09 09:46:33 -05:00
benwoo1110 cc3996ca76 Implement new queue command system. 2021-03-09 20:54:42 +08:00
benwoo1110 1965aecfba Add method to get registered destination identifiers. 2021-03-09 20:05:23 +08:00
benwoo1110 ce34ae44d8 Make UUID regex less restrictive. 2021-03-09 11:48:26 +08:00
benwoo1110 f5a2d7bc47 Add getPotentialWorlds method to WorldManager. 2021-03-09 10:40:46 +08:00
benwoo1110 24295025ef Add option to lookup mvworlds without checking for aliases. 2021-03-09 10:35:42 +08:00
Ben Woo e3f56f6498 Merge pull request #2586 from Multiverse/reflect-helper
Add ReflectHelper class to better facilitate various reflection actions.
2021-03-09 01:18:29 +08:00
Ben Woo bd0c3cff3f Merge pull request #2587 from Multiverse/player-desination
Player destination
2021-03-09 00:32:20 +08:00
Ben Woo 7c4ab035a0 Merge pull request #2588 from Multiverse/world-name-check
Implement new WorldNameChecker
2021-03-09 00:31:58 +08:00
Ben Woo 2593080f77 Merge pull request #2567 from Multiverse/player-utils
Add support to find players based on name, UUID or selectors.
2021-03-09 00:29:22 +08:00
benwoo1110 0d4595d511 Implement new WorldNameChecker for better preliminary checks of world name. 2021-03-08 18:03:35 +08:00
benwoo1110 bf820c2c27 Add getPlayerAwareDestination to DestinationFactory. 2021-03-08 17:09:03 +08:00
benwoo1110 a12718d354 Add ReflectHelper class to better facilitate various reflection actions. 2021-03-08 16:25:33 +08:00
benwoo1110 b23c1ae606 Update unload message logging. 2021-03-04 16:00:53 +08:00
Ben Woo 7c59dcbcb9 Merge pull request #2494 from benwoo1110/property-fix
Fix cannot remove block currency with mvm set command.
2021-03-04 15:32:34 +08:00
Ben Woo 15cacba7c9 Merge pull request #2573 from Multiverse/java-11
Fix compiling with Java 11+
2021-03-02 09:01:38 +08:00
Ben Woo adbe88daa6 Merge pull request #2565 from Multiverse/fis-respawn-anchor
Add respawn anchor support.
2021-03-02 00:36:43 +08:00
Kermina Awad 5350c012f7 fix compiling on java 15 2021-02-25 17:48:17 -05:00
benwoo1110 a91f377cf5 Fix compile on java 11. 2021-02-24 16:40:21 +08:00
Ben Woo c3ae5ac210 Merge pull request #2539 from Multiverse/disable_buscript
Add a Config Option to Disable Buscript
2021-02-24 14:12:35 +08:00
Ben Woo f4ce740c06 Merge pull request #2568 from Multiverse/fullname-face-direction
Add support for fullname face direction.
2021-02-24 14:09:56 +08:00
Kermina Awad 3ff8d34053 add config option to disable buscript 2021-02-23 14:38:54 -05:00
benwoo1110 f362f09380 Add support for fullname face direction.
So we can do `w:world:north` on top of the current ``w:world:n`.
2021-02-21 17:19:18 +08:00
benwoo1110 62b789dff5 Add support to find players based on name, UUID or selectors. 2021-02-21 16:47:13 +08:00
benwoo1110 84a9db597a Add respawn anchor support. 2021-02-19 00:57:19 +08:00
nicegamer7 89fd700e32 Merge pull request #2489 from benwoo1110/world-UID
Adds world UID and generator details to /mvinfo command
2021-01-17 12:36:27 -05:00
benwoo1110 9741b1794c Update readme with more project details 2020-12-31 00:42:22 +08:00
Ben Woo 001a6000f8 Merge pull request #2515 from Multiverse/update_bstats
Update bStats Metrics Class
2020-12-20 12:10:52 +08:00
Kermina Awad bf61069fed update bStats Metrics class 2020-12-19 22:17:04 -05:00
Ben Woo d93def8b5b Merge pull request #2503 from Multiverse/getplayerexact
Use getPlayerExact in favour of getPlayer.
2020-12-14 10:28:58 +08:00
nicegamer7 540394e266 Merge pull request #2505 from benwoo1110/logging
Update to all use static logging.
2020-12-12 09:58:19 -05:00
benwoo1110 425b1c80cc Update to all use static logging. 2020-12-12 10:49:49 +08:00
Kermina Awad 47ae6f5378 use getPlayerExact instead of getPlayer 2020-12-11 12:48:19 -05:00
benwoo1110 48601e4215 Fix cannot remove block currency with mvm set command.
Setting currency to 0 is now considered as no currency value.
2020-11-27 21:14:27 +08:00
Alexander Krantz ed80083fe8 Fix null location when teleporting to own playerbed destination. (#2487)
* Fix teleporting to a the calling player's bed

* Change name to my-bed to prevent collisions with player names

* Re-add old player bed for backwards compatibility

* Remove second bed destination name

* Give constant more sensible name
2020-11-27 12:58:11 +08:00
Ben Woo d041e0a8d1 Merge pull request #2490 from benwoo1110/fix-tags
Update issue template with new tags.
2020-11-25 11:44:16 +08:00
benwoo1110 de85be5832 Update issue template with new tags. 2020-11-25 11:41:57 +08:00
Ben Woo 81d59d8bf5 Update issue template to use paste.gg (#2450)
* Update issue template to use paste.gg

* Update to show paste.gg as link
2020-10-27 11:56:18 -04:00
benwoo1110 5d3d732c25 Fix issue where special chars cause PatternSyntaxException
Escape regex special chars for help command
2020-10-09 12:19:32 +08:00
Jeremy Wood 0c2d2f4e0a One more test for the webhook... 2020-10-08 02:38:34 -04:00
Jeremy Wood 3d9108fb48 Minor change to test webhooks on new base branch. 2020-10-08 02:35:30 -04:00
Jeremy Wood 25c616bc32 Bumped version to 4.2.3-SNAPSHOT for continued development. 2020-10-08 02:21:13 -04:00
Jeremy Wood 148187025a Release version 4.2.2. 2020-10-08 00:38:58 -04:00
Jeremy Wood 115b0dc078 Dump full version output in multifile pastes. 2020-10-07 23:52:43 -04:00
Jeremy Wood 78bf6ba3bf Merge pull request #2442 from Multiverse/version_command_typo
Correct a Typo in VersionCommand
2020-10-07 23:33:13 -04:00
Kermina Awad e31c391af4 correct a typo in VersionCommand 2020-10-07 23:15:21 -04:00
Jeremy Wood 6ed4be9a64 Move back to '\n' line separators in version command. 2020-10-07 23:12:50 -04:00
Jeremy Wood d626e7e4b1 Merge pull request #2429 from benwoo1110/green-warning
More noticable warning for deprecated event
2020-10-07 22:41:54 -04:00
Jeremy Wood e7dd4fee51 Merge pull request #2430 from benwoo1110/clone-cleanup
Remove uneeded variables from clone method
2020-10-07 22:41:01 -04:00
Ben Woo 146075de69 Loads unloaded world before deleting (#2431)
* Loads unload world before deleting

Fixes issue where unloaded worlds can't be deleted.

* Missing commit line smh
2020-10-07 22:38:45 -04:00
Jeremy Wood 9fce6c54f6 Merge pull request #2435 from Multiverse/webpaste
Fix Double Prefix when Logging Version Info
2020-10-07 22:37:22 -04:00
Ben Woo f189eb3b7e Fix issue template label (#2437)
* Fix issue template label

* Remove "type: " from label
2020-10-07 22:32:32 -04:00
benwoo1110 ed77cacb1a Adds generator detail to /mvinfo command 2020-10-07 21:00:40 +08:00
Kermina Awad 2d4fe301cf fix double prefix when logging version info 2020-10-06 16:26:20 -04:00
Jeremy Wood e5fe1fe565 Bump version to 4.2.2-SNAPSHOT for continued development. 2020-10-06 15:46:37 -04:00
Jeremy Wood 83010f1a28 Release version 4.2.1. 2020-10-06 15:08:13 -04:00
Jeremy Wood 864e50e38c Add TestingMode util. 2020-10-06 15:07:56 -04:00
Jeremy Wood 0a99258f3e Bump version to 4.2.1-SNAPSHOT for continued development. 2020-10-06 15:01:42 -04:00
benwoo1110 cfae997de4 Adds world UID to /mvinfo command 2020-10-07 00:39:08 +08:00
benwoo1110 b345baf20e Remove uneeded variables from clone method 2020-10-06 21:12:18 +08:00
benwoo1110 d532052c7b More noticable warning for deprecated event
Add green color to the warning
2020-10-06 20:47:41 +08:00
Jeremy Wood 1c02fb4387 Release version 4.2.0. 2020-10-06 01:45:11 -04:00
Jeremy Wood 2a99649e1e Merge pull request #2426 from Multiverse/webpaste
Make it Easier to Upload Files with the Version Event
2020-10-06 01:24:33 -04:00
Kermina Awad 994bf922af make it easier to upload files with the version event 2020-10-06 00:47:33 -04:00
Ben Wooandwben1110 36094e2bea Disallow world names with spaces (#2393)
* Disallowed world names with spaces

* Fixed wildcard imports

* Use Pattern regex check for worldname validation

Co-authored-by: wben1110 (desktop) <unconfigured@null.spigotmc.org>
2020-10-05 23:58:18 -04:00
Jeremy Wood 6243b41956 Merge pull request #2421 from benwoo1110/issue-tag
Added auto label and config.yml to issue template
2020-10-05 21:02:06 -04:00
benwoo1110 32170cc089 Added auto label and config.yml to issue template 2020-10-05 16:39:16 +08:00
Jeremy Wood c1a3d48944 Merge pull request #2420 from benwoo1110/plugin.yml-update
Updated plugin.yml commands and some missing alias
2020-10-05 01:34:31 -04:00
nicegamer7 75855826e7 Cleanup webpaste code (#2411) 2020-10-05 01:25:15 -04:00
Jeremy Wood d35363b10c Merge pull request #2103 from blubberdiblub/make-saved-anchors-locale-insensitive
Ensure anchors are saved in a machine-readable way
2020-10-05 00:36:19 -04:00
Jeremy Wood ad1b733498 Merge pull request #2379 from rti/master
load cloned world with doLoad() instead of addWorld() (fixes #2378)
2020-10-05 00:29:25 -04:00
benwoo1110 9159dfbb7d Updated plugin.yml commands and some missing alias 2020-10-05 00:28:48 +08:00
Robert Timm b8acd339b3 load cloned world with doLoad() instead of addWorld() (fixes #2378) 2020-10-02 10:01:54 +02:00
nicegamer7 51e035eb3e Update GameMode command and increase Java support. (#2279)
* update gamerule command

* fix NPE in gamerules command and remove deprecated method

* catch buscript initialization errors

* update gamerule command to be more descriptive

* undo GameruleCommand style changes

* update legacy version reporting to include all config options

* use LF line ending for files being pasted to the web

* avoid duplicate code
2020-09-22 15:02:03 -04:00
Jeremy Wood 2fd8e3edc3 Merge pull request #2406 from Jadiction/patch-1
A, not an :P
2020-09-15 15:06:16 -04:00
Jad faf20ee36e A, not an :P 2020-09-10 18:09:58 -05:00
benwoo1110andwben1110 e1494808f3 Fixed inability to clone due to unable to copy session.lock (#2392)
* Added ability to exclude files when copying folders

* Remove wildcard imports

* Added unit testing for ignoring files as well

Co-authored-by: wben1110 (desktop) <unconfigured@null.spigotmc.org>
2020-08-27 08:47:57 -04:00
benwoo1110 05cf052204 Add GitHub issue templates (#2385)
* Added issue templates

* Fixed a typo

* Added more details to template

Added dev build link

Need to enter `/server` output

Declaration that issue is reproducible with only mv plugins

* Added capitalization to issue title
2020-08-26 13:34:37 -04:00
Jeremy Wood 242f05fc77 Merge pull request #2288 from Multiverse/webpaste
Rework Webpaste Package
2020-07-28 20:50:08 -04:00
Jeremy Wood dd29fcc1dd Merge pull request #2315 from Multiverse/another_metric_fix
Don't Report Generator Settings
2020-07-28 20:41:07 -04:00
Kermina Awad d5013546d1 don't report generator settings 2020-06-29 11:40:01 -04:00
Kermina Awad 058c0837f0 bring multi-file pastes to parity with single file pastes 2020-06-14 16:04:58 -04:00
Kermina Awad e01c646562 add paste.gg paste service 2020-06-14 16:04:17 -04:00
Jeremy Wood 3afca50930 Merge pull request #2289 from Multiverse/ammed_bstats
Correct Metric Reports
2020-06-13 18:52:43 -04:00
Kermina Awad 94ca18e95c correct some metrics 2020-06-13 14:20:36 -04:00
Kermina Awad 707eae92a8 improve javadocs, also, no need to make implementations public 2020-06-13 10:36:30 -04:00
Kermina Awad b4a4519876 no need for protected access modifier 2020-06-13 10:36:25 -04:00
Kermina Awad 4f41b7aa6e rework webpaste package 2020-06-13 10:36:21 -04:00
Kermina Awad b9267a3dfc update version command description 2020-06-13 10:36:16 -04:00
Kermina Awad a53c4214f0 add extra space for readability 2020-06-13 10:36:08 -04:00
Kermina Awad 343695e23e add notice as to why pasting to GitHub is disabled 2020-06-13 10:36:04 -04:00
Kermina Awad e17e9c8ce9 rename GithubPasteService as GitHubPasteService 2020-06-13 10:36:00 -04:00
Kermina Awad 676c3a2e3d make pasting more system agnostic 2020-06-13 10:35:58 -04:00
Kermina Awad e821611744 fix pasting to hastebin 2020-06-13 10:35:55 -04:00
Kermina Awad d69c492577 cleanup GitHub and Pastebin paste services 2020-06-13 10:35:53 -04:00
Kermina Awad eb91eefc80 fix BitlyURLShortener 2020-06-13 10:35:49 -04:00
Kermina Awad f570c81366 update version command 2020-06-13 10:35:47 -04:00
Jeremy Wood b3f23278b1 Yay for tests that use method names in strings. -.- 2020-06-13 02:01:41 -04:00
Jeremy Wood 3fa2bfa7cf Merge pull request #2280 from Multiverse/bstats
Fixes #2252, implements #1918.
2020-06-13 01:20:29 -04:00
Jeremy Wood 582d6bef1a Readd world count metric as multiline chart (for future use). 2020-06-13 01:17:00 -04:00
Jeremy Wood 04c65cc59e Cleanup new metrics implementation. (#2286)
* Refactor metrics initialization into its own class.

* Simplify the creation of metrics.

* Clean up new metrics.

* Refactor out duplicate metrics code.
2020-06-13 00:51:18 -04:00
Kermina Awad 268c4982c3 update metric implementations 2020-06-12 23:50:17 -04:00
Kermina Awad 8983a0c024 add vault as softdepend 2020-06-07 19:31:51 -04:00
Kermina Awad 1cbe901e4d lead dev should be the first author listed 2020-06-06 13:38:03 -04:00
Kermina Awad 4894abd1f1 switch to bStats 2020-06-06 13:36:53 -04:00
nicegamer7 1fac13247f Fix Travis Builds for Pull Requests (#2208)
* fix travis

* I don't think we need this

* we don't use circleci anymore
2020-05-06 13:07:48 -04:00
Jeremy Wood 59cfacf007 Merge pull request #2227 from A248/patch-1
Fix NPE for invalid world argument in gamerule cmd
2020-05-05 21:19:42 -04:00
Jeremy Wood 5f916fbf27 Merge pull request #2242 from wellnesscookie/master
Fixes alias not clearing after cloning the world
2020-05-05 21:14:12 -04:00
wellnesscookie c70e254dbf Fixes alias not clearing after cloning the world
This will rather set an alias to an empty string which will automatically be resulted in alias being as same as the name of the cloned world.
Previously, it was not working as intended and kept the alias of the oldWorld.
2020-04-30 20:43:11 +02:00
A248 9d42a05759 Fix NPE for invalid world argument in gamerule cmd
Stumbled upon an NPE when using /mv gamerule. I realised it was because I had specified a nonexistent world. This will fix it.
2020-04-16 18:31:23 -04:00
Jonathan Leitschuh 59b6522d59 Use HTTPS instead of HTTP to resolve dependencies
This fixes a security vulnerability in this project where the `pom.xml`
files were configuring Maven to resolve dependencies over HTTP instead of
HTTPS.

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
2020-02-11 09:04:52 -05:00
Niels Boehm 46f8453b5b Ensure archors are saved in a machine-readable way
`locationToString()` is primarily used by the AnchorManager to persist
anchors to disk (the other use is for logging).

In a locale that uses periods as decimal separator, this works fine and
the anchors can be loaded when the server restarts.

However, in a locale that doesn't use periods (but commas, for instance)
this produces an `anchors.yml` that cannot be parsed when loaded.

Tying the string formatting in `locationToString()` to an English locale
makes it behave as expected, regardless of the external locale setting.
2019-09-23 14:54:35 +02:00
Jeremy Wood b4b0940918 Added additional configuration option to disable the donation messages. 2019-08-26 13:47:54 -04:00
Jeremy Wood 22ad7214b0 Made the donation messages at startup hidden with silent start. 2019-08-26 13:47:26 -04:00
Jeremy Wood 1ba693ffd5 Bumped version to 4.1.1-SNAPSHOT for continued development. 2019-08-23 15:38:51 -04:00
Jeremy Wood 6ee0d8a05e Release version 4.1.0. 2019-08-23 15:28:06 -04:00
Jeremy Wood d3ff2922fd World cloning should work once again! Resolves #1978. 2019-08-23 15:27:45 -04:00
Jeremy Wood 5e2824abeb Prevent importing worlds without .dat file. Fixes #1917. 2019-08-15 21:15:45 -04:00
Jeremy Wood 926e23bf19 Removed super dated toString in plugin main class. 2019-08-02 21:49:11 -04:00
Jeremy Wood 841598232c Added --include-plugin-list to mv version command. 2019-07-31 00:25:34 -04:00
Jeremy Wood 540b6abcab Now using CommandHandler 11! 2019-07-30 23:48:32 -04:00
Jeremy Wood 38d5917915 Added debug mode change event. 2019-07-30 23:03:51 -04:00
Jeremy Wood da6bd20b42 Bumped version to 4.1.0-SNAPSHOT for incoming features. 2019-07-30 22:10:48 -04:00
Jeremy Wood 8859fa78fd Bumped core protocol to 24. 2019-07-30 22:09:14 -04:00
Jeremy Wood 4de6b9ce47 Bumped version to 4.0.2-SNAPSHOT for continued development. 2019-07-30 21:50:37 -04:00
Jeremy Wood f595f4cdb9 Release version 4.0.1. 2019-07-23 21:47:40 -04:00
Jeremy Wood 1581e1e009 Make TravelAgent warning message a debug message. 2019-07-23 21:47:13 -04:00
Jeremy Wood 7cb9bd4bc2 Added message acknowledging deprecated event. 2019-07-23 21:46:23 -04:00
Jeremy Wood 32e72bb355 Bump version to 4.0.1 for continued development. 2019-06-25 13:34:08 -04:00
Jeremy Wood 950402a144 Release version 4.0.0. 2019-06-25 13:33:20 -04:00
Jeremy Wood f598551d9c Merge pull request #2019 from Brokkonaut/master
Phantoms are monsters
2019-06-16 23:57:30 -04:00
Brokkonaut c3f08318d4 Phantoms are monsters 2019-06-17 05:48:02 +02:00
Jeremy Wood f0343b08b5 Merge pull request #2001 from Brokkonaut/fix-javadocs-setcurrency
Fix javadocs: setCurrency(Material) instead of setCurrency(int)
2019-06-04 12:04:14 -04:00
Jeremy Wood 20a1fcb9f5 Bump protocol version to 23. 2019-06-04 10:08:35 -04:00
Jeremy Wood 253ede1c9a Wrap the travel agent in an adapter. 2019-06-04 10:08:11 -04:00
Jeremy Wood d4454703e4 Bumped version to 4.0.0-SNAPSHOT for 1.14 updates. 2019-06-04 09:15:34 -04:00
Jeremy Wood 9737b62813 Bump version to 3.0.0 for release. 2019-06-04 09:11:01 -04:00
Brokkonaut 06bd1a838f Fix javadocs: it is now setCurrency(Material) instead of setCurrency(int) 2019-05-21 19:15:14 +02:00
BaronyCraft 4343167240 allow coord arguments to setspawn command (#1975)
* allow coord arguments to setspawn command

* Implement PR changes as requested
2019-03-14 20:20:49 -04:00
Jeremy Wood 7762aca019 Removed commons-io as compile dependency to fix weird pom issues. 2019-02-02 00:53:51 -05:00
Jeremy Wood 6ebc1188e8 Removed unnecessary json dependency. 2019-01-31 22:09:09 -05:00
Jeremy Wood 8b358b0955 Don't send mvv url response to console twice when run from console. 2019-01-31 22:03:11 -05:00
Jeremy Wood b201b09719 Added a theoretically working Hastebin option for mvv output. 2019-01-31 22:02:13 -05:00
Jeremy Wood 4c9d108f08 Disabled github paste service. 2019-01-31 21:31:39 -05:00
Jeremy Wood 564a7d3684 Removed pastie paste service. 2019-01-31 21:26:12 -05:00
Jeremy Wood d832e9e6d9 Updated vault dependency to 1.7. 2019-01-31 21:21:50 -05:00
Jeremy Wood aa574b6236 Cleaned up the pom a bit and fixed some dependency shading issues. 2019-01-31 21:19:23 -05:00
Jeremy Wood d7894eb847 Fix another NPE in MaterialConverter. 2019-01-30 10:11:43 -05:00
Jeremy Wood 5e067fa72d Fixes NPE in MaterialConverter. 2019-01-30 08:53:40 -05:00
Jeremy Wood b1bf68a0ad Wtf... why was this still here. 2019-01-30 01:02:55 -05:00
Jeremy Wood 89a8f24b14 Welcome to fully semantic versioning with 3.0.0-SNAPSHOT. 2019-01-30 00:38:44 -05:00
Jeremy Wood 43ecdc913a Add null type annotations to MaterialConverter. 2019-01-30 00:19:26 -05:00
Jeremy Wood 0f14ee557d Make Bukkit dependency scope provided. 2019-01-30 00:14:16 -05:00
Jeremy Wood 9b88d1d491 Updated logging library to 1.1.1. 2019-01-29 23:54:58 -05:00
Jeremy Wood 606a3fa3ce Added MaterialConverter util class for type id conversions. 2019-01-29 23:46:40 -05:00
Jeremy Wood a7cace0fdc Fixed potential NPE. 2019-01-28 19:43:13 -05:00
Jeremy Wood ae314108a3 Removed deprecated MVConfigProperty and MVActiveConfigProperty. 2019-01-27 21:34:26 -05:00
Brokkonaut d0180f05d5 Option to disable the automatic purge of entities (#1933) 2019-01-25 13:16:29 -05:00
Jeremy Wood 07df8d0d09 Merge branch 'master' of github.com:Multiverse/Multiverse-Core 2019-01-24 21:23:24 -05:00
Jeremy Wood 4552f70f7e Shade in id converter. 2019-01-24 21:22:56 -05:00
Jeremy Wood a6912c3cb5 Added api-version: 1.13 to plugin.yml.
Should fix #1958
2019-01-24 09:28:03 -05:00
Jeremy Wood 4bdeacfd05 Updated testing dependencies and maven plugins. 2019-01-24 01:00:42 -05:00
Jeremy Wood 01f549f408 Updated Multiverse-Core for Bukkit 1.13.2. 2019-01-23 23:50:47 -05:00
Jeremy Wood f7bbb5029b Bumped protocol to 22. 2019-01-23 22:29:49 -05:00
Jeremy Wood 658b5219c3 Bumped version to 2.7.0-SNAPSHOT. 2019-01-23 22:29:12 -05:00
Jeremy Wood fb505ab161 Bumped version to 2.6.1-SNAPSHOT for continued development. 2018-07-23 14:16:29 -04:00
Jeremy Wood 284b3179ad Version 2.6.0 release. 2018-07-23 14:15:44 -04:00
Jeremy Wood 532ffacf5a Added relativity options to ExactDestination. Implements #1892. 2018-02-22 18:11:12 -05:00
Jeremy Wood 2b4d386eb2 Removed unnecessary for #1836. 2017-07-13 15:47:43 -04:00
Jeremy Wood bc20ecbe60 Hotfix for #1836. 2017-07-12 22:58:33 -04:00
Jeremy Wood 4878395460 Bumped protocol version to 21 for upcoming addition of Kotlin lib. 2017-07-09 18:54:49 -04:00
Jeremy Wood 467ec809b5 Bump version to 2.6.0-SNAPSHOT for significant incoming changes. 2017-07-09 18:53:50 -04:00
Jeremy Wood ceb6850670 Bump version to 2.5.1. 2017-07-09 11:36:23 -04:00
Jeremy Wood 63abf33414 Config travis and circle for Java 8. Resolves #1834 2017-07-09 11:30:45 -04:00
Jeremy Wood bcd7fcaee7 Build for Java 8. Might fix Travis and Circle... 2017-07-09 09:36:39 -04:00
Jeremy Wood d18581828d Exclude old Bukkit from SerializationConfig. 2017-07-09 09:36:02 -04:00
Jeremy Wood 54209e1535 Testing new webhook 2017-06-17 01:03:22 -04:00
Jeremy Wood 2ed59a866f Updated to Buscript 2.0.
This reduces the size of the plugin jar by over ONE MEGABYTE!!
2017-06-16 22:08:51 -04:00
Jeremy Wood 41b3096600 Now building against MC 1.12. 2017-06-16 21:55:09 -04:00
Jeremy Wood 42adfa8175 Bumped version to 2.5.1-SNAPSHOT for continued development. 2017-06-01 21:07:56 -04:00
Jeremy Wood 12bcf71028 Updated to 2.5.0 for release. 2017-06-01 20:25:04 -04:00
Jeremy Wood a826d0b2ff Build against spigot-api 1.11.2-R0.1-SNAPSHOT. 2017-06-01 20:20:10 -04:00
Jeremy Wood 59cab8a417 Remove relative paths from potentially imported worlds. 2017-04-05 16:07:31 -04:00
RezzedUp da6a62b984 Remove relative paths from potentially imported worlds.
Before, relative paths that left the server's root directory were
accepted. Now, the world name has all relative-path components trimmed
off.
2017-04-05 00:44:00 -05:00
Jeremy Wood 806c5909c4 Updated plugin.yml. Can't believe I haven't done this sooner. 2017-02-11 00:07:28 -05:00
Eric Stokes c00847f173 If we're gonna use TravisCI it should at least use JDK7 now. 2016-11-19 21:35:54 -07:00
Eric Stokes 626e5d3e4b Added the autogenerated dependency-reduced-pom.xml to the .gitignore 2016-11-19 18:43:49 -07:00
Eric Stokes f5e8a9c2e8 Fixed deprecated assertTrue call in TestInstanceCreator 2016-11-19 15:44:07 -07:00
Eric Stokes 3364709e53 Fixed deprecated use (since it's going away in 1.11)
* MultiverseCore constructor shouldn't be deprecated, it just needed a fix.
* Removed TestPluginLoader, it should have been mocked anyway.
* New constructor takes a JavaPluginLoader instad of a PluginLoader, so
  we'll have to mock.

You can't win, Java. If you make it `final`, I shall become more powerful
than you can possibly imagine.
2016-11-19 15:43:44 -07:00
Eric Stokes 67d172fd08 Removed redundantThrows checkstyle rule, it's gone in 6.2+
See: checkstyle/checkstyle#473
2016-11-19 14:30:04 -07:00
Eric Stokes f3a420d85c Added additional properties to the test checks for world properties 2016-11-19 14:18:12 -07:00
rlf aba1f05c5b Misc documentation fixes from @rlf 2016-11-19 14:17:26 -07:00
rlf 8fdc0ad3da Fixed failing tests (thanks @rlf)
* This is the test fixing portion of PR#1746
* This fixes using a HashMap and relying on the order of the values.
2016-11-19 13:51:11 -07:00
Eric Stokes 3db57ee1d9 Move to Java 7 (Maybe java 8 soon...)
* Also bump CH to v10, which uses Java 7
* Probably don't use this build, I have to test it first...
2016-11-19 13:02:19 -07:00
httpdop b3841adcc1 Update dependencies and versions 2016-11-06 11:14:10 +01:00
Liam 0b0b3c0088 Updated Vault repo
New vault repo is here: http://nexus.hc.to/content/repositories/pub_releases
2016-10-26 23:49:30 +01:00
Jeremy Wood a64a8d9605 Perhaps the id was important? 2016-05-03 10:58:30 -04:00
Jeremy Wood 0a0d3ba527 Added snapshot repo to distro management. 2016-05-03 10:48:06 -04:00
Jeremy Wood a351fbb345 Moving to new version numbers - 2.5.0-SNAPSHOT 2016-05-03 10:45:32 -04:00
Eric Stokes 46359cfbfe Fixes #1678 anchor list doesn't obey enforceaccess 2016-03-12 15:51:16 -07:00
Eric Stokes f52004cb76 Removed deprecated use of scheduleAsyncDelayedTask 2016-03-12 15:10:27 -07:00
Eric Stokes 0e3848874a Added support for version command to upload to gist.github.com 2016-03-12 15:10:07 -07:00
Eric Stokes 71ba31a0f4 Fixed spacing of spigotmc repo in POM 2016-03-12 13:00:29 -07:00
Eric Stokes 7b1e77340b Removed deprecated use of loadConfiguration
The new method properly uses the Reader class and resolves the reason
for deprecation, the lack of encoding support.
2016-03-12 13:00:05 -07:00
Eric Stokes bebd4742b9 Fixed shortened links pointing to wiki pages that didn't exist anymore 2016-03-06 21:01:44 -07:00
Eric Stokes b933027523 #1672 Fixed typo that made animal lists behave like monster lists 2016-03-06 21:01:16 -07:00
Eric Stokes bd1d852393 #1671 Fixed lists changing not forcing validation of the elements 2016-03-06 20:59:18 -07:00
Eric Stokes 648365f336 #1671 Fixed incorrect WorldPropertyValidator type 2016-03-06 20:56:04 -07:00
Jeremy Wood 12b6a69146 Use latest spigot-api. Also switched to compile scope... 2016-03-02 11:33:39 -05:00
Jeremy Wood cd312c3ab9 Updated used version of MC stats. 2016-02-29 20:04:26 -05:00
Jeremy Wood d2d243caec Deny import of "plugins" and "logs" folder as a world. Should fix #1655 2016-02-15 10:40:07 -05:00
Jeremy Wood 865434d1b1 Don't accept null worlds from the server. Addresses #1649. 2016-02-04 09:39:30 -05:00
Romarjosh Villamor 0858e324dd Added Spigot Dependency and repository 2016-01-30 04:01:53 -08:00
Jeremy Wood 618986e216 Parse difficulty safely. Fixes #1634. 2015-12-17 09:16:18 -05:00
Jeremy Wood cc3dfe9fd4 Bumped protocol version to 20. 2015-10-28 20:12:25 -04:00
Jeremy Wood 6ee8466ac0 Updated Vault dependency to VaultAPI 1.5.
May break backwards compatibility with old Vault (Probably pre 1.4)
2015-10-28 20:10:03 -04:00
Jeremy Wood 3b7dd21440 Added Economist methods to get and set balances. 2015-10-28 20:02:39 -04:00
JBYoshi 528dc25fcb Update cloneWorld().
- Make it actually work.
- Support for unloaded worlds - saves memory!
- The Thread code seems unnecessary since the main thread just waits for it to finish, so I'm removing it.
- Added cloneWorld(String, String).
- Deprecate the old cloneWorld() method.
Closes #1436
Closes #1491

Due to some limitations, I have to temporarily load the old world in
order to properly clone. However, **no chunks are loaded during this
process.**
2015-10-27 22:06:56 -04:00
Jeremy Wood 762d8e3ebb Added possible fix for dependency issues on build. 2015-10-23 12:36:54 -04:00
Simon Rigby ef251c256d Merge pull request #1618 from Multiverse/Fix-Travis-Codehaus
Fix Travis-CI failing for Codehaus Dependencies
2015-10-23 17:16:30 +01:00
Simon Rigby da3015c72c Fix Travis-CI failing for Codehaus Dependencies 2015-10-23 17:11:59 +01:00
Jeremy Wood 601f457e6f Removed mcstats.org repo since it appears to be offline. 2015-09-22 08:50:27 -04:00
Jeremy Wood ec805f38d7 Updated protocol version to 19. 2015-09-22 08:40:18 -04:00
Jeremy Wood 61710369f4 Minor tweaks to new economy system. 2015-07-14 15:47:20 -04:00
Liam 4824d53fab Merge pull request #1593 from TWSSYesterday/Update#1
Changing words
2015-07-14 20:26:57 +01:00
Liam 65cc817573 Changing words
mc-region-fixer instead of chunkster because it's the only one that works of the two.
2015-07-14 20:24:18 +01:00
Jeremy Wood 9bb7dd6e5d Removed AllPay dependency and implemented the new MVEconomist which is used to delegate all economy matters of importance to Multiverse. 2015-07-14 15:00:33 -04:00
Jeremy Wood fadb3280e3 Updated testing framework to work with bukkit changes. 2015-07-14 14:50:47 -04:00
Jeremy Wood b64dfa34af Updated Who command for bukkit changes. 2015-07-14 13:44:44 -04:00
Jeremy Wood 584a81fac6 Updated Bukkit dependency to 1.8.7-R0.1-SNAPSHOT. 2015-07-14 11:40:58 -04:00
Jeremy Wood 4233e4f8b4 Don't try to handle events for worlds we don't own in MVPortalListener. Fixes #1589. 2015-07-13 12:16:36 -04:00
Jeremy Wood 28da4aac2f Allows a valid location to be set. Fixes #1579.
Credit to tuskiomi for discovering this issue.
2015-06-10 13:46:38 -04:00
Jeremy Wood c37dd803c8 Fixed up commons-io dependencies. 2014-08-21 13:14:14 -04:00
TWSSYesterday 27abb55006 Fix
Fixed.
2014-06-17 12:19:39 +01:00
TWSSYesterday c607aa1c47 Colouring added as well as general grammar cleanup
Rephrased some messages, and added colour when there is no world folder found.
2014-06-17 12:12:52 +01:00
Jeremy Wood 79f8f6bd55 Merge pull request #1437 from jflory7/patch-1
Corrected command example to proper command
2014-05-20 15:34:08 -04:00
Justin F. 1446dd936a Corrected command example to proper command
Tiny usage error here – I noticed it on my server and figured I'd make a pull request for this minor error. :)
2014-05-16 23:17:33 -04:00
Jeremy Wood 8664f56eeb Now correctly handles portalForm for end and nether portals! Fixes #1394. 2014-03-18 12:41:15 -04:00
Jeremy Wood 1c2514d5db keepSpawnInMemory will use fallback value in more scenarios. Fixes #1392. 2014-03-18 10:07:24 -04:00
Jeremy Wood 34c8b7cf0b Possibly fixed the pvp/difficulty property issue! 2014-02-26 17:01:48 -05:00
Jeremy Wood 63af4370b5 Now using CommandHandler version 8. 2014-02-20 10:07:16 -05:00
Jeremy Wood 832e0f6497 Once again managing teleportation into MV worlds from non-MV worlds. Fixes #1385. 2014-02-19 16:58:48 -05:00
Jeremy Wood b198942742 Merge pull request #1384 from antiroot/patch-1
Added missing space in log output for Teleport command
2014-02-18 15:06:30 -05:00
antiroot b60250287e Update TeleportCommand.java
Missing spaces in log output for TeleportResult.FAIL_UNSAFE case
2014-02-18 10:41:48 -06:00
Jeremy Wood 86ba242f33 Added entryfee.amount alias and possibly corrected alias currency. Should fix #1201. 2014-02-08 13:29:19 -05:00
Jeremy Wood 0639d39d5a Now including the correct metrics package for shading. Fixes #1376. 2014-02-07 10:49:45 -05:00
Jeremy Wood ee745f8a55 Updated vault. 2014-02-06 22:22:18 -05:00
Jeremy Wood 243fc8bc20 Updated metrics. 2014-02-06 22:22:06 -05:00
Jeremy Wood 807730805c Updated bukkit version. 2014-02-06 22:20:13 -05:00
Jeremy Wood c8abdf00b5 Merge pull request #1021 from Multiverse/custom-teleporters
Custom teleporters.
2014-02-06 22:16:29 -05:00
Jeremy Wood 21aaf4a03e Non-default worlds will now no longer initially load their spawn chunks if keepSpawnInMemory is false. Fixes #1079 2014-02-06 13:12:14 -05:00
Jeremy Wood 8ea639eba8 Removed deprecated UpdateChecker. 2014-02-05 16:39:14 -05:00
Eric Stokes a7e6fd1412 Update Travis CI to use openjdk6 to build, since the Oracle one is gone. 2013-12-14 11:40:11 +04:30
Jeremy Wood 636b8289f6 Made creating amplified worlds a little more intuitive. 2013-12-10 15:14:36 -05:00
main() 79290eed0d Merge pull request #1230 from main--/ryantheleach-playerbeds
Closes #1070.
2013-06-15 03:25:16 -07:00
Jeremy Wood 9f927605da Now actually allows world names with periods. 2013-05-27 14:35:32 -04:00
Jeremy Wood e69b5a6b17 Merge pull request #1205 from bloodmc/master
Added World Load/Unload Event listeners to support Forge in MCPC.
2013-05-24 09:25:03 -07:00
bloodshot cbe6c2c901 Added World Load/Unload Event listeners to support Forge.
* Added extra check to WorldManager.doLoad to check parent folder when
loading worlds. This is required by Forge since the world container is not
MC root but the overworld root.
2013-05-24 11:47:02 -04:00
main() 875685b705 Merge pull request #1150 from DerFlash/prefixchat
added config option to change the format for prefixchat
2013-04-29 11:58:28 -07:00
Björn Teichmann ad6f0d1b62 added config option to change the format for prefixchat 2013-04-08 09:47:29 +02:00
main() 4a66a2f5bb If the debug level is >= 1: stacktrace 2013-03-18 18:02:55 +01:00
main() a8040abd52 "Not MV's fault"-Message for getChunkGenerator()
If a plugin, for whatever weird reason, gets loaded and enabled correctly,
but just getDefaultWorldGenerator() throws, people might think it's MV's
fault. Not anymore.
2013-03-18 17:27:03 +01:00
Jeremy Wood 72a14719ac Now using apache commons for file operations. Hopefully we will get more success with deleting and copying stuff. May fix Inventories test failures. 2013-03-11 15:35:05 -04:00
main() 2b827a1fae Style fixes. 2013-03-02 13:13:24 +01:00
main() e45520c43b Update checkstyle. 2013-03-02 13:13:09 +01:00
main() 0fb33d12d6 Now mocking plugin.getLogger() in the tests.
Fixes the test issues with AllPay.
2013-03-02 12:31:31 +01:00
main() ebe44ed99e Fixed the GenericBank imports 2013-03-02 12:24:05 +01:00
Jeremy Wood 23ba7fe73b Updated to AllPay 13. 2013-02-26 09:49:38 -05:00
Jeremy Wood 4efa97ee0e Removing deprecated getMVConfiguration() method because I suspect it could be related to some issues. 2013-02-20 13:56:24 -05:00
Ryan Leach ce80fc190d Inital extra bed commit with back-compatibility
Needs review and permissions advice before continuing.

line ending derp

---

Modified by @main--:
 * formatting fixed
 * removed changes to travis.yml and gitattributes
 * improved code style
2013-02-15 18:34:58 +01:00
Jeremy Wood 8bfe3a5473 Don't try to set search radius when portal travel agent is null. Fixes #1072. 2013-02-04 15:15:52 -05:00
Jeremy Wood 07a38e3e58 Should fix issue where gamemode/flight change on /reload of server due to permission issues. 2013-01-02 13:20:52 -05:00
Jeremy Wood 360c63fad9 Updated to AllPay 11 2013-01-02 11:44:38 -05:00
Jeremy Wood 2a5edc4f91 Added argument check to setBlockSafety. 2012-12-27 16:02:46 -05:00
main() dba21cadaf Custom teleporters. 2012-12-26 20:09:09 +01:00
main() fa9191dd8f The message now CLEARLY states that it's not Multiverse's fault. 2012-12-22 15:26:20 +01:00
main() 4043d5abcb Getting the generator is now wrapped in a try block.
The Bukkit API calls a plugin method. If that method throws exceptions, they fall through right into our face and then Bukkit blames us. Not good.
Thanks andrewkm for mentioning this.
2012-12-22 00:53:03 +01:00
Jeremy Wood eff56f74da Changed the default portal search radius back to match vanilla's 128 instead of 16. 2012-12-21 10:14:45 -05:00
Jeremy Wood d97a9bccde Now building against Vault 1.2.20 which is hosted on our own repo now. 2012-12-13 08:50:32 -05:00
Jeremy Wood 55741b524d Added bats to animals for the time being. Fixes #996 2012-12-10 23:27:55 -05:00
Jeremy Wood 186d3f15a4 Woo, Travis.ci! 2012-12-10 12:04:26 -08:00
Jeremy Wood 841f6f05df Added "/mv gamerule" and "/mv gamerules" for setting and listing game rules per world. Fixes #987. 2012-12-03 15:05:58 -05:00
Jeremy Wood ebc2a516bb Added world property 'allowFlight' to disable flying per world. Does not have an override permission yet. Adds #440. 2012-12-03 11:59:01 -05:00
Jeremy Wood 9e029ad6ae Maps can now be made for non default worlds! Fixes #972 2012-11-30 13:08:15 -05:00
main() b2135a8f42 Added world seed to the info command.
Fixes #627.
2012-11-28 14:39:07 +01:00
Jeremy Wood 8cbffd1cee Now building against Bukkit 1.4.5-R0.2 2012-11-27 15:59:24 -05:00
Jeremy Wood ff22077adf New worlds now use the correct scale. Fixes #979. 2012-11-27 14:09:33 -05:00
Jeremy Wood 60c0a1ab92 Fixed world spawns not keeping pitch + yaw. Fixes #976 2012-11-23 12:30:11 -05:00
Jeremy Wood 58eeecbcb8 Fixed issue where Multiverse always checks block safety to fix world spawns on startup/reload. 2012-11-23 11:49:14 -05:00
Jeremy Wood 876456b932 Fixed up some migration issues caused by WorldProperties refactor. Fixes #968. 2012-11-19 14:05:07 -05:00
Jeremy Wood 18db50ca56 MVWorld now throws IllegalStateException when it cannot obtain a world reference. This should help pinpoint the source of sometimes cryptic exceptions elsewhere. 2012-11-15 13:49:11 -05:00
Jeremy Wood cce1ccc967 Now caches the world properties before unloading the world in order to prevent NPE on unload then load. Really fixes #947. 2012-11-15 09:30:19 -05:00
Jeremy Wood e5537dd8f1 "mv regen" now respects world type! 2012-11-14 20:55:12 -05:00
Jeremy Wood 0c7ba2ae67 Fixed tests for entity purger changes. 2012-11-14 15:52:21 -05:00
Jeremy Wood bbfc672582 Improved world purger debug. 2012-11-14 15:19:09 -05:00
Jeremy Wood a65dc4966b Now removes projectiles shot by the entities removed by the purger. Should fix #958. 2012-11-14 15:11:55 -05:00
Jeremy Wood 4780f87278 Now uses world UUID to retrieve world reference. 2012-11-14 14:24:10 -05:00
Jeremy Wood b11d911e4a Newly created END worlds will now use a scale of 16. This will result in people ending up invariably closer to the end island when teleporting in while using MV-NetherPortals. 2012-11-14 13:58:08 -05:00
Jeremy Wood 155aad8bf2 Multiverse now uses it's own portal search radius by default (16 blocks instead of bukkit's 128). 2 new configuration options added to adjust this behaviour. 2012-11-14 13:52:37 -05:00
Jeremy Wood 6e1d4ef961 Block safety debugging moved to finest level. 2012-11-14 12:52:33 -05:00
Jeremy Wood cfa5a04e3a Fixes #960 2012-11-14 09:08:04 -05:00
Jeremy Wood 7d1c47c2fc Shifted world properties to its own class WorldProperties so we can now only initialize an MVWorld if there is a 'more solid' world reference. Let's hope this works! Should fix #947 2012-11-13 17:30:35 -05:00
Jeremy Wood 957c55955d Now using SerializationConfig 1.7 2012-11-13 13:39:22 -05:00
main() 0226ab9609 Style again. 2012-11-06 17:52:29 +01:00
Jeremy Wood b888561d98 Added package-private method for setting MVWorld plugin and name. Fixes #923. 2012-11-05 13:08:37 -05:00
Jeremy Wood f210851294 Changed how we deal with CB world reference. Partially fixes #923. 2012-11-05 13:02:03 -05:00
main() 73e394d5ec Style. 2012-11-05 16:40:06 +01:00
Jeremy Wood 63f8811b67 Fixed #942. 2012-11-05 09:05:11 -05:00
Jeremy Wood d01ce71343 Fixed #935. 2012-10-31 08:31:07 -04:00
Jeremy Wood fe00aae7e3 Fixes #934 - Vault dependency issue. 2012-10-30 08:45:05 -04:00
Jeremy Wood d4347d0cff Fixed incorrect log level. 2012-10-25 15:48:28 -03:00
Jeremy Wood b033d59b8a Optimized some log messages and change some Level.INFO messages to Level.CONFIG for the new silent start mode. Fixes #697. 2012-10-25 14:36:44 -04:00
Jeremy Wood aedbfd7bab Added command "mv silent [on|off]" for enabling silent startup mode. 2012-10-25 14:35:22 -04:00
Jeremy Wood b93822502e Reverted debug command. 2012-10-25 14:02:01 -04:00
Jeremy Wood f053f0546b Now using Logging 1.0.9! 2012-10-25 13:56:57 -04:00
Jeremy Wood af3b3d0fab Added ability to set debug level to -1 to disable common startup messages. 2012-10-25 10:43:57 -04:00
Jeremy Wood b1fa677330 Now using Logging 1.0.8 2012-10-25 10:35:27 -04:00
main() 9691a0f978 Merge pull request #931 from ammaraskar/limit
Add player limit per world. Closes #727.
2012-10-25 02:11:29 -07:00
Ammar Askar 0b1a387003 Add player limit per world. Addresses #727 2012-10-25 14:02:27 +05:00
Jeremy Wood 4ce503f55e Cow using EnumSet for maximum performance!!!! 2012-10-23 14:26:09 -04:00
main() 74947a7efd Fixed all other style warnings 2012-10-23 16:58:16 +02:00
main() 85cd71cb8a Fixed high priority style warnings 2012-10-23 16:49:08 +02:00
Jeremy Wood 3ad7d86f74 Deprecated DebugLog. 2012-10-22 17:40:39 -04:00
Jeremy Wood ac9194ec87 Now building with SerializationConfig 1.6c, finally fixes weird config exception messages. 2012-10-22 17:35:06 -04:00
main() 96e8208f3d Merge branch 'ammaraskar_folder' 2012-10-22 19:08:15 +02:00
Ammar Askar 895360ce8b Only delete world folder contents on mv regen, fixes #767 2012-10-22 19:06:19 +02:00
main() 59e34ef353 Merge pull request #925 from ammaraskar/entities
Add golems to animals fixes #891
2012-10-22 08:39:44 -07:00
Ammar Askar 11e556c099 Add golems to animals fixes #891 2012-10-22 20:34:01 +05:00
main() a9579a6594 Merge pull request #922 from ammaraskar/spawn
Added configurable animal and monster ticks per spawn setting. Fixes #519
2012-10-22 04:12:42 -07:00
Ammar Askar 5a1fe2a9e5 Added configurable animal and monster ticks per spawn setting. Fixes #519 2012-10-22 13:20:09 +05:00
Eric Stokes 1c5c792cf3 A broadcast is not needed if we're not doing anything 2012-10-21 18:57:54 -06:00
Eric Stokes dbe9494dbf Fixed Bed Spawns
This fixes #652 and fixes #916
This also fixes some other issues with NullPointerExceptions when trying to teleport to a bed if it was invalid.
2012-10-21 18:49:48 -06:00
Jeremy Wood b116effa2b Using HashSet instead of ArrayList for better contains() efficiency. 2012-10-21 17:55:41 -04:00
Jeremy Wood d361ceb45b Increased efficiency/safety of recent /mv who changes. 2012-10-21 17:49:51 -04:00
Eric Stokes 35709f5389 Tell user when creating a duplicate world
Fixes #921
2012-10-21 14:49:56 -06:00
Eric Stokes b45a4cf20a Fix NPCs Showing up in mv who
This fixes #501. FINALLY!

If anyone wants NPCs back, open a ticket, and I'll add a flag, but this is now the default behavior.
2012-10-21 14:22:12 -06:00
Eric Stokes 009ceeeede Fixed #918, Update to RB
Also added a test for #918, I probably need one more (to test that generators DO work) but I just tested that ingame this time.
2012-10-21 13:38:36 -06:00
Jeremy Wood 19fb9df5cf Added online player count / max players to /mv who header 2012-10-21 00:39:13 -04:00
Jeremy Wood 0829df01aa Readded the accidently removed shading of AllPay! 2012-10-20 20:55:56 -04:00
Jeremy Wood 78ac068a3f Fixed world's not charging correctly. Fixes #893. Fixes #777. Possibly fixes #723. That's a 3fer, good buddy. 2012-10-20 20:49:15 -04:00
Jeremy Wood 57da3df860 Added in Vault as the prefered method for checking economy stuff. Will defer to AllPay for item based world costs. 2012-10-20 20:43:58 -04:00
Jeremy Wood 74241e3d9c Updated protocol to 18 for Vault. 2012-10-20 20:12:42 -04:00
Jeremy Wood 6a4921d7d1 MVWorld.toString() now outputs JSON data. 2012-10-20 12:44:50 -04:00
Jeremy Wood 271e5f339e Version command now outputs world information instead of juts count. 2012-10-20 12:44:29 -04:00
Eric Stokes ec89db1bed Update MCSTATS to 1.2-SNAPSHOT
1.0-SNAPSHOT is gone from the repo :(
2012-10-19 23:35:48 -06:00
Jeremy Wood 7346cbe48c Actually enables debug logging when enabled via command. 2012-10-19 15:11:02 -04:00
Jeremy Wood ac3049f3ab Now properly enables debug logging on startup if debug logging should be enabled. 2012-10-19 15:10:36 -04:00
Jeremy Wood e82db95bbc Now using Logging 1.0.6! 2012-10-19 15:10:02 -04:00
Jeremy Wood 0d0f167396 Stopped trying to replace the old DebugLog. 2012-10-18 21:39:43 -04:00
Jeremy Wood b35a0325b8 Now using Logging 1.0.4 2012-10-18 21:19:33 -04:00
Jeremy Wood 3572d3fbe7 Now using Logging 1.0.3! 2012-10-18 15:17:52 -04:00
Jeremy Wood 7304269866 Upgraded to testificated Logging 1.0.2! 2012-10-18 14:46:25 -04:00
Jeremy Wood d7535b0551 replaced logging with com.dumptruckman.minecraft:Logging lib. 2012-10-17 14:23:00 -04:00
main() 0437a4bd92 Why is/was this "Multiverse-Adventure"... 2012-10-17 14:26:40 +02:00
main() d881908ecc Made entity listener use the world purger's logic
This should fix #872 and most other spawning issues.
2012-09-20 20:01:55 +02:00
Jeremy Wood 3715bc8bc5 Should now detect Async chat availability for even better backwards compatibility. 2012-09-05 20:53:59 -04:00
main() a9f00a46f5 Fixed #859
The WhoCommand was handling invisible players incorrectly
2012-08-26 14:47:01 +02:00
Jeremy Wood d9a7275682 Stop checking for null worlds. 2012-08-21 15:06:55 -04:00
Jeremy Wood 80f6a0159c Now using ConcurrentHashMap instead of ReentrantLock for caching player world. 2012-08-21 15:06:33 -04:00
Jeremy Wood f2e1053b88 Now using ConcurrentHashMap instead of locks for worlds Map. 2012-08-21 14:54:49 -04:00
Jeremy Wood e975968637 MVWorld properties now volatile instead of using thread lock. 2012-08-21 14:25:11 -04:00
Jeremy Wood a778d353c4 Config now volatile instead of using thread lock. 2012-08-21 14:19:05 -04:00
Jeremy Wood d40e67b47d Config properties now volatile instead of using thread lock. 2012-08-21 14:17:24 -04:00
Jeremy Wood 9196973d1c Fixed NPE in world loading.. Thanks Grimlock257 for spotting this. 2012-08-21 13:20:13 -04:00
Jeremy Wood 242d20884c Now building against Bukkit 1.3.1-R2.1-SNAPSHOT 2012-08-21 09:16:28 -04:00
main() b909af873d Should fix #847
(NPE in the GeneratorPlotter for worlds with a null generator)
2012-08-20 10:22:39 +02:00
main() e6f7ba5ac9 Fixed the tests 2012-08-18 15:17:17 +02:00
main() 4ecb28b3bb Less duplicate code ... I think. 2012-08-18 15:13:09 +02:00
main() d0ea4168bc Style! 2012-08-18 14:54:18 +02:00
main() fd9464ced1 More anchor permissions (as suggested in #831) 2012-08-18 14:45:15 +02:00
Jeremy Wood 49eb93af2e Once again prints debug mode output to the console 2012-08-15 11:33:16 -04:00
Jeremy Wood 9274570fa4 Added config option for setting whether or not to use async chat. (Default true (uses async)) 2012-08-15 09:27:52 -04:00
Jeremy Wood 319a701a16 Modifying world values now persists again! (When the hell did this break???) 2012-08-14 15:00:08 -04:00
Jeremy Wood 807c8d0f2c Debug setting saves to config now. 2012-08-13 13:52:25 -04:00
Jeremy Wood 29d97274fe Stopped being dumb and denying bukkit of it's precious invisible constraints for ConfigurationSerializable. Fixes #827. 2012-08-13 13:51:42 -04:00
Jeremy Wood eb1dc502cd Now using ReentrantLock instead of synchronized blocks. Should help debug lag issue. 2012-08-11 23:21:58 -04:00
Jeremy Wood 622fb19c4a Using logging instead of System.out... 2012-08-09 09:18:06 -04:00
Jeremy Wood 5705b5b6a0 Added missing import... 2012-08-09 09:15:07 -04:00
main() 1d1a2213c1 Merge branch 'metrics' 2012-08-09 13:43:07 +02:00
Jeremy Wood 4dd3df26a5 Now building against Bukkit-1.3.1-R1.0 2012-08-08 10:56:22 -04:00
main() 39293482d2 Removed duplicate maven source plugin 2012-08-06 18:44:42 +02:00
main() 9813e5f531 MBot's ?internalerror is useful but this is better 2012-08-06 18:41:02 +02:00
main() 48adbec011 dat style
CheckStyle is merciless!
2012-08-06 15:34:01 +02:00
main() a9a5d7467a Fixed world regeneration 2012-08-06 15:17:14 +02:00
main() b8a0891c4c Fixed again... 2012-08-06 12:06:50 +02:00
main() 53567d4646 Hopefully fixed the tests 2012-08-06 11:54:54 +02:00
main() 3395f3d7c7 We shouldn't try to load deleted worlds 2012-08-06 11:29:54 +02:00
Jeremy Wood e197091bb2 Added better support for large biomes. 2012-08-05 15:40:58 -04:00
Jeremy Wood ede0395d39 Mapping the known world of players for Async chat event. 2012-08-05 14:58:24 -04:00
Jeremy Wood 17963964c7 Minor test update. 2012-08-05 14:53:41 -04:00
Jeremy Wood bb0e2e4a2d Tests now using AsyncPlayerChatEvent. 2012-08-05 00:28:00 -04:00
Jeremy Wood ce4e608cf4 MultiverseCoreConfiguration.setDefaults() now protected as it should be. 2012-08-05 00:27:33 -04:00
Jeremy Wood 944f961ee5 Removed synchronization from setDefaults() due to how SerializationConfig operates. 2012-08-05 00:26:55 -04:00
Jeremy Wood 5335e73707 Now using AsyncPlayerChatEvent... let's hope for the best! 2012-08-05 00:11:39 -04:00
Jeremy Wood d05e2b500f Synchronized world properties required by Async chat event. 2012-08-05 00:11:13 -04:00
Jeremy Wood b2f3b74062 Synchronized all access to worlds map in WorldManager. 2012-08-05 00:00:46 -04:00
Jeremy Wood 16e42f6469 Finalized some object in MultiverseCore to help with thread-safe migration. 2012-08-04 23:51:43 -04:00
Jeremy Wood a31dc83635 Synchronized getting/setting of mv config object. 2012-08-04 23:50:01 -04:00
Jeremy Wood 7b99130bfa Synchronized config values to be used in new Async chat event. 2012-08-04 23:43:09 -04:00
Matt H f57468126a Added '/mv clone' command to clone a world. 2012-08-04 14:29:13 -06:00
Jeremy Wood d17fee6b7c Now building against Bukkit 1.3.1-R0.1-SNAPSHOT. 2012-08-03 13:29:55 -04:00
Jeremy Wood 1a943e42a9 Added maven source and javadoc plugins. 2012-08-03 13:28:32 -04:00
Jeremy Wood 2b80ca80ae Bumped protocol from 16 to 17. 2012-07-25 22:10:06 -04:00
Jeremy Wood 24e26bb7d7 Added buscript Javascript library. 2012-07-25 22:09:28 -04:00
Jeremy Wood 6133cf6bdf Bumped protocol from 15 to 16 2012-07-19 21:10:51 -04:00
Jeremy Wood 085c7a1ccc Migrated Multiverse-Adventure's copyFolder() into core. 2012-07-19 21:08:39 -04:00
main() dd0b2137d6 Changes... 2012-07-12 17:34:25 +02:00
main() 8a4ba2a66c Metrics! 2012-07-12 17:24:23 +02:00
Jeremy Wood 3e7841afc9 Don't bother checking economy stuff if it doesn't even cost to enter. 2012-07-03 16:25:56 -04:00
Jeremy Wood 1427671a8c Bumped version to 2.5... this should have been done a while ago. 2012-07-03 15:49:38 -04:00
Jeremy Wood a15317e21d Removed many instances of String.format in favor of higher performance inline concatenation. We should prune many more of these as well. 2012-07-03 15:48:57 -04:00
main() b10a37f232 Added compatibility check to MultiversePlugin 2012-06-26 20:11:24 +02:00
main() 144de09423 Added the abstract class MultiversePlugin. 2012-06-26 17:29:34 +02:00
main() a60e4e06e1 DebugLog: No more duplicates and you can now modify the log-tag. 2012-06-26 17:26:10 +02:00
Jeremy Wood 9eccf93b66 Probably fixes #707. 2012-06-20 10:18:52 -03:00
main() 220f6a31de Should fix #738. 2012-06-16 10:27:27 +02:00
main() 8cb4f22467 Improved EnglishChatColor and added the "style" world-property.
Closes #732.
2012-06-13 15:58:17 +02:00
Jeremy Wood a2a2594f5a Properly closed debug.log for unit tests by calling onDisable(). 2012-06-12 12:51:36 -04:00
Jeremy Wood 87df407743 You can once again set animals/monsters via /mvm set. 2012-06-07 17:08:47 -04:00
Jeremy Wood cf007f091a Stop creating a new map every time we want property aliases. 2012-06-07 15:44:32 -04:00
Jeremy Wood 680c35e0dc Moved migration debug message to correct location. 2012-06-07 14:52:28 -04:00
Jeremy Wood 1a385c21d7 Removed leftover debug message. 2012-06-07 14:51:43 -04:00
Jeremy Wood cced74d4b0 Suppress stacktraces thrown when migrating worlds.yml. Fixes #700. 2012-06-07 14:50:37 -04:00
Jeremy Wood 1db555581b DebugLog now extends Logger. 2012-06-07 13:26:22 -04:00
Jeremy Wood 63e0c028d9 Slightly improved debugging for worlds migration. 2012-06-07 12:55:32 -04:00
main() ee82dc213f Merge pull request #691 from heisan213/patch-1
Prevent NPE when teleporting to a world not made by MV.
2012-05-22 11:14:30 -07:00
heisan213 d2c09b9d33 Prevent NPE when teleporting to a world not made by MV. 2012-05-22 19:25:32 +03:00
main() 21a3eeacc8 That's the way it should be. 2012-05-03 16:20:59 +02:00
main() 48768b5d6c Now all properties are settable ingame. (bugfix) 2012-05-02 16:25:40 +02:00
main() 96294c092c Wrong default value... 2012-05-01 19:10:51 +02:00
main() 9a3fde2f13 Saving keepSpawnInMemory to config file 2012-05-01 19:08:07 +02:00
main() 6520a31938 Fixed spawnlocation migration 2012-05-01 18:52:05 +02:00
main() f1779c9e68 Shame on me. -.- 2012-05-01 18:46:47 +02:00
main() 9cc35d7b12 public 2012-05-01 18:08:51 +02:00
main() 02347e05d8 Fixed UOE when temporarily saving the NullLocation to the config 2012-05-01 17:43:05 +02:00
main() a4196a901a Fixed spawn location loading 2012-05-01 17:00:05 +02:00
main() 9b2dd0d6c9 Forgot some values, fixed allowweather migration 2012-05-01 16:49:40 +02:00
Jeremy Wood 0efb28be19 Properly close all input/output streams! 2012-05-01 10:47:20 -04:00
main() 5d9941d073 Why is 'null' deserialized to "null" instead of null!? 2012-05-01 15:31:10 +02:00
main() 82cfbaba4e Fixed NPE in migrateWorldConfigs() 2012-05-01 12:48:45 +02:00
main() 9868c66cdb Added migrators. Needs testing. 2012-05-01 12:42:48 +02:00
main() 3a32857683 MethodLength deserves only a warning and why should we count empty lines!? 2012-05-01 12:42:01 +02:00
main() d7a3e1839e Should fix environment, seed and generator-issues. 2012-05-01 12:23:04 +02:00
main() 1496d940bf Merge pull request #547 from Multiverse/mvworld-plus-serializationconfig-equals-awesome
MVWorld + SerializationConfig = Awesome
2012-04-30 13:54:37 -07:00
Jeremy Wood bd57ec19d2 Now building against Bukkit 1.2.5-R1.0 2012-04-18 14:58:05 -03:00
Jeremy Wood da54f9769b Stop giving up immediately on the first failed file deletion and continue deleting files recursively. 2012-04-06 14:54:48 -04:00
Jeremy Wood 2e4b814d6d Added one extra tidbit of logging for GameMode enforcement. 2012-04-03 12:00:02 -04:00
Eric Stokes 3f93fb3648 Add new param to the PTPE, Don't die if we don't find or can't access bukkit.yml 2012-03-18 17:26:24 -06:00
main() 176e729a87 Ignoring TestWorldCreation.
TestInstanceCreator.tearDown() doesn't remove 'fish.world' correctly from the worlds.yml (fixed in mvworld-plus-serializationconfig-equals-awesome)
*cough* @FernFerret *cough*
2012-03-17 12:32:55 +01:00
main() 62f79e7592 Disabled Spout support because we aren't using it 2012-03-17 12:27:50 +01:00
main() f60f770b98 Fixed #578
Another iPhone-commit...
2012-03-16 07:33:35 +01:00
Eric Stokes 3c434d18e3 Bump AllPay Version 2012-03-13 22:24:49 -06:00
Eric Stokes c9b52c81a6 Add some neat debug to Permissions 2012-03-12 20:58:58 -06:00
Eric Stokes 5be6ea2766 Use the fromstring in entity type 2012-03-10 10:29:44 -07:00
main() 98f5e1e4ee This IS fixed! 2012-03-10 17:41:53 +01:00
main() de6fc6481e Merge branch 'master' into mvworld-plus-serializationconfig-equals-awesome
Conflicts:
	src/main/java/com/onarandombox/MultiverseCore/api/MultiverseWorld.java
2012-03-10 14:03:04 +01:00
main() dcc6b828a8 Unused imports. 2012-03-10 13:59:04 +01:00
Eric Stokes 7da91f7875 Fix NPE with players and purging, Update AP and CH 2012-03-10 00:32:26 -07:00
Eric Stokes d84f930a54 Fix purging removing the player entity
...and lots of other bad stuff...
2012-03-09 23:45:10 -07:00
main() bdd5e8bd91 Now shortening the URL in /mvv using bit.ly! 2012-03-08 17:59:25 +01:00
main() d1280a9031 Some fixes + added tests. 2012-03-07 19:59:20 +01:00
main() 08b8f01c44 Bugfix: We shouldn't check access-perms if enforceaccess is off! 2012-03-04 20:38:26 +01:00
main() fd227960b9 Now correctly saving worlds 2012-03-04 20:21:42 +01:00
main() 0efc0b965b Fixed removeWorldFromConfig(String). 2012-03-04 19:53:40 +01:00
main() bbe134bd1a Dots in world-names are now possible! :D 2012-03-04 19:36:14 +01:00
main() 91f7debb08 MVWorld + SerializationConfig = Awesome
Yes, I did it.
2012-03-04 16:08:09 +01:00
main() 871a601e37 General cleanup. 2012-03-03 17:07:07 +01:00
main() bd7ad20b7b Fixed the tests.
Why is this option even on by default...
2012-03-02 21:22:12 +01:00
main() 873d878252 Build fixed. Bukkit, I hate breaking changes!
However, this is not tested *at all*. Try it if you're brave enough ^^
2012-03-01 16:55:37 +01:00
main() 8c63cac4c5 I'm walking...
(Yes, I'm doing this on my iPhone)
Should fix #530.
2012-03-01 13:12:09 +01:00
main() 283913010f Now using SerializationConfig v1.3 2012-02-26 16:45:23 +01:00
main() 109582335b Missing javadoc. 2012-02-25 14:59:33 +01:00
main() 3f09fbd710 Fixed the world-purger using the names from the new EntiyType-enum.
Closes #478.
Should fix #482.
Poor sheep.
2012-02-25 14:48:36 +01:00
main() ccb96ead10 Nasty bugs are nasty. 2012-02-25 13:11:21 +01:00
Eric Stokes 5c48899d92 Add initial support for enforcing access better 2012-02-23 20:15:10 -07:00
Eric Stokes 5f5d7084fa Add **much** better mv check command 2012-02-22 20:22:37 -07:00
Eric Stokes 7b9c26d40a Cleanup logging a bit, state when core is allowing players to access 2012-02-21 17:45:29 -07:00
Eric Stokes 0c96da48f9 Allow Spawner eggs to override settings 2012-02-21 16:58:36 -07:00
Eric Stokes fbbe031b2c Fix for method deprecations in R5 2012-02-21 05:25:59 -07:00
main() 868ac57a4a Removed TODOs in deprecated classes. There's nothing left to be done there. 2012-02-06 19:25:34 +01:00
main() 7c21a114db Fixed a bug in the info-command.
Information about the player's current world was shown when he entered an invalid world-name.
2012-02-06 17:19:51 +01:00
main() e7573d3bd7 Rewrote the who-command. Fixes #467. 2012-02-06 17:19:50 +01:00
main() 772d5a222d Unused import... 2012-02-06 17:19:44 +01:00
Eric Stokes 9eaca3e093 Bump to 2.4 2012-02-05 21:57:31 -07:00
Eric Stokes 2eb61af76f Remove Structures and Types from import
Fixes #466
2012-02-05 20:32:09 -07:00
Eric Stokes ad9d4e41ff Remove EGG, that's for chickens, silly. 2012-02-05 00:10:36 -07:00
Eric Stokes 6a2e0e5810 Fix Portals being blocked in End
This Fixes #463
This is caused by a bug in Bukkit/Bukkit@b2364780cb see line 38 of EntityCreatePortalEvent
2012-02-04 23:46:40 -07:00
Eric Stokes a9c6582487 Fix bypass perms. Fixes #443
I had a typo and didn't add the parent perms :(

Sorry about this big breakage... should be fixed.
2012-02-04 18:06:50 -07:00
Eric Stokes b66028e0e0 Lots of cleanup prepping for 2.3AB 2012-02-04 17:40:12 -07:00
Eric Stokes 3ac4e55dc2 Minor bug fixed preparing for 2.3
Fix chatPrefix -> chatprefix
Fix portalcooldown -> teleportcooldown
Fix made teleportcooldown show up in the config
Add New warnings to the default.
2012-02-04 10:14:58 -07:00
Eric Stokes 950991ff1b Removed old checks, cleanup poop
Add in the deprecated config method to not break other plugins
Fix handling of unloaded worlds in info and list
2012-02-04 09:10:56 -07:00
main() a1b07065b2 Merge branch 'master' of github.com:Multiverse/Multiverse-Core into config-changes
Conflicts:
	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
	src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java
	src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java
	src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java
	src/main/resources/defaults/config.yml
2012-02-04 15:19:37 +01:00
main() a1075224d3 Fixed config... 2012-02-04 14:22:55 +01:00
Eric Stokes d707a9f9a8 Made config command more hardcoded, but work. 2012-02-04 00:18:48 -07:00
Eric Stokes 90b04aa798 Add migrater for new configs, remove default, it's autogenned now 2012-02-03 23:36:17 -07:00
main() 5d1532e811 Updated build instructions in README (goodbye, submodules!) 2012-02-02 17:25:53 +01:00
main() 443d62580b CommandHandler is now mavenized, we can delete the submodule! 2012-02-02 17:20:46 +01:00
Eric Stokes 541819ea8f Move to shaded CH, this will break all MV plugins 2012-02-01 21:44:15 -07:00
Eric Stokes b09ea0e66a Add shading relocation so we don't conflict anymore! 2012-02-01 19:37:33 -07:00
Eric Stokes 8272e121f4 Update to allpay 6 2012-02-01 19:13:47 -07:00
main() 5d2534f497 Goodbye economy-dependencies! 2012-02-01 18:07:27 -07:00
main() 1e7eef90f9 Now using AllPay as maven-dependency, not as git-submodule. 2012-02-01 17:13:59 +01:00
main() 44df567936 Now using SerializationConfig. 2012-02-01 16:28:23 +01:00
main() d595cb9a31 Added SerializationConfig-dependency, including it with the shade-plugin. 2012-01-31 20:49:55 +01:00
Eric Stokes e8a72d19e1 Fix checkstyle violations 2012-01-29 15:56:57 -07:00
Eric Stokes dde3b63fb9 Fix non-active properties not saving.
Fixes #409
2012-01-29 15:40:16 -07:00
Eric Stokes 87d4d4e1f4 Allow generate-structures to be used per world 2012-01-29 12:41:48 -07:00
Eric Stokes 7aca740296 Fix javadocs in PortalTypeConfigProperty 2012-01-29 12:37:40 -07:00
Eric Stokes 6c9bc6951f Many small fixes.
- Update to 1.1-R2
 - Fix the '--list' not working with the import
 - Fix typo in new portalform catcher
 - Fix 'the_end' not working on import/create
2012-01-29 12:11:41 -07:00
Eric Stokes 74726b44ab Mid commit on adding portal prevention 2012-01-29 09:33:56 -07:00
Eric Stokes 18a57bf975 Allow eggs to spawn monsters 2012-01-28 08:27:57 -07:00
main() b2578b1736 "No newline at end of file" deserves more than only an information. 2012-01-28 15:48:46 +01:00
main() eec765bc48 Merge branch 'util-refactoring' 2012-01-28 15:41:58 +01:00
main() 060c0b1b44 (Re)designed PurgeWorlds/WorldPurger for extension. 2012-01-28 15:06:45 +01:00
Eric Stokes ba90228586 Fix anchors pages not being accessable
Fixes #434
2012-01-27 22:24:50 -07:00
main() 8017172f0e ...
-.-
RAGE!
2012-01-26 19:00:31 +01:00
main() b4ea5e9299 Change in SafeTTeleporter: We can SET the BlockSafety! 2012-01-26 18:56:54 +01:00
main() 59f2c8b62e (Re)designed SafeTTeleporter for extension. 2012-01-26 18:55:09 +01:00
main() 9a28158e5f Merge branch 'master' of github.com:Multiverse/Multiverse-Core into util-refactoring 2012-01-26 18:28:29 +01:00
Eric Stokes 4d97453881 Add the rest of the required items for the new events 2012-01-25 18:14:46 -07:00
Eric Stokes 8488f9db3c Remove the MVVersionRequestEvent, Update pom
I've had enough of our repo being fussy. Just adding the bukkit repos too.
We'll get the proxy stuff working eventually...
2012-01-25 17:13:30 -07:00
main() 51586c7dd5 More tests :D 2012-01-25 21:03:09 +01:00
Eric Stokes 7b74384a8e Fix compatibility with new tests.
Note: @main-- the new tests are balls slow for doing location generation. Like, they take 1s per check, which made the old one run for 16x16x9 seconds (making the test run take about 38.4 minutes)

For now, I've added a special case for nullterrains, which uses the new -n param to skip checking.
2012-01-24 20:32:39 -07:00
main() 33afa4d0d7 Now using the new listeners from ecb97fd5c1 2012-01-24 19:18:03 -07:00
main() 0980e0a201 Merge branch 'master' of github.com:Multiverse/Multiverse-Core into new-tests
Conflicts:
	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
2012-01-23 19:05:21 +01:00
main() 8bab4ae606 Merge branch 'master' of github.com:Multiverse/Multiverse-Core into new-tests 2012-01-11 16:44:59 +01:00
main() a1299239a2 Added more checks 2012-01-07 21:26:51 +01:00
main() 7cdb52e740 Yay for colored messages! 2012-01-07 21:26:23 +01:00
main() e2d6652ef1 One single missing char that kept breaking everything.
It took me half an hour to find this -.-
RAGE!
2012-01-07 17:13:00 +01:00
main() 814725a2ba Merge branch 'master' of github.com:Multiverse/Multiverse-Core into new-tests
Conflicts:
	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
2012-01-07 16:10:18 +01:00
main() da6e6145f2 (Re)designed MVMessaging for extension. 2012-01-07 16:05:16 +01:00
main() ee715b13b0 (Re)designed LocationManipulation for extension. 2012-01-07 16:02:23 +01:00
main() a18611fb76 (Re)designed BlockSafety for extension. 2012-01-06 21:11:51 +01:00
main() 9173a15eb9 Started work on tons of new tests 2011-12-31 18:34:04 +01:00
547 changed files with 40062 additions and 15487 deletions

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
github: Multiverse
open_collective: multiverse-plugins
+77
View File
@@ -0,0 +1,77 @@
name: 🐛 Report a Bug
description: Report a problem with Multiverse-Core.
title: "[Bug]: "
labels: ["Bug: Unconfirmed"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
If you are having issues with other submodules of Multiverse, please go to their respective git repo:
Multiverse-Portals: https://github.com/Multiverse/Multiverse-Portals/issues/new/choose
Multiverse-NetherPortals: https://github.com/Multiverse/Multiverse-NetherPortals/issues/new/choose
Multiverse-Inventories: https://github.com/Multiverse/Multiverse-Inventories/issues/new/choose
Multiverse-SignPortals: https://github.com/Multiverse/Multiverse-SignPortals/issues/new/choose
Not sure if this is a bug with Multiverse-Core? Feel free to ask on our Discord server: https://discord.gg/NZtfKky
When completing the report, please ensure all fields are filled with the correct details requested. Failure to do so will result in your issue being closed.
- type: input
id: multiverse-version-info
attributes:
label: '`/mv dumps` output'
description: Run `/mv dumps` in the console, then copy and paste the link from the output of the command into this box. If `/mv dumps` command is not available, update multiverse to v5.
validations:
required: true
- type: input
id: server-logs
attributes:
label: Server logs
description: >
Include full startup log and console error (if any). upload all relevant logs to either https://pastes.dev
or https://gist.github.com, save and the paste the link in this box.
validations:
required: true
- type: textarea
id: server-version
attributes:
label: Server Version
description: Output of `/version` command.
placeholder: server version info
render: shell
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Bug Description
description: Describe in detail what the bug is about. Include the expected behaviour and actual behaviour.
placeholder: "Example: When running `/mv` it cause the server to crash..."
validations:
required: true
- type: textarea
id: reproduce-steps
attributes:
label: Steps to reproduce
description: Provide detailed instructions to trigger the bug.
placeholder: |
Example:
1. Start a server with only multiverse installed.
2. Run `/mv` command.
3. Players all get kicked with a "server closed" message.
...
validations:
required: true
- type: checkboxes
id: agreements
attributes:
label: Agreements
description: Ensure you have done the following being submitting this issue.
options:
- label: I have searched for and ensured there isn't already an open or resolved issue(s) regarding this.
required: true
- label: >
I was able to reproduce my issue on a freshly setup and up-to-date server with the latest
version of Multiverse plugins with no other plugins and with no kinds of other server or client mods.
required: true
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 💬 Multiverse Discord Server
url: https://discord.gg/NZtfKky
about: Need help with using Multiverse-Core or just want to chat with the devs? Join the Multiverse Discord Server for help!
@@ -0,0 +1,41 @@
name: 💡 Request a Feature
description: Suggest a feature you want to see in Multiverse-Core!
title: "[Idea]: "
labels: ["Type: Idea"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to share your ideas!
If you are look for other submodules of Multiverse, go to their respective git repo:
Multiverse-Portals: https://github.com/Multiverse/Multiverse-Portals/issues/new/choose
Multiverse-NetherPortals: https://github.com/Multiverse/Multiverse-NetherPortals/issues/new/choose
Multiverse-Inventories: https://github.com/Multiverse/Multiverse-Inventories/issues/new/choose
Multiverse-SignPortals: https://github.com/Multiverse/Multiverse-SignPortals/issues/new/choose
Not sure if your feature fits in Multiverse-Core? Feel free to ask on our Discord server: https://discord.gg/NZtfKky
- type: textarea
id: feature-description
attributes:
label: Describe the feature
description: What feature are you suggesting?
placeholder: "Example: I hope multiverse can implement random teleport feature..."
validations:
required: true
- type: textarea
id: feature-reasoning
attributes:
label: How is the feature useful to all Multiverse users?
description: How is the feature useful to all players, server owners and/or developers?
placeholder: "Example: Random teleporting can be integrated into many multiverse modules such as mv-portals..."
validations:
required: true
- type: checkboxes
id: agreements
attributes:
label: Agreements
description: Ensure you have done the following being submitting this issue.
options:
- label: I have searched for and ensured there isn't already an open issue regarding this.
required: true
+34
View File
@@ -0,0 +1,34 @@
name: 'Call: GitHub Release'
on:
workflow_call:
inputs:
release_mode:
description: 'Release mode'
required: true
type: string
version_bump:
description: 'Version bump'
required: false
type: string
promote_from:
description: 'Promote from'
required: false
type: string
outputs:
release_created:
description: 'Release created'
value: ${{ jobs.github_release.outputs.release_created }}
tag_name:
description: 'Tag name'
value: ${{ jobs.github_release.outputs.tag_name }}
jobs:
github_release:
uses: ./.github/workflows/generic.github_release.yml
secrets: inherit
with:
plugin_name: multiverse-core
release_mode: ${{ inputs.release_mode }}
version_bump: ${{ inputs.version_bump }}
promote_from: ${{ inputs.promote_from }}
@@ -0,0 +1,83 @@
name: 'Call: Platform Uploads'
on:
workflow_call:
inputs:
target_tag:
description: 'Version to upload'
required: true
type: string
upload_modrinth:
description: 'Upload to modrinth.com'
required: true
type: string
upload_dbo:
description: 'Upload to dev.bukkit.org'
required: true
type: string
upload_hangar:
description: 'Upload to hangar.papermc.io'
required: true
type: string
secrets:
MODRINTH_TOKEN:
required: true
DBO_UPLOAD_API_TOKEN:
required: true
HANGAR_UPLOAD_TOKEN:
required: true
jobs:
platform_uploads:
uses: ./.github/workflows/generic.platform_uploads.yml
secrets: inherit
with:
plugin_name: multiverse-core
modrinth_project_id: 3wmN97b8
modrinth_dependencies: >
[
{"project_id": "qvdtDX3s", "dependency_type": "optional"},
{"project_id": "8VMk6P0I", "dependency_type": "optional"},
{"project_id": "vtawPsTo", "dependency_type": "optional"},
{"project_id": "WuErDeI1", "dependency_type": "optional"}
]
dbo_project_id: 30765
dbo_project_relations: >
[
{"slug": "multiverse-inventories", "type": "optionalDependency"},
{"slug": "multiverse-portals", "type": "optionalDependency"},
{"slug": "multiverse-netherportals", "type": "optionalDependency"},
{"slug": "multiverse-signportals", "type": "optionalDependency"},
{"slug": "vault", "type": "optionalDependency"}
]
hangar_slug: Multiverse-Core
hangar_plugin_dependencies: >
{ "PAPER": [
{
"name": "Multiverse-Inventories",
"required": false,
"platforms": ["PAPER"]
},
{
"name": "Multiverse-Portals",
"required": false,
"platforms": ["PAPER"]
},
{
"name": "Multiverse-NetherPortals",
"required": false,
"platforms": ["PAPER"]
},
{
"name": "Multiverse-SignPortals",
"required": false,
"platforms": ["PAPER"]
}
]}
target_tag: ${{ inputs.target_tag }}
upload_modrinth: ${{ inputs.upload_modrinth }}
upload_dbo: ${{ inputs.upload_dbo }}
upload_hangar: ${{ inputs.upload_hangar }}
@@ -0,0 +1,39 @@
name: 'Dispatch: Create Release'
on:
workflow_dispatch:
inputs:
release_type:
description: 'Stable or pre-release'
required: true
type: choice
options:
- prerelease
- release
version_bump:
description: 'Version bump type'
required: true
type: choice
options:
- major
- minor
- patch
jobs:
github_release:
uses: ./.github/workflows/call.github_release.yml
secrets: inherit
with:
release_mode: ${{ inputs.release_type }}
version_bump: ${{ inputs.version_bump }}
platform_uploads:
needs: github_release
if: needs.github_release.outputs.release_created == 'true'
uses: ./.github/workflows/call.platform_uploads.yml
secrets: inherit
with:
target_tag: ${{ needs.github_release.outputs.tag_name }}
upload_modrinth: 'true'
upload_dbo: 'false'
upload_hangar: 'false'
+55
View File
@@ -0,0 +1,55 @@
name: 'Dispatch: Deploy Javadoc'
on:
workflow_dispatch:
inputs:
target_tag:
description: 'Version to generate javadoc'
required: true
replace_latest:
description: 'Replace the latest folder'
type: boolean
jobs:
javadocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.target_tag }}
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: build javadoc
run: ./gradlew javadoc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_VERSION: ${{ inputs.target_tag }}
- name: Copy javadoc to deploy folder
run: |
mkdir -p build/docs/javadoc-deploy/${{ inputs.target_tag }}
cp -r build/docs/javadoc/* build/docs/javadoc-deploy/${{ inputs.target_tag }}
- name: Copy javadoc to latest folder
if: inputs.replace_latest
run: |
mkdir -p build/docs/javadoc-deploy/latest
cp -r build/docs/javadoc/* build/docs/javadoc-deploy/latest
- name: Deploy javadoc to gh pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: build/docs/javadoc-deploy
branch: javadoc
target-folder: javadoc
clean: false
commit-message: Deploy javadoc for ${{ inputs.target_tag }}
@@ -0,0 +1,31 @@
name: 'Dispatch: Platform Uploads'
on:
workflow_dispatch:
inputs:
target_tag:
description: 'Version to upload'
required: true
type: string
upload_modrinth:
description: 'Upload to modrinth.com'
required: true
type: boolean
upload_dbo:
description: 'Upload to dev.bukkit.org'
required: true
type: boolean
upload_hangar:
description: 'Upload to hangar.papermc.io'
required: true
type: boolean
jobs:
dispatch_platform_uploads:
uses: ./.github/workflows/call.platform_uploads.yml
secrets: inherit
with:
target_tag: ${{ github.event.inputs.target_tag }}
upload_modrinth: ${{ github.event.inputs.upload_modrinth }}
upload_dbo: ${{ github.event.inputs.upload_dbo }}
upload_hangar: ${{ github.event.inputs.upload_hangar }}
@@ -0,0 +1,38 @@
name: 'Dispatch: Promote Release'
on:
workflow_dispatch:
inputs:
target_tag:
description: 'Version to promote'
required: true
jobs:
check_version:
runs-on: ubuntu-latest
steps:
- name: Verify input version is prerelease
run: |
if [[ "${{ github.event.inputs.target_tag }}" != *"pre"* ]]; then
echo "Version must be a prerelease"
exit 1
fi
github_release:
needs: check_version
uses: ./.github/workflows/call.github_release.yml
secrets: inherit
with:
release_mode: promote
promote_from: ${{ github.event.inputs.target_tag }}
platform_uploads:
needs: github_release
if: needs.github_release.outputs.release_created == 'true'
uses: ./.github/workflows/call.platform_uploads.yml
secrets: inherit
with:
target_tag: ${{ needs.github_release.outputs.tag_name }}
upload_modrinth: 'true'
upload_dbo: 'true'
upload_hangar: 'true'
+22
View File
@@ -0,0 +1,22 @@
name: 'Generic: Checkstyle'
on:
workflow_call:
jobs:
checkstyle:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: dbelyaev/action-checkstyle@v0.8.4
continue-on-error: true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
checkstyle_version: 10.12.2
checkstyle_config: ./config/mv_checks.xml
level: warning
@@ -0,0 +1,131 @@
name: 'Generic: GitHub Release'
on:
workflow_call:
inputs:
# Plugin specific
plugin_name:
description: 'Plugin name'
required: true
type: string
# Common params
release_mode:
description: 'Release mode'
required: true
type: string
version_bump:
description: 'Version bump'
required: false
type: string
promote_from:
description: 'Promote from'
required: false
type: string
outputs:
release_created:
description: 'Release created'
value: ${{ jobs.github_release.outputs.release_created }}
tag_name:
description: 'Tag name'
value: ${{ jobs.github_release.outputs.tag_name }}
jobs:
github_release:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Echo inputs
run: |
echo "release_mode: ${{ inputs.release_mode }}"
echo "version_bump: ${{ inputs.version_bump }}"
echo "promote_from: ${{ inputs.promote_from }}"
- uses: actions/checkout@v4
with:
ref: ${{ inputs.promote_from }}
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build to test
id: test
run: ./gradlew clean build -x assemble -x shadowJar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
id: release
if: steps.test.outcome == 'success'
uses: benwoo1110/semantic-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_mode: ${{ inputs.release_mode }}
version_bump: ${{ inputs.version_bump }}
promote_from: ${{ inputs.promote_from }}
- name: Publish package
if: steps.release.outputs.release_created == 'true'
run: >
./gradlew publish -x test
-PmultiverseUsername=${{ secrets.REPOSILITE_REPO_USERNAME }}
-PmultiversePassword=${{ secrets.REPOSILITE_REPO_PASSWORD }}
env:
GITHUB_VERSION: ${{ steps.release.outputs.publish_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build for upload
id: build
if: steps.release.outputs.release_created == 'true'
run: ./gradlew build -x test
env:
GITHUB_VERSION: ${{ steps.release.outputs.tag_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release artifact
if: steps.build.outcome == 'success'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/${{ inputs.plugin_name }}-${{ steps.release.outputs.tag_name }}.jar
asset_name: ${{ inputs.plugin_name }}-${{ steps.release.outputs.tag_name }}.jar
tag: ${{ steps.release.outputs.tag_name }}
- name: Generate javadoc
id: javadoc
if: steps.build.outcome == 'success'
run: ./gradlew javadoc -x test
env:
GITHUB_VERSION: ${{ steps.release.outputs.publish_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload javadoc
if: steps.javadoc.outcome == 'success'
run: |
mkdir -p build/docs/javadoc-deploy/${{ steps.release.outputs.publish_version }}
cp -r build/docs/javadoc/* build/docs/javadoc-deploy/${{ steps.release.outputs.publish_version }}
- name: Override latest javadoc for stable release
if: steps.javadoc.outcome == 'success' && steps.release.outputs.release_type == 'release'
run: |
mkdir -p build/docs/javadoc-deploy/latest
cp -r build/docs/javadoc/* build/docs/javadoc-deploy/latest
- name: Deploy javadoc to gh pages
if: steps.javadoc.outcome == 'success'
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: build/docs/javadoc-deploy
branch: javadoc
target-folder: javadoc
clean: false
commit-message: Deploy javadoc for ${{ steps.release.outputs.tag_name }}
@@ -0,0 +1,140 @@
name: 'Generic: Platform Uploads'
on:
workflow_call:
inputs:
# Plugin specific params
plugin_name:
description: 'Plugin name'
required: true
type: string
modrinth_project_id:
description: 'modrinth.com project ID'
required: true
type: string
modrinth_dependencies:
description: 'modrinth.com project dependencies'
required: false
type: string
default: '[]'
dbo_project_id:
description: 'dev.bukkit.org project ID'
required: true
type: string
dbo_project_relations:
description: 'dev.bukkit.org project relations'
required: false
type: string
default: '[]'
hangar_slug:
description: 'hangar.papermc.io project slug'
required: true
type: string
hangar_plugin_dependencies:
description: 'hangar.papermc.io project dependencies'
required: false
type: string
default: '{}'
# Common params
target_tag:
description: 'Version to upload'
required: true
type: string
upload_modrinth:
description: 'Upload to modrinth.com'
required: true
type: string
upload_dbo:
description: 'Upload to dev.bukkit.org'
required: true
type: string
upload_hangar:
description: 'Upload to hangar.papermc.io'
required: true
type: string
secrets:
MODRINTH_TOKEN:
required: true
DBO_UPLOAD_API_TOKEN:
required: true
HANGAR_UPLOAD_TOKEN:
required: true
jobs:
platform_uploads:
runs-on: ubuntu-latest
steps:
- name: Get release info
id: release-info
uses: cardinalby/git-get-release-action@1.2.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ inputs.target_tag }}
- name: Download release artifact
id: release-artifact
uses: dsaltares/fetch-gh-release-asset@1.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: tags/${{ steps.release-info.outputs.tag_name }}
file: ${{ inputs.plugin_name }}-${{ steps.release-info.outputs.tag_name }}.jar
- name: Parse release type
id: parse-release-type
run: |
if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then
echo Setting release_type to Beta
echo "release_type=Beta" >> $GITHUB_OUTPUT
else
echo Setting release_type to Release
echo "release_type=Release" >> $GITHUB_OUTPUT
fi
- name: Upload to Modrinth
if: ${{ !cancelled() && inputs.upload_modrinth == 'true' }}
uses: benwoo1110/modrinth-upload-action@v1
with:
api_token: ${{ secrets.MODRINTH_TOKEN }}
project_id: ${{ inputs.modrinth_project_id }}
version_number: ${{ steps.release-info.outputs.tag_name }}
files: '["${{ github.workspace }}/${{ inputs.plugin_name }}-${{ steps.release-info.outputs.tag_name }}.jar"]'
name: ${{ steps.release-info.outputs.tag_name }}
changelog: ${{ steps.release-artifact.outputs.body }}
game_versions: 1.21.8, 1.21.7, 1.21.6, 1.21.5, 1.21.4, 1.21.3, 1.21.2, 1.21.1, 1.21, 1.20.6, 1.20.5, 1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2
version_type: ${{ steps.parse-release-type.outputs.release_type }}
loaders: bukkit, spigot, paper
dependencies: ${{ inputs.modrinth_dependencies }}
- name: Upload to DBO
if: ${{ !cancelled() && inputs.upload_dbo == 'true' }}
uses: benwoo1110/dbo-upload-action@v1
with:
api_token: ${{ secrets.DBO_UPLOAD_API_TOKEN }}
project_id: ${{ inputs.dbo_project_id }}
changelog: ${{ steps.release-artifact.outputs.body }}
changelog_type: markdown
display_name: ${{ steps.release-info.outputs.tag_name }}
game_versions: 1.21.8, 1.21.7, 1.21.6, 1.21.5, 1.21.4, 1.21.3, 1.21.2, 1.21.1, 1.21, 1.20.6, 1.20.5, 1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2
release_type: ${{ steps.parse-release-type.outputs.release_type }}
project_relations: ${{ inputs.dbo_project_relations }}
file_path: ${{ github.workspace }}/${{ inputs.plugin_name }}-${{ steps.release-info.outputs.tag_name }}.jar
- name: Upload to Hangar
if: ${{ !cancelled() && inputs.upload_hangar == 'true' }}
uses: benwoo1110/hangar-upload-action@v1
with:
api_token: ${{ secrets.HANGAR_UPLOAD_TOKEN }}
slug: ${{ inputs.hangar_slug }}
version: ${{ steps.release-info.outputs.tag_name }}
channel: ${{ steps.parse-release-type.outputs.release_type }}
files: '[{"path": "${{ github.workspace }}/${{ inputs.plugin_name }}-${{ steps.release-info.outputs.tag_name }}.jar", "platforms": ["PAPER"]}]'
description: ${{ steps.release-artifact.outputs.body }}
platform_dependencies: '{"PAPER": ["1.18.2-1.21.8"]}'
plugin_dependencies: ${{ inputs.hangar_plugin_dependencies }}
+48
View File
@@ -0,0 +1,48 @@
name: 'Generic: Test'
on:
workflow_call:
inputs:
plugin_name:
description: 'Plugin name'
required: true
type: string
jobs:
test-and-artifact:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run unit tests
run: ./gradlew build
env:
GITHUB_VERSION: pr${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Artifact output
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.plugin_name }}-pr${{ github.event.pull_request.number }}
path: build/libs/${{ inputs.plugin_name }}-pr${{ github.event.pull_request.number }}.jar
comment-artifact:
needs: test-and-artifact
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: benwoo1110/artifact-comment-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
+24
View File
@@ -0,0 +1,24 @@
name: 'Main: Prerelease'
on:
push:
branches: [main]
jobs:
github_release_on_push:
uses: ./.github/workflows/call.github_release.yml
secrets: inherit
with:
release_mode: prerelease
version_bump: prlabel
platform_uploads_on_push:
needs: github_release_on_push
if: needs.github_release_on_push.outputs.release_created == 'true'
uses: ./.github/workflows/call.platform_uploads.yml
secrets: inherit
with:
target_tag: ${{ needs.github_release_on_push.outputs.tag_name }}
upload_modrinth: 'true'
upload_dbo: 'false'
upload_hangar: 'false'
+9
View File
@@ -0,0 +1,9 @@
name: 'PR: Checkstyle'
on:
pull_request:
types: [opened, synchronize]
jobs:
checkstyle:
uses: ./.github/workflows/generic.checkstyle.yml
+18
View File
@@ -0,0 +1,18 @@
name: 'PR: Require Label'
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
branches: [main]
jobs:
require_label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
mode: exactly
count: 1
labels: "release:major, release:minor, release:patch, no release"
+11
View File
@@ -0,0 +1,11 @@
name: 'PR: Test'
on:
pull_request:
types: [opened, synchronize]
jobs:
test:
uses: ./.github/workflows/generic.test.yml
with:
plugin_name: multiverse-core
+4
View File
@@ -12,6 +12,7 @@
# maven
/target
dependency-reduced-pom.xml
# vim
.*.sw[a-p]
@@ -42,3 +43,6 @@ debug.log
# Doxygen
/docs/html
debug.txt
# Gradle
.gradle
-7
View File
@@ -1,7 +0,0 @@
[submodule "lib/allpay"]
path = lib/allpay
url = git://github.com/FernFerret/AllPay.git
[submodule "lib/commandhandler"]
path = lib/commandhandler
url = git://github.com/PneumatiCraft/CommandHandler.git
branch = notrie
+6
View File
@@ -0,0 +1,6 @@
Copyright (c) 2011, The Multiverse Team All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the The Multiverse Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+44 -11
View File
@@ -1,18 +1,51 @@
Building
========
Update the submodules after you clone and before you build with maven.
<p align="center">
<img src="config/multiverse-banner.png" alt="Multiverse Logo">
</p>
[![Modrinth](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/plugin/multiverse-core)
[![Hangar](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/hangar_vector.svg)](https://hangar.papermc.io/Multiverse/Multiverse-Core)
[![Bukkit](https://raw.githubusercontent.com/intergrav/devins-badges/refs/heads/v3/assets/cozy/available/bukkit_vector.svg)](https://dev.bukkit.org/projects/multiverse-core)
[![Spigot](https://raw.githubusercontent.com/intergrav/devins-badges/refs/heads/v3/assets/cozy/available/spigot_vector.svg)](https://www.spigotmc.org/resources/multiverse-core.390/)
[![Release](https://img.shields.io/github/v/release/multiverse/multiverse-core)](https://github.com/Multiverse/Multiverse-Core/releases/latest)
[![Pre-Release](https://img.shields.io/github/v/release/multiverse/multiverse-core?include_prereleases&label=Pre-release)](https://github.com/Multiverse/Multiverse-Core/releases)
[![Discord](https://img.shields.io/discord/325459248047980545?label=Discord&logo=discord)](https://discord.gg/NZtfKky)
[![Donate on Github Sponsor](https://img.shields.io/badge/Github%20Sponsor-Donate-pink?logo=githubsponsors)](https://github.com/sponsors/Multiverse)
[![Donate on Open Collective](https://img.shields.io/badge/Open%20Collective-Donate-blue?style=flat&logo=opencollective)](https://opencollective.com/multiverse-plugins)
# About
[Multiverse](https://modrinth.com/plugin/multiverse-core) was created at the dawn of Bukkit multiworld support. It has since then grown into a **complete world management solution!** Multiverse provides the easiest to use world management solution for your Minecraft server, big or small, and with great addons like [Portals](https://dev.bukkit.org/projects/multiverse-portals) and [NetherPortals](https://dev.bukkit.org/projects/multiverse-netherportals/), what's not to love!
Now it's time to create your very own Multiverse server, do check out our [Wiki](https://github.com/Multiverse/Multiverse-Core/wiki) and [Usage Guide](https://github.com/Multiverse/Multiverse-Core/wiki/Basics) to get started. Feel free to hop onto our [Discord](https://discord.gg/NZtfKky) if you have any question or just want to have a chat with us!
## Amazing sub-modules available:
* [Multiverse-NetherPortals](https://github.com/Multiverse/Multiverse-NetherPortals) -> Have separate nether and end worlds for each of your overworlds!
* [Multiverse-Portals](https://github.com/Multiverse/Multiverse-Portals) -> Make custom portals to go to any destination!
* [Multiverse-Inventories](https://github.com/Multiverse/Multiverse-Inventories) -> Have separated players stats and inventories per world or per group of worlds.
* [Multiverse-SignPortals](https://github.com/Multiverse/Multiverse-SignPortals) -> Signs as teleporters!
## Usage Guide
We have a cool new website hosting our Wiki: https://mvplugins.org
## Building
Simply build the source with Gradle:
```
$ git submodule update --init --recursive
$ mvn install
./gradlew build
```
More details are available on the [build instructions wiki page](https://github.com/Multiverse/Multiverse-Core/wiki/Building).
## Contributing
License
=======
Copyright (c) 2011, The Multiverse Team All rights reserved.
**Want to help improve Multiverse?** There are several ways you can support and contribute to the project.
* Take a look at our "Bug: Unconfirmed" issues, where you can find issues that need extra testing and investigation.
* Want others to love Multiverse too? You can join the [Multiverse Discord community](https://discord.gg/NZtfKky) and help others with issues and setup!
* A Multiverse guru? You can update our [Wiki](https://github.com/Multiverse/multiverse-web) with your latest tip, tricks and guides! The wiki open for all to edit and improve.
* Love coding? You could look at ["State: Open to PR"](https://github.com/Multiverse/Multiverse-Core/labels/State%3A%20Open%20to%20PR) and ["Resolution: Accepted"](https://github.com/Multiverse/Multiverse-Core/labels/Resolution%3A%20Accepted) issues. We're always happy to receive bug fixes and feature additions as [pull requests](https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/).
* If you'd like to make a financial contribution to the project, do consider donating to our [Github Sponsors](https://github.com/sponsors/Multiverse) or [Open Collective](https://opencollective.com/multiverse-plugins)!
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Additionally, we would like to give a big thanks to everyone that has supported Multiverse over the years, as well as those in the years to come. Thank you!
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the The Multiverse Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## License
Multiverse-Core is licensed under BSD-3-Clause License. Please see [LICENSE.md](LICENSE.md) for more info.
+117
View File
@@ -0,0 +1,117 @@
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'org.mvplugins.multiverse-plugin' version '1.2.1'
}
group = 'org.mvplugins.multiverse.core'
description = 'Multiverse-Core'
repositories {
maven {
name = 'aikar repo'
url = uri('https://repo.aikar.co/content/groups/aikar/')
}
maven {
name = 'glaremasters repo'
url = 'https://repo.glaremasters.me/repository/towny/'
}
maven {
name = "helpchatRepoReleases"
url = uri("https://repo.helpch.at/releases/")
}
}
configure(apiDependencies) {
serverApiVersion = '1.21.8-R0.1-SNAPSHOT'
mockBukkitServerApiVersion = '1.21'
mockBukkitVersion = '4.69.2'
}
dependencies {
// Economy
externalPlugin('com.github.MilkBowl:VaultAPI:1.7.1') {
exclude group: 'org.bukkit', module: 'bukkit'
}
// PlaceholderAPI
externalPlugin 'me.clip:placeholderapi:2.11.6'
// Command Framework
shadowed 'co.aikar:acf-paper:0.5.1-SNAPSHOT'
// Config
shadowed('io.github.townyadvanced.commentedconfiguration:CommentedConfiguration:1.0.1') {
exclude group: 'org.spigotmc', module: 'spigot-api'
}
// Utils
shadowed 'io.vavr:vavr:0.10.7'
shadowed 'org.glassfish.hk2:hk2-locator:3.1.1'
shadowed('org.glassfish.hk2:hk2-inhabitant-generator:3.1.1') {
exclude group: 'org.apache.maven', module: 'maven-core'
}
shadowed('com.dumptruckman.minecraft:Logging:1.1.1') {
exclude group: 'junit', module: 'junit'
}
shadowed 'de.themoep.idconverter:mappings:1.2-SNAPSHOT'
shadowed('org.bstats:bstats-bukkit:3.1.0') {
exclude group: 'org.bukkit', module: 'bukkit'
}
shadowed 'net.minidev:json-smart:2.5.2'
shadowed 'org.jetbrains:annotations:26.0.2'
shadowed 'io.papermc:paperlib:1.0.8'
// Tests
testImplementation('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'junit', module: 'junit'
}
testImplementation("org.hamcrest:hamcrest:3.0")
}
ext.bitlyAccessToken = System.getenv('BITLY_ACCESS_TOKEN') ?: 'bitly-access-token'
tasks.register('prepareSource', Sync) {
inputs.property 'bitlyAccessToken', bitlyAccessToken
from sourceSets.main.java
into "$buildDir/src"
filter(ReplaceTokens, tokens: [
'bitly-access-token': bitlyAccessToken,
])
}
shadowJar {
relocate 'co.aikar', 'org.mvplugins.multiverse.external.acf'
relocate 'com.dumptruckman.minecraft.util.Logging', 'org.mvplugins.multiverse.core.utils.CoreLogging'
relocate 'com.dumptruckman.minecraft.util.DebugLog', 'org.mvplugins.multiverse.core.utils.DebugFileLogger'
relocate 'de.themoep.idconverter', 'org.mvplugins.multiverse.external.idconverter'
relocate 'io.github.townyadvanced.commentedconfiguration', 'org.mvplugins.multiverse.external.commentedconfiguration'
relocate 'org.bstats', 'org.mvplugins.multiverse.external.bstats'
relocate 'com.sun', 'org.mvplugins.multiverse.external.sun'
relocate 'net.minidev', 'org.mvplugins.multiverse.external.minidev'
relocate 'org.objectweb', 'org.mvplugins.multiverse.external.objectweb'
relocate 'io.vavr', 'org.mvplugins.multiverse.external.vavr'
relocate 'jakarta', 'org.mvplugins.multiverse.external.jakarta'
relocate 'javassist', 'org.mvplugins.multiverse.external.javassist'
relocate 'org.aopalliance', 'org.mvplugins.multiverse.external.aopalliance'
relocate 'org.glassfish', 'org.mvplugins.multiverse.external.glassfish'
relocate 'org.jvnet', 'org.mvplugins.multiverse.external.jvnet'
relocate 'org.intellij', 'org.mvplugins.multiverse.external.intellij'
relocate 'org.jetbrains', 'org.mvplugins.multiverse.external.jetbrains'
relocate 'io.papermc.lib', 'org.mvplugins.multiverse.external.paperlib'
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/Multiverse/Multiverse-Core"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
+1
View File
@@ -0,0 +1 @@
out.txt
+20
View File
@@ -0,0 +1,20 @@
filepath = "../src/main/resources/multiverse-core_en.properties"
enumList = []
with open(filepath) as f:
for line in f:
line = line.strip()
if len(line) == 0:
enumList.append("")
elif line.startswith("#"):
enumList.append(line.replace("#", "//"))
else:
parts = line.split("=")
if (len(parts) < 2):
continue
parts = parts[0].split(".")[1:]
enumList.append("_".join([p.upper() for p in parts]) + ",")
with open("out.txt", "w") as f:
f.write("\n".join(enumList))
Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

+626 -103
View File
@@ -6,137 +6,660 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!-- Future reference: valid severity values are 'ignore', 'info', 'warning', 'error' -->
<module name="Checker">
<module name="JavadocPackage">
<property name="allowLegacy" value="true"/>
</module>
<module name="NewlineAtEndOfFile">
<property name="severity" value="info"/>
</module>
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java, properties, xml"/>
<property name="severity" value="warning"/>
<!-- Javadoc Comments -->
<module name="JavadocPackage"/><!-- require package-info.java file -->
<!-- Miscellaneous -->
<module name="NewlineAtEndOfFile" />
<module name="OrderedProperties"/>
<module name="Translation"/>
<module name="FileLength"/>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="UniqueProperties"/>
<!-- Regexp -->
<module name="RegexpSingleline">
<property name="message" value="Line has trailing spaces."/>
<property name="format" value="\s+$"/>
</module>
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="SUPPRESS CHECKSTYLE: (\w+)"/>
<property name="checkFormat" value="$1"/>
<!-- Size Violations -->
<module name="FileLength">
<property name="max" value="2000"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="BEGIN CHECKSTYLE-SUPPRESSION\: (\w+)"/>
<property name="onCommentFormat" value="END CHECKSTYLE-SUPPRESSION\: (\w+)"/>
<property name="checkFormat" value="$1"/>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="BEGIN CHECKSTYLE-SUPPRESSION\: ALL"/>
<property name="onCommentFormat" value="END CHECKSTYLE-SUPPRESSION\: ALL"/>
<!-- Whitespace -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="TreeWalker">
<!-- Make suppression possible -->
<module name="FileContentsHolder"/>
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="SUPPRESS CHECKSTYLE: (\w+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="BEGIN CHECKSTYLE-SUPPRESSION\: (\w+)"/>
<property name="onCommentFormat" value="END CHECKSTYLE-SUPPRESSION\: (\w+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="BEGIN CHECKSTYLE-SUPPRESSION\: ALL"/>
<property name="onCommentFormat" value="END CHECKSTYLE-SUPPRESSION\: ALL"/>
</module>
<!-- Actual checks -->
<module name="LineLength">
<property name="max" value="160"/>
<!-- Annotations -->
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, PACKAGE_DEF, ENUM_CONSTANT_DEF,
ENUM_DEF, METHOD_DEF, CTOR_DEF, RECORD_DEF, COMPACT_CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationVariables"/>
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="AnnotationLocation"/>
<module name="AnnotationUseStyle"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<!-- Block Checks -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock">
<property name="tokens"
value="LITERAL_WHILE, LITERAL_TRY, LITERAL_FINALLY, LITERAL_DO, LITERAL_IF,
LITERAL_ELSE, LITERAL_FOR, INSTANCE_INIT, STATIC_INIT, LITERAL_SWITCH,
LITERAL_SYNCHRONIZED"/>
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="(ignore|expect)"/>
</module>
<module name="LeftCurly">
<property name="ignoreEnums" value="false"/>
<property name="tokens"
value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
INTERFACE_DEF, LAMBDA, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT,
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF,
OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF"/>
</module>
<module name="NeedBraces">
<property name="id" value="SingleLineIf"/>
<property name="tokens" value="LITERAL_IF"/>
<property name="allowSingleLineStatement" value="true"/>
</module>
<module name="NeedBraces">
<property name="id" value="NoSingleLineControl"/>
<property name="tokens" value="LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
LITERAL_DO"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, INTERFACE_DEF, RECORD_DEF,
COMPACT_CTOR_DEF, LITERAL_SWITCH"/>
</module>
<!-- Class Design -->
<module name="DesignForExtension">
<property name="severity" value="info"/>
</module>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InnerTypeLast"/>
<module name="InterfaceIsType"/>
<module name="MutableException"/>
<module name="OneTopLevelClass"/>
<module name="ThrowsCount">
<property name="max" value="2"/>
</module>
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
</module>
<!-- Coding -->
<module name="ArrayTrailingComma"/>
<module name="AvoidDoubleBraceInitialization"/>
<module name="AvoidNoArgumentSuperConstructorCall"/>
<module name="CovariantEquals"/>
<module name="DeclarationOrder">
<!-- Doesn't respect static methods at top -->
<property name="severity" value="ignore"/>
</module>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="FallThrough">
<property name="checkLastCaseGroup" value="true"/>
</module>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
<property name="ignoreSetter" value="true"/>
<property name="setterCanReturnItsClass" value="true"/>
<property name="ignoreAbstractMethods" value="true"/>
<!-- Not smart enough -->
<property name="severity" value="ignore"/>
</module>
<module name="IllegalCatch"/>
<module name="IllegalThrows"/>
<module name="IllegalToken"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
</module>
<module name="IllegalType"/>
<module name="InnerAssignment"/>
<module name="MagicNumber">
<property name="ignoreHashCodeMethod" value="true"/>
<property name="ignoreAnnotationElementDefaults" value="true"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="ModifiedControlVariable"/>
<module name="MultipleStringLiterals">
</module>
<module name="MultipleVariableDeclarations"/>
<module name="NestedForDepth">
<property name="severity" value="warning"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="package"/><!-- We don't need javadoc for private methods -->
<property name="tokens" value="METHOD_DEF"/><!-- We don't need javadoc for constructors -->
<module name="NestedIfDepth"/>
<module name="NestedTryDepth"/>
<module name="NoClone"/>
<module name="NoFinalizer"/>
<module name="OneStatementPerLine"/>
<module name="PackageDeclaration"/>
<module name="ParameterAssignment"/>
<module name="RequireThis"/>
<module name="ReturnCount">
<property name="severity" value="info"/>
</module>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="SuperClone"/>
<module name="SuperFinalize"/>
<module name="UnnecessaryParentheses"/>
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="UnusedLocalVariable"/>
<module name="VariableDeclarationUsageDistance">
<property name="allowedDistance" value="3"/>
<property name="validateBetweenScopes" value="false"/>
</module>
<module name="VariableDeclarationUsageDistance">
<property name="allowedDistance" value="5"/>
<property name="validateBetweenScopes" value="true"/>
</module>
<!-- Imports -->
<module name="AvoidStarImport"/>
<module name="IllegalImport">
<property name="illegalPkgs" value="sun"/>
</module>
<module name="ImportOrder">
<property name="option" value="bottom"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="separatedStaticGroups" value="true"/>
<property name="caseSensitive" value="true"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
<property name="groups"
value="java,javax,*,org.mvplugins"/>
<property name="staticGroups"
value="/^.*$/"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Javadoc Comments -->
<module name="AtclauseOrder">
<property name="target"
value="CLASS_DEF, COMPACT_CTOR_DEF, CTOR_DEF, ENUM_DEF,
INTERFACE_DEF, METHOD_DEF, RECORD_DEF, VARIABLE_DEF"/>
</module>
<module name="InvalidJavadocPosition"/>
<module name="JavadocBlockTagLocation"/>
<module name="JavadocContentLocationCheck"/>
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF"/>
</module>
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
</module>
<module name="JavadocMissingLeadingAsterisk"/>
<module name="JavadocMissingWhitespaceAfterAsterisk"/>
<module name="JavadocParagraph">
<property name="allowNewlineParagraph" value="true"/>
</module>
<module name="JavadocStyle">
<property name="scope" value="package"/>
</module>
<module name="JavadocTagContinuationIndentation"/>
<module name="JavadocType"/>
<module name="JavadocVariable">
<property name="scope" value="package"/><!-- We don't need javadoc for private variables -->
<property name="scope" value="package"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="protected"/>
<property name="excludeScope" value="public"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
<property name="minLineCount" value="2"/>
</module>
<module name="MissingJavadocType">
<property name="scope" value="protected"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
RECORD_DEF, ANNOTATION_DEF"/>
<property name="excludeScope" value="nothing"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
<module name="SingleLineJavadoc"/>
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocStyle"/>
<module name="WriteTag">
<property name="tag" value="@author"/>
<property name="tagFormat" value="\S"/>
<property name="severity" value="ignore"/>
<property name="tagSeverity" value="warning"/>
</module>
<module name="ConstantName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<module name="AvoidStarImport">
<property name="severity" value="warning"/>
<property name="excludes" value="com.onarandombox.MultiverseCore.utils,com.onarandombox.MultiverseCore.configuration,com.onarandombox.MultiverseCore.commands,com.onarandombox.MultiverseCore.destination"/>
<!-- Metrics -->
<module name="BooleanExpressionComplexity"/>
<module name="ClassDataAbstractionCoupling">
<property name="max" value="7"/>
<property name="excludedClasses"
value="ArrayIndexOutOfBoundsException, ArrayList, Boolean, Byte, Character,
Class, Collection, Deprecated, Deque, Double, DoubleStream, EnumSet, Exception,
Float, FunctionalInterface, HashMap, HashSet, IllegalArgumentException,
IllegalStateException, IndexOutOfBoundsException, IntStream, Integer,
LinkedHashMap, LinkedHashSet, LinkedList, List, Long, LongStream, Map,
NullPointerException, Object, Optional, OptionalDouble, OptionalInt,
OptionalLong, Override, Queue, RuntimeException, SafeVarargs, SecurityException,
Set, Short, SortedMap, SortedSet, Stream, String, StringBuffer, StringBuilder,
SuppressWarnings, Throwable, TreeMap, TreeSet, UnsupportedOperationException,
Void, boolean, byte, char, double, float, int, long, short, var, void"/>
</module>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports">
<property name="processJavadoc" value="true"/>
</module>
<module name="MethodLength"/>
<module name="ParameterNumber"/>
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter">
<property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
</module>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter">
<property name="severity" value="warning"/>
</module>
<module name="WhitespaceAround">
<property name="severity" value="warning"/>
</module>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock">
<property name="tokens" value="LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_IF,LITERAL_FOR,LITERAL_TRY,LITERAL_WHILE,INSTANCE_INIT,STATIC_INIT"/>
</module>
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="DoubleCheckedLocking"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<property name="tokens" value="VARIABLE_DEF"/><!-- We don't care if parameters hide fields. -->
</module>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber">
<property name="ignoreNumbers" value="-1, 0, 0.5, 1, 2, 3"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="RedundantThrows"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<!-- Don't like errors for `final` missing
<module name="DesignForExtension"/>
<module name="FinalClass"/>
-->
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
</module>
<module name="ArrayTypeStyle"/>
<!-- Don't like errors for `final` missing
<module name="FinalParameters"/>
-->
<module name="TodoComment">
<module name="ClassFanOutComplexity">
<property name="id" value="FanOutComplexityGettingTooHigh"/>
<property name="max" value="20"/>
<property name="excludedClasses"
value="ArrayIndexOutOfBoundsException, ArrayList, Boolean, Byte, Character,
Class, Collection, Deprecated, Deque, Double, DoubleStream, EnumSet, Exception,
Float, FunctionalInterface, HashMap, HashSet, IllegalArgumentException,
IllegalStateException, IndexOutOfBoundsException, IntStream, Integer,
LinkedHashMap, LinkedHashSet, LinkedList, List, Long, LongStream, Map,
NullPointerException, Object, Optional, OptionalDouble, OptionalInt,
OptionalLong, Override, Queue, RuntimeException, SafeVarargs, SecurityException,
Set, Short, SortedMap, SortedSet, Stream, String, StringBuffer, StringBuilder,
SuppressWarnings, Throwable, TreeMap, TreeSet, UnsupportedOperationException,
Void, boolean, byte, char, double, float, int, long, short, var, void"/>
<property name="severity" value="info"/>
</module>
<module name="ClassFanOutComplexity">
<property name="id" value="FanOutComplexityProbablyTooHigh"/>
<property name="max" value="35"/>
<property name="excludedClasses"
value="ArrayIndexOutOfBoundsException, ArrayList, Boolean, Byte, Character,
Class, Collection, Deprecated, Deque, Double, DoubleStream, EnumSet, Exception,
Float, FunctionalInterface, HashMap, HashSet, IllegalArgumentException,
IllegalStateException, IndexOutOfBoundsException, IntStream, Integer,
LinkedHashMap, LinkedHashSet, LinkedList, List, Long, LongStream, Map,
NullPointerException, Object, Optional, OptionalDouble, OptionalInt,
OptionalLong, Override, Queue, RuntimeException, SafeVarargs, SecurityException,
Set, Short, SortedMap, SortedSet, Stream, String, StringBuffer, StringBuilder,
SuppressWarnings, Throwable, TreeMap, TreeSet, UnsupportedOperationException,
Void, boolean, byte, char, double, float, int, long, short, var, void"/>
</module>
<module name="CyclomaticComplexity">
<property name="max" value="7"/>
<property name="severity" value="warning"/>
</module>
<module name="JavaNCSS">
<property name="methodMaximum" value="50"/>
<property name="classMaximum" value="1500"/>
<property name="fileMaximum" value="2000"/>
<property name="recordMaximum" value="150"/>
</module>
<module name="NPathComplexity">
<property name="max" value="200"/>
</module>
<!-- Miscellaneous -->
<module name="ArrayTypeStyle"/>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="CommentsIndentation">
<property name="tokens" value="SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN"/>
</module>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="4"/>
<property name="caseIndent" value="4"/>
<property name="throwsIndent" value="8"/>
<property name="arrayInitIndent" value="4"/>
<property name="lineWrappingIndentation" value="8"/>
<property name="forceStrictCondition" value="false"/>
</module>
<module name="NoCodeInFile"/>
<module name="OuterTypeFilename"/>
<module name="TodoComment">
<property name="format" value="TODO"/>
<!-- TODO change back to warning after MV5 -->
<property name="severity" value="info"/>
</module>
<module name="TrailingComment">
<property name="legalComment" value="^\sSUPPRESS CHECKSTYLE:"/>
</module>
<module name="UncommentedMain"/>
<module name="UpperEll"/>
<module name="Indentation"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<!-- Modifiers -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Naming Conventions -->
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="0"/>
<property name="allowedAbbreviations" value="MV"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF,
PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF,
RECORD_COMPONENT_DEF"/>
</module>
<module name="AbstractClassName">
<property name="ignoreName" value="true"/>
<message key="name.invalidPattern"
value="Abstract class name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CatchParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z]{1,3}$"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ConstantName">
<message key="name.invalidPattern"
value="Constant name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="^[A-Z]{1,3}$"/>
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalFinalVariableName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Local final variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$|^[A-Z][A-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodName">
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^[A-Z]{1,3}$"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="PackageName">
<property name="severity" value="info"/>
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="PatternVariableName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Pattern variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="RecordComponentName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Record component name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="RecordTypeParameterName">
<property name="format" value="^[A-Z]{1,3}$"/>
<message key="name.invalidPattern"
value="Record type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="StaticVariableName">
<message key="name.invalidPattern"
value="Static variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
ANNOTATION_DEF, RECORD_DEF"/>
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<!-- Size Violations -->
<module name="AnonInnerLength">
<property name="max" value="20"/>
</module>
<module name="ExecutableStatementCount">
<property name="max" value="30"/>
</module>
<module name="LambdaBodyLength">
<property name="id" value="LambdaGettingTooLong"/>
<property name="max" value="10"/>
<property name="severity" value="info"/>
</module>
<module name="LambdaBodyLength">
<property name="id" value="LambdaProbablyTooLong"/>
<property name="max" value="25"/>
</module>
<module name="MethodCount">
<property name="maxTotal" value="100"/>
<property name="maxPrivate" value="100"/>
<property name="maxPackage" value="100"/>
<property name="maxProtected" value="100"/>
<property name="maxPublic" value="100"/>
</module>
<module name="MethodLength">
<property name="max" value="50"/>
<property name="severity" value="warning"/>
</module>
<module name="OuterTypeNumber">
<property name="max" value="1"/>
</module>
<module name="ParameterNumber">
<property name="id" value="ConsiderLessMethodParameters"/>
<property name="max" value="4"/>
<property name="ignoreOverriddenMethods" value="true"/>
<property name="severity" value="info"/>
<property name="tokens" value="METHOD_DEF"/>
</module>
<module name="ParameterNumber">
<property name="id" value="ProbablyTooManyMethodParameters"/>
<property name="max" value="10"/>
<property name="ignoreOverriddenMethods" value="true"/>
<property name="tokens" value="METHOD_DEF"/>
</module>
<module name="ParameterNumber">
<property name="id" value="ConsiderLessConstructorParameters"/>
<property name="max" value="7"/>
<property name="ignoreOverriddenMethods" value="true"/>
<property name="severity" value="info"/>
<property name="tokens" value="CTOR_DEF"/>
</module>
<module name="ParameterNumber">
<property name="id" value="ProbablyTooManyConstructorParameters"/>
<property name="max" value="12"/>
<property name="ignoreOverriddenMethods" value="true"/>
<property name="tokens" value="CTOR_DEF"/>
</module>
<module name="RecordComponentNumber">
<property name="max" value="8"/>
</module>
<!-- Whitespace -->
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="allowMultipleEmptyLines" value="false"/>
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
<property name="tokens"
value="PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF,
COMPACT_CTOR_DEF"/>
</module>
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="MethodParamPad">
<property name="tokens"
value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF,
SUPER_CTOR_CALL, ENUM_CONSTANT_DEF, RECORD_DEF"/>
</module>
<module name="NoLineWrap">
<property name="tokens" value="PACKAGE_DEF, IMPORT, STATIC_IMPORT"/>
</module>
<module name="NoWhitespaceAfter">
<property name="tokens"
value="AT, INC, DEC, UNARY_MINUS,UNARY_PLUS,BNOT,LNOT,DOT,ARRAY_DECLARATOR,INDEX_OP,LITERAL_SYNCHRONIZED,METHOD_REF"/>
</module>
<module name="NoWhitespaceBefore">
<property name="id" value="AllowedWhitespaceBeforeWithoutLinebreak"/>
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, ELLIPSIS, LABELED_STAT"/>
</module>
<module name="NoWhitespaceBefore">
<property name="id" value="AllowedWhitespaceBeforeWithLinebreak"/>
<property name="tokens" value="DOT, METHOD_REF"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="NoWhitespaceBeforeCaseDefaultColon"/>
<module name="OperatorWrap">
<property name="tokens"
value="QUESTION, COLON, EQUAL, NOT_EQUAL, DIV, PLUS, MINUS, STAR, MOD,
SR, BSR, GE, GT, SL, LE, LT, BXOR, BOR, LOR, BAND, LAND, LITERAL_INSTANCEOF,
TYPE_EXTENSION_AND, ASSIGN, DIV_ASSIGN, PLUS_ASSIGN, MINUS_ASSIGN,
STAR_ASSIGN, MOD_ASSIGN, SR_ASSIGN, BSR_ASSIGN, SL_ASSIGN, BXOR_ASSIGN,
BOR_ASSIGN, BAND_ASSIGN, METHOD_REF"/>
</module>
<module name="ParenPad">
<property name="tokens"
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL,
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA,
RECORD_DEF"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapNl"/>
<property name="option" value="nl"/>
<property name="tokens" value="DOT, AT, METHOD_REF"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapEol"/>
<property name="option" value="eol"/>
<property name="tokens"
value="COMMA, SEMI, ELLIPSIS, RPAREN, ARRAY_DECLARATOR, RBRACK"/>
</module>
<module name="SingleSpaceSeparator"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter">
<property name="tokens"
value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, LITERAL_RETURN,
LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, LITERAL_FINALLY, DO_WHILE, ELLIPSIS,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_CATCH, LAMBDA,
LITERAL_YIELD, LITERAL_CASE"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="ignoreEnhancedForColon" value="false"/>
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND,
LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks
may only be represented as '{}' when not part of a multi-block statement"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
</module>
</module>
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored Executable
+244
View File
@@ -0,0 +1,244 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
Vendored
+92
View File
@@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
Submodule lib/allpay deleted from 7abba1f004.
-281
View File
@@ -1,281 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.onarandombox.multiversecore</groupId>
<artifactId>Multiverse-Core</artifactId>
<version>2.3</version>
<name>Multiverse-Core</name>
<description>World Management Plugin</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.number>UNKNOWN</project.build.number>
</properties>
<repositories>
<repository>
<id>onarandombox</id>
<url>http://repo.onarandombox.com/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>doodleproject-repo</id>
<name>DoodleProject Maven 2 Repository</name>
<url>http://doodleproject.sourceforge.net/maven2/release</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<ciManagement>
<system>jenkins</system>
<url>http://ci.onarandombox.com</url>
</ciManagement>
<!-- Profiles are used to detect whether this is a local or Jenkins build
and adjust the build number accordingly -->
<profiles>
<profile>
<id>jenkins</id>
<activation>
<property>
<name>env.BUILD_NUMBER</name>
</property>
</activation>
<properties>
<project.build.number>${env.BUILD_NUMBER}</project.build.number>
</properties>
</profile>
</profiles>
<build>
<defaultGoal>clean package</defaultGoal>
<plugins>
<!-- Compiler -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- Build Helper - Additional Source Folders -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-wsdl-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/lib/allpay/src/main/java</source>
<source>${project.basedir}/lib/commandhandler/src</source>
<source>${project.basedir}/lib/commandhandler/lib/ShellParser/src</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
<version>1.3.8</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>target/classes/plugin.yml</file>
<replacements>
<replacement>
<token>maven-version-number</token>
<value>${project.version}-b${project.build.number}</value>
</replacement>
</replacements>
</configuration>
</plugin>
<!-- Jar Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifestEntries>
</manifestEntries>
</archive>
</configuration>
</plugin>
<!-- Maven Source Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<configuration>
<parallel>methods</parallel>
<threadCount>10</threadCount>
<excludes>
<exclude>**/TestCommandSender.java</exclude>
<exclude>**/TestInstanceCreator.java</exclude>
</excludes>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.11</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.8</version>
<configuration>
<enableRulesSummary>true</enableRulesSummary>
<configLocation>${project.basedir}/config/mv_checks.xml</configLocation>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Bukkit Dependency -->
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.1-R1-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Bukkit Dependency -->
<!-- Start of Spout -->
<dependency>
<groupId>org.getspout</groupId>
<artifactId>spoutpluginapi</artifactId>
<version>dev-SNAPSHOT</version>
</dependency>
<!-- End of Spout -->
<!-- Start of Economy Dependencies -->
<dependency>
<groupId>cosine.boseconomy</groupId>
<artifactId>BOSEconomy</artifactId>
<version>0.6.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>fr.crafter.tickleman.RealShop</groupId>
<artifactId>RealShop</artifactId>
<version>0.63</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.iCo6</groupId>
<artifactId>iConomy</artifactId>
<version>6.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.iConomy</groupId>
<artifactId>iConomy</artifactId>
<version>5.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nijiko.coelho.iConomy</groupId>
<artifactId>iConomy</artifactId>
<version>4.65</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.earth2me.essentials</groupId>
<artifactId>Essentials</artifactId>
<version>2.4.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.ashtheking.currency</groupId>
<artifactId>MultiCurrency</artifactId>
<version>0.09</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ca.agnate</groupId>
<artifactId>EconXP</artifactId>
<version>1.0.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- End of Economy Dependencies -->
<!-- Start of Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.4.9</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>1.4.9</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.4.9</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<!-- End of Test Dependencies -->
</dependencies>
<distributionManagement>
<repository>
<id>OnARandomBox</id>
<url>http://repo.onarandombox.com/content/repositories/multiverse</url>
</repository>
</distributionManagement>
</project>
+14
View File
@@ -0,0 +1,14 @@
/*
* This file was generated by the Gradle 'init' task.
*/
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = uri('https://repo.onarandombox.com/multiverse-releases')
}
}
}
rootProject.name = 'multiverse-core'
File diff suppressed because it is too large. Load diff
@@ -1,784 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore;
import com.fernferret.allpay.AllPay;
import com.fernferret.allpay.GenericBank;
import com.onarandombox.MultiverseCore.api.Core;
import com.onarandombox.MultiverseCore.api.MVPlugin;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.commands.*;
import com.onarandombox.MultiverseCore.destination.AnchorDestination;
import com.onarandombox.MultiverseCore.destination.BedDestination;
import com.onarandombox.MultiverseCore.destination.CannonDestination;
import com.onarandombox.MultiverseCore.destination.DestinationFactory;
import com.onarandombox.MultiverseCore.destination.ExactDestination;
import com.onarandombox.MultiverseCore.destination.PlayerDestination;
import com.onarandombox.MultiverseCore.destination.WorldDestination;
import com.onarandombox.MultiverseCore.event.MVVersionEvent;
import com.onarandombox.MultiverseCore.listeners.MVEntityListener;
import com.onarandombox.MultiverseCore.listeners.MVPlayerListener;
import com.onarandombox.MultiverseCore.listeners.MVPluginListener;
import com.onarandombox.MultiverseCore.listeners.MVWeatherListener;
import com.onarandombox.MultiverseCore.utils.AnchorManager;
import com.onarandombox.MultiverseCore.utils.DebugLog;
import com.onarandombox.MultiverseCore.utils.MVMessaging;
import com.onarandombox.MultiverseCore.utils.MVPermissions;
import com.onarandombox.MultiverseCore.utils.MVPlayerSession;
import com.onarandombox.MultiverseCore.utils.SafeTTeleporter;
import com.onarandombox.MultiverseCore.utils.SpoutInterface;
import com.onarandombox.MultiverseCore.utils.WorldManager;
import com.pneumaticraft.commandhandler.CommandHandler;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* The implementation of the Multiverse-{@link Core}.
*/
public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
private static final int PROTOCOL = 12;
// Global Multiverse config variable, states whether or not
// Multiverse should stop other plugins from teleporting players
// to worlds.
// TODO This is REALLY bad style! We have to change this!
// No, I'm NOT going to suppress these warnings because we HAVE TO CHANGE THIS!
public static boolean EnforceAccess;
public static boolean PrefixChat;
public static boolean DisplayPermErrors;
public static boolean TeleportIntercept;
public static boolean FirstSpawnOverride;
public static Map<String, String> teleportQueue = new HashMap<String, String>();
public static int GlobalDebug = 0;
private AnchorManager anchorManager = new AnchorManager(this);
/**
* This method is used to find out who is teleporting a player.
* @param playerName The teleported player (the teleportee).
* @return The player that teleported the other one (the teleporter).
*/
public static String getPlayerTeleporter(String playerName) {
if (teleportQueue.containsKey(playerName)) {
String teleportee = teleportQueue.get(playerName);
teleportQueue.remove(playerName);
return teleportee;
}
return null;
}
/**
* This method is used to add a teleportation to the teleportQueue.
*
* @param teleporter The name of the player that initiated the teleportation.
* @param teleportee The name of the player that was teleported.
*/
public static void addPlayerToTeleportQueue(String teleporter, String teleportee) {
staticLog(Level.FINEST, "Adding mapping '" + teleporter + "' => '" + teleportee + "' to teleport queue");
teleportQueue.put(teleportee, teleporter);
}
@Override
public String toString() {
return "The Multiverse-Core Plugin";
}
/**
* {@inheritDoc}
* @deprecated This is now deprecated, nobody needs it any longer.
* All version info-dumping is now done with {@link MVVersionEvent}.
*/
@Override
@Deprecated
public String dumpVersionInfo(String buffer) {
return buffer;
}
@Override
public MultiverseCore getCore() {
return this;
}
@Override
public void setCore(MultiverseCore core) {
// This method is required by the interface (so core is effectively a plugin of itself) and therefore
// this is never used.
}
@Override
public int getProtocolVersion() {
return MultiverseCore.PROTOCOL;
}
// Useless stuff to keep us going.
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private static DebugLog debugLog;
// Setup our Map for our Commands using the CommandHandler.
private CommandHandler commandHandler;
private static final String LOG_TAG = "[Multiverse-Core]";
// Multiverse Permissions Handler
private MVPermissions ph;
// Configurations
private FileConfiguration multiverseConfig = null;
private MVWorldManager worldManager = new WorldManager(this);
// Setup the block/player/entity listener.
private MVPlayerListener playerListener = new MVPlayerListener(this);
private MVEntityListener entityListener = new MVEntityListener(this);
private MVPluginListener pluginListener = new MVPluginListener(this);
private MVWeatherListener weatherListener = new MVWeatherListener(this);
//public UpdateChecker updateCheck;
// HashMap to contain information relating to the Players.
private HashMap<String, MVPlayerSession> playerSessions;
private GenericBank bank = null;
private AllPay banker;
private int pluginCount;
private DestinationFactory destFactory;
private SpoutInterface spoutInterface = null;
private static final double ALLPAY_VERSION = 5;
private static final double CH_VERSION = 4;
private MVMessaging messaging;
private File serverFolder = new File(System.getProperty("user.dir"));
@Override
public void onLoad() {
// Create our DataFolder
getDataFolder().mkdirs();
// Setup our Debug Log
debugLog = new DebugLog("Multiverse-Core", getDataFolder() + File.separator + "debug.log");
}
/**
* {@inheritDoc}
*/
@Override
public FileConfiguration getMVConfiguration() {
return this.multiverseConfig;
}
/**
* {@inheritDoc}
*/
@Override
public GenericBank getBank() {
return this.bank;
}
/**
* {@inheritDoc}
*/
@Override
public void onEnable() {
//this.worldManager = new WorldManager(this);
// Perform initial checks for AllPay
if (!this.validateAllpay() || !this.validateCH()) {
this.getServer().getPluginManager().disablePlugin(this);
return;
}
this.messaging = new MVMessaging();
this.banker = new AllPay(this, LOG_TAG + " ");
// Output a little snippet to show it's enabled.
this.log(Level.INFO, "- Version " + this.getDescription().getVersion() + " (API v" + PROTOCOL + ") Enabled - By " + getAuthors());
// Load the defaultWorldGenerators
this.worldManager.getDefaultWorldGenerators();
this.registerEvents();
// Setup Permissions, we'll do an initial check for the Permissions plugin then fall back on isOP().
this.ph = new MVPermissions(this);
this.bank = this.banker.loadEconPlugin();
// Setup the command manager
this.commandHandler = new CommandHandler(this, this.ph);
// Call the Function to assign all the Commands to their Class.
this.registerCommands();
// Initialize the Destination factor AFTER the commands
this.initializeDestinationFactory();
this.playerSessions = new HashMap<String, MVPlayerSession>();
// Start the Update Checker
// updateCheck = new UpdateChecker(this.getDescription().getName(), this.getDescription().getVersion());
// Call the Function to load all the Worlds and setup the HashMap
// When called with null, it tries to load ALL
// this function will be called every time a plugin registers a new envtype with MV
// Setup & Load our Configuration files.
loadConfigs();
if (this.multiverseConfig != null) {
this.worldManager.loadDefaultWorlds();
this.worldManager.loadWorlds(true);
} else {
this.log(Level.SEVERE, "Your configs were not loaded. Very little will function in Multiverse.");
}
this.anchorManager.loadAnchors();
// Now set the firstspawnworld (after the worlds are loaded):
// Default as the server.props world.
this.worldManager.setFirstSpawnWorld(this.multiverseConfig.getString("firstspawnworld", getDefaultWorldName()));
// We have to set this one here, if it's not present, we don't know the name of the default world.
// and this one won't be in the defaults yml file.
try {
this.multiverseConfig.set("firstspawnworld", this.worldManager.getFirstSpawnWorld().getName());
} catch (NullPointerException e) {
// A test that had no worlds loaded was being run. This should never happen in production
}
this.saveMVConfig();
// Check to see if spout was already loaded (most likely):
if (this.getServer().getPluginManager().getPlugin("Spout") != null) {
this.setSpout();
this.log(Level.INFO, "Spout integration enabled.");
}
}
private boolean validateAllpay() {
try {
this.banker = new AllPay(this, "Verify");
if (this.banker.getVersion() >= ALLPAY_VERSION) {
return true;
}
} catch (Throwable t) {
}
LOGGER.info(String.format("%s - Version %s was NOT ENABLED!!!", LOG_TAG, this.getDescription().getVersion()));
LOGGER.info(String.format("%s A plugin that has loaded before %s has an incompatible version of AllPay (an internal library)!",
LOG_TAG, this.getDescription().getName()));
LOGGER.info(String.format("%s The Following Plugins MAY out of date: %s", LOG_TAG, AllPay.pluginsThatUseUs.toString()));
LOGGER.info(String.format("%s This plugin needs AllPay v%f or higher and another plugin has loaded v%f!",
LOG_TAG, ALLPAY_VERSION, this.banker.getVersion()));
return false;
}
private boolean validateCH() {
try {
this.commandHandler = new CommandHandler(this, null);
if (this.commandHandler.getVersion() >= CH_VERSION) {
return true;
}
} catch (Throwable t) {
}
LOGGER.info(String.format("%s - Version %s was NOT ENABLED!!!", LOG_TAG, this.getDescription().getVersion()));
LOGGER.info(String.format("%s A plugin that has loaded before %s has an incompatible version of CommandHandler (an internal library)!",
LOG_TAG, this.getDescription().getName()));
LOGGER.info(String.format("%s Please contact this plugin author!!!", LOG_TAG));
LOGGER.info(String.format("%s This plugin needs CommandHandler v%f or higher and another plugin has loaded v%f!",
LOG_TAG, CH_VERSION, this.commandHandler.getVersion()));
return false;
}
private void initializeDestinationFactory() {
this.destFactory = new DestinationFactory(this);
this.destFactory.registerDestinationType(WorldDestination.class, "");
this.destFactory.registerDestinationType(WorldDestination.class, "w");
this.destFactory.registerDestinationType(ExactDestination.class, "e");
this.destFactory.registerDestinationType(PlayerDestination.class, "pl");
this.destFactory.registerDestinationType(CannonDestination.class, "ca");
this.destFactory.registerDestinationType(BedDestination.class, "b");
this.destFactory.registerDestinationType(AnchorDestination.class, "a");
}
/**
* Function to Register all the Events needed.
*/
private void registerEvents() {
PluginManager pm = getServer().getPluginManager();
pm.registerEvents(this.playerListener, this);
pm.registerEvents(this.entityListener, this);
pm.registerEvents(this.pluginListener, this);
pm.registerEvents(this.weatherListener, this);
}
/**
* {@inheritDoc}
*/
@Override
public void loadConfigs() {
// Now grab the Configuration Files.
this.multiverseConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml"));
Configuration coreDefaults = YamlConfiguration.loadConfiguration(this.getClass().getResourceAsStream("/defaults/config.yml"));
this.multiverseConfig.setDefaults(coreDefaults);
this.multiverseConfig.options().copyDefaults(true);
this.saveMVConfig();
this.multiverseConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml"));
this.worldManager.loadWorldConfig(new File(getDataFolder(), "worlds.yml"));
// Setup the Debug option, we'll default to false because this option will not be in the default config.
GlobalDebug = this.multiverseConfig.getInt("debug", 0);
// Lets cache these values due to the fact that they will be accessed many times.
EnforceAccess = this.multiverseConfig.getBoolean("enforceaccess", false);
PrefixChat = this.multiverseConfig.getBoolean("worldnameprefix", true);
// Should MV Intercept teleports by other plugins?
TeleportIntercept = this.multiverseConfig.getBoolean("teleportintercept", true);
// Should MV do the first spawn stuff?
FirstSpawnOverride = this.multiverseConfig.getBoolean("firstspawnoverride", true);
// Should permissions errors display to users?
DisplayPermErrors = this.multiverseConfig.getBoolean("displaypermerrors", true);
this.messaging.setCooldown(this.multiverseConfig.getInt("messagecooldown", 5000)); // SUPPRESS CHECKSTYLE: MagicNumberCheck
// Update the version of the config!
this.multiverseConfig.set("version", coreDefaults.get("version"));
// Remove old values.
this.multiverseConfig.set("enforcegamemodes", null);
this.multiverseConfig.set("bedrespawn", null);
this.multiverseConfig.set("opfallback", null);
this.saveMVConfigs();
}
/**
* Safely return a world name.
* (The tests call this with no worlds loaded)
*
* @return The default world name.
*/
private String getDefaultWorldName() {
if (this.getServer().getWorlds().size() > 0) {
return this.getServer().getWorlds().get(0).getName();
}
return "";
}
/**
* {@inheritDoc}
*/
@Override
public MVMessaging getMessaging() {
return this.messaging;
}
/**
* Register Multiverse-Core commands to Command Manager.
*/
private void registerCommands() {
// Intro Commands
this.commandHandler.registerCommand(new HelpCommand(this));
this.commandHandler.registerCommand(new VersionCommand(this));
this.commandHandler.registerCommand(new ListCommand(this));
this.commandHandler.registerCommand(new InfoCommand(this));
this.commandHandler.registerCommand(new CreateCommand(this));
this.commandHandler.registerCommand(new ImportCommand(this));
this.commandHandler.registerCommand(new ReloadCommand(this));
this.commandHandler.registerCommand(new SetSpawnCommand(this));
this.commandHandler.registerCommand(new CoordCommand(this));
this.commandHandler.registerCommand(new TeleportCommand(this));
this.commandHandler.registerCommand(new WhoCommand(this));
this.commandHandler.registerCommand(new SpawnCommand(this));
// Dangerous Commands
this.commandHandler.registerCommand(new UnloadCommand(this));
this.commandHandler.registerCommand(new LoadCommand(this));
this.commandHandler.registerCommand(new RemoveCommand(this));
this.commandHandler.registerCommand(new DeleteCommand(this));
this.commandHandler.registerCommand(new RegenCommand(this));
this.commandHandler.registerCommand(new ConfirmCommand(this));
// Modification commands
this.commandHandler.registerCommand(new ModifyCommand(this));
this.commandHandler.registerCommand(new PurgeCommand(this));
this.commandHandler.registerCommand(new ModifyAddCommand(this));
this.commandHandler.registerCommand(new ModifySetCommand(this));
this.commandHandler.registerCommand(new ModifyRemoveCommand(this));
this.commandHandler.registerCommand(new ModifyClearCommand(this));
this.commandHandler.registerCommand(new ConfigCommand(this));
this.commandHandler.registerCommand(new AnchorCommand(this));
// Misc Commands
this.commandHandler.registerCommand(new EnvironmentCommand(this));
this.commandHandler.registerCommand(new DebugCommand(this));
this.commandHandler.registerCommand(new GeneratorCommand(this));
this.commandHandler.registerCommand(new CheckCommand(this));
}
/**
* {@inheritDoc}
*/
@Override
public void onDisable() {
debugLog.close();
this.banker = null;
this.bank = null;
log(Level.INFO, "- Disabled");
}
/**
* {@inheritDoc}
*/
@Override
public MVPlayerSession getPlayerSession(Player player) {
if (this.playerSessions.containsKey(player.getName())) {
return this.playerSessions.get(player.getName());
} else {
this.playerSessions.put(player.getName(), new MVPlayerSession(player, this.multiverseConfig, this));
return this.playerSessions.get(player.getName());
}
}
/**
* {@inheritDoc}
*/
@Override
public SafeTTeleporter getTeleporter() {
return new SafeTTeleporter(this);
}
/**
* {@inheritDoc}
*/
@Override
public MVPermissions getMVPerms() {
return this.ph;
}
/**
* {@inheritDoc}
*/
@Override
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
if (!this.isEnabled()) {
sender.sendMessage("This plugin is Disabled!");
return true;
}
ArrayList<String> allArgs = new ArrayList<String>(Arrays.asList(args));
allArgs.add(0, command.getName());
return this.commandHandler.locateAndRunCommand(sender, allArgs, DisplayPermErrors);
}
/**
* {@inheritDoc}
*/
@Override
public void log(Level level, String msg) {
staticLog(level, msg);
}
/**
* Logs a message at the specified level.
*
* @param level The Log-{@link Level}.
* @param msg The message to log.
*/
public static void staticLog(Level level, String msg) {
if (level == Level.FINE && GlobalDebug >= 1) {
staticDebugLog(Level.INFO, msg);
return;
} else if (level == Level.FINER && GlobalDebug >= 2) {
staticDebugLog(Level.INFO, msg);
return;
} else if (level == Level.FINEST && GlobalDebug >= 3) {
staticDebugLog(Level.INFO, msg);
return;
} else if (level != Level.FINE && level != Level.FINER && level != Level.FINEST) {
LOGGER.log(level, String.format("%s %s", LOG_TAG, msg));
debugLog.log(level, String.format("%s %s", LOG_TAG, msg));
}
}
/**
* Print messages to the Debug Log, if the servers in Debug Mode then we also wan't to print the messages to the
* standard Server Console.
*
* @param level The Log-{@link Level}
* @param msg The message
*/
public static void staticDebugLog(Level level, String msg) {
LOGGER.log(level, "[MVCore-Debug] " + msg);
debugLog.log(level, "[MVCore-Debug] " + msg);
}
/**
* {@inheritDoc}
*/
@Override
public String getAuthors() {
String authors = "";
ArrayList<String> auths = this.getDescription().getAuthors();
if (auths.size() == 0) {
return "";
}
if (auths.size() == 1) {
return auths.get(0);
}
for (int i = 0; i < auths.size(); i++) {
if (i == this.getDescription().getAuthors().size() - 1) {
authors += " and " + this.getDescription().getAuthors().get(i);
} else {
authors += ", " + this.getDescription().getAuthors().get(i);
}
}
return authors.substring(2);
}
/**
* {@inheritDoc}
*/
@Override
public CommandHandler getCommandHandler() {
return this.commandHandler;
}
/**
* Gets the log-tag.
*
* @return The log-tag
*/
// TODO this should be static!
public String getTag() {
return MultiverseCore.LOG_TAG;
}
/**
* Shows a message that the given world is not a MultiverseWorld.
*
* @param sender The {@link CommandSender} that should receive the message
* @param worldName The name of the invalid world
*/
public void showNotMVWorldMessage(CommandSender sender, String worldName) {
sender.sendMessage("Multiverse doesn't know about " + ChatColor.DARK_AQUA + worldName + ChatColor.WHITE + " yet.");
sender.sendMessage("Type " + ChatColor.DARK_AQUA + "/mv import ?" + ChatColor.WHITE + " for help!");
}
/**
* Removes a player-session.
*
* @param player The {@link Player} that owned the session.
*/
public void removePlayerSession(Player player) {
if (this.playerSessions.containsKey(player.getName())) {
this.playerSessions.remove(player.getName());
}
}
/**
* {@inheritDoc}
*/
@Override
public int getPluginCount() {
return this.pluginCount;
}
/**
* {@inheritDoc}
*/
@Override
public void incrementPluginCount() {
this.pluginCount += 1;
}
/**
* {@inheritDoc}
*/
@Override
public void decrementPluginCount() {
this.pluginCount -= 1;
}
/**
* {@inheritDoc}
*/
@Override
public AllPay getBanker() {
return this.banker;
}
/**
* {@inheritDoc}
*/
@Override
public void setBank(GenericBank bank) {
this.bank = bank;
}
/**
* {@inheritDoc}
*/
@Override
public DestinationFactory getDestFactory() {
return this.destFactory;
}
/**
* This is a convenience method to allow the QueuedCommand system to call it. You should NEVER call this directly.
*
* @param teleporter The Person requesting that the teleport should happen.
* @param p Player The Person being teleported.
* @param l The potentially unsafe location.
*/
public void teleportPlayer(CommandSender teleporter, Player p, Location l) {
// This command is the override, and MUST NOT TELEPORT SAFELY
this.getTeleporter().safelyTeleport(teleporter, p, l, false);
}
/**
* Gets the server's root-folder as {@link File}.
*
* @return The server's root-folder
*/
public File getServerFolder() {
return serverFolder;
}
/**
* Sets this server's root-folder.
*
* @param newServerFolder The new server-root
*/
public void setServerFolder(File newServerFolder) {
if (!newServerFolder.isDirectory())
throw new IllegalArgumentException("That's not a folder!");
this.serverFolder = newServerFolder;
}
/**
* Initializes Spout.
*/
public void setSpout() {
this.spoutInterface = new SpoutInterface();
this.commandHandler.registerCommand(new SpoutCommand(this));
}
/**
* Gets our {@link SpoutInterface}.
*
* @return The {@link SpoutInterface} we're using.
*/
public SpoutInterface getSpout() {
return this.spoutInterface;
}
/**
* {@inheritDoc}
*/
@Override
public MVWorldManager getMVWorldManager() {
return this.worldManager;
}
/**
* Gets the {@link MVPlayerListener}.
*
* @return The {@link MVPlayerListener}.
*/
public MVPlayerListener getPlayerListener() {
return this.playerListener;
}
/**
* Saves the Multiverse-Config.
*
* @return Whether the Multiverse-Config was successfully saved
*/
public boolean saveMVConfig() {
try {
this.multiverseConfig.save(new File(getDataFolder(), "config.yml"));
return true;
} catch (IOException e) {
this.log(Level.SEVERE, "Could not save Multiverse config.yml config. Please check your file permissions.");
return false;
}
}
/**
* Saves the world config.
*
* @return Whether the world-config was successfully saved
*/
public boolean saveWorldConfig() {
return this.worldManager.saveWorldsConfig();
}
/**
* {@inheritDoc}
*/
@Override
public boolean saveMVConfigs() {
return this.saveMVConfig() && this.saveWorldConfig();
}
/**
* NOT deprecated for the time as queued commands use this.
* However, this is not in the API and other plugins should therefore not use it.
*
* @param name World to delete
* @return True if success, false if fail.
*/
public Boolean deleteWorld(String name) {
return this.worldManager.deleteWorld(name);
}
/**
* {@inheritDoc}
*/
@Override
public Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed) {
MultiverseWorld world = this.worldManager.getMVWorld(name);
if (world == null) {
return false;
}
List<Player> ps = world.getCBWorld().getPlayers();
if (useNewSeed) {
// Set the worldseed.
if (randomSeed) {
Random random = new Random();
Long newseed = random.nextLong();
seed = newseed.toString();
}
((WorldManager) this.worldManager).getConfigWorlds().set("worlds." + name + ".seed", seed);
}
if (this.worldManager.deleteWorld(name, false)) {
this.worldManager.loadWorlds(false);
SafeTTeleporter teleporter = this.getTeleporter();
Location newSpawn = this.getServer().getWorld(name).getSpawnLocation();
// Send all players that were in the old world, BACK to it!
for (Player p : ps) {
teleporter.safelyTeleport(null, p, newSpawn, true);
}
return true;
}
return false;
}
/**
* {@inheritDoc}
*/
@Override
public AnchorManager getAnchorManager() {
return this.anchorManager;
}
}
@@ -1,166 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.api;
import com.fernferret.allpay.AllPay;
import com.fernferret.allpay.GenericBank;
import com.onarandombox.MultiverseCore.destination.DestinationFactory;
import com.onarandombox.MultiverseCore.utils.*;
import com.pneumaticraft.commandhandler.CommandHandler;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
/**
* Multiverse 2 Core API
* <p>
* This API contains a bunch of useful things you can get out of Multiverse in general!
*/
public interface Core {
/**
* Gets the Multiverse config file.
*
* @return The Multiverse config file.
*/
FileConfiguration getMVConfiguration();
/**
* Gets the Banking system that Multiverse-Core has hooked into.
*
* @return A {@link GenericBank} that can be used for payments.
*/
GenericBank getBank();
/**
* Reloads the Multiverse Configuration files:
* worlds.yml and config.yml.
*/
void loadConfigs();
/**
* Gets the Multiverse message system. This allows you to send messages
* to users at specified intervals.
*
* @return The loaded {@link MVMessaging}.
*/
MVMessaging getMessaging();
/**
* Gets the {@link MVPlayerSession} for the given player.
* This will also create a player session if one does not exist
* for a player.
*
* @param player The player's session to grab.
*
* @return The corresponding {@link MVPlayerSession}.
*/
MVPlayerSession getPlayerSession(Player player);
/**
* Gets the instantiated Safe-T-Teleporter for performing
* safe teleports.
*
* @return A non-null {@link SafeTTeleporter}.
*/
SafeTTeleporter getTeleporter();
/**
* Multiverse uses an advanced permissions setup, this object
* simplifies getting/setting permissions.
*
* @return A non-null {@link MVPermissions}.
*/
MVPermissions getMVPerms();
/**
* Multiverse uses {@link CommandHandler} to make adding and using commands
* a piece of cake.
*
* @return A non-null {@link CommandHandler}.
*/
CommandHandler getCommandHandler();
/**
* Gets the factory class responsible for loading many different destinations
* on demand.
*
* @return A valid {@link DestinationFactory}.
*/
DestinationFactory getDestFactory();
/**
* Gets the primary class responsible for managing Multiverse Worlds.
*
* @return {@link WorldManager}.
*/
MVWorldManager getMVWorldManager();
/**
* Saves all configs.
*
* @return Whether the config was successfully saved
*/
boolean saveMVConfigs();
/**
* Gets the {@link AnchorManager}.
*
* @return The {@link AnchorManager}
*/
AnchorManager getAnchorManager();
/**
* Used by queued commands to regenerate a world on a delay.
*
* @param name Name of the world to regenerate
* @param useNewSeed If a new seed should be used
* @param randomSeed IF the new seed should be random
* @param seed The seed of the world.
*
* @return True if success, false if fail.
*/
Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed);
/**
* Sets the {@link GenericBank}-Bank AllPay is using.
*
* @param bank The new {@link GenericBank}
*/
void setBank(GenericBank bank);
/**
* Gets this plugin's {@link AllPay}-Banker.
*
* @return An {@link AllPay}-Banker
*/
AllPay getBanker();
/**
* Decrements the number of plugins that have specifically hooked into core.
*/
void decrementPluginCount();
/**
* Increments the number of plugins that have specifically hooked into core.
*/
void incrementPluginCount();
/**
* Returns the number of plugins that have specifically hooked into core.
*
* @return The number if plugins that have hooked into core.
*/
int getPluginCount();
/**
* Parse the Authors Array into a readable String with ',' and 'and'.
*
* @return The readable authors-{@link String}
*/
String getAuthors();
}
@@ -1,20 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.api;
/**
* A fancy text.
*/
public interface FancyText {
/**
* Gets the {@link String}-representation of this {@link FancyText}.
*
* @return The {@link String}-representation of this {@link FancyText}.
*/
String getFancyText();
}
@@ -1,30 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.api;
import org.bukkit.Server;
import java.util.logging.Level;
/** A simple API to require plugins to have a log method. */
public interface LoggablePlugin {
/**
* Logs a message at the specified level.
*
* @param level The Log-{@link Level}.
* @param msg The message to log.
*/
void log(Level level, String msg);
/**
* Gets the server instance that this plugin is attached to.
*
* @return A {@link Server} instance.
*/
Server getServer();
}
@@ -1,141 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.api;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
/**
* A destination API for Multiverse
* Any plugin can add these to MV and when they are, any action that uses them (portals, MVTP, etc.) can use them!
*/
public interface MVDestination {
/**
* Returns the identifier or prefix that is required for this destination.
* <p>
* Portals have a prefix of "p" for example and OpenWarp (third party plugin) uses "ow". This is derived from a
* hash and cannot have duplicate values. Read that as your plugin cannot use 'p' because it's already used.
* Please check the wiki when adding a custom destination!
*
* @return The identifier or prefix that is required for this destination.
*/
String getIdentifier();
/**
* Allows you to determine if a Destination is valid for the type it thinks it is.
* <p>
* An example of this would be the exact destination. A valid string would be: e:0,0,0 where an invalid one would
* be e:1:2:3. The first string would return true the second would return false. This is simply a convenience
* method
* and does not even NEED to be called, but it's highly recommended if you're teleporting, but it's mainly for
* Multiverse Internal use.
*
* @param plugin The plugin who the type belongs to.
* @param destination The destination string. ex: p:MyPortal:nw
*
* @return True if the destination is valid, false if not.
*/
boolean isThisType(JavaPlugin plugin, String destination);
/**
* Returns the location a specific entity will spawn at.
* <p>
* To just retrieve the location as it is stored you can just pass null, but be warned some destinations may return
* null back to you if you do this. It is always safer to pass an actual entity. This is used so things like
* minecarts can be teleported.
* <p>
* Do not forget to use {@link #getVelocity()} as destinations can use this too!
*
* @param entity The entity to be teleported.
*
* @return The location of the entity.
*/
Location getLocation(Entity entity);
/**
* Returns the velocity vector for this destination.
* <p>
* Plugins wishing to fully support MVDestinations MUST implement this.
*
* @return A vector representing the speed/direction the player should travel when arriving
*/
Vector getVelocity();
/**
* Sets the destination string.
* <p>
* This should be used when you want to tell this destination object about a change in where it should take people.
* The destination param should be match the result from {@link #getIdentifier()}. A valid example would be that if
* {@link #getIdentifier()} returned "ow" our destination string could be "ow:TownCenter" but could not be
* "p:HomePortal"
*
* @param plugin The plugin who the type belongs to.
* @param destination The destination string. ex: p:MyPortal:nw
*/
void setDestination(JavaPlugin plugin, String destination);
/**
* Returns true if the destination is valid and players will be taken to it.
* <p>
* Even if destinations are in the correct format (p:MyPortal) MyPortal may not exist, and therefore this would
* return false.
*
* @return True if the destination is valid; false if not.
*/
boolean isValid();
/**
* Gives you a general friendly description of the type of destination.
* <p>
* For example, the PlayerDestination sets this to "Player". You can use this to show where a player will be taken.
*
* @return A friendly string description of the type of destination.
*/
String getType();
/**
* Gives you a specific name of the destination.
* <p>
* For example, the PlayerDestination sets this to The Player's Name.
*
* @return A friendly string stating the name of the destination.
*/
String getName();
/**
* Returns a string that can easily be saved in the config that contains all the details needed to rebuild this
* destination.
* <p>
* ex: e:0,0,0:50:50
*
* @return The savable config string.
*/
String toString();
/**
* Returns the permissions string required to go here.
* <p>
* ex: multiverse.access.world
* <p>
* NOTE: This is NOT the permission to use the teleport command.
*
* @return the permissions string required to go here.
*/
String getRequiredPermission();
/**
* Should the Multiverse SafeTeleporter be used?
* <p>
* If not, MV will blindly take people to the location specified.
*
* @return True if the SafeTeleporter will be used, false if not.
*/
boolean useSafeTeleporter();
}
@@ -1,52 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.api;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.event.MVVersionEvent;
/**
* This interface is implemented by every official Multiverse-plugin.
*/
public interface MVPlugin extends LoggablePlugin {
/**
* Adds This plugin's version information to the buffer and returns the new string.
*
* @param buffer The string that contains Core and all other MV plugins' versions.
*
* @return A modified buffer that contains this MVPlugin's version information.
*
* @deprecated This is now deprecated, nobody needs it any longer.
* All version info-dumping is now done with {@link MVVersionEvent}.
*/
@Deprecated
String dumpVersionInfo(String buffer);
/**
* Gets the reference to MultiverseCore.
*
* @return A valid {@link MultiverseCore}.
*/
MultiverseCore getCore();
/**
* Sets the reference to MultiverseCore.
*
* @param core A valid {@link MultiverseCore}.
*/
void setCore(MultiverseCore core);
/**
* Allows Multiverse or a plugin to query another Multiverse plugin to see what version its protocol is. This
* number
* should change when something will break the code.
*
* @return The Integer protocol version.
*/
int getProtocolVersion();
}
@@ -1,230 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.api;
import com.onarandombox.MultiverseCore.utils.PurgeWorlds;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.WorldType;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.generator.ChunkGenerator;
import java.io.File;
import java.util.Collection;
import java.util.List;
/**
* Multiverse 2 World Manager API
* <p>
* This API contains all of the world managing
* functions that your heart desires!
*/
public interface MVWorldManager {
/**
* Add a new World to the Multiverse Setup.
*
* @param name World Name
* @param env Environment Type
* @param seedString The seed in the form of a string.
* If the seed is a Long,
* it will be interpreted as such.
* @param type The Type of the world to be made.
* @param generator The Custom generator plugin to use.
* @return True if the world is added, false if not.
*/
boolean addWorld(String name, Environment env, String seedString, WorldType type, String generator);
/**
* Add a new World to the Multiverse Setup.
*
* @param name World Name
* @param env Environment Type
* @param seedString The seed in the form of a string.
* If the seed is a Long,
* it will be interpreted as such.
* @param type The Type of the world to be made.
* @param generator The Custom generator plugin to use.
* @param useSpawnAdjust If true, multiverse will search for a safe spawn. If not, It will not modify the level.dat.
* @return True if the world is added, false if not.
*/
boolean addWorld(String name, Environment env, String seedString, WorldType type, String generator, boolean useSpawnAdjust);
/**
* Remove the world from the Multiverse list, from the
* config and deletes the folder.
*
* @param name The name of the world to remove
* @return True if success, false if failure.
*/
boolean deleteWorld(String name);
/**
* Remove the world from the Multiverse list, from the
* config if wanted, and deletes the folder.
*
* @param name The name of the world to remove
* @param removeConfig If true(default), we'll remove the entries from the
* config. If false, they'll stay and the world may come back.
* @return True if success, false if failure.
*/
boolean deleteWorld(String name, boolean removeConfig);
/**
* Unload a world from Multiverse.
*
* @param name Name of the world to unload
* @return True if the world was unloaded, false if not.
*/
boolean unloadWorld(String name);
/**
* Loads the world. Only use this if the world has been
* unloaded with {@link #unloadWorld(String)}.
*
* @param name The name of the world to load
* @return True if success, false if failure.
*/
boolean loadWorld(String name);
/**
* Removes all players from the specified world.
*
* @param name World to remove players from.
*/
void removePlayersFromWorld(String name);
/**
* Test if a given chunk generator is valid.
*
* @param generator The generator name.
* @param generatorID The generator id.
* @param worldName The worldName to use as the default.
* @return A {@link ChunkGenerator} or null
*/
ChunkGenerator getChunkGenerator(String generator, String generatorID, String worldName);
/**
* Returns a list of all the worlds Multiverse knows about.
*
* @return A list of {@link MultiverseWorld}.
*/
Collection<MultiverseWorld> getMVWorlds();
/**
* Returns a {@link MultiverseWorld} if it exists, and null if it does not.
* This will search name AND alias.
*
* @param name The name or alias of the world to get.
* @return A {@link MultiverseWorld} or null.
*/
MultiverseWorld getMVWorld(String name);
/**
* Returns a {@link MultiverseWorld} if it exists, and null if it does not.
*
* @param world The Bukkit world to check.
* @return A {@link MultiverseWorld} or null.
*/
MultiverseWorld getMVWorld(World world);
/**
* Checks to see if the given name is a valid {@link MultiverseWorld}.
*
* @param name The name or alias of the world to check.
* @return True if the world exists, false if not.
*/
boolean isMVWorld(String name);
/**
* Checks to see if the given world is a valid {@link MultiverseWorld}.
*
* @param world The Bukkit world to check.
* @return True if the world has been loaded into MV2, false if not.
*/
boolean isMVWorld(World world);
/**
* Load the Worlds & Settings from the configuration file.
*
* @param forceLoad If set to true, this will perform a total
* reset and not just load new worlds.
*/
void loadWorlds(boolean forceLoad);
/**
* Loads the Worlds & Settings for any worlds that bukkit loaded before us.
* <p>
* This way people will _always_ have some worlds in the list.
*/
void loadDefaultWorlds();
/**
* Return the World Purger.
*
* @return A valid {@link PurgeWorlds}.
*/
PurgeWorlds getWorldPurger();
/**
* Gets the world players will spawn in on first join.
* Currently this always returns worlds.get(0) from Bukkit.
*
* @return A Multiverse world that players will spawn in or null if no MV world has been set.
*/
MultiverseWorld getSpawnWorld();
/**
* Gets the list of worlds in the config, but unloaded.
*
* @return A List of worlds as strings.
*/
List<String> getUnloadedWorlds();
/**
* This method populates an internal list and needs to be called after multiverse initialization.
*/
void getDefaultWorldGenerators();
/**
* Load the config from a file.
*
* @param file The file to load.
* @return A loaded configuration.
*/
FileConfiguration loadWorldConfig(File file);
/**
* Saves the world config to disk.
*
* @return True if success, false if fail.
*/
boolean saveWorldsConfig();
/**
* Remove the world from the Multiverse list and from the config.
*
* @param name The name of the world to remove
* @return True if success, false if failure.
*/
boolean removeWorldFromConfig(String name);
/**
* Sets the initial spawn world for new players.
*
* @param world The World new players should spawn in.
*/
void setFirstSpawnWorld(String world);
/**
* Gets the world players should spawn in first.
*
* @return The {@link MultiverseWorld} new players should spawn in.
*/
MultiverseWorld getFirstSpawnWorld();
}
@@ -1,576 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.api;
import com.onarandombox.MultiverseCore.configuration.MVConfigProperty;
import com.onarandombox.MultiverseCore.exceptions.PropertyDoesNotExistException;
import org.bukkit.ChatColor;
import org.bukkit.Difficulty;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.WorldType;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permission;
import java.util.List;
/**
* The API for a Multiverse Handled World.
*/
public interface MultiverseWorld {
/**
* Returns the Bukkit world object that this world describes.
*
* @return A {@link World}
*/
World getCBWorld();
/**
* Adds the property to the given value.
* It will throw a PropertyDoesNotExistException if the property is not found.
*
* @param property The name of a world property to set.
* @param value A value in string representation, it will be parsed to the correct type.
* @param sender The sender who wants this value to be set.
* @return True if the value was set, false if not.
* @throws PropertyDoesNotExistException Thrown if the property was not found in the world.
*/
boolean setProperty(String property, String value, CommandSender sender) throws PropertyDoesNotExistException;
/**
* Gets the actual MVConfigProperty from this world.
* It will throw a PropertyDoesNotExistException if the property is not found.
*
* @param property The name of a world property to get.
* @return A valid MVWorldProperty.
* @throws PropertyDoesNotExistException Thrown if the property was not found in the world.
* @deprecated Use {@link #getProperty(String, Class)} instead
*/
@Deprecated
MVConfigProperty<?> getProperty(String property) throws PropertyDoesNotExistException;
/**
* Gets the string representation of a property.
* It will throw a PropertyDoesNotExistException if the property is not found.
*
* @param property The name of a world property to get.
* @return A valid MVWorldProperty.
* @throws PropertyDoesNotExistException Thrown if the property was not found in the world.
*/
String getPropertyValue(String property) throws PropertyDoesNotExistException;
/**
* Gets the actual MVConfigProperty from this world.
* It will throw a PropertyDoesNotExistException if the property is not found.
*
* @param property The name of a world property to get.
* @param expected The type of the expected property. Use Object.class if this doesn't matter for you.
* @param <T> The type of the expected property.
*
* @return A valid MVWorldProperty.
*
* @throws PropertyDoesNotExistException Thrown if the property was not found in the world.
*/
<T> MVConfigProperty<T> getProperty(String property, Class<T> expected) throws PropertyDoesNotExistException;
/**
* Removes all values from the given property. The property must be a {@link com.onarandombox.MultiverseCore.enums.AddProperties}.
*
* @param property The name of a {@link com.onarandombox.MultiverseCore.enums.AddProperties} to clear.
* @return True if it was cleared, false if not.
*/
boolean clearVariable(String property);
/**
* Adds a value to the given property. The property must be a {@link com.onarandombox.MultiverseCore.enums.AddProperties}.
*
* @param property The name of a {@link com.onarandombox.MultiverseCore.enums.AddProperties} to add a value to.
* @param value A value in string representation, it will be parsed to the correct type.
* @return True if the value was added, false if not.
*/
boolean addToVariable(String property, String value);
/**
* Removes a value from the given property. The property must be a {@link com.onarandombox.MultiverseCore.enums.AddProperties}.
*
* @param property The name of a {@link com.onarandombox.MultiverseCore.enums.AddProperties} to remove a value
* from.
* @param value A value in string representation, it will be parsed to the correct type.
* @return True if the value was removed, false if not.
*/
boolean removeFromVariable(String property, String value);
/**
* Gets the environment of this world.
*
* @return A {@link org.bukkit.World.Environment}.
*/
World.Environment getEnvironment();
/**
* Sets the environment of a world.
* <p>
* Note: This will ONLY take effect once the world is unloaded/reloaded.
*
* @param environment A {@link org.bukkit.World.Environment}.
*/
void setEnvironment(World.Environment environment);
/**
* Gets the world seed of this world.
*
* @return The Long version of the seed.
*/
Long getSeed();
/**
* Sets the seed of this world.
*
* @param seed A Long that is the seed.
*/
void setSeed(Long seed);
/**
* Gets the name of this world. This cannot be changed.
*
* @return The name of the world as a String.
*/
String getName();
/**
* Gets the lowercased name of the world. This method is required, since the permissables
* lowercase all permissions when recalculating.
* <p>
* Note: This also means if a user has worlds named: world and WORLD, that they can both
* exist, and both be teleported to independently, but their permissions **cannot** be
* uniqueified at this time. See bug report #.
*
* @return The lowercased name of the world.
*/
String getPermissibleName();
/**
* Gets the alias of this world.
* <p>
* This alias allows users to have a world named "world" but show up in the list as "FernIsland"
*
* @return The alias of the world as a String.
*/
String getAlias();
/**
* Sets the alias of the world.
*
* @param alias A string that is the new alias.
*/
void setAlias(String alias);
/**
* Sets the color that this world's name/alias will display as.
*
* @param color A valid color name.
* @return True if the color was set, false if not.
*/
boolean setColor(String color);
/**
* Gets the color that this world's name/alias will display as.
*
* @return The color of this world.
*/
ChatColor getColor();
/**
* Tells you if someone entered a valid color.
*
* @param color A string that may translate to a color.
* @return True if it is a color, false if not.
*/
boolean isValidAliasColor(String color);
/**
* Returns a very nicely colored string (using Alias and Color if they are set).
*
* @return A nicely colored string.
*/
String getColoredWorldString();
/**
* Gets whether or not animals are allowed to spawn in this world.
*
* @return True if ANY animal can, false if no animals can spawn.
*/
boolean canAnimalsSpawn();
/**
* Gets whether or not monsters are allowed to spawn in this world.
*
* @return True if ANY monster can, false if no monsters can spawn.
*/
boolean canMonstersSpawn();
/**
* Turn pvp on or off. This setting is used to set the world's PVP mode, and thus relies on fakePVP
*
* @param pvpMode True to enable PVP damage, false to disable it.
*/
void setPVPMode(boolean pvpMode);
/**
* Turn pvp on or off. This setting is used to set the world's PVP mode, and thus relies on fakePVP
*
* @return True if this world has fakepvp on
* @deprecated This is deprecated.
*/
@Deprecated
boolean getFakePVP();
/**
* Gets whether or not PVP is enabled in this world in some form (fake or not).
*
* @return True if players can take damage from other players.
*/
boolean isPVPEnabled();
/**
* Gets whether or not this world will display in chat, mvw and mvl regardless if a user has the
* access permissions to go to this world.
*
* @return True if the world will be hidden, false if not.
*/
boolean isHidden();
/**
* Sets whether or not this world will display in chat, mvw and mvl regardless if a user has the
* access permissions to go to this world.
*
* @param hidden Set
*/
void setHidden(boolean hidden);
/**
* Sets whether or not there will be weather events in a given world.
* If set to false, Multiverse will disable the weather in the world immediately.
*
* @param enableWeather True if weather events should occur in a world, false if not.
*/
void setEnableWeather(boolean enableWeather);
/**
* Gets whether weather is enabled in this world.
*
* @return True if weather events will occur, false if not.
*/
boolean isWeatherEnabled();
/**
* If true, tells Craftbukkit to keep a worlds spawn chunks loaded in memory (default: true)
* If not, CraftBukkit will attempt to free memory when players have not used that world.
* This will not happen immediately.
*
* @param keepSpawnInMemory If true, CraftBukkit will keep the spawn chunks loaded in memory.
*/
void setKeepSpawnInMemory(boolean keepSpawnInMemory);
/**
* Gets whether or not CraftBukkit is keeping the chunks for this world in memory.
*
* @return True if CraftBukkit is keeping spawn chunks in memory.
*/
boolean isKeepingSpawnInMemory();
/**
* Sets the difficulty of this world and returns true if success.
* Valid string values are either an integer of difficulty(0-3) or
* the name that resides in the Bukkit enum, ex. PEACEFUL
*
* @param difficulty The difficulty to set the world to as a string.
* @return True if success, false if the provided string
* could not be translated to a difficulty.
*/
boolean setDifficulty(String difficulty);
/**
* Gets the difficulty of this world.
*
* @return The difficulty of this world.
*/
Difficulty getDifficulty();
/**
* Sets the spawn location for a world.
*
* @param spawnLocation The spawn location for a world.
*/
void setSpawnLocation(Location spawnLocation);
/**
* Gets the spawn location of this world.
*
* @return The spawn location of this world.
*/
Location getSpawnLocation();
/**
* Sets whether or not the hunger level of players will go down in a world.
*
* @param hungerEnabled True if hunger will go down, false to keep it at
* the level they entered a world with.
*/
void setHunger(boolean hungerEnabled);
/**
* Gets whether or not the hunger level of players will go down in a world.
*
* @return True if it will go down, false if it will remain steady.
*/
boolean getHunger();
/**
* Sets the game mode of this world.
*
* @param gameMode A valid game mode string (either
* an int ex. 0 or a string ex. creative).
* @return True if the game mode was successfully changed, false if not.
*/
boolean setGameMode(String gameMode);
/**
* Gets the GameMode of this world.
*
* @return The GameMode of this world.
*/
GameMode getGameMode();
/**
* Gets the permission required to enter this world.
*
* @return The permission required to be exempt from charges to/from this world.
*/
Permission getAccessPermission();
/**
* Gets the permission required to be exempt when entering.
*
* @return The permission required to be exempt when entering.
*/
Permission getExemptPermission();
/**
* Sets the price for entry to this world.
* You can think of this like an amount.
* The type can be set with {@link #setCurrency(int)}
*
* @param price The Amount of money/item to enter the world.
*/
void setPrice(double price);
/**
* Gets the amount of currency it requires to enter this world.
*
* @return The amount it costs to enter this world.
*/
double getPrice();
/**
* Sets the type of item that will be required given the price is not 0.
* Use -1 to use an AllPay economy, or any valid itemid
*
* @param item The Type of currency that will be used when users enter this world.
*/
void setCurrency(int item);
/**
* Gets the Type of currency that will be used when users enter this world.
*
* @return The Type of currency that will be used when users enter this world.
*/
int getCurrency();
/**
* Sets the world players will respawn in if they die in this one.
* Returns true upon success, false upon failure.
*
* @param respawnWorld The name of a world that exists on the server.
* @return True if respawnWorld existed, false if not.
*/
boolean setRespawnToWorld(String respawnWorld);
/**
* Gets the world players will respawn in if they die in this one.
*
* @return A world that exists on the server.
*/
World getRespawnToWorld();
/**
* Sets the scale of this world. Really only has an effect if you use
* Multiverse-NetherPortals.
*
* @param scaling A scaling value, cannot be negative or 0.
* @return Whether the scale was set successfully.
*/
boolean setScaling(double scaling);
/**
* Gets the scaling value of this world.Really only has an effect if you use
* Multiverse-NetherPortals.
*
* @return This world's non-negative, non-zero scale.
*/
double getScaling();
/**
* Gets a list of all the worlds that players CANNOT travel to from this world,
* regardless of their access permissions.
*
* @return A List of world names.
*/
List<String> getWorldBlacklist();
/**
* Returns a list of animals. This list always negates the {@link #canAnimalsSpawn()} result.
*
* @return A list of animals that will spawn if {@link #canAnimalsSpawn()} is false.
*/
List<String> getAnimalList();
/**
* Sets whether or not animals can spawn.
* If there are values in {@link #getAnimalList()} and this is false,
* those animals become the exceptions, and will spawn
*
* @param allowAnimalSpawn True to allow spawning of monsters, false to prevent.
*/
void setAllowAnimalSpawn(boolean allowAnimalSpawn);
/**
* Returns a list of monsters. This list always negates the {@link #canMonstersSpawn()} ()} result.
*
* @return A list of monsters that will spawn if {@link #canMonstersSpawn()} is false.
*/
List<String> getMonsterList();
/**
* Sets whether or not monsters can spawn.
* If there are values in {@link #getMonsterList()} and this is false,
* those monsters become the exceptions, and will spawn
*
* @param allowMonsterSpawn True to allow spawning of monsters, false to prevent.
*/
void setAllowMonsterSpawn(boolean allowMonsterSpawn);
/**
* Clears a list property (sets it to []).
*
* @param property The property to clear.
* @return True if success, false if fail.
*/
boolean clearList(String property);
/**
* Sets whether or not a world will auto-heal players if the difficulty is on peaceful.
*
* @param heal True if the world will heal.
*/
void setAutoHeal(boolean heal);
/**
* Gets whether or not a world will auto-heal players if the difficulty is on peaceful.
*
* @return True if the world should heal (default), false if not.
*/
boolean getAutoHeal();
/**
* Sets whether or not Multiverse should auto-adjust the spawn for this world.
*
* @param adjust True if multiverse should adjust the spawn, false if not.
*/
void setAdjustSpawn(boolean adjust);
/**
* Gets whether or not Multiverse should auto-adjust the spawn for this world.
*
* @return True if Multiverse should adjust the spawn, false if not.
*/
boolean getAdjustSpawn();
/**
* Sets whether or not Multiverse should auto-load this world.
* <p>
* True is default.
*
* @param autoLoad True if multiverse should autoload this world the spawn, false if not.
*/
void setAutoLoad(boolean autoLoad);
/**
* Gets whether or not Multiverse should auto-load this world.
*
* @return True if Multiverse should auto-load this world.
*/
boolean getAutoLoad();
/**
* Sets whether or not a player who dies in this world will respawn in their
* bed or follow the normal respawn pattern.
* <p>
* True is default.
*
* @param autoLoad True if players dying in this world respawn at their bed.
*/
void setBedRespawn(boolean autoLoad);
/**
* Gets whether or not a player who dies in this world will respawn in their
* bed or follow the normal respawn pattern.
*
* @return True if players dying in this world should respawn at their bed.
*/
boolean getBedRespawn();
/**
* Gets all the names of all properties that can be SET.
*
* @return All property names, with alternating colors.
*/
String getAllPropertyNames();
/**
* Sets the current time in a world.
* <p>
* This method will take the following formats:
* 11:37am
* 4:30p
* day(morning), night, noon, midnight
*
* @param timeAsString The formatted time to set the world to.
* @return True if the time was set, false if not.
*/
boolean setTime(String timeAsString);
/**
* Same as {@link #getTime()}, but returns a string.
* @return The time as a short string: 12:34pm
*/
String getTime();
/**
* Gets the type of this world. As of 1.1-R1 this will be:
* FLAT or NORMAL
* <p>
* This is *not* the generator.
*
* @return The Type of this world.
*/
WorldType getWorldType();
}
@@ -1,5 +0,0 @@
/**
* The Multiverse-API, containing lots of interfaces that can be quite useful for other
* plugins when interacting with Multiverse.
*/
package com.onarandombox.MultiverseCore.api;
@@ -1,138 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.List;
/**
* Allows management of Anchor Destinations.
*/
public class AnchorCommand extends PaginatedCoreCommand<String> {
public AnchorCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Create, Delete and Manage Anchor Destinations.");
this.setCommandUsage("/mv anchor " + ChatColor.GREEN + "{name}" + ChatColor.GOLD + " [-d]");
this.setArgRange(0, 2);
this.addKey("mv anchor");
this.addKey("mv anchors");
this.addKey("mvanchor");
this.addKey("mvanchors");
this.addCommandExample("/mv anchor " + ChatColor.GREEN + "awesomething");
this.addCommandExample("/mv anchor " + ChatColor.GREEN + "otherthing");
this.addCommandExample("/mv anchor " + ChatColor.GREEN + "awesomething " + ChatColor.RED + "-d");
this.addCommandExample("/mv anchors ");
this.setPermission("multiverse.core.anchor", "Allows management of Anchor Destinations.", PermissionDefault.OP);
this.setItemsPerPage(8); // SUPPRESS CHECKSTYLE: MagicNumberCheck
}
private List<String> getFancyAnchorList(Player p) {
List<String> anchorList = new ArrayList<String>();
ChatColor color = ChatColor.GREEN;
for (String anchor : this.plugin.getAnchorManager().getAnchors(p)) {
anchorList.add(color + anchor);
color = (color == ChatColor.GREEN) ? ChatColor.GOLD : ChatColor.GREEN;
}
return anchorList;
}
private void showList(CommandSender sender, List<String> args) {
sender.sendMessage(ChatColor.LIGHT_PURPLE + "====[ Multiverse Anchor List ]====");
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
FilterObject filterObject = this.getPageAndFilter(args);
List<String> availableAnchors = new ArrayList<String>(this.getFancyAnchorList(p));
if (filterObject.getFilter().length() > 0) {
availableAnchors = this.getFilteredItems(availableAnchors, filterObject.getFilter());
if (availableAnchors.size() == 0) {
sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE
+ "No anchors matched your filter: " + ChatColor.AQUA + filterObject.getFilter());
return;
}
} else {
if (availableAnchors.size() == 0) {
sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE + "No anchors were defined.");
return;
}
}
if (!(sender instanceof Player)) {
for (String c : availableAnchors) {
sender.sendMessage(c);
}
return;
}
int totalPages = (int) Math.ceil(availableAnchors.size() / (this.itemsPerPage + 0.0));
if (filterObject.getPage() > totalPages) {
filterObject.setPage(totalPages);
}
sender.sendMessage(ChatColor.AQUA + " Page " + filterObject.getPage() + " of " + totalPages);
this.showPage(filterObject.getPage(), sender, availableAnchors);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (args.size() == 0) {
this.showList(sender, args);
return;
}
if (args.size() == 2) {
if (this.plugin.getAnchorManager().deleteAnchor(args.get(0))) {
sender.sendMessage("Anchor '" + args.get(0) + "' was successfully " + ChatColor.RED + "deleted!");
} else {
sender.sendMessage("Anchor '" + args.get(0) + "' was " + ChatColor.RED + " NOT " + ChatColor.WHITE + "deleted!");
}
return;
}
if (!(sender instanceof Player)) {
sender.sendMessage("You must be a player to create Anchors.");
return;
}
Player player = (Player) sender;
if (this.plugin.getAnchorManager().saveAnchorLocation(args.get(0), player.getLocation())) {
sender.sendMessage("Anchor '" + args.get(0) + "' was successfully " + ChatColor.GREEN + "created!");
} else {
sender.sendMessage("Anchor '" + args.get(0) + "' was " + ChatColor.RED + " NOT " + ChatColor.WHITE + "created!");
}
}
@Override
protected List<String> getFilteredItems(List<String> availableItems, String filter) {
List<String> filtered = new ArrayList<String>();
for (String s : availableItems) {
if (s.matches("(?i).*" + filter + ".*")) {
filtered.add(s);
}
}
return filtered;
}
@Override
protected String getItemText(String item) {
return item;
}
}
@@ -1,62 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.destination.InvalidDestination;
import com.onarandombox.MultiverseCore.utils.MVPermissions;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Checks to see if a player can go to a destination.
*/
public class CheckCommand extends MultiverseCommand {
public CheckCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Help you validate your multiverse settings");
this.setCommandUsage("/mv check " + ChatColor.GREEN + "{PLAYER} {DESTINATION}");
this.setArgRange(2, 2);
this.addKey("mv check");
this.addKey("mvcheck");
this.addCommandExample("/mv check " + ChatColor.GREEN + "fernferret " + ChatColor.LIGHT_PURPLE + "w:MyWorld");
this.addCommandExample("/mv check " + ChatColor.GREEN + "Rigby90 " + ChatColor.LIGHT_PURPLE + "p:MyPortal");
this.addCommandExample("/mv check " + ChatColor.GREEN + "lithium3141 " + ChatColor.LIGHT_PURPLE + "ow:WarpName");
this.setPermission("multiverse.core.debug", "Checks to see if a player can go to a destination. Prints debug if false.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
Player p = this.plugin.getServer().getPlayer(args.get(0));
if (p == null) {
sender.sendMessage("Could not find player " + ChatColor.GREEN + args.get(0));
sender.sendMessage("Are they online?");
return;
}
MVDestination dest = this.plugin.getDestFactory().getDestination(args.get(1));
if (dest instanceof InvalidDestination) {
sender.sendMessage("You asked if '" + args.get(0) + "' could go to " + ChatColor.GREEN + args.get(0) + ChatColor.WHITE + ",");
sender.sendMessage("but I couldn't find a Destination of that name? Did you type it correctly?");
return;
}
MVPermissions perms = this.plugin.getMVPerms();
if (perms.canEnterDestination(p, dest)) {
sender.sendMessage(ChatColor.GREEN + args.get(0) + ChatColor.WHITE + " can travel to " + ChatColor.GREEN + args.get(1));
} else {
sender.sendMessage(ChatColor.AQUA + args.get(0) + ChatColor.RED + " CANNOT travel to " + ChatColor.AQUA + args.get(1));
sender.sendMessage("Please turn debug mode to 3 then watch the console to find out why!");
sender.sendMessage("Use: " + ChatColor.GREEN + "/mv debug 3");
}
}
}
@@ -1,97 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.enums.ConfigProperty;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Allows you to set Global MV Variables.
*/
public class ConfigCommand extends MultiverseCommand {
public ConfigCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Configuration");
this.setCommandUsage("/mv config " + ChatColor.GREEN + "{PROPERTY} {VALUE}");
this.setArgRange(1, 2);
this.addKey("mv config");
this.addKey("mvconfig");
this.addKey("mv conf");
this.addKey("mvconf");
this.addCommandExample("All values: " + ConfigProperty.getAllValues());
this.addCommandExample("/mv config show");
this.addCommandExample("/mv config " + ChatColor.GREEN + "debug" + ChatColor.AQUA + " 3");
this.addCommandExample("/mv config " + ChatColor.GREEN + "enforceaccess" + ChatColor.AQUA + " false");
this.setPermission("multiverse.core.config", "Allows you to set Global MV Variables.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (args.size() <= 1) {
String[] allProps = ConfigProperty.getAllValues().split(" ");
String currentvals = "";
for (String prop : allProps) {
currentvals += ChatColor.GREEN;
currentvals += prop;
currentvals += ChatColor.WHITE;
currentvals += " = ";
currentvals += ChatColor.GOLD;
currentvals += this.plugin.getMVConfiguration().get(prop, "NOT SET");
currentvals += ChatColor.WHITE;
currentvals += ", ";
}
sender.sendMessage(currentvals.substring(0, currentvals.length() - 2));
return;
}
if (args.get(0).equalsIgnoreCase("firstspawnworld")) {
this.plugin.getMVConfiguration().set(args.get(0).toLowerCase(), args.get(1));
// Don't forget to set the world!
this.plugin.getMVWorldManager().setFirstSpawnWorld(args.get(1));
} else if (args.get(0).equalsIgnoreCase("messagecooldown") || args.get(0).equalsIgnoreCase("teleportcooldown")
|| args.get(0).equalsIgnoreCase("debug")) {
try {
this.plugin.getMVConfiguration().set(args.get(0).toLowerCase(), Integer.parseInt(args.get(1)));
} catch (NumberFormatException e) {
sender.sendMessage(ChatColor.RED + "Sorry, " + ChatColor.AQUA + args.get(0) + ChatColor.WHITE + " must be an integer!");
return;
}
} else {
ConfigProperty property = null;
try {
property = ConfigProperty.valueOf(args.get(0).toLowerCase());
} catch (IllegalArgumentException e) {
sender.sendMessage(ChatColor.RED + "Sorry, " + ChatColor.AQUA
+ args.get(0) + ChatColor.WHITE + " you can't set " + ChatColor.AQUA + args.get(0));
sender.sendMessage(ChatColor.GREEN + "Valid values are:");
sender.sendMessage(ConfigProperty.getAllValues());
return;
}
if (property != null) {
try {
this.plugin.getMVConfiguration().set(args.get(0).toLowerCase(), Boolean.parseBoolean(args.get(1)));
} catch (Exception e) {
sender.sendMessage(ChatColor.RED + "Sorry, " + ChatColor.AQUA + args.get(0) + ChatColor.WHITE + " must be true or false!");
return;
}
}
}
if (this.plugin.saveMVConfigs()) {
sender.sendMessage(ChatColor.GREEN + "SUCCESS!" + ChatColor.WHITE + " Values were updated successfully!");
this.plugin.loadConfigs();
} else {
sender.sendMessage(ChatColor.RED + "FAIL!" + ChatColor.WHITE + " Check your console for details!");
}
}
}
@@ -1,39 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Confirms actions.
*/
public class ConfirmCommand extends MultiverseCommand {
public ConfirmCommand(MultiverseCore plugin) {
super(plugin);
// Any command that is dangerous should require op
this.setName("Confirms a command that could destroy life, the universe and everything.");
this.setCommandUsage("/mv confirm");
this.setArgRange(0, 0);
this.addKey("mvconfirm");
this.addKey("mv confirm");
this.addCommandExample("/mv confirm");
this.setPermission("multiverse.core.confirm", "If you have not been prompted to use this, it will not do anything.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
this.plugin.getCommandHandler().confirmQueuedCommand(sender);
}
}
@@ -1,71 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.utils.LocationManipulation;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.text.DecimalFormat;
import java.util.List;
/**
* Returns detailed information on the Players where abouts.
*/
public class CoordCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public CoordCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Coordinates");
this.setCommandUsage("/mv coord");
this.setArgRange(0, 0);
this.addKey("mv coord");
this.addKey("mvcoord");
this.addKey("mvco");
this.addCommandExample("/mv coord");
this.setPermission("multiverse.core.coord", "Returns detailed information on the Players where abouts.", PermissionDefault.OP);
this.worldManager = this.plugin.getMVWorldManager();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// Check if the command was sent from a Player.
if (sender instanceof Player) {
Player p = (Player) sender;
World world = p.getWorld();
if (!this.worldManager.isMVWorld(world.getName())) {
this.plugin.showNotMVWorldMessage(sender, world.getName());
return;
}
MultiverseWorld mvworld = this.worldManager.getMVWorld(world.getName());
p.sendMessage(ChatColor.AQUA + "--- Location Information ---");
p.sendMessage(ChatColor.AQUA + "World: " + ChatColor.WHITE + world.getName());
p.sendMessage(ChatColor.AQUA + "Alias: " + mvworld.getColoredWorldString());
p.sendMessage(ChatColor.AQUA + "World Scale: " + ChatColor.WHITE + mvworld.getScaling());
DecimalFormat df = new DecimalFormat();
df.setMinimumFractionDigits(0);
df.setMaximumFractionDigits(2);
p.sendMessage(ChatColor.AQUA + "Coordinates: " + ChatColor.WHITE + LocationManipulation.strCoords(p.getLocation()));
p.sendMessage(ChatColor.AQUA + "Direction: " + ChatColor.WHITE + LocationManipulation.getDirection(p.getLocation()));
p.sendMessage(ChatColor.AQUA + "Block: " + ChatColor.WHITE + Material.getMaterial(world.getBlockTypeIdAt(p.getLocation())));
} else {
sender.sendMessage("This command needs to be used from a Player.");
}
}
}
@@ -1,93 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.pneumaticraft.commandhandler.CommandHandler;
import org.bukkit.ChatColor;
import org.bukkit.World.Environment;
import org.bukkit.WorldType;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.io.File;
import java.util.List;
/**
* Creates a new world and loads it.
*/
public class CreateCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public CreateCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Create World");
this.setCommandUsage("/mv create" + ChatColor.GREEN + " {NAME} {ENV}" + ChatColor.GOLD + " -s [SEED] -g [GENERATOR[:ID]] -t [WORLDTYPE] [-n]");
this.setArgRange(2, 9); // SUPPRESS CHECKSTYLE: MagicNumberCheck
this.addKey("mvcreate");
this.addKey("mvc");
this.addKey("mv create");
this.setPermission("multiverse.core.create", "Creates a new world and loads it.", PermissionDefault.OP);
this.addCommandExample("/mv create " + ChatColor.GOLD + "world" + ChatColor.GREEN + " normal");
this.addCommandExample("/mv create " + ChatColor.GOLD + "lavaland" + ChatColor.RED + " nether");
this.addCommandExample("/mv create " + ChatColor.GOLD + "starwars" + ChatColor.AQUA + " end");
this.addCommandExample("/mv create " + ChatColor.GOLD + "flatroom" + ChatColor.GREEN + " normal" + ChatColor.AQUA + " -t flat");
this.addCommandExample("/mv create " + ChatColor.GOLD + "gargamel" + ChatColor.GREEN + " normal" + ChatColor.DARK_AQUA + " -s gargamel");
this.addCommandExample("/mv create " + ChatColor.GOLD + "moonworld" + ChatColor.GREEN + " normal" + ChatColor.DARK_AQUA + " -g BukkitFullOfMoon");
this.worldManager = this.plugin.getMVWorldManager();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
String worldName = args.get(0);
File worldFile = new File(this.plugin.getServer().getWorldContainer(), worldName);
String env = args.get(1);
String seed = CommandHandler.getFlag("-s", args);
String generator = CommandHandler.getFlag("-g", args);
String typeString = CommandHandler.getFlag("-t", args);
boolean useSpawnAdjust = true;
for (String s : args) {
if (s.equalsIgnoreCase("-n")) {
useSpawnAdjust = false;
}
}
if (worldFile.exists() || this.worldManager.isMVWorld(worldName)) {
sender.sendMessage(ChatColor.RED + "A Folder/World already exists with this name!");
sender.sendMessage(ChatColor.RED + "If you are confident it is a world you can import with /mvimport");
return;
}
Environment environment = EnvironmentCommand.getEnvFromString(env);
if (environment == null) {
sender.sendMessage(ChatColor.RED + "That is not a valid environment.");
EnvironmentCommand.showEnvironments(sender);
return;
}
// If they didn't specify a type, default to NORMAL
if (typeString == null) {
typeString = "NORMAL";
}
WorldType type = EnvironmentCommand.getWorldTypeFromString(typeString);
if (type == null) {
sender.sendMessage(ChatColor.RED + "That is not a valid World Type.");
EnvironmentCommand.showWorldTypes(sender);
return;
}
Command.broadcastCommandMessage(sender, "Starting creation of world '" + worldName + "'...");
if (this.worldManager.addWorld(worldName, environment, seed, type, generator, useSpawnAdjust)) {
Command.broadcastCommandMessage(sender, "Complete!");
} else {
Command.broadcastCommandMessage(sender, "FAILED.");
}
}
}
@@ -1,65 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
import java.util.logging.Level;
/**
* Enables debug-information.
*/
public class DebugCommand extends MultiverseCommand {
public DebugCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Turn Debug on/off?");
this.setCommandUsage("/mv debug" + ChatColor.GOLD + " [1|2|3|off]");
this.setArgRange(0, 1);
this.addKey("mv debug");
this.addKey("mv d");
this.addKey("mvdebug");
this.addCommandExample("/mv debug " + ChatColor.GOLD + "2");
this.setPermission("multiverse.core.debug", "Spams the console a bunch.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (args.size() == 1) {
if (args.get(0).equalsIgnoreCase("off")) {
MultiverseCore.GlobalDebug = 0;
} else {
try {
int debugLevel = Integer.parseInt(args.get(0));
if (debugLevel > 3 || debugLevel < 0) {
throw new NumberFormatException();
}
MultiverseCore.GlobalDebug = debugLevel;
} catch (NumberFormatException e) {
sender.sendMessage(ChatColor.RED + "Error" + ChatColor.WHITE
+ " setting debug level. Please use a number 0-3 " + ChatColor.AQUA + "(3 being many many messages!)");
}
}
}
this.displayDebugMode(sender);
}
private void displayDebugMode(CommandSender sender) {
if (MultiverseCore.GlobalDebug == 0) {
sender.sendMessage("Multiverse Debug mode is " + ChatColor.RED + "OFF");
} else {
sender.sendMessage("Multiverse Debug mode is " + ChatColor.GREEN + MultiverseCore.GlobalDebug);
this.plugin.log(Level.FINE, "Multiverse Debug ENABLED");
}
}
}
@@ -1,41 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.List;
/**
* Deletes worlds.
*/
public class DeleteCommand extends MultiverseCommand {
public DeleteCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Delete World");
this.setCommandUsage("/mv delete" + ChatColor.GREEN + " {WORLD}");
this.setArgRange(1, 1);
this.addKey("mvdelete");
this.addKey("mv delete");
this.addCommandExample("/mv create " + ChatColor.GOLD + "MyWorld");
this.setPermission("multiverse.core.delete", "Deletes a world on your server. " + ChatColor.RED + "PERMANENTLY.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
Class<?>[] paramTypes = {String.class};
List<Object> objectArgs = new ArrayList<Object>(args);
this.plugin.getCommandHandler().queueCommand(sender, "mvdelete", "deleteWorld", objectArgs,
paramTypes, ChatColor.GREEN + "World Deleted!", ChatColor.RED + "World could NOT be deleted!");
}
}
@@ -1,112 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.WorldType;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Lists valid known environments.
*/
public class EnvironmentCommand extends MultiverseCommand {
public EnvironmentCommand(MultiverseCore plugin) {
super(plugin);
this.setName("List Environments");
this.setCommandUsage("/mv env");
this.setArgRange(0, 0);
this.addKey("mvenv");
this.addKey("mv env");
this.addKey("mv type");
this.addKey("mv environment");
this.addKey("mv environments");
this.addCommandExample("/mv env");
this.setPermission("multiverse.core.list.environments", "Lists valid known environments/world types.", PermissionDefault.OP);
}
/**
* Shows all valid known environments to a {@link CommandSender}.
*
* @param sender The {@link CommandSender}.
*/
public static void showEnvironments(CommandSender sender) {
sender.sendMessage(ChatColor.YELLOW + "Valid Environments are:");
sender.sendMessage(ChatColor.GREEN + "NORMAL");
sender.sendMessage(ChatColor.RED + "NETHER");
sender.sendMessage(ChatColor.AQUA + "END");
}
/**
* Shows all valid known world types to a {@link CommandSender}.
*
* @param sender The {@link CommandSender}.
*/
public static void showWorldTypes(CommandSender sender) {
sender.sendMessage(ChatColor.YELLOW + "Valid World Types are:");
sender.sendMessage(String.format("%sNORMAL %sor %sFLAT",
ChatColor.GREEN, ChatColor.WHITE, ChatColor.AQUA));
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
EnvironmentCommand.showEnvironments(sender);
EnvironmentCommand.showWorldTypes(sender);
}
/**
* Converts a {@link String} into a {@link WorldType}.
*
* @param type The WorldType as a {@link String}
* @return The WorldType as a {@link WorldType}
*/
public static WorldType getWorldTypeFromString(String type) {
// Don't reference the enum directly as there aren't that many, and we can be more forgiving to users this way
if (type.equalsIgnoreCase("normal"))
type = "NORMAL";
if (type.equalsIgnoreCase("flat"))
type = "FLAT";
try {
// Now that we've converted a potentially unfriendly value
// to a friendly one, get it from the ENUM!
return WorldType.valueOf(type);
} catch (IllegalArgumentException e) {
return null;
}
}
/**
* Converts a {@link String} into an {@link org.bukkit.World.Environment}.
*
* @param env The environment as {@link String}
* @return The environment as {@link org.bukkit.World.Environment}
*/
public static World.Environment getEnvFromString(String env) {
// Don't reference the enum directly as there aren't that many, and we can be more forgiving to users this way
if (env.equalsIgnoreCase("HELL") || env.equalsIgnoreCase("NETHER"))
env = "NETHER";
if (env.equalsIgnoreCase("END") || env.equalsIgnoreCase("THEEND") || env.equalsIgnoreCase("STARWARS"))
env = "THE_END";
if (env.equalsIgnoreCase("NORMAL") || env.equalsIgnoreCase("WORLD"))
env = "NORMAL";
try {
// Now that we've converted a potentially unfriendly value
// to a friendly one, get it from the ENUM!
return World.Environment.valueOf(env);
} catch (IllegalArgumentException e) {
return null;
}
}
}
@@ -1,60 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.Plugin;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
/**
* Returns a list of loaded generator plugins.
*/
public class GeneratorCommand extends MultiverseCommand {
public GeneratorCommand(MultiverseCore plugin) {
super(plugin);
this.setName("World Information");
this.setCommandUsage("/mv generators");
this.setArgRange(0, 0);
this.addKey("mv generators");
this.addKey("mvgenerators");
this.addKey("mv gens");
this.addKey("mvgens");
this.addCommandExample("/mv generators");
this.setPermission("multiverse.core.generator", "Returns a list of Loaded Generator Plugins.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
this.plugin.log(Level.INFO, "PLEASE IGNORE the 'Plugin X does not contain any generators' message below!");
Plugin[] plugins = this.plugin.getServer().getPluginManager().getPlugins();
List<String> generators = new ArrayList<String>();
for (Plugin p : plugins) {
if (p.isEnabled() && p.getDefaultWorldGenerator("world", "") != null) {
generators.add(p.getDescription().getName());
}
}
sender.sendMessage(ChatColor.AQUA + "--- Loaded Generator Plugins ---");
String loadedGens = "";
boolean altColor = false;
for (String s : generators) {
loadedGens += (altColor ? ChatColor.YELLOW : ChatColor.WHITE) + s + " ";
altColor = !altColor;
}
if (loadedGens.length() == 0) {
loadedGens = ChatColor.RED + "No Generator Plugins found.";
}
sender.sendMessage(loadedGens);
}
}
@@ -1,106 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.pneumaticraft.commandhandler.Command;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.List;
/**
* Displays a nice help menu.
*/
public class HelpCommand extends PaginatedCoreCommand<Command> {
public HelpCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Get Help with Multiverse");
this.setCommandUsage("/mv " + ChatColor.GOLD + "[FILTER] [PAGE #]");
this.setArgRange(0, 2);
this.addKey("mv");
this.addKey("mvh");
this.addKey("mvhelp");
this.addKey("mv help");
this.addKey("mvsearch");
this.addKey("mv search");
this.addCommandExample("/mv help ?");
this.setPermission("multiverse.help", "Displays a nice help menu.", PermissionDefault.TRUE);
this.setItemsPerPage(7); // SUPPRESS CHECKSTYLE: MagicNumberCheck
}
@Override
protected List<Command> getFilteredItems(List<Command> availableItems, String filter) {
List<Command> filtered = new ArrayList<Command>();
for (Command c : availableItems) {
if (stitchThisString(c.getKeyStrings()).matches("(?i).*" + filter + ".*")) {
filtered.add(c);
} else if (c.getCommandName().matches("(?i).*" + filter + ".*")) {
filtered.add(c);
} else if (c.getCommandDesc().matches("(?i).*" + filter + ".*")) {
filtered.add(c);
} else if (c.getCommandUsage().matches("(?i).*" + filter + ".*")) {
filtered.add(c);
} else {
for (String example : c.getCommandExamples()) {
if (example.matches("(?i).*" + filter + ".*")) {
filtered.add(c);
break;
}
}
}
}
return filtered;
}
@Override
protected String getItemText(Command item) {
return ChatColor.AQUA + item.getCommandUsage();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
sender.sendMessage(ChatColor.AQUA + "====[ Multiverse Help ]====");
FilterObject filterObject = this.getPageAndFilter(args);
List<Command> availableCommands = new ArrayList<Command>(this.plugin.getCommandHandler().getCommands(sender));
if (filterObject.getFilter().length() > 0) {
availableCommands = this.getFilteredItems(availableCommands, filterObject.getFilter());
if (availableCommands.size() == 0) {
sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE
+ "No commands matched your filter: " + ChatColor.AQUA + filterObject.getFilter());
return;
}
}
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.AQUA + " Add a '" + ChatColor.DARK_PURPLE + "?" + ChatColor.AQUA + "' after a command to see more about it.");
for (Command c : availableCommands) {
sender.sendMessage(ChatColor.AQUA + c.getCommandUsage());
}
return;
}
int totalPages = (int) Math.ceil(availableCommands.size() / (this.itemsPerPage + 0.0));
if (filterObject.getPage() > totalPages) {
filterObject.setPage(totalPages);
}
sender.sendMessage(ChatColor.AQUA + " Page " + filterObject.getPage() + " of " + totalPages);
sender.sendMessage(ChatColor.AQUA + " Add a '" + ChatColor.DARK_PURPLE + "?" + ChatColor.AQUA + "' after a command to see more about it.");
this.showPage(filterObject.getPage(), sender, availableCommands);
}
}
@@ -1,175 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.pneumaticraft.commandhandler.CommandHandler;
import org.bukkit.ChatColor;
import org.bukkit.World.Environment;
import org.bukkit.WorldType;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Imports a new world of the specified type.
*/
public class ImportCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public ImportCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Import World");
this.setCommandUsage("/mv import" + ChatColor.GREEN + " {NAME} {ENV} " + ChatColor.GOLD + " -g [GENERATOR[:ID]] [-n] -t [TYPE]");
this.setArgRange(2, 5); // SUPPRESS CHECKSTYLE: MagicNumberCheck
this.addKey("mvimport");
this.addKey("mvim");
this.addKey("mv import");
this.addCommandExample("/mv import " + ChatColor.GOLD + "gargamel" + ChatColor.GREEN + " normal");
this.addCommandExample("/mv import " + ChatColor.GOLD + "flatroom" + ChatColor.GREEN + " normal" + ChatColor.AQUA + " -t flat");
this.addCommandExample("/mv import " + ChatColor.GOLD + "hell_world" + ChatColor.GREEN + " nether");
this.addCommandExample("/mv import " + ChatColor.GOLD + "CleanRoom" + ChatColor.GREEN + " normal" + ChatColor.DARK_AQUA + " CleanRoomGenerator");
this.setPermission("multiverse.core.import", "Imports a new world of the specified type.", PermissionDefault.OP);
this.worldManager = this.plugin.getMVWorldManager();
}
/**
* A very basic check to see if a folder has a level.dat file.
* If it does, we can safely assume it's a world folder.
*
* @param worldFolder The File that may be a world.
* @return True if it looks like a world, false if not.
*/
private boolean checkIfIsWorld(File worldFolder) {
if (worldFolder.isDirectory()) {
File[] files = worldFolder.listFiles(new FilenameFilter() {
@Override
public boolean accept(File file, String name) {
return name.equalsIgnoreCase("level.dat");
}
});
if (files != null && files.length > 0) {
return true;
}
}
return false;
}
private String getPotentialWorlds() {
File worldFolder = this.plugin.getServer().getWorldContainer();
if (worldFolder == null) {
return "";
}
File[] files = worldFolder.listFiles();
String worldList = "";
Collection<MultiverseWorld> worlds = this.worldManager.getMVWorlds();
List<String> worldStrings = new ArrayList<String>();
for (MultiverseWorld world : worlds) {
worldStrings.add(world.getName());
}
for (String world : this.worldManager.getUnloadedWorlds()) {
worldStrings.add(world);
}
ChatColor currColor = ChatColor.WHITE;
for (File file : files) {
if (file.isDirectory() && checkIfIsWorld(file) && !worldStrings.contains(file.getName())) {
worldList += currColor + file.getName() + " ";
if (currColor == ChatColor.WHITE) {
currColor = ChatColor.YELLOW;
} else {
currColor = ChatColor.WHITE;
}
}
}
return worldList;
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
String worldName = args.get(0);
if (worldName.toLowerCase().equals("--list") || worldName.toLowerCase().equals("-l")) {
String worldList = this.getPotentialWorlds();
if (worldList.length() > 2) {
sender.sendMessage(ChatColor.AQUA + "====[ These look like worlds ]====");
sender.sendMessage(worldList);
} else {
sender.sendMessage(ChatColor.RED + "No potential worlds found. Sorry!");
}
return;
}
// Since we made an exception for the list, we have to make sure they have at least 2 params:
// Note the exception is --list, which is covered above.
if (args.size() == 1) {
this.showHelp(sender);
return;
}
// Make sure we don't already know about this world.
if (this.worldManager.isMVWorld(worldName)) {
sender.sendMessage(ChatColor.GREEN + "Multiverse" + ChatColor.WHITE
+ " already knows about '" + ChatColor.AQUA + worldName + ChatColor.WHITE + "'!");
return;
}
File worldFile = new File(this.plugin.getServer().getWorldContainer(), worldName);
String generator = CommandHandler.getFlag("-g", args);
String typeString = CommandHandler.getFlag("-t", args);
boolean useSpawnAdjust = true;
for (String s : args) {
if (s.equalsIgnoreCase("-n")) {
useSpawnAdjust = false;
}
}
String env = args.get(1);
Environment environment = EnvironmentCommand.getEnvFromString(env);
if (environment == null) {
sender.sendMessage(ChatColor.RED + "That is not a valid environment.");
EnvironmentCommand.showEnvironments(sender);
return;
}
// If they didn't specify a type, default to NORMAL
if (typeString == null) {
typeString = "NORMAL";
}
WorldType type = EnvironmentCommand.getWorldTypeFromString(typeString);
if (type == null) {
sender.sendMessage(ChatColor.RED + "That is not a valid World Type.");
EnvironmentCommand.showWorldTypes(sender);
return;
}
if (worldFile.exists() && env != null) {
Command.broadcastCommandMessage(sender, String.format("Starting import of world '%s'...", worldName));
if (this.worldManager.addWorld(worldName, environment, null, type, generator, useSpawnAdjust))
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Complete!");
else
Command.broadcastCommandMessage(sender, ChatColor.RED + "Failed!");
} else if (env == null) {
sender.sendMessage(ChatColor.RED + "FAILED.");
sender.sendMessage("That world environment did not exist.");
sender.sendMessage("For a list of available world types, type: " + ChatColor.AQUA + "/mvenv");
} else {
sender.sendMessage(ChatColor.RED + "FAILED.");
String worldList = this.getPotentialWorlds();
sender.sendMessage("That world folder does not exist. These look like worlds to me:");
sender.sendMessage(worldList);
}
}
}
@@ -1,257 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.FancyText;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.utils.FancyColorScheme;
import com.onarandombox.MultiverseCore.utils.FancyHeader;
import com.onarandombox.MultiverseCore.utils.FancyMessage;
import com.onarandombox.MultiverseCore.utils.LocationManipulation;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.List;
// Will use when we can compile with JDK 6
//import com.sun.xml.internal.ws.util.StringUtils;
/**
* Returns detailed information about a world.
*/
public class InfoCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public InfoCommand(MultiverseCore plugin) {
super(plugin);
this.setName("World Information");
this.setCommandUsage("/mv info" + ChatColor.GOLD + " [WORLD] [PAGE]");
this.setArgRange(0, 2);
this.addKey("mvinfo");
this.addKey("mvi");
this.addKey("mv info");
this.addCommandExample("/mv info " + ChatColor.GOLD + "1");
this.addCommandExample("/mv info " + ChatColor.GOLD + "3");
this.setPermission("multiverse.core.info", "Returns detailed information on the world.", PermissionDefault.OP);
this.worldManager = this.plugin.getMVWorldManager();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// Check if the command was sent from a Player.
String worldName = "";
int pageNum = 0;
if (args.size() == 0) {
if (sender instanceof Player) {
Player p = (Player) sender;
worldName = p.getWorld().getName();
} else {
sender.sendMessage("You must enter a" + ChatColor.LIGHT_PURPLE + " world" + ChatColor.WHITE + " from the console!");
return;
}
} else if (args.size() == 1) {
if (this.worldManager.getMVWorld(args.get(0)) != null) {
// then we have a world!
worldName = args.get(0);
} else {
if (sender instanceof Player) {
Player p = (Player) sender;
worldName = p.getWorld().getName();
try {
pageNum = Integer.parseInt(args.get(0)) - 1;
} catch (NumberFormatException e) {
pageNum = 0;
}
} else {
sender.sendMessage("You must enter a" + ChatColor.LIGHT_PURPLE + " world" + ChatColor.WHITE + " from the console!");
return;
}
}
} else if (args.size() == 2) {
worldName = args.get(0);
try {
pageNum = Integer.parseInt(args.get(1)) - 1;
} catch (NumberFormatException e) {
pageNum = 0;
}
}
if (this.worldManager.isMVWorld(worldName)) {
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
showPage(pageNum, sender, this.buildEntireCommand(this.worldManager.getMVWorld(worldName), p));
} else if (this.plugin.getServer().getWorld(worldName) != null) {
sender.sendMessage("That world exists, but multiverse does not know about it!");
sender.sendMessage("You can import it with" + ChatColor.AQUA + "/mv import " + ChatColor.GREEN + worldName + ChatColor.LIGHT_PURPLE + "{ENV}");
sender.sendMessage("For available environments type " + ChatColor.GREEN + "/mv env");
}
}
private List<List<FancyText>> buildEntireCommand(MultiverseWorld world, Player p) {
List<FancyText> message = new ArrayList<FancyText>();
List<List<FancyText>> worldInfo = new ArrayList<List<FancyText>>();
// Page 1
FancyColorScheme colors = new FancyColorScheme(ChatColor.AQUA, ChatColor.AQUA, ChatColor.GOLD, ChatColor.WHITE);
message.add(new FancyHeader("General Info", colors));
message.add(new FancyMessage("World Name: ", world.getName(), colors));
message.add(new FancyMessage("World Alias: ", world.getColoredWorldString(), colors));
message.add(new FancyMessage("Game Mode: ", world.getGameMode().toString(), colors));
message.add(new FancyMessage("World Type: ", world.getWorldType().toString(), colors));
//message.add(new FancyMessage("Game Mode: ", StringUtils.capitalize(world.getGameMode().toString()), colors));
Location spawn = world.getSpawnLocation();
message.add(new FancyMessage("Spawn Location: ", LocationManipulation.strCoords(spawn), colors));
message.add(new FancyMessage("World Scale: ", world.getScaling() + "", colors));
if (world.getPrice() > 0) {
message.add(new FancyMessage("Price to enter this world: ",
this.plugin.getBank().getFormattedAmount(p, world.getPrice(), world.getCurrency()), colors));
} else {
message.add(new FancyMessage("Price to enter this world: ", ChatColor.GREEN + "FREE!", colors));
}
if (world.getRespawnToWorld() != null) {
MultiverseWorld respawn = this.worldManager.getMVWorld(world.getRespawnToWorld());
if (respawn != null) {
message.add(new FancyMessage("Players will respawn in: ", respawn.getColoredWorldString(), colors));
} else {
message.add(new FancyMessage("Players will respawn in: ", ChatColor.RED + "!!INVALID!!", colors));
}
}
worldInfo.add(message);
// Page 2
message = new ArrayList<FancyText>();
message.add(new FancyHeader("More World Settings", colors));
message.add(new FancyMessage("Difficulty: ", world.getDifficulty().toString(), colors));
message.add(new FancyMessage("Weather: ", world.isWeatherEnabled() + "", colors));
message.add(new FancyMessage("Players will get hungry: ", world.getHunger() + "", colors));
message.add(new FancyMessage("Keep spawn in memory: ", world.isKeepingSpawnInMemory() + "", colors));
message.add(new FancyHeader("PVP Settings", colors));
message.add(new FancyMessage("Multiverse Setting: ", world.isPVPEnabled() + "", colors));
message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getPVP() + "", colors));
worldInfo.add(message);
// Page 3
message = new ArrayList<FancyText>();
message.add(new FancyHeader("Monster Settings", colors));
message.add(new FancyMessage("Multiverse Setting: ", world.canMonstersSpawn() + "", colors));
message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getAllowMonsters() + "", colors));
if (world.getMonsterList().size() > 0) {
if (world.canMonstersSpawn()) {
message.add(new FancyMessage("Monsters that" + ChatColor.RED + " CAN NOT "
+ ChatColor.GREEN + "spawn: ", toCommaSeperated(world.getMonsterList()), colors));
} else {
message.add(new FancyMessage("Monsters that" + ChatColor.GREEN + " CAN SPAWN: ", toCommaSeperated(world.getMonsterList()), colors));
}
} else {
message.add(new FancyMessage("Monsters that CAN spawn: ", world.canMonstersSpawn() ? "ALL" : "NONE", colors));
}
worldInfo.add(message);
// Page 4
message = new ArrayList<FancyText>();
message.add(new FancyHeader("Animal Settings", colors));
message.add(new FancyMessage("Multiverse Setting: ", world.canAnimalsSpawn() + "", colors));
message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getAllowAnimals() + "", colors));
if (world.getMonsterList().size() > 0) {
if (world.canMonstersSpawn()) {
message.add(new FancyMessage("Animals that" + ChatColor.RED + " CAN NOT "
+ ChatColor.GREEN + "spawn: ", toCommaSeperated(world.getAnimalList()), colors));
} else {
message.add(new FancyMessage("Animals that" + ChatColor.GREEN + " CAN SPAWN: ", toCommaSeperated(world.getAnimalList()), colors));
}
} else {
message.add(new FancyMessage("Animals that CAN spawn: ", world.canAnimalsSpawn() ? "ALL" : "NONE", colors));
}
worldInfo.add(message);
return worldInfo;
}
private String toCommaSeperated(List<String> list) {
if (list == null || list.size() == 0) {
return "";
}
if (list.size() == 1) {
return list.get(0);
}
String result = list.get(0);
for (int i = 1; i < list.size() - 1; i++) {
result += ", " + list.get(i);
}
result += " and " + list.get(list.size() - 1);
return result;
}
/**
* Gets a "positive" or "negative" {@link ChatColor}.
*
* @param positive Whether this {@link ChatColor} should be "positive".
* @return The {@link ChatColor}.
*/
protected ChatColor getChatColor(boolean positive) {
return positive ? ChatColor.GREEN : ChatColor.RED;
}
private void showPage(int page, CommandSender sender, List<List<FancyText>> doc) {
page = page < 0 ? 0 : page;
page = page > doc.size() - 1 ? doc.size() - 1 : page;
boolean altColor = false;
boolean appendedPageNum = false;
if (sender instanceof Player) {
List<FancyText> list = doc.get(page);
for (FancyText fancyT : list) {
if (fancyT instanceof FancyMessage) {
FancyMessage text = (FancyMessage) fancyT;
text.setAltColor(altColor);
altColor = !altColor;
sender.sendMessage(text.getFancyText());
} else if (fancyT instanceof FancyHeader) {
FancyHeader text = (FancyHeader) fancyT;
if (!appendedPageNum) {
text.appendText(ChatColor.DARK_PURPLE + " [ Page " + (page + 1) + " of " + doc.size() + " ]");
appendedPageNum = true;
}
sender.sendMessage(text.getFancyText());
altColor = false;
}
}
} else {
for (List<FancyText> list : doc) {
for (FancyText fancyT : list) {
if (fancyT instanceof FancyMessage) {
FancyMessage text = (FancyMessage) fancyT;
text.setAltColor(altColor);
altColor = !altColor;
sender.sendMessage(text.getFancyText());
} else {
FancyText text = fancyT;
if (appendedPageNum) {
sender.sendMessage(" ");
} else {
appendedPageNum = true;
}
sender.sendMessage(text.getFancyText());
altColor = false;
}
}
}
}
}
}
@@ -1,128 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import org.bukkit.ChatColor;
import org.bukkit.World.Environment;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.List;
/**
* Displays a listing of all worlds that a player can enter.
*/
public class ListCommand extends PaginatedCoreCommand<String> {
public ListCommand(MultiverseCore plugin) {
super(plugin);
this.setName("World Listing");
this.setCommandUsage("/mv list");
this.setArgRange(0, 2);
this.addKey("mvlist");
this.addKey("mvl");
this.addKey("mv list");
this.setPermission("multiverse.core.list.worlds", "Displays a listing of all worlds that you can enter.", PermissionDefault.OP);
this.setItemsPerPage(8); // SUPPRESS CHECKSTYLE: MagicNumberCheck
}
private List<String> getFancyWorldList(Player p) {
List<String> worldList = new ArrayList<String>();
for (MultiverseWorld world : this.plugin.getMVWorldManager().getMVWorlds()) {
if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) {
continue;
}
ChatColor color = ChatColor.GOLD;
Environment env = world.getEnvironment();
if (env == Environment.NETHER) {
color = ChatColor.RED;
} else if (env == Environment.NORMAL) {
color = ChatColor.GREEN;
} else if (env == Environment.THE_END) {
color = ChatColor.AQUA;
}
String outputCache = world.getColoredWorldString() + ChatColor.WHITE + " - " + color + world.getEnvironment();
if (world.isHidden()) {
if (p == null || p.hasPermission("multiverse.core.modify")) {
// Prefix hidden worlds with an "[H]"
worldList.add(ChatColor.GRAY + "[H]" + outputCache);
}
} else {
worldList.add(outputCache);
}
}
for (String name : this.plugin.getMVWorldManager().getUnloadedWorlds()) {
if (p == null || this.plugin.getMVPerms().hasPermission(p, "multiverse.access." + name, true)) {
worldList.add(ChatColor.GRAY + name + " - UNLOADED");
}
}
return worldList;
}
@Override
protected List<String> getFilteredItems(List<String> availableItems, String filter) {
List<String> filtered = new ArrayList<String>();
for (String s : availableItems) {
if (s.matches("(?i).*" + filter + ".*")) {
filtered.add(s);
}
}
return filtered;
}
@Override
protected String getItemText(String item) {
return item;
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
sender.sendMessage(ChatColor.LIGHT_PURPLE + "====[ Multiverse World List ]====");
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
FilterObject filterObject = this.getPageAndFilter(args);
List<String> availableWorlds = new ArrayList<String>(this.getFancyWorldList(p));
if (filterObject.getFilter().length() > 0) {
availableWorlds = this.getFilteredItems(availableWorlds, filterObject.getFilter());
if (availableWorlds.size() == 0) {
sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE
+ "No worlds matched your filter: " + ChatColor.AQUA + filterObject.getFilter());
return;
}
}
if (!(sender instanceof Player)) {
for (String c : availableWorlds) {
sender.sendMessage(c);
}
return;
}
int totalPages = (int) Math.ceil(availableWorlds.size() / (this.itemsPerPage + 0.0));
if (filterObject.getPage() > totalPages) {
filterObject.setPage(totalPages);
}
sender.sendMessage(ChatColor.AQUA + " Page " + filterObject.getPage() + " of " + totalPages);
this.showPage(filterObject.getPage(), sender, availableWorlds);
}
}
@@ -1,42 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Loads a world into Multiverse.
*/
public class LoadCommand extends MultiverseCommand {
public LoadCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Load World");
this.setCommandUsage("/mv load" + ChatColor.GREEN + " {WORLD}");
this.setArgRange(1, 1);
this.addKey("mvload");
this.addKey("mv load");
this.addCommandExample("/mv load " + ChatColor.GREEN + "MyUnloadedWorld");
this.setPermission("multiverse.core.load", "Loads a world into Multiverse.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (this.plugin.getMVWorldManager().loadWorld(args.get(0))) {
Command.broadcastCommandMessage(sender, "Loaded world '" + args.get(0) + "'!");
} else {
sender.sendMessage("Error trying to load world '" + args.get(0) + "'!");
}
}
}
@@ -1,91 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.enums.Action;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
// This will contain all the properties that support the ADD/REMOVE
// Anything not in here will only support the SET action
/**
* Used to modify various aspects of worlds.
*/
public class ModifyAddCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public ModifyAddCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Modify a World (Add a value)");
this.setCommandUsage("/mv modify " + ChatColor.GREEN + "add {VALUE} {PROPERTY}" + ChatColor.GOLD + " [WORLD] ");
this.setArgRange(2, 3);
this.addKey("mvm add");
this.addKey("mvmadd");
this.addKey("mv modify add");
this.addKey("mvmodify add");
this.addCommandExample("/mvm " + ChatColor.GOLD + "add " + ChatColor.GREEN + "sheep " + ChatColor.RED + "animals");
this.addCommandExample("/mvm " + ChatColor.GOLD + "add " + ChatColor.GREEN + "creeper " + ChatColor.RED + "monsters");
this.addCommandExample("/mvm " + ChatColor.GOLD + "add " + ChatColor.GREEN + "MyWorld " + ChatColor.RED + "worldblacklist");
this.setPermission("multiverse.core.modify.add", "Modify various aspects of worlds. See the help wiki for how to use this command properly. "
+ "If you do not include a world, the current world will be used.", PermissionDefault.OP);
this.worldManager = this.plugin.getMVWorldManager();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// We NEED a world from the command line
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
if (args.size() == 2 && p == null) {
sender.sendMessage(ChatColor.RED + "From the console, WORLD is required.");
sender.sendMessage(this.getCommandDesc());
sender.sendMessage(this.getCommandUsage());
sender.sendMessage("Nothing changed.");
return;
}
MultiverseWorld world;
String value = args.get(0);
String property = args.get(1);
if (args.size() == 2) {
world = this.worldManager.getMVWorld(p.getWorld().getName());
} else {
world = this.worldManager.getMVWorld(args.get(2));
}
if (world == null) {
sender.sendMessage("That world does not exist!");
return;
}
if (!ModifyCommand.validateAction(Action.Add, property)) {
sender.sendMessage("Sorry, you can't ADD to " + property);
sender.sendMessage("Please visit our Github Wiki for more information: http://goo.gl/4W8cY");
return;
}
if (world.addToVariable(property, value)) {
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA
+ value + ChatColor.WHITE + " was " + ChatColor.GREEN + "added to " + ChatColor.GREEN + property);
} else {
sender.sendMessage(value + " could not be added to " + property);
}
}
}
@@ -1,88 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.enums.Action;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Removes all values from a world-property.
*/
public class ModifyClearCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public ModifyClearCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Modify a World (Clear a property)");
this.setCommandUsage("/mv modify" + ChatColor.GREEN + " clear {PROPERTY}" + ChatColor.GOLD + " [WORLD]");
this.setArgRange(1, 2);
this.addKey("mvm clear");
this.addKey("mvmclear");
this.addKey("mv modify clear");
this.addKey("mvmodify clear");
this.addCommandExample("/mvm " + ChatColor.GOLD + "clear " + ChatColor.RED + "animals");
this.addCommandExample("/mvm " + ChatColor.GOLD + "clear " + ChatColor.RED + "monsters");
this.addCommandExample("/mvm " + ChatColor.GOLD + "clear " + ChatColor.RED + "worldblacklist");
this.setPermission("multiverse.core.modify.clear",
"Removes all values from a property. This will work on properties that contain lists.", PermissionDefault.OP);
this.worldManager = this.plugin.getMVWorldManager();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// We NEED a world from the command line
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
if (args.size() == 1 && p == null) {
sender.sendMessage(ChatColor.RED + "From the console, WORLD is required.");
sender.sendMessage(this.getCommandDesc());
sender.sendMessage(this.getCommandUsage());
sender.sendMessage("Nothing changed.");
return;
}
MultiverseWorld world;
String property = args.get(0);
if (args.size() == 1) {
world = this.worldManager.getMVWorld(p.getWorld().getName());
} else {
world = this.worldManager.getMVWorld(args.get(1));
}
if (world == null) {
sender.sendMessage("That world does not exist!");
return;
}
if (!ModifyCommand.validateAction(Action.Clear, property)) {
sender.sendMessage("Sorry, you can't use CLEAR with " + property);
sender.sendMessage("Please visit our Github Wiki for more information: http://goo.gl/cgB2B");
return;
}
if (world.clearList(property)) {
sender.sendMessage(property + " was cleared. It contains 0 values now.");
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + property + ChatColor.WHITE + " was "
+ ChatColor.GREEN + "CLEARED" + ChatColor.WHITE + ". It contains " + ChatColor.LIGHT_PURPLE + "0" + ChatColor.WHITE + " values now.");
} else {
sender.sendMessage(ChatColor.RED + "Error: " + ChatColor.GOLD + property
+ ChatColor.WHITE + " was " + ChatColor.GOLD + "NOT" + ChatColor.WHITE + " cleared.");
}
}
}
@@ -1,76 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.enums.Action;
import com.onarandombox.MultiverseCore.enums.AddProperties;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Used to modify various aspects of worlds.
*/
public class ModifyCommand extends MultiverseCommand {
public ModifyCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Modify a World");
this.setCommandUsage("/mv modify" + ChatColor.GREEN + " {set|add|remove|clear} ...");
this.setArgRange(2, 3);
this.addKey("mvm");
this.addKey("mvmodify");
this.addKey("mv modify");
Map<String, Boolean> children = new HashMap<String, Boolean>();
children.put("multiverse.core.modify.add", true);
children.put("multiverse.core.modify.modify", true);
children.put("multiverse.core.modify.clear", true);
children.put("multiverse.core.modify.remove", true);
Permission modify = new Permission("multiverse.core.modify",
"Modify various aspects of worlds. It requires add/set/clear/remove. See the examples below", PermissionDefault.OP, children);
this.addCommandExample(ChatColor.AQUA + "/mv modify set ?");
this.addCommandExample(ChatColor.GREEN + "/mv modify add ?");
this.addCommandExample(ChatColor.BLUE + "/mv modify clear ?");
this.addCommandExample(ChatColor.RED + "/mv modify remove ?");
this.setPermission(modify);
}
/**
* Validates the specified action.
*
* @param action The {@link Action}.
* @param property The property.
* @return Whether this action is valid.
*/
protected static boolean validateAction(Action action, String property) {
if (action != Action.Set) {
try {
AddProperties.valueOf(property);
return true;
} catch (IllegalArgumentException e) {
return false;
}
}
return false;
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// This is just a place holder. The real commands are in:
// ModifyAddCommand
// ModifyRemoveCommand
// ModifySetCommand
// ModifyClearCommand
}
}
@@ -1,93 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.enums.Action;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Removes values from a world-property.
*/
public class ModifyRemoveCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public ModifyRemoveCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Modify a World (Remove a value)");
this.setCommandUsage("/mv modify" + ChatColor.GREEN + " remove {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD]");
this.setArgRange(2, 3);
this.addKey("mvm remove");
this.addKey("mvmremove");
this.addKey("mv modify remove");
this.addKey("mvmodify remove");
this.addKey("mvm delete");
this.addKey("mvmdelete");
this.addKey("mv modify delete");
this.addKey("mvmodify delete");
this.addCommandExample("/mvm " + ChatColor.GOLD + "remove " + ChatColor.GREEN + "sheep " + ChatColor.RED + "animals");
this.addCommandExample("/mvm " + ChatColor.GOLD + "remove " + ChatColor.GREEN + "creeper " + ChatColor.RED + "monsters");
this.addCommandExample("/mvm " + ChatColor.GOLD + "remove " + ChatColor.GREEN + "MyWorld " + ChatColor.RED + "worldblacklist");
this.setPermission("multiverse.core.modify.remove", "Modify various aspects of worlds. See the help wiki for how to use this command properly. "
+ "If you do not include a world, the current world will be used.", PermissionDefault.OP);
this.worldManager = this.plugin.getMVWorldManager();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// We NEED a world from the command line
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
if (args.size() == 2 && p == null) {
sender.sendMessage(ChatColor.RED + "From the console, WORLD is required.");
sender.sendMessage(this.getCommandDesc());
sender.sendMessage(this.getCommandUsage());
sender.sendMessage("Nothing changed.");
return;
}
MultiverseWorld world;
String value = args.get(0);
String property = args.get(1);
if (args.size() == 2) {
world = this.worldManager.getMVWorld(p.getWorld().getName());
} else {
world = this.worldManager.getMVWorld(args.get(2));
}
if (world == null) {
sender.sendMessage("That world does not exist!");
return;
}
if (!ModifyCommand.validateAction(Action.Remove, property)) {
sender.sendMessage("Sorry, you can't REMOVE anything from" + property);
sender.sendMessage("Please visit our Github Wiki for more information: http://goo.gl/4W8cY");
return;
}
if (world.removeFromVariable(property, value)) {
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE
+ " was " + ChatColor.RED + "removed from " + ChatColor.GREEN + property);
} else {
sender.sendMessage(ChatColor.RED + "There was an error removing " + ChatColor.GRAY
+ value + ChatColor.WHITE + " from " + ChatColor.GOLD + property);
}
}
}
@@ -1,123 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.enums.EnglishChatColor;
import com.onarandombox.MultiverseCore.exceptions.PropertyDoesNotExistException;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Used to set world-properties.
*/
public class ModifySetCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public ModifySetCommand(MultiverseCore plugin) {
super(plugin);
this.worldManager = this.plugin.getMVWorldManager();
this.setName("Modify a World (Set a value)");
this.setCommandUsage("/mv modify" + ChatColor.GREEN + " set {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD]");
this.setArgRange(1, 3);
this.addKey("mvm set");
this.addKey("mvmset");
this.addKey("mv modify set");
this.addKey("mvmodify set");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "mode " + ChatColor.RED + "creative");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "animals " + ChatColor.RED + "false");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "monsters " + ChatColor.RED + "false");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "alias " + ChatColor.RED + "MyWorld");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "color " + ChatColor.RED + "green");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "curr " + ChatColor.RED + "3");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "price " + ChatColor.RED + "5");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "scale " + ChatColor.RED + "1.2");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "memory " + ChatColor.RED + "true");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "diff " + ChatColor.RED + "hard");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "hunger " + ChatColor.RED + "false");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "hidden " + ChatColor.RED + "true");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "pvp " + ChatColor.RED + "false");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "heal " + ChatColor.RED + "true");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "adjustspawn " + ChatColor.RED + "false");
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "spawn");
this.setPermission("multiverse.core.modify.set", "Modify various aspects of worlds. See the help wiki for how to use this command properly. "
+ "If you do not include a world, the current world will be used.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// Special case for spawn:
if (args.size() == 1) {
if (!(sender instanceof Player)) {
sender.sendMessage("You must be a player to set the" + ChatColor.GREEN + " spawn");
return;
}
if (args.get(0).equalsIgnoreCase("spawn")) {
SetSpawnCommand c = new SetSpawnCommand(this.plugin);
c.setWorldSpawn(sender);
} else {
sender.sendMessage("Spawn is the only param with no" + ChatColor.GREEN + " VALUE");
sender.sendMessage("Type " + ChatColor.GREEN + "/mv modify ?" + ChatColor.WHITE + " For help.");
}
return;
}
// We NEED a world from the command line
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
if (args.size() == 2 && p == null) {
sender.sendMessage("From the command line, WORLD is required.");
sender.sendMessage(this.getCommandDesc());
sender.sendMessage(this.getCommandUsage());
sender.sendMessage("Nothing changed.");
return;
}
MultiverseWorld world;
String value = args.get(1);
String property = args.get(0);
if (args.size() == 2) {
world = this.worldManager.getMVWorld(p.getWorld().getName());
} else {
world = this.worldManager.getMVWorld(args.get(2));
}
if (world == null) {
sender.sendMessage("That world does not exist!");
return;
}
if ((property.equalsIgnoreCase("aliascolor") || property.equalsIgnoreCase("color")) && !world.isValidAliasColor(value)) {
sender.sendMessage(value + " is not a valid color. Please pick one of the following:");
sender.sendMessage(EnglishChatColor.getAllColors());
return;
}
try {
if (world.setProperty(property, value, sender)) {
sender.sendMessage(ChatColor.GREEN + "Success!" + ChatColor.WHITE + " Property " + ChatColor.AQUA + property
+ ChatColor.WHITE + " was set to " + ChatColor.GREEN + value);
} else {
sender.sendMessage(world.getProperty(property, Object.class).getHelp());
}
} catch (PropertyDoesNotExistException e) {
sender.sendMessage(ChatColor.RED + "Sorry, You can't set: '" + ChatColor.GRAY + property + ChatColor.RED + "'");
// TODO: Display the list
sender.sendMessage(ChatColor.GOLD + "For a full list of thingys, see our wiki.");
}
}
}
@@ -1,40 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.utils.MVMessaging;
import com.pneumaticraft.commandhandler.Command;
import org.bukkit.command.CommandSender;
import java.util.List;
/**
* A generic Multiverse-command.
*/
public abstract class MultiverseCommand extends Command {
/**
* The reference to the core.
*/
protected MultiverseCore plugin;
/**
* The reference to {@link MVMessaging}.
*/
protected MVMessaging messaging;
public MultiverseCommand(MultiverseCore plugin) {
super(plugin);
this.plugin = plugin;
this.messaging = this.plugin.getMessaging();
}
@Override
public abstract void runCommand(CommandSender sender, List<String> args);
}
@@ -1,164 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.pneumaticraft.commandhandler.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.List;
/**
* A generic paginated command.
* @param <T> The type of items on the page.
*/
public abstract class PaginatedCommand<T> extends Command {
private static final int DEFAULT_ITEMS_PER_PAGE = 9;
/**
* The number of items per page.
*/
protected int itemsPerPage = DEFAULT_ITEMS_PER_PAGE;
public PaginatedCommand(JavaPlugin plugin) {
super(plugin);
}
/**
* Set the number of items per page.
*
* @param items The new number of items per page.
*/
protected void setItemsPerPage(int items) {
itemsPerPage = items;
}
/**
* Gets filtered items.
* @param availableItems All available items.
* @param filter The filter-{@link String}.
* @return A list of items that match the filter.
*/
protected abstract List<T> getFilteredItems(List<T> availableItems, String filter);
/**
* Constructs a single string from a list of strings.
*
* @param list The {@link List} of strings.
* @return A single {@link String}.
*/
protected String stitchThisString(List<String> list) {
StringBuilder builder = new StringBuilder();
for (String s : list) {
builder.append(s);
builder.append(' ');
}
return builder.toString();
}
/**
* Shows a page.
*
* @param page The number of the page to show.
* @param sender The {@link CommandSender} that wants to see the page.
* @param cmds The items that should be displayed on the page.
*/
protected void showPage(int page, CommandSender sender, List<T> cmds) {
// Ensure the page is at least 1.
page = (page <= 0) ? 1 : page;
int start = (page - 1) * itemsPerPage;
int end = start + itemsPerPage;
for (int i = start; i < end; i++) {
// For consistancy, print some extra lines if it's a player:
if (i < cmds.size()) {
sender.sendMessage(this.getItemText(cmds.get(i)));
} else if (sender instanceof Player) {
sender.sendMessage(" ");
}
}
}
/**
* Converts an item into a string.
*
* @param item The item.
* @return A {@link String}.
*/
protected abstract String getItemText(T item);
/**
* Constructs a {@link FilterObject} from a {@link List} of arguments.
*
* @param args The {@link List} of arguments.
* @return The {@link FilterObject}.
*/
protected FilterObject getPageAndFilter(List<String> args) {
int page = 1;
String filter = "";
if (args.size() == 0) {
filter = "";
page = 1;
} else if (args.size() == 1) {
try {
page = Integer.parseInt(args.get(0));
} catch (NumberFormatException ex) {
filter = args.get(0);
page = 1;
}
} else if (args.size() == 2) {
filter = args.get(0);
try {
page = Integer.parseInt(args.get(1));
} catch (NumberFormatException ex) {
page = 1;
}
}
return new FilterObject(page, filter);
}
/**
* "Key-Object" containing information about the page and the filter that were requested.
*/
protected class FilterObject {
private Integer page;
private String filter;
public FilterObject(Integer page, String filter) {
this.page = page;
this.filter = filter;
}
/**
* Gets the page.
* @return The page.
*/
public Integer getPage() {
return this.page;
}
/**
* Sets the page.
*
* @param page The new page.
*/
public void setPage(int page) {
this.page = page;
}
/**
* Gets the filter.
* @return The filter.
*/
public String getFilter() {
return this.filter;
}
}
}
@@ -1,26 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
/**
* A generic paginated Multiverse-command.
* @param <T> The type of items on the page.
*/
public abstract class PaginatedCoreCommand<T> extends PaginatedCommand<T> {
/**
* The reference to the core.
*/
protected MultiverseCore plugin;
public PaginatedCoreCommand(MultiverseCore plugin) {
super(plugin);
this.plugin = plugin;
}
}
@@ -1,92 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.utils.PurgeWorlds;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Removes a type of mob from a world.
*/
public class PurgeCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public PurgeCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Purge World of Creatures");
this.setCommandUsage("/mv purge" + ChatColor.GOLD + " [WORLD|all] " + ChatColor.GREEN + "{all|animals|monsters|MOBNAME}");
this.setArgRange(1, 2);
this.addKey("mvpurge");
this.addKey("mv purge");
this.addCommandExample("/mv purge " + ChatColor.GREEN + "all");
this.addCommandExample("/mv purge " + ChatColor.GOLD + "all " + ChatColor.GREEN + "all");
this.addCommandExample("/mv purge " + ChatColor.GREEN + "monsters");
this.addCommandExample("/mv purge " + ChatColor.GOLD + "all " + ChatColor.GREEN + "animals");
this.addCommandExample("/mv purge " + ChatColor.GOLD + "MyWorld " + ChatColor.GREEN + "squid");
this.addCommandExample("/mv purge " + ChatColor.GOLD + "MyWorld_nether " + ChatColor.GREEN + "ghast");
this.setPermission("multiverse.core.purge", "Removed the specified type of mob from the specified world.", PermissionDefault.OP);
this.worldManager = this.plugin.getMVWorldManager();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
if (args.size() == 1 && p == null) {
sender.sendMessage("This command requires a WORLD when being run from the console!");
sender.sendMessage(this.getCommandUsage());
return;
}
String worldName = null;
String deathName = null;
if (args.size() == 1) {
worldName = p.getWorld().getName();
deathName = args.get(0);
} else {
worldName = args.get(0);
deathName = args.get(1);
}
if (!worldName.equalsIgnoreCase("all") && !this.worldManager.isMVWorld(worldName)) {
((MultiverseCore) this.plugin).showNotMVWorldMessage(sender, worldName);
sender.sendMessage("It cannot be purged.");
return;
}
List<MultiverseWorld> worldsToRemoveEntitiesFrom = new ArrayList<MultiverseWorld>();
// Handle all case any user who names a world "all" should know better...
if (worldName.equalsIgnoreCase("all")) {
worldsToRemoveEntitiesFrom.addAll(this.worldManager.getMVWorlds());
} else {
worldsToRemoveEntitiesFrom.add(this.worldManager.getMVWorld(worldName));
}
PurgeWorlds purger = this.worldManager.getWorldPurger();
ArrayList<String> thingsToKill = new ArrayList<String>();
if (deathName.equalsIgnoreCase("all") || deathName.equalsIgnoreCase("animals") || deathName.equalsIgnoreCase("monsters")) {
thingsToKill.add(deathName.toUpperCase());
} else {
Collections.addAll(thingsToKill, deathName.toUpperCase().split(","));
}
for (MultiverseWorld w : worldsToRemoveEntitiesFrom) {
purger.purgeWorld(sender, w, thingsToKill, false, false);
}
}
}
@@ -1,53 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.List;
/**
* Regenerates a world.
*/
public class RegenCommand extends MultiverseCommand {
public RegenCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Regenerates a World");
this.setCommandUsage("/mv regen" + ChatColor.GREEN + " {WORLD}" + ChatColor.GOLD + " [-s [SEED]]");
this.setArgRange(1, 3);
this.addKey("mvregen");
this.addKey("mv regen");
this.addCommandExample("You can use the -s with no args to get a new seed:");
this.addCommandExample("/mv regen " + ChatColor.GREEN + "MyWorld" + ChatColor.GOLD + " -s");
this.addCommandExample("or specifiy a seed to get that one:");
this.addCommandExample("/mv regen " + ChatColor.GREEN + "MyWorld" + ChatColor.GOLD + " -s" + ChatColor.AQUA + " gargamel");
this.setPermission("multiverse.core.regen", "Regenerates a world on your server. The previous state will be lost "
+ ChatColor.RED + "PERMANENTLY.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
Boolean useseed = (!(args.size() == 1));
Boolean randomseed = (args.size() == 2 && args.get(1).equalsIgnoreCase("-s"));
String seed = (args.size() == 3) ? args.get(2) : "";
Class<?>[] paramTypes = {String.class, Boolean.class, Boolean.class, String.class};
List<Object> objectArgs = new ArrayList<Object>();
objectArgs.add(args.get(0));
objectArgs.add(useseed);
objectArgs.add(randomseed);
objectArgs.add(seed);
this.plugin.getCommandHandler().queueCommand(sender, "mvregen", "regenWorld", objectArgs,
paramTypes, ChatColor.GREEN + "World Regenerated!", ChatColor.RED + "World could NOT be regenerated!");
}
}
@@ -1,57 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.event.MVConfigReloadEvent;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.List;
/**
* Reloads worlds.yml and config.yml.
*/
public class ReloadCommand extends MultiverseCommand {
public ReloadCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Reload Configs");
this.setCommandUsage("/mv reload");
this.setArgRange(0, 0);
this.addKey("mvreload");
this.addKey("mv reload");
this.addCommandExample("/mv reload");
this.setPermission("multiverse.core.reload", "Reloads worlds.yml and config.yml.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
sender.sendMessage(ChatColor.GOLD + "Reloading all Multiverse Plugin configs...");
this.plugin.loadConfigs();
this.plugin.getAnchorManager().loadAnchors();
this.plugin.getMVWorldManager().loadWorlds(true);
List<String> configsLoaded = new ArrayList<String>();
configsLoaded.add("Multiverse-Core - config.yml");
configsLoaded.add("Multiverse-Core - worlds.yml");
configsLoaded.add("Multiverse-Core - anchors.yml");
// Create the event
MVConfigReloadEvent configReload = new MVConfigReloadEvent(configsLoaded);
// Fire it off
this.plugin.getServer().getPluginManager().callEvent(configReload);
for (String s : configReload.getAllConfigsLoaded()) {
sender.sendMessage(s);
}
sender.sendMessage(ChatColor.GREEN + "Reload Complete!");
}
}
@@ -1,42 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Unloads a world and removes it from the config.
*/
public class RemoveCommand extends MultiverseCommand {
public RemoveCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Remove World");
this.setCommandUsage("/mv remove" + ChatColor.GREEN + " {WORLD}");
this.setArgRange(1, 1);
this.addKey("mvremove");
this.addKey("mv remove");
this.addCommandExample("/mv remove " + ChatColor.GREEN + "MyWorld");
this.setPermission("multiverse.core.remove",
"Unloads a world from Multiverse and removes it from worlds.yml, this does NOT DELETE the world folder.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (this.plugin.getMVWorldManager().removeWorldFromConfig(args.get(0))) {
sender.sendMessage("World removed from config!");
} else {
sender.sendMessage("Error trying to remove world from config!");
}
}
}
@@ -1,77 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.utils.BlockSafety;
import com.onarandombox.MultiverseCore.utils.LocationManipulation;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Sets the spawn for a world.
*/
public class SetSpawnCommand extends MultiverseCommand {
public SetSpawnCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Set World Spawn");
this.setCommandUsage("/mv setspawn");
this.setArgRange(0, 0);
this.addKey("mvsetspawn");
this.addKey("mvss");
this.addKey("mv set spawn");
this.addKey("mv setspawn");
this.addKey("mvset spawn");
this.addCommandExample("/mv set spawn");
this.setPermission("multiverse.core.spawn.set", "Sets the spawn for the current world.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
setWorldSpawn(sender);
}
/**
* Does the actual spawn-setting-work.
*
* @param sender The {@link CommandSender} that's setting the spawn.
*/
protected void setWorldSpawn(CommandSender sender) {
if (sender instanceof Player) {
Player p = (Player) sender;
Location l = p.getLocation();
World w = p.getWorld();
MultiverseWorld foundWorld = this.plugin.getMVWorldManager().getMVWorld(w.getName());
if (foundWorld != null) {
foundWorld.setSpawnLocation(p.getLocation());
BlockSafety bs = new BlockSafety();
if (!bs.playerCanSpawnHereSafely(p.getLocation()) && foundWorld.getAdjustSpawn()) {
sender.sendMessage("It looks like that location would normally be unsafe. But I trust you.");
sender.sendMessage("I'm turning off the Safe-T-Teleporter for spawns to this world.");
sender.sendMessage("If you want this turned back on just do:");
sender.sendMessage(ChatColor.AQUA + "/mvm set adjustspawn true " + foundWorld.getAlias());
foundWorld.setAdjustSpawn(false);
}
sender.sendMessage("Spawn was set to: " + LocationManipulation.strCoords(p.getLocation()));
} else {
w.setSpawnLocation(l.getBlockX(), l.getBlockY(), l.getBlockZ());
sender.sendMessage("Multiverse does not know about this world, only X,Y and Z set. Please import it to set the spawn fully (Pitch/Yaws).");
}
} else {
sender.sendMessage("You cannot use this command from the console.");
}
}
}
@@ -1,42 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Takes the player to the latest bed he's slept in.
*/
public class SleepCommand extends MultiverseCommand {
public SleepCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Go to Sleep");
this.setCommandUsage("/mv sleep");
this.setArgRange(0, 0);
this.addKey("mv sleep");
this.setPermission("multiverse.core.sleep", "Takes you the latest bed you've slept in (Currently BROKEN).", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
if (p == null) {
return;
}
}
}
@@ -1,90 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Teleports a player to the spawn.
*/
public class SpawnCommand extends MultiverseCommand {
public SpawnCommand(MultiverseCore plugin) {
super(plugin);
Permission otherPerm = new Permission("multiverse.core.spawn.other",
"Teleports another player to the spawn of the world they are in.", PermissionDefault.OP);
this.setName("Spawn");
this.setCommandUsage("/mv spawn" + ChatColor.GOLD + " [PLAYER]");
this.setArgRange(0, 1);
this.addKey("mvspawn");
this.addKey("mv spawn");
this.addKey("mvs");
this.setPermission("multiverse.core.spawn.self", "Teleports you to the Spawn Point of the world you are in.", PermissionDefault.OP);
this.addAdditonalPermission(otherPerm);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
// If a persons name was passed in, you must be A. the console, or B have permissions
if (args.size() == 1) {
if (player != null && !this.plugin.getMVPerms().hasPermission(player, "multiverse.core.spawn.other", true)) {
sender.sendMessage("You don't have permission to teleport another player to spawn. (multiverse.core.spawn.other)");
return;
}
Player target = this.plugin.getServer().getPlayer(args.get(0));
if (target != null) {
target.sendMessage("Teleporting to this world's spawn...");
spawnAccurately(target);
if (player != null) {
target.sendMessage("You were teleported by: " + ChatColor.YELLOW + player.getName());
} else {
target.sendMessage("You were teleported by: " + ChatColor.LIGHT_PURPLE + "the console");
}
} else {
sender.sendMessage(args.get(0) + " is not logged on right now!");
}
} else {
if (player != null && !this.plugin.getMVPerms().hasPermission(player, "multiverse.core.spawn.self", true)) {
sender.sendMessage("You don't have permission to teleport yourself to spawn. (multiverse.core.spawn.self)");
return;
}
if (player != null) {
player.sendMessage("Teleporting to this world's spawn...");
spawnAccurately(player);
} else {
sender.sendMessage("From the console, you must provide a PLAYER.");
}
}
}
private void spawnAccurately(Player player) {
MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(player.getWorld().getName());
Location spawnLocation;
if (world != null) {
spawnLocation = world.getSpawnLocation();
} else {
spawnLocation = player.getWorld().getSpawnLocation();
}
this.plugin.getTeleporter().safelyTeleport(player, player, spawnLocation, false);
}
}
@@ -1,65 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import org.getspout.spoutapi.gui.GenericButton;
import org.getspout.spoutapi.gui.GenericPopup;
import org.getspout.spoutapi.gui.PopupScreen;
import org.getspout.spoutapi.player.SpoutPlayer;
import java.util.List;
/**
* Edit a world with spout.
*/
public class SpoutCommand extends MultiverseCommand {
public SpoutCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Edit World with Spout");
this.setCommandUsage("/mv spout");
this.setArgRange(0, 0);
this.addKey("mv spout");
this.setPermission("multiverse.core.spout", "Edit a world with spout.", PermissionDefault.OP);
this.addCommandExample("/mv spout");
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "This command must be run as a player!");
return;
}
if (plugin.getSpout() == null) {
sender.sendMessage(ChatColor.RED + "You need spout installed on this server to use it with Multiverse!");
return;
}
SpoutPlayer p = (SpoutPlayer) sender;
if (!p.isSpoutCraftEnabled()) {
sender.sendMessage(ChatColor.RED + p.getName() + "You need to be using the Spoutcraft client to run this command!");
return;
}
PopupScreen pop = new GenericPopup();
GenericButton button = new GenericButton("Fish");
// TODO maybe use constants for these
// BEGIN CHECKSTYLE-SUPPRESSION: MagicNumberCheck
button.setX(50);
button.setY(50);
button.setWidth(100);
button.setHeight(40);
// END CHECKSTYLE-SUPPRESSION: MagicNumberCheck
pop.attachWidget(this.plugin, button);
sender.sendMessage(ChatColor.GREEN + "YAY!");
p.getMainScreen().attachPopupScreen(pop);
}
}
@@ -1,207 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.destination.DestinationFactory;
import com.onarandombox.MultiverseCore.destination.InvalidDestination;
import com.onarandombox.MultiverseCore.destination.WorldDestination;
import com.onarandombox.MultiverseCore.enums.TeleportResult;
import com.onarandombox.MultiverseCore.event.MVTeleportEvent;
import com.onarandombox.MultiverseCore.utils.LocationManipulation;
import com.onarandombox.MultiverseCore.utils.SafeTTeleporter;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
/**
* Used to teleport players.
*/
public class TeleportCommand extends MultiverseCommand {
private SafeTTeleporter playerTeleporter;
public TeleportCommand(MultiverseCore plugin) {
super(plugin);
Permission menu = new Permission("multiverse.teleport.*", "Allows you to display the teleport menu.", PermissionDefault.OP);
this.setName("Teleport");
this.setCommandUsage("/mv tp " + ChatColor.GOLD + "[PLAYER]" + ChatColor.GREEN + " {WORLD}");
this.setArgRange(1, 2);
this.addKey("mvtp");
this.addKey("mv tp");
this.playerTeleporter = new SafeTTeleporter(this.plugin);
this.setPermission(menu);
}
private static final int UNSAFE_TELEPORT_EXPIRE_DELAY = 15;
@Override
public void runCommand(CommandSender sender, List<String> args) {
// Check if the command was sent from a Player.
CommandSender teleporter = sender;
Player teleportee = null;
if (sender instanceof Player) {
teleporter = (Player) sender;
}
String destinationName;
if (args.size() == 2) {
teleportee = this.plugin.getServer().getPlayer(args.get(0));
if (teleportee == null) {
this.messaging.sendMessage(sender, String.format("Sorry, I couldn't find player: %s%s",
ChatColor.GOLD, args.get(0)), false);
return;
}
destinationName = args.get(1);
} else {
destinationName = args.get(0);
if (!(sender instanceof Player)) {
this.messaging.sendMessage(sender, String.format("From the console, you must specify a player to teleport"), false);
return;
}
teleportee = (Player) sender;
}
// Special case for cannons:
if (destinationName.matches("(?i)cannon-[\\d]+(\\.[\\d]+)?")) {
String[] cannonSpeed = destinationName.split("-");
try {
double speed = Double.parseDouble(cannonSpeed[1]);
destinationName = "ca:" + teleportee.getWorld().getName() + ":" + teleportee.getLocation().getX()
+ "," + teleportee.getLocation().getY() + "," + teleportee.getLocation().getZ() + ":"
+ teleportee.getLocation().getPitch() + ":" + teleportee.getLocation().getYaw() + ":" + speed;
} catch (Exception e) {
destinationName = "i:invalid";
}
}
DestinationFactory df = this.plugin.getDestFactory();
MVDestination d = df.getDestination(destinationName);
MVTeleportEvent teleportEvent = new MVTeleportEvent(d, teleportee, teleporter, true);
this.plugin.getServer().getPluginManager().callEvent(teleportEvent);
if (teleportEvent.isCancelled()) {
this.plugin.log(Level.FINE, "Someone else cancelled the MVTeleport Event!!!");
return;
}
if (d != null && d instanceof InvalidDestination) {
this.messaging.sendMessage(sender, String.format("Multiverse does not know how to take you to %s%s",
ChatColor.RED, destinationName), false);
return;
}
if (!this.checkSendPermissions(teleporter, teleportee, d)) {
return;
}
if (MultiverseCore.EnforceAccess && teleporter != null && !this.plugin.getMVPerms().canEnterDestination(teleporter, d)) {
if (teleportee.equals(teleporter)) {
teleporter.sendMessage("Doesn't look like you're allowed to go " + ChatColor.RED + "there...");
} else {
teleporter.sendMessage("Doesn't look like you're allowed to send " + ChatColor.GOLD
+ teleportee.getName() + ChatColor.WHITE + " to " + ChatColor.RED + "there...");
}
return;
} else if (teleporter != null && !this.plugin.getMVPerms().canTravelFromLocation(teleporter, d.getLocation(teleportee))) {
if (teleportee.equals(teleporter)) {
this.messaging.sendMessage(teleporter, String.format("DOH! Doesn't look like you can get to %s%s %sfrom where you are...",
ChatColor.GREEN, d.toString(), ChatColor.WHITE), false);
} else {
this.messaging.sendMessage(teleporter, String.format("DOH! Doesn't look like %s%s %scan get to %sTHERE from where they are...",
ChatColor.GREEN, ((Player) teleporter).getWorld().getName(), ChatColor.WHITE, ChatColor.RED), false);
}
return;
}
// Special check to verify if players are tryint to teleport to the same
// WORLDDestination as the world they're in, that they ALSO have multiverse.core.spawn.self
if (d instanceof WorldDestination) {
World w = d.getLocation(teleportee).getWorld();
if (teleportee.getWorld().equals(w)) {
if (teleporter.equals(teleportee)) {
if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.core.spawn.self", true)) {
this.messaging.sendMessages(teleporter, new String[]{
String.format("Sorry you don't have permission to go to the world spawn!"),
String.format("%s (multiverse.core.spawn.self)",
ChatColor.RED) }, false);
return;
}
} else {
if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.core.spawn.other", true)) {
this.messaging.sendMessages(teleporter, new String[]{
String.format("Sorry you don't have permission to send %s to the world spawn!",
teleportee.getDisplayName()),
String.format("%s (multiverse.core.spawn.other)",
ChatColor.RED) }, false);
return;
}
}
}
}
if (d.getLocation(teleportee) == null) {
this.messaging.sendMessage(teleporter, "Sorry Boss, I tried everything, but just couldn't teleport ya there!", false);
return;
}
TeleportResult result = this.playerTeleporter.safelyTeleport(teleporter, teleportee, d);
if (result == TeleportResult.FAIL_UNSAFE) {
this.plugin.log(Level.FINE, "Could not teleport " + teleportee.getName() + " to " + LocationManipulation.strCoordsRaw(d.getLocation(teleportee)));
this.plugin.log(Level.FINE, "Queueing Command");
Class<?>[] paramTypes = { CommandSender.class, Player.class, Location.class };
List<Object> items = new ArrayList<Object>();
items.add(teleporter);
items.add(teleportee);
items.add(d.getLocation(teleportee));
String player = "you";
if (!teleportee.equals(teleporter)) {
player = teleportee.getName();
}
String message = String.format("%sMultiverse %sdid not teleport %s%s%sto %s%s%sbecause it was unsafe.",
ChatColor.GREEN, ChatColor.WHITE, ChatColor.AQUA, player, ChatColor.WHITE, ChatColor.DARK_AQUA, d.getName(), ChatColor.WHITE);
this.plugin.getCommandHandler().queueCommand(sender, "mvteleport", "teleportPlayer", items,
paramTypes, message, "Would you like to try anyway?", "", "", UNSAFE_TELEPORT_EXPIRE_DELAY);
}
// else: Player was teleported successfully (or the tp event was fired I should say)
}
private boolean checkSendPermissions(CommandSender teleporter, Player teleportee, MVDestination destination) {
if (teleporter.equals(teleportee)) {
if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.teleport.self." + destination.getIdentifier(), true)) {
this.messaging.sendMessages(teleporter, new String[]{
String.format("%sYou don't have permission to teleport %syourself %sto a %s%s %sDestination",
ChatColor.WHITE, ChatColor.AQUA, ChatColor.WHITE, ChatColor.RED, destination.getType(), ChatColor.WHITE),
String.format("%s (multiverse.teleport.self.%s)",
ChatColor.RED, destination.getIdentifier()) }, false);
return false;
}
} else {
if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.teleport.other." + destination.getIdentifier(), true)) {
this.messaging.sendMessages(teleporter, new String[]{
String.format("You don't have permission to teleport another player to a %s%s Destination.",
ChatColor.GREEN, destination.getType()),
String.format("%s(multiverse.teleport.other.%s)",
ChatColor.RED, destination.getIdentifier()) }, false);
return false;
}
}
return true;
}
}
@@ -1,42 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Unloads worlds from Multiverse.
*/
public class UnloadCommand extends MultiverseCommand {
public UnloadCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Unload World");
this.setCommandUsage("/mv unload" + ChatColor.GREEN + " {WORLD}");
this.setArgRange(1, 1);
this.addKey("mvunload");
this.addKey("mv unload");
this.setPermission("multiverse.core.unload",
"Unloads a world from Multiverse. This does NOT remove the world folder. This does NOT remove it from the config file.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (this.plugin.getMVWorldManager().unloadWorld(args.get(0))) {
Command.broadcastCommandMessage(sender, "Unloaded world '" + args.get(0) + "'!");
} else {
sender.sendMessage("Error trying to unload world '" + args.get(0) + "'!");
}
}
}
@@ -1,109 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.event.MVVersionEvent;
import com.onarandombox.MultiverseCore.utils.webpaste.PasteFailedException;
import com.onarandombox.MultiverseCore.utils.webpaste.PasteService;
import com.onarandombox.MultiverseCore.utils.webpaste.PasteServiceFactory;
import com.onarandombox.MultiverseCore.utils.webpaste.PasteServiceType;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
import java.util.logging.Level;
/**
* Dumps version info to the console.
*/
public class VersionCommand extends MultiverseCommand {
public VersionCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Multiverse Version");
this.setCommandUsage("/mv version " + ChatColor.GOLD + "-[pb]");
this.setArgRange(0, 1);
this.addKey("mv version");
this.addKey("mvv");
this.addKey("mvversion");
this.setPermission("multiverse.core.version",
"Dumps version info to the console, optionally to pastie.org with -p or pastebin.com with a -b.", PermissionDefault.TRUE);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// Check if the command was sent from a Player.
if (sender instanceof Player) {
sender.sendMessage("Version info dumped to console. Please check your server logs.");
}
StringBuilder buffer = new StringBuilder();
buffer.append("[Multiverse-Core] Multiverse-Core Version: ").append(this.plugin.getDescription().getVersion()).append('\n');
buffer.append("[Multiverse-Core] Bukkit Version: ").append(this.plugin.getServer().getVersion()).append('\n');
buffer.append("[Multiverse-Core] Loaded Worlds: ").append(this.plugin.getMVWorldManager().getMVWorlds().size()).append('\n');
buffer.append("[Multiverse-Core] Multiverse Plugins Loaded: ").append(this.plugin.getPluginCount()).append('\n');
buffer.append("[Multiverse-Core] Economy being used: ").append(this.plugin.getBank().getEconUsed()).append('\n');
buffer.append("[Multiverse-Core] Permissions Plugin: ").append(this.plugin.getMVPerms().getType()).append('\n');
buffer.append("[Multiverse-Core] Dumping Config Values: (version ")
.append(this.plugin.getMVConfiguration().getDouble("version", -1)).append(")").append('\n');
buffer.append("[Multiverse-Core] messagecooldown: ").append(this.plugin.getMessaging().getCooldown()).append('\n');
buffer.append("[Multiverse-Core] teleportcooldown: ").append("Not yet IMPLEMENTED").append('\n');
buffer.append("[Multiverse-Core] worldnameprefix: ").append(MultiverseCore.PrefixChat).append('\n');
buffer.append("[Multiverse-Core] enforceaccess: ").append(MultiverseCore.EnforceAccess).append('\n');
buffer.append("[Multiverse-Core] displaypermerrors: ").append(MultiverseCore.DisplayPermErrors).append('\n');
buffer.append("[Multiverse-Core] teleportintercept: ").append(MultiverseCore.TeleportIntercept).append('\n');
buffer.append("[Multiverse-Core] firstspawnoverride: ").append(MultiverseCore.FirstSpawnOverride).append('\n');
buffer.append("[Multiverse-Core] firstspawnworld: ").append(this.plugin.getMVConfiguration().getString("firstspawnworld", "NOT SET")).append('\n');
buffer.append("[Multiverse-Core] debug: ").append(MultiverseCore.GlobalDebug).append('\n');
buffer.append("[Multiverse-Core] Special Code: FRN002").append('\n');
MVVersionEvent versionEvent = new MVVersionEvent(buffer.toString());
this.plugin.getServer().getPluginManager().callEvent(versionEvent);
// log to console
String data = versionEvent.getVersionInfo();
String[] lines = data.split("\n");
for (String line : lines) {
this.plugin.log(Level.INFO, line);
}
if (args.size() == 1) {
String pasteUrl = "";
if (args.get(0).equalsIgnoreCase("-p")) {
pasteUrl = postToService(PasteServiceType.PASTIE, true, data); // private post to pastie
} else if (args.get(0).equalsIgnoreCase("-b")) {
pasteUrl = postToService(PasteServiceType.PASTEBIN, true, data); // private post to pastie
} else {
return;
}
sender.sendMessage("Version info dumped here: " + ChatColor.GREEN + pasteUrl);
this.plugin.log(Level.INFO, "Version info dumped here: " + pasteUrl);
}
}
/**
* Send the current contents of this.pasteBinBuffer to a web service.
*
* @param type Service type to send to
* @param isPrivate Should the paste be marked as private.
* @return URL of visible paste
*/
private static String postToService(PasteServiceType type, boolean isPrivate, String pasteData) {
PasteService ps = PasteServiceFactory.getService(type, isPrivate);
try {
return ps.postData(ps.encodeData(pasteData), ps.getPostURL());
} catch (PasteFailedException e) {
System.out.print(e);
return "Error posting to service";
}
}
}
@@ -1,104 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.ArrayList;
import java.util.List;
/**
* States who is in what world.
*/
public class WhoCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public WhoCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Who?");
this.setCommandUsage("/mv who" + ChatColor.GOLD + " [WORLD]");
this.setArgRange(0, 1);
this.addKey("mv who");
this.addKey("mvw");
this.addKey("mvwho");
this.setPermission("multiverse.core.list.who", "States who is in what world.", PermissionDefault.OP);
this.worldManager = this.plugin.getMVWorldManager();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// If this command was sent from a Player then we need to check Permissions
Player p = null;
// By default, show all from the console
boolean showAll = true;
if (sender instanceof Player) {
p = (Player) sender;
showAll = false;
}
List<MultiverseWorld> worlds = new ArrayList<MultiverseWorld>();
if (args.size() > 0) {
MultiverseWorld world = this.worldManager.getMVWorld(args.get(0));
if (args.get(0).equalsIgnoreCase("--all") || args.get(0).equalsIgnoreCase("-a")) {
showAll = true;
worlds = new ArrayList<MultiverseWorld>(this.worldManager.getMVWorlds());
} else if (world != null) {
if (!world.isHidden()) {
worlds.add(world);
}
} else {
sender.sendMessage(ChatColor.RED + "World does not exist");
return;
}
} else {
worlds = new ArrayList<MultiverseWorld>(this.worldManager.getMVWorlds());
}
if (worlds.size() == 0) {
sender.sendMessage("Multiverse does not know about any of your worlds :(");
} else if (worlds.size() == 1) {
sender.sendMessage(ChatColor.AQUA + "--- Players in" + worlds.get(0).getColoredWorldString() + ChatColor.AQUA + " ---");
} else {
sender.sendMessage(ChatColor.AQUA + "--- There are players in ---");
}
for (MultiverseWorld world : worlds) {
if (!(this.worldManager.isMVWorld(world.getName()))) {
continue;
}
if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) {
continue;
}
List<Player> players = world.getCBWorld().getPlayers();
String result = "";
if (players.size() <= 0 && !showAll) {
continue;
}
if (players.size() <= 0) {
result = "Empty";
} else {
for (Player player : players) {
result += player.getDisplayName() + " " + ChatColor.WHITE;
}
}
sender.sendMessage(world.getColoredWorldString() + ChatColor.WHITE + " - " + result);
}
}
}
@@ -1,4 +0,0 @@
/**
* This package contains all Commands.
*/
package com.onarandombox.MultiverseCore.commands;
@@ -1,115 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2012. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
/**
* A {@link String} config-property that will NOT be saved to the config.
*/
public class ActiveStringConfigProperty implements MVActiveConfigProperty<String> {
private String name;
private String value;
private String method;
private String help;
public ActiveStringConfigProperty(String name, String defaultValue, String help) {
this.name = name;
this.help = help;
this.value = defaultValue;
this.parseValue(defaultValue);
}
public ActiveStringConfigProperty(String name, String defaultValue, String help, String method) {
this(name, defaultValue, help);
this.method = method;
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public String getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public String getMethod() {
return this.method;
}
/**
* {@inheritDoc}
*/
@Override
public void setMethod(String methodName) {
this.method = methodName;
}
/**
* {@inheritDoc}
*/
@Override
public Class<?> getPropertyClass() {
return String.class;
}
/**
* {@inheritDoc}
*/
@Override
public boolean parseValue(String value) {
if (value == null) {
return false;
}
this.setValue(value);
return true;
}
/**
* {@inheritDoc}
*/
@Override
public String getConfigNode() {
return "";
}
/**
* {@inheritDoc}
*/
@Override
public String getHelp() {
return this.help;
}
/**
* {@inheritDoc}
*/
@Override
public boolean setValue(String value) {
if (value == null) {
return false;
}
this.value = value;
return true;
}
@Override
public String toString() {
return value;
}
}
@@ -1,135 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import org.bukkit.configuration.ConfigurationSection;
/**
* A {@link Boolean} config-property.
*/
public class BooleanConfigProperty implements MVActiveConfigProperty<Boolean> {
private String name;
private Boolean value;
private String configNode;
private ConfigurationSection section;
private String help;
private String method;
public BooleanConfigProperty(ConfigurationSection section, String name, Boolean defaultValue, String help) {
this(section, name, defaultValue, name, help);
}
public BooleanConfigProperty(ConfigurationSection section, String name, Boolean defaultValue, String configNode, String help) {
this.name = name;
this.configNode = configNode;
this.section = section;
this.help = help;
this.value = defaultValue;
this.setValue(this.section.getBoolean(this.configNode, defaultValue));
}
public BooleanConfigProperty(ConfigurationSection section, String name, Boolean defaultValue, String configNode, String help, String method) {
this(section, name, defaultValue, configNode, help);
this.method = method;
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public Boolean getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public boolean setValue(Boolean value) {
if (value == null) {
return false;
}
this.value = value;
this.section.set(configNode, this.value);
return true;
}
/**
* {@inheritDoc}
*/
@Override
public boolean parseValue(String value) {
if (value == null) {
return false;
}
if (value.toLowerCase().equals("true") || value.toLowerCase().equals("false")) {
this.setValue(Boolean.parseBoolean(value));
return true;
}
return false;
}
/**
* {@inheritDoc}
*/
@Override
public String getConfigNode() {
return this.configNode;
}
/**
* {@inheritDoc}
*/
@Override
public String getHelp() {
return this.help;
}
@Override
public String toString() {
return value.toString();
}
/**
* Gets the method that will be executed.
*
* @return The name of the method in MVWorld to be called.
*/
@Override
public String getMethod() {
return this.method;
}
/**
* Sets the method that will be executed.
*
* @param methodName The name of the method in MVWorld to be called.
*/
@Override
public void setMethod(String methodName) {
this.method = methodName;
}
/**
* Returns the class of the object we're looking at.
*
* @return the class of the object we're looking at.
*/
@Override
public Class<?> getPropertyClass() {
return Boolean.class;
}
}
@@ -1,98 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import com.onarandombox.MultiverseCore.enums.EnglishChatColor;
import org.bukkit.configuration.ConfigurationSection;
/**
* A {@link EnglishChatColor} config-property.
*/
public class ColorConfigProperty implements MVConfigProperty<EnglishChatColor> {
private String name;
private EnglishChatColor value;
private String configNode;
private ConfigurationSection section;
private String help;
public ColorConfigProperty(ConfigurationSection section, String name, EnglishChatColor defaultValue, String help) {
this(section, name, defaultValue, name, help);
}
public ColorConfigProperty(ConfigurationSection section, String name, EnglishChatColor defaultValue, String configNode, String help) {
this.name = name;
this.configNode = configNode;
this.section = section;
this.help = help;
this.value = defaultValue;
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public EnglishChatColor getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public boolean setValue(EnglishChatColor value) {
if (value == null) {
return false;
}
this.value = value;
this.section.set(configNode, this.value.getText());
return true;
}
/**
* {@inheritDoc}
*/
@Override
public boolean parseValue(String value) {
EnglishChatColor color = EnglishChatColor.fromString(value);
if (color == null) {
return false;
}
this.setValue(color);
return true;
}
/**
* {@inheritDoc}
*/
@Override
public String getConfigNode() {
return this.configNode;
}
/**
* {@inheritDoc}
*/
@Override
public String getHelp() {
return this.help;
}
@Override
public String toString() {
return value.toString();
}
}
@@ -1,292 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2012. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import com.onarandombox.MultiverseCore.enums.EnglishChatColor;
import org.bukkit.Difficulty;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
/** A factory to create config properties for a given world. */
public class ConfigPropertyFactory {
private ConfigurationSection section;
public ConfigPropertyFactory(ConfigurationSection section) {
this.section = section;
}
// Booleans
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public BooleanConfigProperty getNewProperty(String name, boolean defaultValue, String help) {
return new BooleanConfigProperty(this.section, name, defaultValue, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public BooleanConfigProperty getNewProperty(String name, boolean defaultValue, String node, String help) {
return new BooleanConfigProperty(this.section, name, defaultValue, node, help);
}
/**
* Constructs a new ActiveBooleanConfigProperty
*
* This property will execute 'method' after it has been successfully set.
*
* @param name The name of this ConifgProperty
* @param defaultValue The default value.
* @param help What string is shown for help.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param method The method that should be executed.
* @return The ActiveStringConfigProperty
*/
public BooleanConfigProperty getNewProperty(String name, boolean defaultValue, String help, String node, String method) {
return new BooleanConfigProperty(this.section, name, defaultValue, help, node, method);
}
// Integers
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public IntegerConfigProperty getNewProperty(String name, int defaultValue, String help) {
return new IntegerConfigProperty(this.section, name, defaultValue, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public IntegerConfigProperty getNewProperty(String name, int defaultValue, String node, String help) {
return new IntegerConfigProperty(this.section, name, defaultValue, node, help);
}
// Doubles
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public DoubleConfigProperty getNewProperty(String name, double defaultValue, String help) {
return new DoubleConfigProperty(this.section, name, defaultValue, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public DoubleConfigProperty getNewProperty(String name, double defaultValue, String node, String help) {
return new DoubleConfigProperty(this.section, name, defaultValue, node, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @param method The name of the method that's used to set this property.
* @return The ConfigProperty.
*/
public DoubleConfigProperty getNewProperty(String name, double defaultValue, String node, String help, String method) {
return new DoubleConfigProperty(this.section, name, defaultValue, node, help, method);
}
// Strings
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public StringConfigProperty getNewProperty(String name, String defaultValue, String help) {
return new StringConfigProperty(this.section, name, defaultValue, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public StringConfigProperty getNewProperty(String name, String defaultValue, String node, String help) {
return new StringConfigProperty(this.section, name, defaultValue, node, help);
}
// Colors
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public ColorConfigProperty getNewProperty(String name, EnglishChatColor defaultValue, String help) {
return new ColorConfigProperty(this.section, name, defaultValue, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public ColorConfigProperty getNewProperty(String name, EnglishChatColor defaultValue, String node, String help) {
return new ColorConfigProperty(this.section, name, defaultValue, node, help);
}
// Difficulty
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public DifficultyConfigProperty getNewProperty(String name, Difficulty defaultValue, String help) {
return new DifficultyConfigProperty(this.section, name, defaultValue, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public DifficultyConfigProperty getNewProperty(String name, Difficulty defaultValue, String node, String help) {
return new DifficultyConfigProperty(this.section, name, defaultValue, node, help);
}
// GameMode
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public GameModeConfigProperty getNewProperty(String name, GameMode defaultValue, String help) {
return new GameModeConfigProperty(this.section, name, defaultValue, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public GameModeConfigProperty getNewProperty(String name, GameMode defaultValue, String node, String help) {
return new GameModeConfigProperty(this.section, name, defaultValue, node, help);
}
// GameMode
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public LocationConfigProperty getNewProperty(String name, Location defaultValue, String help) {
return new LocationConfigProperty(this.section, name, defaultValue, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @return The ConfigProperty.
*/
public LocationConfigProperty getNewProperty(String name, Location defaultValue, String node, String help) {
return new LocationConfigProperty(this.section, name, defaultValue, node, help);
}
/**
* Constructs a new ConfigProperty.
*
* @param name The name of this ConfigProperty.
* @param defaultValue The default-value.
* @param node The name of the configuration-node this ConfigProperty will be stored as.
* @param help The text that's displayed when a user failed to set the property.
* @param method The name of the method that's used to set this property.
* @return The ConfigProperty.
*/
public LocationConfigProperty getNewProperty(String name, Location defaultValue, String node, String help, String method) {
return new LocationConfigProperty(this.section, name, defaultValue, node, help, method);
}
/**
* Constructs a new ActiveStringConfigProperty
*
* This property will execute 'method' after it has been successfully set.
* This string will NOT be saved to the config file.
*
* @param name The name of this ConifgProperty
* @param defaultValue The default value.
* @param help What string is shown for help.
* @param method The method that should be executed.
* @param saveToConfig Should the variable save to the config?
* @return The ActiveStringConfigProperty
*/
public ActiveStringConfigProperty getNewProperty(String name, String defaultValue, String help, String method, boolean saveToConfig) {
return new ActiveStringConfigProperty(name, defaultValue, help, method);
}
}
@@ -1,129 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import org.bukkit.Difficulty;
import org.bukkit.configuration.ConfigurationSection;
/**
* A {@link Difficulty} config-property.
*/
public class DifficultyConfigProperty implements MVActiveConfigProperty<Difficulty> {
private String name;
private Difficulty value;
private String configNode;
private ConfigurationSection section;
private String help;
public DifficultyConfigProperty(ConfigurationSection section, String name, Difficulty defaultValue, String help) {
this(section, name, defaultValue, name, help);
}
public DifficultyConfigProperty(ConfigurationSection section, String name, Difficulty defaultValue, String configNode, String help) {
this.name = name;
this.configNode = configNode;
this.section = section;
this.help = help;
this.value = defaultValue;
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public Difficulty getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public boolean setValue(Difficulty value) {
if (value == null) {
return false;
}
this.value = value;
this.section.set(configNode, this.value.toString());
return true;
}
/**
* {@inheritDoc}
*/
@Override
public boolean parseValue(String value) {
try {
return this.setValue(Difficulty.getByValue(Integer.parseInt(value)));
} catch (NumberFormatException nfe) {
try {
return this.setValue(Difficulty.valueOf(value.toUpperCase()));
} catch (Exception e) {
return false;
}
}
}
/**
* {@inheritDoc}
*/
@Override
public String getConfigNode() {
return this.configNode;
}
/**
* {@inheritDoc}
*/
@Override
public String getHelp() {
return this.help;
}
@Override
public String toString() {
return value.toString();
}
/**
* Gets the method that will be executed.
*
* @return The name of the method in MVWorld to be called.
*/
@Override
public String getMethod() {
return "setActualDifficulty";
}
/**
* Sets the method that will be executed.
*
* @param methodName The name of the method in MVWorld to be called.
*/
@Override
public void setMethod(String methodName) {
// Unused here. This will only ever be setDifficulty.
}
/**
* {@inheritDoc}
*/
@Override
public Class<?> getPropertyClass() {
return Difficulty.class;
}
}
@@ -1,133 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import org.bukkit.configuration.ConfigurationSection;
/**
* A {@link Double} config-property.
*/
public class DoubleConfigProperty implements MVActiveConfigProperty<Double> {
private String name;
private Double value;
private String configNode;
private ConfigurationSection section;
private String help;
private String method;
public DoubleConfigProperty(ConfigurationSection section, String name, Double defaultValue, String help) {
this(section, name, defaultValue, name, help);
}
public DoubleConfigProperty(ConfigurationSection section, String name, Double defaultValue, String configNode, String help) {
this.name = name;
this.configNode = configNode;
this.section = section;
this.help = help;
this.value = defaultValue;
this.setValue(this.section.getDouble(this.configNode, defaultValue));
}
public DoubleConfigProperty(ConfigurationSection section, String name, Double defaultValue, String configNode, String help, String method) {
this(section, name, defaultValue, configNode, help);
this.method = method;
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public Double getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public boolean setValue(Double value) {
if (value == null) {
return false;
}
this.value = value;
this.section.set(configNode, this.value);
return true;
}
/**
* {@inheritDoc}
*/
@Override
public boolean parseValue(String value) {
try {
this.setValue(Double.parseDouble(value));
return true;
} catch (NumberFormatException e) {
return false;
}
}
/**
* {@inheritDoc}
*/
@Override
public String getConfigNode() {
return this.configNode;
}
/**
* {@inheritDoc}
*/
@Override
public String getHelp() {
return this.help;
}
@Override
public String toString() {
return value.toString();
}
/**
* Gets the method that will be executed.
*
* @return The name of the method in MVWorld to be called.
*/
@Override
public String getMethod() {
return this.method;
}
/**
* Sets the method that will be executed.
*
* @param methodName The name of the method in MVWorld to be called.
*/
@Override
public void setMethod(String methodName) {
this.method = methodName;
}
/**
* Returns the class of the object we're looking at.
*
* @return the class of the object we're looking at.
*/
@Override
public Class<?> getPropertyClass() {
return Double.class;
}
}
@@ -1,129 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import org.bukkit.GameMode;
import org.bukkit.configuration.ConfigurationSection;
/**
* A {@link GameMode} config-property.
*/
public class GameModeConfigProperty implements MVActiveConfigProperty<GameMode> {
private String name;
private GameMode value;
private String configNode;
private ConfigurationSection section;
private String help;
public GameModeConfigProperty(ConfigurationSection section, String name, GameMode defaultValue, String help) {
this(section, name, defaultValue, name, help);
}
public GameModeConfigProperty(ConfigurationSection section, String name, GameMode defaultValue, String configNode, String help) {
this.name = name;
this.configNode = configNode;
this.section = section;
this.help = help;
this.value = defaultValue;
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public GameMode getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public boolean setValue(GameMode value) {
if (value == null) {
return false;
}
this.value = value;
this.section.set(configNode, this.value.toString());
return true;
}
/**
* {@inheritDoc}
*/
@Override
public boolean parseValue(String value) {
try {
return this.setValue(GameMode.getByValue(Integer.parseInt(value)));
} catch (NumberFormatException nfe) {
try {
return this.setValue(GameMode.valueOf(value.toUpperCase()));
} catch (Exception e) {
return false;
}
}
}
/**
* {@inheritDoc}
*/
@Override
public String getConfigNode() {
return this.configNode;
}
/**
* {@inheritDoc}
*/
@Override
public String getHelp() {
return this.help;
}
@Override
public String toString() {
return value.toString();
}
/**
* Gets the method that will be executed.
*
* @return The name of the method in MVWorld to be called.
*/
@Override
public String getMethod() {
return "setActualGameMode";
}
/**
* Sets the method that will be executed.
*
* @param methodName The name of the method in MVWorld to be called.
*/
@Override
public void setMethod(String methodName) {
// Not required. Gamemode will only ever be one.
}
/**
* {@inheritDoc}
*/
@Override
public Class<?> getPropertyClass() {
return GameMode.class;
}
}
@@ -1,97 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import org.bukkit.configuration.ConfigurationSection;
/**
* A {@link Integer} config-property.
*/
public class IntegerConfigProperty implements MVConfigProperty<Integer> {
private String name;
private Integer value;
private String configNode;
private ConfigurationSection section;
private String help;
public IntegerConfigProperty(ConfigurationSection section, String name, Integer defaultValue, String help) {
this(section, name, defaultValue, name, help);
}
public IntegerConfigProperty(ConfigurationSection section, String name, Integer defaultValue, String configNode, String help) {
this.name = name;
this.configNode = configNode;
this.section = section;
this.help = help;
this.value = defaultValue;
this.setValue(this.section.getInt(this.configNode, defaultValue));
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public Integer getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public boolean setValue(Integer value) {
if (value == null) {
return false;
}
this.value = value;
this.section.set(configNode, this.value);
return true;
}
/**
* {@inheritDoc}
*/
@Override
public boolean parseValue(String value) {
try {
this.setValue(Integer.parseInt(value));
return true;
} catch (NumberFormatException e) {
return false;
}
}
/**
* {@inheritDoc}
*/
@Override
public String getConfigNode() {
return this.configNode;
}
/**
* {@inheritDoc}
*/
@Override
public String getHelp() {
return this.help;
}
@Override
public String toString() {
return value.toString();
}
}
@@ -1,151 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import com.onarandombox.MultiverseCore.utils.LocationManipulation;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
/**
* A {@link Location} config-property.
*/
public class LocationConfigProperty implements MVActiveConfigProperty<Location> {
private String name;
private Location value;
private String configNode;
private ConfigurationSection section;
private String help;
private String method;
public LocationConfigProperty(ConfigurationSection section, String name, Location defaultValue, String help) {
this(section, name, defaultValue, name, help);
}
public LocationConfigProperty(ConfigurationSection section, String name, Location defaultValue, String configNode, String help) {
this.name = name;
this.configNode = configNode;
this.section = section;
this.help = help;
this.value = defaultValue;
this.setValue(this.getLocationFromConfig(defaultValue));
}
public LocationConfigProperty(ConfigurationSection section, String name, Location defaultValue, String configNode, String help, String method) {
this(section, name, defaultValue, configNode, help);
this.method = method;
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public Location getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public boolean parseValue(String value) {
Location parsed = LocationManipulation.stringToLocation(value);
return this.setValue(parsed);
}
/**
* {@inheritDoc}
*/
@Override
public String getConfigNode() {
return this.configNode;
}
/**
* {@inheritDoc}
*/
@Override
public String getHelp() {
return this.help;
}
/**
* {@inheritDoc}
*/
@Override
public boolean setValue(Location value) {
if (value == null) {
return false;
}
this.value = value;
this.section.set(configNode + ".x", this.value.getX());
this.section.set(configNode + ".y", this.value.getY());
this.section.set(configNode + ".z", this.value.getZ());
this.section.set(configNode + ".pitch", this.value.getPitch());
this.section.set(configNode + ".yaw", this.value.getYaw());
this.section.set(configNode + ".world", this.value.getWorld().getName());
return true;
}
private Location getLocationFromConfig(Location defaultValue) {
double x = this.section.getDouble(this.configNode + ".x", defaultValue.getX());
double y = this.section.getDouble(this.configNode + ".y", defaultValue.getY());
double z = this.section.getDouble(this.configNode + ".z", defaultValue.getZ());
double pitch = this.section.getDouble(this.configNode + ".pitch", defaultValue.getPitch());
double yaw = this.section.getDouble(this.configNode + ".yaw", defaultValue.getYaw());
String w = this.section.getString(this.configNode + ".world", defaultValue.getWorld().getName());
Location found = LocationManipulation.stringToLocation(w + ":" + x + "," + y + "," + z + ":" + yaw + ":" + pitch);
if (found != null) {
return found;
}
return defaultValue;
}
@Override
public String toString() {
return LocationManipulation.strCoordsRaw(this.value);
}
/**
* Gets the method that will be executed.
*
* @return The name of the method in MVWorld to be called.
*/
@Override
public String getMethod() {
return this.method;
}
/**
* Sets the method that will be executed.
*
* @param methodName The name of the method in MVWorld to be called.
*/
@Override
public void setMethod(String methodName) {
this.method = methodName;
}
/**
* Returns the class of the object we're looking at.
*
* @return the class of the object we're looking at.
*/
@Override
public Class<?> getPropertyClass() {
return Location.class;
}
}
@@ -1,35 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2012. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
/**
* An "active" {@link MVConfigProperty} that uses the specified method to be "actually" set.
* @param <T> The type of the config-property.
* @see MVConfigProperty
*/
public interface MVActiveConfigProperty<T> extends MVConfigProperty<T> {
/**
* Gets the method that will be executed.
*
* @return The name of the method in MVWorld to be called.
*/
String getMethod();
/**
* Sets the method that will be executed.
*
* @param methodName The name of the method in MVWorld to be called.
*/
void setMethod(String methodName);
/**
* Returns the class of the object we're looking at.
* @return the class of the object we're looking at.
*/
Class<?> getPropertyClass();
}
@@ -1,75 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import com.onarandombox.MultiverseCore.api.LoggablePlugin;
import org.bukkit.plugin.Plugin;
import org.bukkit.util.config.Configuration;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
/*
* This is a mess, so I'm just going to suppress all warnings here.
* BEGIN CHECKSTYLE-SUPPRESSION: ALL
*/
/**
* @deprecated This isn't used any more, is it?
*/
@Deprecated
public abstract class MVConfigMigrator {
public List<String> createdDefaults = new ArrayList<String>();
public abstract boolean migrate(String name, File folder);
protected final void migrateListItem(Configuration newConfig, Configuration oldConfig, String key, String oldProperty, String newProperty) {
List<String> list = Arrays.asList(oldConfig.getString("worlds." + key + oldProperty).split(","));
if (list.size() > 0) {
if (list.get(0).length() == 0) {
list = new ArrayList<String>();
}
}
newConfig.setProperty("worlds." + key + newProperty, list);
}
protected final File detectMultiverseFolders(File folder, LoggablePlugin mvPlugin) {
File oldFolder = null;
mvPlugin.log(Level.INFO, "Starting Multiverse Configuration Migrator(MVCM)!");
// They still have MV 1 installed! Good!
if (mvPlugin.getServer().getPluginManager().getPlugin("MultiVerse") != null) {
mvPlugin.log(Level.INFO, "Found MultiVerse 1. Starting Config Migration...");
Plugin plugin = mvPlugin.getServer().getPluginManager().getPlugin("MultiVerse");
oldFolder = plugin.getDataFolder();
} else {
// They didn't have MV 1 enabled... let's try and find the folder...
File[] folders = folder.getParentFile().listFiles();
List<File> folderList = Arrays.asList(folders);
for (File f : folderList) {
if (f.getName().equalsIgnoreCase("MultiVerse")) {
mvPlugin.log(Level.INFO, "Found the MultiVerse 1 config folder. Starting Config Migration...");
oldFolder = f;
}
}
if (oldFolder == null) {
mvPlugin.log(Level.INFO, "Did not find the MV1 Folder. If you did not have MultiVerse 1 installed and this is the FIRST time you're running MV2, this message is GOOD. ");
mvPlugin.log(Level.INFO, "If you did, your configs were **NOT** migrated! Go Here: INSERTURLFORHELP");
return null;
}
}
return oldFolder;
}
}
/*
* END CHECKSTYLE-SUPPRESSION: ALL
*/
@@ -1,67 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
/**
* A generic config-property.
*
* @param <T> The type of the config-property.
*/
public interface MVConfigProperty<T> {
/**
* Gets the name of this property.
*
* @return The name of this property.
*/
String getName();
/**
* Gets the value of this property.
*
* @return The value of this property.
*/
T getValue();
/**
* Gets the string representation of this value.
*
* @return The value of this property as a string.
*/
String toString();
/**
* Gets the help string for this.
*
* @return The value of this property as a string.
*/
String getHelp();
/**
* Sets the value of this property.
*
* @param value The T representation of this value.
* @return True the value was successfully set.
*/
boolean setValue(T value);
/**
* This parseValue should be used with strings.
*
* @param value The string representation of the value to set.
*
* @return True if the value was set, false if not.
*/
boolean parseValue(String value);
/**
* Gets the name of the config-node that this {@link MVConfigProperty} is saved as.
*
* @return The name of the config-node that this {@link MVConfigProperty} is saved as.
*/
String getConfigNode();
}
@@ -1,96 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.configuration;
import org.bukkit.configuration.ConfigurationSection;
/**
* A {@link String} config-property.
*/
public class StringConfigProperty implements MVConfigProperty<String> {
private String name;
private String value;
private String configNode;
private ConfigurationSection section;
private String help;
public StringConfigProperty(ConfigurationSection section, String name, String defaultValue, String help) {
this(section, name, defaultValue, defaultValue, help);
}
public StringConfigProperty(ConfigurationSection section, String name, String defaultValue, String configNode, String help) {
this.name = name;
this.configNode = configNode;
this.section = section;
this.help = help;
this.value = defaultValue;
this.parseValue(this.section.getString(this.configNode, defaultValue));
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public String getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public boolean parseValue(String value) {
if (value == null) {
return false;
}
this.setValue(value);
return true;
}
/**
* {@inheritDoc}
*/
@Override
public String getConfigNode() {
return this.configNode;
}
/**
* {@inheritDoc}
*/
@Override
public String getHelp() {
return this.help;
}
/**
* {@inheritDoc}
*/
@Override
public boolean setValue(String value) {
if (value == null) {
return false;
}
this.value = value;
this.section.set(configNode, this.value);
return true;
}
@Override
public String toString() {
return value;
}
}
@@ -1,4 +0,0 @@
/**
* This package contains the Multiverse-configuration.
*/
package com.onarandombox.MultiverseCore.configuration;
@@ -1,148 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.destination;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
import java.util.Arrays;
import java.util.List;
/**
* An anchor-{@link MVDestination}.
*/
public class AnchorDestination implements MVDestination {
private boolean isValid;
private Location location;
private MultiverseCore plugin;
private String name;
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "a";
}
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
return new Vector(0, 0, 0);
}
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
return false;
}
this.plugin = (MultiverseCore) plugin;
List<String> parsed = Arrays.asList(destination.split(":"));
// Need at least: a:name
if (!(parsed.size() == 2)) {
return false;
}
// If it's not an Anchor type
return parsed.get(0).equalsIgnoreCase("a");
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity e) {
return this.location;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
return;
}
this.plugin = (MultiverseCore) plugin;
List<String> parsed = Arrays.asList(destination.split(":"));
// Need at least: e:world:x,y,z
// OR e:world:x,y,z:pitch:yaw
// so basically 3 or 5
if (!(parsed.size() == 2)) {
this.isValid = false;
return;
}
this.name = parsed.get(1);
this.location = this.plugin.getAnchorManager().getAnchorLocation(parsed.get(1));
if (this.location == null) {
this.isValid = false;
return;
}
if (!parsed.get(0).equalsIgnoreCase(this.getIdentifier())) {
this.isValid = false;
}
this.isValid = true;
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "Anchor";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Anchor: " + this.name;
}
@Override
public String toString() {
if (isValid) {
return "a:" + this.name;
}
return "i:Invalid Destination";
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
return "multiverse.access." + this.location.getWorld().getName();
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
// This is an ANCHOR destination, don't safely teleport here.
return false;
}
}
@@ -1,119 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.destination;
import com.onarandombox.MultiverseCore.api.MVDestination;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
/**
* A bed-{@link MVDestination}.
*/
public class BedDestination implements MVDestination {
private boolean isValid;
private Location knownBedLoc;
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "b";
}
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
String[] split = destination.split(":");
this.isValid = split.length >= 1 && split.length <= 2 && split[0].equals(this.getIdentifier());
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity entity) {
if (entity instanceof Player) {
this.knownBedLoc = ((Player) entity).getBedSpawnLocation();
return this.knownBedLoc;
}
return null;
}
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
return new Vector();
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
// Not needed.
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "Bed";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Bed";
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
if (knownBedLoc != null) {
return "multiverse.access." + knownBedLoc.getWorld().getName();
}
return "";
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
// Bukkit should have already checked this.
return false;
}
@Override
public String toString() {
return "b:playerbed";
}
}
@@ -1,227 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.destination;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
import java.util.Arrays;
import java.util.List;
/**
* A cannon-{@link MVDestination}.
*/
public class CannonDestination implements MVDestination {
private final String coordRegex = "(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*)";
private boolean isValid;
private Location location;
private double speed;
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
double pitchRadians = Math.toRadians(location.getPitch());
double yawRadians = Math.toRadians(location.getYaw());
double x = Math.sin(yawRadians) * speed * -1;
double y = Math.sin(pitchRadians) * speed * -1;
double z = Math.cos(yawRadians) * speed;
// Account for the angle they were pointed, and take away velocity
x = Math.cos(pitchRadians) * x;
z = Math.cos(pitchRadians) * z;
return new Vector(x, y, z);
}
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "ca";
}
// NEED ca:world:x,y,z:pitch:yaw:speed
// so basically 6
private static final int SPLIT_SIZE = 6;
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
return false;
}
List<String> parsed = Arrays.asList(destination.split(":"));
if (parsed.size() != SPLIT_SIZE) {
return false;
}
// If it's not an Cannon type
if (!parsed.get(0).equalsIgnoreCase("ca")) {
return false;
}
// If it's not a MV world
if (!((MultiverseCore) plugin).getMVWorldManager().isMVWorld(parsed.get(1))) {
return false;
}
// Verify X,Y,Z are numbers
if (!parsed.get(2).matches(coordRegex)) {
return false;
}
try {
// BEGIN CHECKSTYLE-SUPPRESSION: MagicNumberCheck
Float.parseFloat(parsed.get(3));
Float.parseFloat(parsed.get(4));
Float.parseFloat(parsed.get(5));
// END CHECKSTYLE-SUPPRESSION: MagicNumberCheck
} catch (NumberFormatException e) {
return false;
}
return true;
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity e) {
return this.location;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
return;
}
List<String> parsed = Arrays.asList(destination.split(":"));
if (parsed.size() != SPLIT_SIZE) {
this.isValid = false;
return;
}
if (!parsed.get(0).equalsIgnoreCase(this.getIdentifier())) {
this.isValid = false;
return;
}
if (!((MultiverseCore) plugin).getMVWorldManager().isMVWorld(parsed.get(1))) {
this.isValid = false;
return;
}
this.location = new Location(((MultiverseCore) plugin).getMVWorldManager().getMVWorld(parsed.get(1)).getCBWorld(), 0, 0, 0);
if (!parsed.get(2).matches(this.coordRegex)) {
this.isValid = false;
return;
}
double[] coords = new double[3];
String[] coordString = parsed.get(2).split(",");
for (int i = 0; i < 3; i++) {
try {
coords[i] = Double.parseDouble(coordString[i]);
} catch (NumberFormatException e) {
this.isValid = false;
return;
}
}
this.location.setX(coords[0]);
this.location.setY(coords[1]);
this.location.setZ(coords[2]);
try {
// BEGIN CHECKSTYLE-SUPPRESSION: MagicNumberCheck
this.location.setPitch(Float.parseFloat(parsed.get(3)));
this.location.setYaw(Float.parseFloat(parsed.get(4)));
this.speed = Math.abs(Float.parseFloat(parsed.get(5)));
// END CHECKSTYLE-SUPPRESSION: MagicNumberCheck
} catch (NumberFormatException e) {
this.isValid = false;
return;
}
this.isValid = true;
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "Cannon!";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Cannon (" + this.location.getX() + ", " + this.location.getY() + ", " + this.location.getZ() + ":"
+ this.location.getPitch() + ":" + this.location.getYaw() + ":" + this.speed + ")";
}
/**
* Sets this {@link CannonDestination}.
*
* @param location The {@link Location}.
* @param speed The speed.
*/
public void setDestination(Location location, double speed) {
if (location != null) {
this.location = location;
this.speed = Math.abs(speed);
this.isValid = true;
}
this.isValid = false;
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
return "multiverse.access." + this.location.getWorld().getName();
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
return false;
}
@Override
public String toString() {
if (isValid) {
return "ca:" + location.getWorld().getName() + ":" + location.getX() + "," + location.getY()
+ "," + location.getZ() + ":" + location.getPitch() + ":" + location.getYaw() + ":" + this.speed;
}
return "i:Invalid Destination";
}
}
@@ -1,104 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.destination;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.commands.TeleportCommand;
import com.onarandombox.MultiverseCore.utils.PermissionTools;
import com.pneumaticraft.commandhandler.Command;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** A factory class that will create destinations from specific strings. */
public class DestinationFactory {
private MultiverseCore plugin;
private Map<String, Class<? extends MVDestination>> destList;
private Command teleportCommand;
public DestinationFactory(MultiverseCore plugin) {
this.plugin = plugin;
this.destList = new HashMap<String, Class<? extends MVDestination>>();
List<Command> cmds = this.plugin.getCommandHandler().getAllCommands();
for (Command c : cmds) {
if (c instanceof TeleportCommand) {
this.teleportCommand = c;
}
}
}
/**
* Gets a new destination from a string.
* Returns a new InvalidDestination if the string could not be parsed.
*
* @param destination The destination in string format.
*
* @return A non-null MVDestination
*/
public MVDestination getDestination(String destination) {
String idenChar = "";
if (destination.split(":").length > 1) {
idenChar = destination.split(":")[0];
}
if (this.destList.containsKey(idenChar)) {
Class<? extends MVDestination> myClass = this.destList.get(idenChar);
try {
MVDestination mydest = myClass.newInstance();
if (!mydest.isThisType((MultiverseCore) this.plugin, destination)) {
return new InvalidDestination();
}
mydest.setDestination(this.plugin, destination);
return mydest;
} catch (InstantiationException e) {
} catch (IllegalAccessException e) {
}
}
return new InvalidDestination();
}
/**
* Registers a {@link MVDestination}.
*
* @param c The {@link Class} of the {@link MVDestination} to register.
* @param identifier The {@link String}-identifier.
* @return True if the class was successfully registered.
*/
public boolean registerDestinationType(Class<? extends MVDestination> c, String identifier) {
if (this.destList.containsKey(identifier)) {
return false;
}
this.destList.put(identifier, c);
// Special case for world defaults:
if (identifier.equals("")) {
identifier = "w";
}
Permission self = this.plugin.getServer().getPluginManager().getPermission("multiverse.teleport.self." + identifier);
Permission other = this.plugin.getServer().getPluginManager().getPermission("multiverse.teleport.other." + identifier);
PermissionTools pt = new PermissionTools(this.plugin);
if (self == null) {
self = new Permission("multiverse.teleport.self." + identifier,
"Permission to teleport yourself for the " + identifier + " destination.", PermissionDefault.OP);
this.plugin.getServer().getPluginManager().addPermission(self);
pt.addToParentPerms("multiverse.teleport.self." + identifier);
}
if (other == null) {
other = new Permission("multiverse.teleport.other." + identifier,
"Permission to teleport others for the " + identifier + " destination.", PermissionDefault.OP);
this.plugin.getServer().getPluginManager().addPermission(other);
pt.addToParentPerms("multiverse.teleport.other." + identifier);
}
this.teleportCommand.addAdditonalPermission(self);
this.teleportCommand.addAdditonalPermission(other);
return true;
}
}
@@ -1,222 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.destination;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
import java.util.Arrays;
import java.util.List;
/**
* An exact {@link MVDestination}.
*/
public class ExactDestination implements MVDestination {
private final String coordRegex = "(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*)";
private boolean isValid;
private Location location;
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "e";
}
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
return new Vector(0, 0, 0);
}
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
return false;
}
List<String> parsed = Arrays.asList(destination.split(":"));
// Need at least: e:world:x,y,z
// OR e:world:x,y,z:pitch:yaw
// so basically 3 or 5
if (!(parsed.size() == 3 || parsed.size() == 5)) { // SUPPRESS CHECKSTYLE: MagicNumberCheck
return false;
}
// If it's not an Exact type
if (!parsed.get(0).equalsIgnoreCase("e")) {
return false;
}
// If it's not a MV world
if (!((MultiverseCore) plugin).getMVWorldManager().isMVWorld(parsed.get(1))) {
return false;
}
if (!parsed.get(2).matches(coordRegex)) {
return false;
}
// This is 1 now, because we've removed 2
if (parsed.size() == 3) {
return true;
}
try {
Float.parseFloat(parsed.get(3));
Float.parseFloat(parsed.get(4)); // SUPPRESS CHECKSTYLE: MagicNumberCheck
} catch (NumberFormatException e) {
return false;
}
return true;
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity e) {
return this.location;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
return;
}
List<String> parsed = Arrays.asList(destination.split(":"));
// Need at least: e:world:x,y,z
// OR e:world:x,y,z:pitch:yaw
// so basically 3 or 5
if (!(parsed.size() == 3 || parsed.size() == 5)) { // SUPPRESS CHECKSTYLE: MagicNumberCheck
this.isValid = false;
return;
}
if (!parsed.get(0).equalsIgnoreCase(this.getIdentifier())) {
this.isValid = false;
return;
}
if (!((MultiverseCore) plugin).getMVWorldManager().isMVWorld(parsed.get(1))) {
this.isValid = false;
return;
}
this.location = new Location(((MultiverseCore) plugin).getMVWorldManager().getMVWorld(parsed.get(1)).getCBWorld(), 0, 0, 0);
if (!parsed.get(2).matches(this.coordRegex)) {
this.isValid = false;
return;
}
double[] coords = new double[3];
String[] coordString = parsed.get(2).split(",");
for (int i = 0; i < 3; i++) {
try {
coords[i] = Double.parseDouble(coordString[i]);
} catch (NumberFormatException e) {
this.isValid = false;
return;
}
}
this.location.setX(coords[0]);
this.location.setY(coords[1]);
this.location.setZ(coords[2]);
if (parsed.size() == 3) {
this.isValid = true;
return;
}
try {
this.location.setPitch(Float.parseFloat(parsed.get(3)));
this.location.setYaw(Float.parseFloat(parsed.get(4))); // SUPPRESS CHECKSTYLE: MagicNumberCheck
} catch (NumberFormatException e) {
this.isValid = false;
return;
}
this.isValid = true;
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "Exact";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Exact (" + this.location.getX() + ", " + this.location.getY() + ", " + this.location.getZ()
+ ":" + location.getPitch() + ":" + location.getYaw() + ")";
}
/**
* Sets this {@link ExactDestination}.
*
* @param location The {@link Location}.
*/
public void setDestination(Location location) {
if (location != null) {
this.location = location;
this.isValid = true;
}
this.isValid = false;
}
/**
* {@inheritDoc}
*/
@Override
public String toString() {
if (isValid) {
return "e:" + location.getWorld().getName() + ":" + location.getX() + "," + location.getY()
+ "," + location.getZ() + ":" + location.getPitch() + ":" + location.getYaw();
}
return "i:Invalid Destination";
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
return "multiverse.access." + this.location.getWorld().getName();
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
// This is an EXACT destination, don't safely teleport here.
return false;
}
}
Loaded 100 of 547 files, more files were not shown because too many files have changed in this diff. Show more