Compare commits

..
1472 Commits
Author SHA1 Message Date
NotAlexNoyle 8a8f65ec82 Exclude CODEOWNERS from language statistics 2026-10-27 08:25:13 -04:00
NotAlexNoyle feb854817f Add CODEOWNERS (one staff approval) 2026-10-27 08:25:13 -04:00
NotAlexNoyle 97a73bf591 Fix jar name 2025-12-13 13:20:22 -05:00
NotAlexNoyle 4e66693b21 Backport 5.3.4 to java 17 2025-12-12 00:04:56 -05:00
NotAlexNoyle f9fc0f1a28 Merge branch 'Multiverse:main' into main 2025-12-12 00:03:29 -05:00
NotAlexNoyle f246094915 Rebase on version 5 2025-12-12 00:01:29 -05:00
Ben Woo 72ee0d5bed Merge pull request #3402 from Multiverse/fix/on-change-node
Always fire onChange for node even if old and new values may be equal
2025-12-12 12:01:31 +08:00
Ben Woo 1afecd40ea Merge pull request #3401 from Multiverse/chore/1.21.11
Update platforms supported version for 1.21.11
2025-12-12 11:57:24 +08:00
Ben Woo 00944ed3b2 Always fire onChange for node even if old and new values may be equal 2025-12-12 11:56:50 +08:00
Ben Woo 5f659a80d8 Update platforms supported version for 1.21.11 2025-12-11 14:24:39 +08:00
Ben Woo 5f9b0af8d1 Merge pull request #3400 from Multiverse/feat/notify-restart
Add restart message for config options that only applies after a server restart
2025-12-10 10:44:34 +08:00
Ben Woo 5c44c05f6f Add restart message for config options that only applies after a server restart 2025-12-09 20:48:04 +08:00
Ben Woo 1699a47011 Merge pull request #3396 from Multiverse/feat/unset-entity-rate
Default spawn rate and limit to "unset" instead of server wide's default
2025-12-09 17:16:27 +08:00
Ben Woo 96deee719b Merge pull request #3397 from Multiverse/fix/config-reset
Remove config saving on plugin disable
2025-12-09 17:15:33 +08:00
Ben Woo 8a60761098 Merge pull request #3398 from Multiverse/fix/arg-handling
Add maxArgForAware flag to gamerule commands for improved argument handling
2025-12-09 17:14:35 +08:00
Ben Woo a38b4e03b4 Merge pull request #3399 from Multiverse/fix/localise-replacements
Properly localise message replacement even if message itself is not localised
2025-12-09 17:14:18 +08:00
Ben Woo db9b725e10 Properly localise message replacement even if message itself is not localised 2025-12-09 16:17:43 +08:00
Ben Woo d43b23e7ea Add maxArgForAware flag to gamerule commands for improved argument handling 2025-12-09 15:59:57 +08:00
Ben Woo 86d77ae796 Remove config saving on plugin disable 2025-12-09 15:50:38 +08:00
Ben Woo 86bf785c84 Improve config saving error checking 2025-12-09 15:50:19 +08:00
Ben Woo 626537290d Default spawn rate and limit to "unset" instead of server wide's default 2025-12-09 14:41:01 +08:00
Ben Woo 9fa47727f4 Merge pull request #3395 from Multiverse/feat/node-load-change
Refactor configuration node on set callbacks to split up load and change events
2025-12-09 12:34:12 +08:00
Ben Woo ae3bc6d201 Rename NodeLoadCallback to NodeValueCallback to extend it potential use case 2025-12-09 11:28:02 +08:00
Ben Woo b1d126397e Refactor configuration node on set callbacks to split up load and change events 2025-12-08 21:18:10 +08:00
Ben Woo 8ab9993e97 Merge pull request #3394 from Multiverse/feat/case-insensitive
Make world name matching case-insensitive to follow papermc behvaiour
2025-12-08 21:03:28 +08:00
Ben Woo 13b949c692 Make world name matching case-insensitive to follow papermc behvaiour 2025-12-08 17:39:10 +08:00
Ben Woo 2b41c1367e Merge pull request #3393 from Multiverse/feat/more-patterns
Add more useful common regex patterns
2025-12-08 17:21:25 +08:00
Ben Woo fde3f388bd Add more useful common regex patterns 2025-12-07 20:56:00 +08:00
Ben Woo eb3968b7d6 Merge pull request #3391 from Multiverse/feat/sort-plugin-list
Sort plugin list alphabetically for dumps
2025-12-04 10:20:19 +08:00
Ben Woo fed1fdcbea Sort plugin list alphabetically for dumps 2025-12-03 10:34:05 +08:00
Ben Woo bfb6fea5f5 Merge pull request #3390 from Multiverse/feat/placeholder-playercount
Add player count placeholder
2025-12-02 23:13:13 +08:00
Ben Woo 5b02452a3d Add player count placeholder 2025-12-02 23:03:30 +08:00
Ben Woo 4a2bfc74fa Merge pull request #3361 from Multiverse/v5.4
V5.4
2025-12-01 17:06:01 +08:00
Ben Woo f0539441cf Merge pull request #3388 from Multiverse/chore/purpur-loader
Add purpur as a supported loader tag on modrinth
2025-12-01 17:04:51 +08:00
Ben Woo efe490d8c4 Add purpur as a supported loader tag on modrinth 2025-12-01 16:55:41 +08:00
Ben Woo 3074cfab17 Fix typo in maxArgForAware for who command 2025-12-01 16:51:16 +08:00
Ben Woo 7a5dd44feb Merge pull request #3383 from Multiverse/refactor/using-option
Refactor world manager methods with better use of streams and option
2025-12-01 16:41:21 +08:00
Ben Woo 88a9ee5b6d Merge pull request #3387 from Multiverse/fix/selectors-error-spam
Fix selectors spamming stacktrace and improve invalid format message
2025-12-01 16:41:02 +08:00
Ben Woo 46f67240e8 Merge pull request #3384 from Multiverse/fix/issuer-aware
Fix ambiguous error message with issue aware args is not found by using maxArgForAware
2025-12-01 16:40:45 +08:00
Ben Woo 89e765b2e8 Fix selectors spamming stacktrace and improve invalid format message 2025-11-29 11:15:04 +08:00
Ben Woo b8bdec22d3 Fix ambiguous error message with issue aware args is not found by using maxArgForAware 2025-11-19 15:32:26 +08:00
Ben Woo 792913cff7 Refactor world manager methods with better use of streams and option 2025-11-19 15:00:39 +08:00
Ben Woo 6dcb40fdcb Merge pull request #3380 from Multiverse/fix/issuer-aware-argument
Better error message for teleport command when no players match selectors
2025-11-19 11:25:46 +08:00
Ben Woo 2bb601098a Merge pull request #3382 from Multiverse/refactor/attempt
Refactor Attempt interface to remove default method implementations and enforce contract
2025-11-18 16:40:22 +08:00
Ben Woo 4bcebd51f5 Merge pull request #3381 from Multiverse/chore/whitespace
Remove unnecessary blank line in CloneWorldOptions.java
2025-11-18 16:40:01 +08:00
Ben Woo e207eb5d0d Merge branch 'main' into v5.4 2025-11-18 16:37:44 +08:00
Ben Woo f181bb7ade Better error message for teleport command when no players match selectors. 2025-11-18 16:34:38 +08:00
Ben Woo 7207d9303f Refactor IssuerAwareContextBuilder and add maxArgForAware option 2025-11-18 16:34:00 +08:00
Ben Woo 82799cdbe8 Open up PlayerFinder::isSelector method 2025-11-18 16:31:12 +08:00
Ben Woo 3629babdbc Remove unnecessary blank line in CloneWorldOptions.java 2025-11-18 15:34:49 +08:00
Ben Woo eed3353e2b Refactor Attempt interface to remove default method implementations and enforce contract 2025-11-18 15:34:28 +08:00
Ben Woo 147564caab Merge pull request #3372 from Multiverse/fix/perm-register
Register permission with its wildcards explicitly
2025-11-13 10:52:04 +08:00
Ben Woo 30e50866bd Merge pull request #3376 from Multiverse/fix/java-17-issue
Fix compatibility with Java 17
2025-11-05 17:29:46 +08:00
Ben Woo 5dde7608f2 Merge pull request #3377 from Multiverse/fix/checkstyle-action
Bump checkstyle action version
2025-11-05 17:29:11 +08:00
Ben Woo 2f9915c62e Bump checkstyle action version 2025-11-05 17:28:36 +08:00
Ben Woo e62e37831b Fix compatibility with Java 17 2025-11-05 10:09:28 +08:00
Ben Woo ef9934f3c6 Merge pull request #3373 from riku6460/fix-set-spawn
Fix spawn location inconsistency
2025-11-04 11:20:19 +08:00
Ben Woo 691bcd0ffa Merge pull request #3375 from BenTechDev/patch-1
✏️ fix typo in UnloadWorldOptions
2025-11-04 11:10:00 +08:00
BenTech 148644970d ✏️ fix typo in UnloadWorldOptions 2025-11-03 18:34:42 +00:00
riku6460 ad20ec94c5 Fix spawn location inconsistency
CraftWorld.setSpawnLocation(Location) requires the world in location.
https://github.com/PaperMC/Paper/blob/e8c6ba5068287049c890688534963041208c4213/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java#L338

See #3321
2025-11-03 03:33:06 +09:00
Ben Woo f7d86884b4 Merge pull request #3369 from Multiverse/feat/simplified-destination
Add simplified destination tab completion configuration option
2025-10-30 11:30:12 +08:00
Ben Woo 0e0e4e0434 Register permission with its wildcards explicitly 2025-10-30 11:29:12 +08:00
Ben Woo 8e878b1ed0 Merge pull request #3370 from Multiverse/fix/passenger-mode
Update default passenger mode description for papermc 1.21.10 changes
2025-10-26 23:21:33 +08:00
Ben Woo e1c6af2f38 Update default passenger mode description for papermc 1.21.10 changes 2025-10-26 13:37:58 +08:00
Ben Woo b52d65757a Fix config test 2025-10-26 13:27:55 +08:00
Ben Woo ff2135c775 Add simplified destination tab completion configuration option 2025-10-26 12:09:06 +08:00
Ben Woo c4e4e311e2 Merge pull request #3368 from Multiverse/perf/suggest-destination
Minor perf improvement to suggestDestinationsWithPerms
2025-10-26 11:59:39 +08:00
Ben Woo 3e4ded52e3 Merge branch 'main' into v5.4 2025-10-26 11:45:23 +08:00
Ben Woo 4ef8390ea3 Minor perf improvement to suggestDestinationsWithPerms 2025-10-26 11:44:57 +08:00
Ben Woo bca71e1acc Merge pull request #3367 from Multiverse/fix/tab-complete-quotes
Quote multi-word strings for all tab-completion
2025-10-24 14:43:14 +08:00
Ben Woo 343da8c301 Quote multi-word strings for all tab-completion 2025-10-24 14:29:07 +08:00
Ben Woo d34f3adccc Merge pull request #3366 from Multiverse/fix/coordinate-scale
Fix spigot compatibility with getCoordinateScale
2025-10-20 11:33:59 +08:00
Ben Woo b3862faf88 Fix spigot compatibility with getCoordinateScale 2025-10-20 10:56:31 +08:00
Ben Woo 8bffffdc65 Merge pull request #3364 from Multiverse/feat/silent-teleport
Add a silent flag to turn off teleport output message
2025-10-16 11:21:03 +08:00
Ben Woo 79a71fa58f Add a silent flag to turn off teleport output message 2025-10-15 22:43:22 +08:00
Ben Woo a41476de89 Merge pull request #3363 from Multiverse/fix/warning-spam
Revert throw an error when trying to set spawn-rate or spawn-limit if…
2025-10-15 22:30:32 +08:00
Ben Woo fe75e497e4 Revert throw an error when trying to set spawn-rate or spawn-limit if disabled by config 2025-10-15 22:26:31 +08:00
Ben Woo fdd9257e2c Merge pull request #3359 from Multiverse/fix/async-online-players
Implement ConcurrentPlayerWorldTracker to allow for async online player names and worlds lookup
2025-10-13 17:41:37 +08:00
Ben Woo 55d1347d4f Merge pull request #3360 from Multiverse/feat/destination-message
Implement display message for destination instances to improve teleport command output
2025-10-13 17:38:45 +08:00
Ben Woo 29cc97486b Add @since 5.4 annotations to ConcurrentPlayerWorldTracker methods 2025-10-13 17:37:41 +08:00
Ben Woo 8d06b92edd Implement display message for destination instances to improve teleport command output 2025-10-12 23:27:12 +08:00
Ben Woo ce3b6ab700 Make getOnlinePlayers unmodifiable and getPlayerWorld return option 2025-10-12 23:00:01 +08:00
Ben Woo 58ac0f505c Make tab completion for players a non-async call 2025-10-12 22:58:50 +08:00
Ben Woo 4004554733 Merge pull request #3358 from Multiverse/chore/mockbukkit-dep
Bump mockbukkit and fix test dep
2025-10-12 22:42:15 +08:00
Ben Woo 99037b2af5 Bump mockbukkit and fix test dep 2025-10-12 22:37:30 +08:00
Ben Woo ac46a5f64a Merge pull request #3355 from Multiverse/chore/config-links
Update wiki and add donation link in `config.yml`
2025-10-09 22:08:47 +08:00
Ben Woo 4d805b921b Merge pull request #3356 from Multiverse/chore/copper-update
Add supported mc versions for 1.21.9 and 1.21.10
2025-10-09 21:55:48 +08:00
Ben Woo a612854490 Add supported mc versions for 1.21.9 and 1.21.10 2025-10-09 21:42:20 +08:00
Ben Woo e85c14e319 Update wiki and add donation link in config.yml 2025-10-09 21:39:25 +08:00
Ben Woo 3983af7b4c Merge pull request #3351 from Multiverse/fix/spawn-location
Fix join location on 1.21.9 due to deprecated PlayerSpawnLocationEvent
2025-10-03 23:07:40 +08:00
Ben Woo 8853f88f3a Fix join location on 1.21.9 due to deprecated PlayerSpawnLocationEvent 2025-10-03 23:01:07 +08:00
Ben Woo 08d361e0ec Merge pull request #3350 from Multiverse/chore/mockbukkit-bump
Bump multiverse-plugin and mockbukkit version
2025-10-01 21:51:18 +08:00
Ben Woo f985f2db06 Bump multiverse-plugin and mockbukkit version 2025-10-01 21:46:38 +08:00
Ben Woo c068225950 Implement ConcurrentPlayerWorldTracker to allow for async online player names and worlds lookup 2025-10-01 21:45:27 +08:00
Ben Woo 82acca3ff9 Merge pull request #3348 from Multiverse/feat/properties-bukkit-world
Use bukkit world properties for difficulty, scale, and keep-spawn when create/import
2025-10-01 21:34:05 +08:00
Ben Woo d712c1eb09 Merge pull request #3347 from Multiverse/fix/deprecated-biome
Refactor biome parsing to use NamespacedKey and Registry
2025-10-01 21:33:28 +08:00
Ben Woo 25e9213ee9 Merge pull request #3349 from Multiverse/fix/apply-spawn-disabled
Throw an error when trying to set spawn-rate or spawn-limit if disabled by config
2025-10-01 21:33:02 +08:00
Ben Woo 9e79708fec Refactor biome parsing to use NamespacedKey and Registry 2025-09-29 22:18:42 +08:00
Ben Woo 65d1141289 Throw an error when trying to set spawn-rate or spawn-limit if disabled by config 2025-09-29 22:01:51 +08:00
Ben Woo 63b2ffdf72 Use bukkit world properties for difficulty, scale, and keep-spawn when create/import 2025-09-29 21:34:00 +08:00
Ben Woo 14d8ad7a5c Merge pull request #3346 from Multiverse/fix/locale-lowercase
Fix issues with lower/uppercasing string when server is of non-english locale
2025-09-29 21:18:29 +08:00
Ben Woo 33e0df925f Merge pull request #3345 from Multiverse/chore/non-public-listener
Cleanup listener methods to be non-public
2025-09-29 21:17:45 +08:00
Ben Woo 1883edbb28 Fix issues with lower/uppercasing string when server is of non-english locale 2025-09-29 20:47:08 +08:00
Ben Woo b7a2bd61ca Cleanup listener methods to be non-public 2025-09-29 20:22:40 +08:00
Ben Woo a0673ac109 Merge pull request #3344 from Multiverse/fix/test-generator
Pass empty string instead of null for generator id and improve error message
2025-09-28 17:50:10 +08:00
Ben Woo 7735a33ccf Change test error message to not show full stacktrace 2025-09-28 17:47:05 +08:00
Ben Woo 5f24520685 Pass empty string instead of null for generator type 2025-09-28 17:46:31 +08:00
Ben Woo 608cb8611c Merge pull request #3343 from Multiverse/fix/custom-env
Remove tab completing "custom" environment type
2025-09-28 10:19:03 +08:00
Ben Woo a965b9ce56 Remove tab completing "custom" environment type 2025-09-28 10:15:08 +08:00
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
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
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 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
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
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
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
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
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
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
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
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
545 changed files with 35841 additions and 21685 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
.gitea/CODEOWNERS linguist-detectable=false
+3
View File
@@ -0,0 +1,3 @@
# Pull requests request review from the eligible staff team(s).
# One approval from either an Admin or Developer satisfies branch protection.
* @trueog/Admins @trueog/Developers
+2
View File
@@ -0,0 +1,2 @@
github: Multiverse
open_collective: multiverse-plugins
+5 -5
View File
@@ -18,10 +18,10 @@ body:
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: mutliverse-version-info
id: multiverse-version-info
attributes:
label: '`/mv version -p` output'
description: Run `/mv version -p` in the console, then copy and paste the link from the output of the command into this box.
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
@@ -29,7 +29,7 @@ body:
attributes:
label: Server logs
description: >
Include full startup log and console error (if any). upload all relevant logs to either https://paste.gg
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
@@ -54,7 +54,7 @@ body:
id: reproduce-steps
attributes:
label: Steps to reproduce
description: Provide detailed intructions to trigger the bug.
description: Provide detailed instructions to trigger the bug.
placeholder: |
Example:
1. Start a server with only multiverse installed.
+7 -57
View File
@@ -25,60 +25,10 @@ on:
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@v3
with:
ref: ${{ inputs.promote_from }}
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build and test
uses: gradle/gradle-build-action@v2
with:
arguments: clean build -x assemble -x shadowJar -x checkStyleMain -x checkStyleTest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
id: release
uses: benwoo1110/semantic-release-action@v1.0.0
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'
uses: gradle/gradle-build-action@v2
with:
arguments: publish -x checkStyleMain -x checkStyleTest -x test
env:
GITHUB_VERSION: ${{ steps.release.outputs.publish_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release artifact
if: steps.release.outputs.release_created == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/multiverse-core-${{ steps.release.outputs.publish_version }}.jar
asset_name: multiverse-core-${{ steps.release.outputs.tag_name }}.jar
tag: ${{ steps.release.outputs.tag_name }}
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 }}
+55 -64
View File
@@ -15,78 +15,69 @@ on:
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 }}
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"}
]
- 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: multiverse-core-${{ steps.release-info.outputs.tag_name }}.jar
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"}
]
- name: Parse release type
run: |
if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then
echo Setting RELEASE_TYPE to Beta
echo "RELEASE_TYPE=Beta" >> $GITHUB_ENV
else
echo Setting RELEASE_TYPE to Release
echo "RELEASE_TYPE=Release" >> $GITHUB_ENV
fi
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"]
}
]}
- name: echo inputs
run: |
echo "upload_modrinth: ${{ inputs.upload_modrinth }}"
echo "upload_dbo: ${{ inputs.upload_dbo }}"
echo "RELEASE_TYPE: ${{ env.RELEASE_TYPE }}"
- name: Upload to Modrinth
if: inputs.upload_modrinth == 'true'
uses: benwoo1110/modrinth-upload-action@v1.0.0
with:
api_token: ${{ secrets.MODRINTH_TOKEN }}
project_id: 3wmN97b8
version_number: ${{ steps.release-info.outputs.tag_name }}
files: '["${{ github.workspace }}/multiverse-core-${{ steps.release-info.outputs.tag_name }}.jar"]'
name: ${{ steps.release-info.outputs.tag_name }}
changelog: ${{ steps.release-artifact.outputs.body }}
game_versions: 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13
version_type: ${{ env.RELEASE_TYPE }}
loaders: bukkit, spigot, paper
- name: Upload to DBO
if: inputs.upload_dbo == 'true'
uses: benwoo1110/dbo-upload-action@v1.0.1
with:
api_token: ${{ secrets.DBO_UPLOAD_API_TOKEN }}
project_id: 30765
changelog: ${{ steps.release-artifact.outputs.body }}
changelog_type: markdown
display_name: ${{ steps.release-info.outputs.tag_name }}
game_versions: 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17, 1.16, 1.15, 1.14, 1.13
release_type: ${{ env.RELEASE_TYPE }}
project_relations: >
[
{"slug": "multiverse-portals", "type": "optionalDependency"},
{"slug": "multiverse-netherportals", "type": "optionalDependency"},
{"slug": "multiverse-signportals", "type": "optionalDependency"},
{"slug": "multiverse-inventories", "type": "optionalDependency"}
]
file_path: ${{ github.workspace }}/multiverse-core-${{ steps.release-info.outputs.tag_name }}.jar
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 }}
@@ -15,6 +15,10 @@ on:
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:
@@ -24,3 +28,4 @@ jobs:
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 }}
@@ -35,3 +35,4 @@ jobs:
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@v5
- uses: dbelyaev/action-checkstyle@v3
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.11, 1.21.10, 1.21.9, 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, purpur
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.11, 1.21.10, 1.21.9, 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.11"]}'
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 }}
+1
View File
@@ -21,3 +21,4 @@ jobs:
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
+3 -28
View File
@@ -6,31 +6,6 @@ on:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Run unit tests
uses: gradle/gradle-build-action@v2
with:
arguments: build
env:
GITHUB_VERSION: pr${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Artifact output
uses: actions/upload-artifact@v3
with:
name: multiverse-core-pr${{ github.event.pull_request.number }}
path: build/libs/multiverse-core-pr${{ github.event.pull_request.number }}.jar
uses: ./.github/workflows/generic.test.yml
with:
plugin_name: multiverse-core
+4
View File
@@ -0,0 +1,4 @@
kotlin version: 2.0.21
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready
+16 -14
View File
@@ -1,21 +1,21 @@
<p align="center">
<img src="config/multiverse2-long.png" alt="Multiverse Logo">
<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)
[![bukkit](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/bukkit_vector.svg)](https://dev.bukkit.org/projects/multiverse-core)
[![Spigot](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/spigot_vector.svg)](https://www.spigotmc.org/resources/multiverse-core.390/)
[![Release](https://img.shields.io/nexus/r/com.onarandombox.multiversecore/Multiverse-Core?label=release&server=https%3A%2F%2Frepo.onarandombox.com%2F)](https://dev.bukkit.org/projects/multiverse-core)
[![Dev builds](https://img.shields.io/nexus/s/com.onarandombox.multiversecore/Multiverse-Core?label=dev%20builds&server=http%3A%2F%2Frepo.onarandombox.com%2F)](https://ci.onarandombox.com/job/Multiverse-Core/)
[![Discord](https://img.shields.io/discord/325459248047980545?label=discord&logo=discord)](https://discord.gg/NZtfKky)
[![Support us on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Ddumptruckman%26type%3Dpatrons&style=flat)](https://patreon.com/dumptruckman)
[![License](https://img.shields.io/github/license/Multiverse/Multiverse-Core)](LICENSE.md)
[![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://dev.bukkit.org/projects/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!
[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!
@@ -26,22 +26,24 @@ Now it's time to create your very own Multiverse server, do check out our [Wiki]
* [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:
```
./gradlew build
```
More details are available on the [build instructions wiki page](https://github.com/Multiverse/Multiverse-Core/wiki/Building).
## Contributing
**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-Core/wiki) with your latest tip, tricks and guides! The wiki open for all to edit and improve.
* 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 joining our [Patreon](https://www.patreon.com/dumptruckman) or make a one-time donation [here](https://paypal.me/dumptruckman)!
* 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)!
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!
-190
View File
@@ -1,190 +0,0 @@
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'java-library'
id 'maven-publish'
id 'checkstyle'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id "com.modrinth.minotaur" version "2.+"
}
version = System.getenv('GITHUB_VERSION') ?: 'local'
group = 'com.onarandombox.multiversecore'
description = 'Multiverse-Core'
java.sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/')
}
maven {
url = uri('https://repo.onarandombox.com/content/groups/public')
}
maven {
url = uri('https://hub.spigotmc.org/nexus/content/groups/public/')
}
maven {
url = uri('https://jitpack.io')
}
maven {
url = uri('https://repo.minebench.de/')
}
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}
dependencies {
compileOnly 'org.bukkit:bukkit:1.13.2-R0.1-SNAPSHOT'
implementation('com.github.MilkBowl:VaultAPI:1.7') {
exclude group: 'org.bukkit', module: 'bukkit'
}
api('me.main__.util:SerializationConfig:1.7') {
exclude group: 'org.bukkit', module: 'bukkit'
}
api('com.pneumaticraft.commandhandler:CommandHandler:11') {
exclude group: 'org.bukkit', module: 'bukkit'
exclude group: 'junit', module: 'junit'
}
api 'com.dumptruckman.minecraft:buscript:2.0-SNAPSHOT'
api 'org.bstats:bstats-bukkit:2.2.1'
api('com.dumptruckman.minecraft:Logging:1.1.1') {
exclude group: 'junit', module: 'junit'
}
api 'de.themoep.idconverter:mappings:1.2-SNAPSHOT'
api 'org.jetbrains:annotations:16.0.2'
testImplementation 'org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT'
testImplementation('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'junit', module: 'junit'
}
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:3.11.2'
testImplementation 'commons-io:commons-io:2.4'
}
java {
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
configurations {
[apiElements, runtimeElements].each {
it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) }
it.outgoing.artifact(shadowJar)
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/Multiverse/Multiverse-Core"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
ext.bitlyAccessToken = System.getenv('BITLY_ACCESS_TOKEN') ?: 'bitly-access-token'
task prepareSource(type: Sync) {
inputs.property 'bitlyAccessToken', bitlyAccessToken
from sourceSets.main.java
into "$buildDir/src"
filter(ReplaceTokens, tokens: [
'bitly-access-token': bitlyAccessToken,
])
}
compileJava {
source = prepareSource.outputs
}
processResources {
def props = [version: "${project.version}"]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
// This task should never be skipped. The tests depend on this having been run but we want the new version number
// that is created after tests are run and before we run again to publish.
outputs.upToDateWhen { false }
}
checkstyle {
toolVersion = '6.1.1'
configFile file('config/mv_checks.xml')
ignoreFailures = true
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
}
project.configurations.api.canBeResolved = true
shadowJar {
relocate 'me.main__.util', 'com.onarandombox.serializationconfig'
relocate 'com.pneumaticraft.commandhandler', 'com.onarandombox.commandhandler'
relocate 'buscript', 'com.onarandombox.buscript'
relocate 'org.bstats', 'com.onarandombox.bstats'
relocate 'com.dumptruckman.minecraft.util.Logging', 'com.onarandombox.MultiverseCore.utils.CoreLogging'
relocate 'com.dumptruckman.minecraft.util.DebugLog', 'com.onarandombox.MultiverseCore.utils.DebugFileLogger'
relocate 'org.codehaus.jettison', 'com.onarandombox.jettison'
relocate 'de.themoep.idconverter', 'com.onarandombox.idconverter'
configurations = [project.configurations.api]
archiveFileName = "$baseName-$version.$extension"
classifier = ''
}
build.dependsOn shadowJar
jar.enabled = false
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "multiverse-core"
versionNumber = System.getenv("VERSION_NUMBER")
versionType = System.getenv("VERSION_TYPE")
uploadFile = jar
gameVersions = ["1.20.1", "1.20", "1.19.4", "1.19.3", "1.19.2", "1.19.1", "1.19", "1.18.2", "1.18.1", "1.18", "1.17.1", "1.17", "1.16.5", "1.16.4", "1.16.3", "1.16.2", "1.16.1", "1.16", "1.15.2", "1.15.1", "1.15", "1.14.4", "1.14.3", "1.14.2", "1.14.1", "1.14", "1.13.2", "1.13.1", "1.13"]
loaders = ["bukkit", "spigot", "paper"]
changelog = System.getenv("CHANGELOG")
}
+364
View File
@@ -0,0 +1,364 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import groovy.util.Node
import groovy.util.NodeList
import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.api.artifacts.Configuration
import org.gradle.api.credentials.PasswordCredentials
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.Sync
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.external.javadoc.StandardJavadocDocletOptions
import org.gradle.jvm.tasks.Jar
import org.gradle.language.jvm.tasks.ProcessResources
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`java-library`
eclipse
`maven-publish`
id("com.gradleup.shadow") version "8.3.9"
kotlin("jvm") version "2.0.21"
}
group = "org.mvplugins.multiverse.core"
version = System.getenv("GITHUB_VERSION") ?: "5.3.4.17"
description = "Multiverse-Core"
val sourceSets = extensions.getByType<SourceSetContainer>()
val serverApi: Configuration by configurations.creating
val externalPlugin: Configuration by configurations.creating
val shadowed: Configuration by configurations.creating
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
maven {
url = uri("https://repo.onarandombox.com/content/groups/public")
}
maven {
url = uri("https://hub.spigotmc.org/nexus/content/groups/public/")
}
maven {
url = uri("https://jitpack.io")
}
maven {
url = uri("https://repo.minebench.de/")
}
maven {
url = uri("https://repo.maven.apache.org/maven2/")
}
maven {
name = "aikar repo"
url = uri("https://repo.aikar.co/content/groups/aikar/")
}
maven {
name = "glaremasters repo"
url = uri("https://repo.glaremasters.me/repository/towny/")
}
maven {
name = "helpchatRepoReleases"
url = uri("https://repo.helpch.at/releases/")
}
maven {
name = "papermc repo"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
// Purpur API
maven("https://repo.purpurmc.org/snapshots")
}
// Configuration wiring like in the Groovy build
configurations["compileOnly"].extendsFrom(serverApi)
configurations["runtimeClasspath"].extendsFrom(serverApi)
configurations["implementation"].extendsFrom(externalPlugin)
configurations["compileClasspath"].extendsFrom(shadowed)
configurations["testCompileClasspath"].extendsFrom(shadowed)
configurations["testRuntimeClasspath"].extendsFrom(shadowed)
dependencies {
// Server API: Purpur 1.19.4
serverApi("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT")
// 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.4")
shadowed("org.glassfish.hk2:hk2-locator:3.0.3")
shadowed("org.glassfish.hk2:hk2-inhabitant-generator:3.0.3") {
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.4.9")
shadowed("org.jetbrains:annotations:22.0.0")
shadowed("io.papermc:paperlib:1.0.8")
// Tests
testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.21")
testImplementation("com.github.seeseemelk:MockBukkit-v1.19:3.1.0")
testImplementation("com.googlecode.json-simple:json-simple:1.1.1") {
exclude(group = "junit", module = "junit")
}
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("com.natpryce:hamkrest:1.8.0.1")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0")
// Annotation Processors
annotationProcessor("org.glassfish.hk2:hk2-metadata-generator:3.0.3")
testAnnotationProcessor("org.glassfish.hk2:hk2-metadata-generator:3.0.3")
}
java {
// Plugin is compiled for Java 17 (GraalVM 17-friendly)
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
withSourcesJar()
withJavadocJar()
}
val bitlyAccessToken: String = System.getenv("BITLY_ACCESS_TOKEN") ?: "bitly-access-token"
// === Token-filtered source generation (prepareSource) ===
val prepareSource by tasks.registering(Sync::class) {
inputs.property("bitlyAccessToken", bitlyAccessToken)
from(sourceSets["main"].java)
// avoid deprecated buildDir getter
into(layout.buildDirectory.dir("src"))
filter<ReplaceTokens>(
"tokens" to mapOf(
"bitly-access-token" to bitlyAccessToken,
),
)
}
// Use ONLY the filtered sources for compileJava (fixes duplicate classes)
tasks.named<JavaCompile>("compileJava") {
dependsOn(prepareSource)
source = prepareSource.get().outputs.files.asFileTree
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
tasks.named<JavaCompile>("compileTestJava") {
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.compilerArgs.add(
"-Aorg.glassfish.hk2.metadata.location=META-INF/hk2-locator/Multiverse-Core",
)
}
tasks.withType<Javadoc>().configureEach {
(options as StandardJavadocDocletOptions).encoding = "UTF-8"
}
tasks.named<KotlinCompile>("compileTestKotlin") {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
javaParameters.set(true)
}
}
// We're not using Kotlin in the plugin itself, just tests!
tasks.named<KotlinCompile>("compileKotlin") {
enabled = false
}
configurations
.filterNot { it.name.startsWith("test") }
.forEach {
it.exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
}
tasks.named<ProcessResources>("processResources") {
val props = mapOf("version" to project.version.toString())
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
}
// Never up-to-date: tests depend on fresh version expansion
outputs.upToDateWhen { false }
}
tasks.named<Javadoc>("javadoc") {
source = sourceSets["main"].allJava
classpath = configurations["compileClasspath"]
}
// Removed: configurations["api"].isCanBeResolved = true (deprecated in Gradle 8/9)
val jarTask = tasks.named<Jar>("jar")
val shadowJarTask = tasks.named<ShadowJar>("shadowJar")
listOf("apiElements", "runtimeElements").forEach { configurationName ->
configurations.named(configurationName) {
outgoing.artifacts.removeIf { artifact ->
artifact.buildDependencies.getDependencies(null).contains(jarTask.get())
}
outgoing.artifact(shadowJarTask)
}
}
tasks.named<ShadowJar>("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("me.main__.util", "org.mvplugins.multiverse.external.serializationconfig")
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")
configurations = listOf(project.configurations["shadowed"])
archiveClassifier.set("")
dependencies {
exclude { dependency ->
dependency.moduleGroup == "org.jetbrains.kotlin"
}
}
}
tasks.named("build") {
dependsOn("shadowJar")
}
tasks.named<Jar>("jar") {
enabled = false
}
tasks.named<Test>("test") {
useJUnitPlatform()
testLogging {
exceptionFormat = TestExceptionFormat.FULL
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom.withXml {
val pomNode = asNode()
val dependenciesNode = (
(pomNode.get("dependencies") as? NodeList)
?.firstOrNull() as? Node
) ?: (pomNode.appendNode("dependencies") as Node)
val dependencyNodes = dependenciesNode.children().filterIsInstance<Node>().toList()
// Remove Kotlin dependency
dependencyNodes
.filter { dependencyNode ->
val groupIdNodes = dependencyNode.get("groupId") as? NodeList ?: return@filter false
val groupId = (groupIdNodes.firstOrNull() as? Node)?.text()
groupId == "org.jetbrains.kotlin"
}
.forEach { dependencyNode ->
dependenciesNode.remove(dependencyNode)
}
// Switch runtime deps to provided
dependencyNodes.forEach { dependencyNode ->
val scopeNodes = dependencyNode.get("scope") as? NodeList ?: return@forEach
val scopeNode = scopeNodes.firstOrNull() as? Node ?: return@forEach
if (scopeNode.text() == "runtime") {
scopeNode.setValue("provided")
}
}
// Add server API (Purpur) to pom as provided
configurations["serverApi"].allDependencies.forEach { dependency ->
val depNode = dependenciesNode.appendNode("dependency")
depNode.appendNode("groupId", dependency.group)
depNode.appendNode("artifactId", dependency.name)
depNode.appendNode("version", dependency.version)
depNode.appendNode("scope", "provided")
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Multiverse/Multiverse-Core")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
maven {
name = "multiverse"
val releasesRepoUrl = uri("https://repo.dumptruckman.com/multiverse-releases")
val snapshotsRepoUrl = uri("https://repo.dumptruckman.com/multiverse-snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials(PasswordCredentials::class)
}
maven {
// todo: remove before mv5 release
name = "multiverseBeta"
url = uri("https://repo.c0ding.party/multiverse-beta")
credentials(PasswordCredentials::class)
}
}
}
+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

+625 -101
View File
@@ -6,136 +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>
<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">
<property name="severity" value="warning"/>
<property name="countEmpty" value="false"/>
</module>
<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="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="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.
+2 -1
View File
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+21 -13
View File
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -55,7 +57,7 @@
# 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
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -83,10 +85,9 @@ 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"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,10 +134,13 @@ 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.
if ! command -v java >/dev/null 2>&1
then
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
fi
# Increase the maximum file descriptors if we can.
@@ -144,7 +148,7 @@ 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
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -197,11 +201,15 @@ if "$cygwin" || "$msys" ; then
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.
# 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"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Vendored
+12 -10
View File
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@@ -43,11 +45,11 @@ 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.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -57,11 +59,11 @@ 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.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
-11
View File
@@ -1,11 +0,0 @@
/*
* This file was generated by the Gradle 'init' task.
*/
pluginManagement {
repositories {
gradlePluginPortal()
}
}
rootProject.name = 'multiverse-core'
+11
View File
@@ -0,0 +1,11 @@
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
File diff suppressed because it is too large. Load diff
@@ -1,385 +0,0 @@
package com.onarandombox.MultiverseCore;
import java.util.Map;
import com.dumptruckman.minecraft.util.Logging;
import com.onarandombox.MultiverseCore.api.MultiverseCoreConfig;
import com.onarandombox.MultiverseCore.event.MVDebugModeEvent;
import me.main__.util.SerializationConfig.NoSuchPropertyException;
import me.main__.util.SerializationConfig.Property;
import me.main__.util.SerializationConfig.SerializationConfig;
import org.bukkit.Bukkit;
/**
* Our configuration.
*/
public class MultiverseCoreConfiguration extends SerializationConfig implements MultiverseCoreConfig {
private static MultiverseCoreConfiguration instance;
/**
* Sets the statically saved instance.
* @param instance The new instance.
*/
public static void setInstance(MultiverseCoreConfiguration instance) {
MultiverseCoreConfiguration.instance = instance;
}
/**
* @return True if the static instance of config is set.
*/
public static boolean isSet() {
return instance != null;
}
/**
* Gets the statically saved instance.
* @return The statically saved instance.
*/
public static MultiverseCoreConfiguration getInstance() {
if (instance == null)
throw new IllegalStateException("The instance wasn't set!");
return instance;
}
@Property
private volatile boolean enforceaccess;
@Property
private volatile boolean prefixchat;
@Property
private volatile String prefixchatformat;
@Property
private volatile boolean useasyncchat;
@Property
private volatile boolean teleportintercept;
@Property
private volatile boolean firstspawnoverride;
@Property
private volatile boolean displaypermerrors;
@Property
private volatile boolean enablebuscript;
@Property
private volatile int globaldebug;
@Property
private volatile boolean silentstart;
@Property
private volatile int messagecooldown;
@Property
private volatile double version;
@Property
private volatile String firstspawnworld;
@Property
private volatile int teleportcooldown;
@Property
private volatile boolean defaultportalsearch;
@Property
private volatile int portalsearchradius;
@Property
private volatile boolean autopurge;
@Property
private volatile boolean idonotwanttodonate;
public MultiverseCoreConfiguration() {
super();
MultiverseCoreConfiguration.setInstance(this);
}
public MultiverseCoreConfiguration(Map<String, Object> values) {
super(values);
MultiverseCoreConfiguration.setInstance(this);
}
/**
* {@inheritDoc}
*/
@Override
protected void setDefaults() {
// BEGIN CHECKSTYLE-SUPPRESSION: MagicNumberCheck
enforceaccess = false;
useasyncchat = true;
prefixchat = false;
prefixchatformat = "[%world%]%chat%";
teleportintercept = true;
firstspawnoverride = true;
displaypermerrors = true;
enablebuscript = true;
globaldebug = 0;
messagecooldown = 5000;
teleportcooldown = 1000;
this.version = 2.9;
silentstart = false;
defaultportalsearch = true;
portalsearchradius = 128;
autopurge = true;
idonotwanttodonate = false;
// END CHECKSTYLE-SUPPRESSION: MagicNumberCheck
}
/**
* {@inheritDoc}
*/
@Override
public boolean setConfigProperty(String property, String value) {
try {
return this.setProperty(property, value, true);
} catch (NoSuchPropertyException e) {
return false;
}
}
// And here we go:
/**
* {@inheritDoc}
*/
@Override
public boolean getEnforceAccess() {
return this.enforceaccess;
}
/**
* {@inheritDoc}
*/
@Override
public void setEnforceAccess(boolean enforceAccess) {
this.enforceaccess = enforceAccess;
}
/**
* {@inheritDoc}
*/
@Override
public boolean getPrefixChat() {
return this.prefixchat;
}
/**
* {@inheritDoc}
*/
@Override
public void setPrefixChat(boolean prefixChat) {
this.prefixchat = prefixChat;
}
/**
* {@inheritDoc}
*/
@Override
public String getPrefixChatFormat() {
return this.prefixchatformat;
}
/**
* {@inheritDoc}
*/
@Override
public void setPrefixChatFormat(String prefixChatFormat) {
this.prefixchatformat = prefixChatFormat;
}
/**
* {@inheritDoc}
*/
@Override
public boolean getTeleportIntercept() {
return this.teleportintercept;
}
/**
* {@inheritDoc}
*/
@Override
public void setTeleportIntercept(boolean teleportIntercept) {
this.teleportintercept = teleportIntercept;
}
/**
* {@inheritDoc}
*/
@Override
public boolean getFirstSpawnOverride() {
return this.firstspawnoverride;
}
/**
* {@inheritDoc}
*/
@Override
public void setFirstSpawnOverride(boolean firstSpawnOverride) {
this.firstspawnoverride = firstSpawnOverride;
}
/**
* {@inheritDoc}
*/
@Override
public boolean getDisplayPermErrors() {
return this.displaypermerrors;
}
/**
* {@inheritDoc}
*/
@Override
public boolean getEnableBuscript() {
return this.enablebuscript;
}
/**
* {@inheritDoc}
*/
@Override
public void setEnableBuscript(boolean enableBuscript) {
this.enablebuscript = enableBuscript;
}
/**
* {@inheritDoc}
*/
@Override
public void setDisplayPermErrors(boolean displayPermErrors) {
this.displaypermerrors = displayPermErrors;
}
/**
* {@inheritDoc}
*/
@Override
public int getGlobalDebug() {
return this.globaldebug;
}
/**
* {@inheritDoc}
*/
@Override
public void setGlobalDebug(int globalDebug) {
this.globaldebug = globalDebug;
Logging.setDebugLevel(globalDebug);
Bukkit.getPluginManager().callEvent(new MVDebugModeEvent(globalDebug));
}
/**
* {@inheritDoc}
*/
@Override
public int getMessageCooldown() {
return this.messagecooldown;
}
/**
* {@inheritDoc}
*/
@Override
public void setMessageCooldown(int messageCooldown) {
this.messagecooldown = messageCooldown;
}
/**
* {@inheritDoc}
*/
@Override
public double getVersion() {
return this.version;
}
/**
* {@inheritDoc}
*/
@Override
public void setVersion(int version) {
this.version = version;
}
/**
* {@inheritDoc}
*/
@Override
public String getFirstSpawnWorld() {
return this.firstspawnworld;
}
/**
* {@inheritDoc}
*/
@Override
public void setFirstSpawnWorld(String firstSpawnWorld) {
this.firstspawnworld = firstSpawnWorld;
}
/**
* {@inheritDoc}
*/
@Override
public int getTeleportCooldown() {
return this.teleportcooldown;
}
/**
* {@inheritDoc}
*/
@Override
public void setTeleportCooldown(int teleportCooldown) {
this.teleportcooldown = teleportCooldown;
}
@Override
public void setUseAsyncChat(boolean useAsyncChat) {
this.useasyncchat = useAsyncChat;
}
@Override
public boolean getUseAsyncChat() {
return this.useasyncchat;
}
@Override
public void setSilentStart(boolean silentStart) {
Logging.setShowingConfig(!silentStart);
this.silentstart = silentStart;
}
@Override
public boolean getSilentStart() {
return silentstart;
}
@Override
public void setUseDefaultPortalSearch(boolean useDefaultPortalSearch) {
defaultportalsearch = useDefaultPortalSearch;
}
@Override
public boolean isUsingDefaultPortalSearch() {
return defaultportalsearch;
}
@Override
public void setPortalSearchRadius(int searchRadius) {
this.portalsearchradius = searchRadius;
}
@Override
public int getPortalSearchRadius() {
return portalsearchradius;
}
@Override
public boolean isAutoPurgeEnabled() {
return autopurge;
}
@Override
public void setAutoPurgeEnabled(boolean autopurge) {
this.autopurge = autopurge;
}
@Override
public boolean isShowingDonateMessage() {
return !idonotwanttodonate;
}
@Override
public void setShowDonateMessage(boolean showDonateMessage) {
this.idonotwanttodonate = !showDonateMessage;
}
}
@@ -1,655 +0,0 @@
package com.onarandombox.MultiverseCore;
import com.onarandombox.MultiverseCore.MVWorld.NullLocation;
import com.onarandombox.MultiverseCore.configuration.EntryFee;
import com.onarandombox.MultiverseCore.configuration.SpawnLocation;
import com.onarandombox.MultiverseCore.configuration.SpawnSettings;
import com.onarandombox.MultiverseCore.configuration.WorldPropertyValidator;
import com.onarandombox.MultiverseCore.enums.AllowedPortalType;
import com.onarandombox.MultiverseCore.enums.EnglishChatColor;
import com.onarandombox.MultiverseCore.enums.EnglishChatStyle;
import me.main__.util.SerializationConfig.IllegalPropertyValueException;
import me.main__.util.SerializationConfig.Property;
import me.main__.util.SerializationConfig.SerializationConfig;
import me.main__.util.SerializationConfig.Serializor;
import me.main__.util.SerializationConfig.Validator;
import me.main__.util.SerializationConfig.VirtualProperty;
import org.bukkit.ChatColor;
import org.bukkit.Difficulty;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World.Environment;
import org.bukkit.configuration.serialization.SerializableAs;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/*
* This is a property class, I think we don't need that much javadoc.
* BEGIN CHECKSTYLE-SUPPRESSION: Javadoc
*/
@SerializableAs("MVWorld")
public class WorldProperties extends SerializationConfig {
private static final Map<String, String> PROPERTY_ALIASES;
static {
PROPERTY_ALIASES = new HashMap<String, String>();
PROPERTY_ALIASES.put("curr", "entryfee.currency");
PROPERTY_ALIASES.put("currency", "entryfee.currency");
PROPERTY_ALIASES.put("price", "entryfee.amount");
PROPERTY_ALIASES.put("scaling", "scale");
PROPERTY_ALIASES.put("aliascolor", "color");
PROPERTY_ALIASES.put("heal", "autoHeal");
PROPERTY_ALIASES.put("storm", "allowWeather");
PROPERTY_ALIASES.put("weather", "allowWeather");
PROPERTY_ALIASES.put("spawnmemory", "keepSpawnInMemory");
PROPERTY_ALIASES.put("memory", "keepSpawnInMemory");
PROPERTY_ALIASES.put("mode", "gameMode");
PROPERTY_ALIASES.put("diff", "difficulty");
PROPERTY_ALIASES.put("spawnlocation", "spawn");
PROPERTY_ALIASES.put("limit", "playerLimit");
PROPERTY_ALIASES.put("animals", "spawning.animals.spawn");
PROPERTY_ALIASES.put("monsters", "spawning.monsters.spawn");
PROPERTY_ALIASES.put("animalsrate", "spawning.animals.spawnrate");
PROPERTY_ALIASES.put("monstersrate", "spawning.monsters.spawnrate");
PROPERTY_ALIASES.put("flight", "allowFlight");
PROPERTY_ALIASES.put("fly", "allowFlight");
PROPERTY_ALIASES.put("allowfly", "allowFlight");
}
private final boolean keepSpawnFallback;
public WorldProperties(Map<String, Object> values) {
super(values);
Object keepSpawnObject = values.get("keepSpawnInMemory");
keepSpawnFallback = keepSpawnObject == null || Boolean.parseBoolean(keepSpawnObject.toString());
}
public WorldProperties() {
super();
keepSpawnFallback = true;
}
public WorldProperties(final boolean fixSpawn, final Environment environment) {
super();
if (!fixSpawn) {
this.adjustSpawn = false;
}
setScaling(getDefaultScale(environment));
keepSpawnFallback = true;
}
void setMVWorld(MVWorld world) {
registerObjectUsing(world);
registerGlobalValidator(new WorldPropertyValidator());
}
/**
* Serializor for the color-property.
*/
private static final class EnumPropertySerializor<T extends Enum<T>> implements Serializor<T, String> {
@Override
public String serialize(T from) {
return from.toString();
}
@Override
public T deserialize(String serialized, Class<T> wanted) throws IllegalPropertyValueException {
try {
return Enum.valueOf(wanted, serialized.toUpperCase());
} catch (IllegalArgumentException e) {
throw new IllegalPropertyValueException(e);
}
}
}
/**
* Serializor for the difficulty-property.
*/
private static final class DifficultyPropertySerializor implements Serializor<Difficulty, String> {
@Override
public String serialize(Difficulty from) {
return from.toString();
}
@Override
public Difficulty deserialize(String serialized, Class<Difficulty> wanted) throws IllegalPropertyValueException {
try {
return Difficulty.getByValue(Integer.parseInt(serialized));
} catch (Exception e) {
}
try {
return Difficulty.valueOf(serialized.toUpperCase());
} catch (Exception e) {
}
throw new IllegalPropertyValueException();
}
}
/**
* Serializor for the gameMode-property.
*/
private static final class GameModePropertySerializor implements Serializor<GameMode, String> {
@Override
public String serialize(GameMode from) {
return from.toString();
}
@Override
public GameMode deserialize(String serialized, Class<GameMode> wanted) throws IllegalPropertyValueException {
try {
return GameMode.getByValue(Integer.parseInt(serialized));
} catch (NumberFormatException nfe) {
}
try {
return GameMode.valueOf(serialized.toUpperCase());
} catch (Exception e) {
}
throw new IllegalPropertyValueException();
}
}
/**
* Serializor for the time-property.
*/
private static final class TimePropertySerializor implements Serializor<Long, String> {
// BEGIN CHECKSTYLE-SUPPRESSION: MagicNumberCheck
private static final String TIME_REGEX = "(\\d\\d?):?(\\d\\d)(a|p)?m?";
private static final Map<String, String> TIME_ALIASES;
static {
Map<String, String> staticTimes = new HashMap<String, String>();
staticTimes.put("morning", "8:00");
staticTimes.put("day", "12:00");
staticTimes.put("noon", "12:00");
staticTimes.put("midnight", "0:00");
staticTimes.put("night", "20:00");
// now set TIME_ALIASES to a "frozen" map
TIME_ALIASES = Collections.unmodifiableMap(staticTimes);
}
@Override
public String serialize(Long from) {
// I'm tired, so they get time in 24 hour for now.
// Someone else can add 12 hr format if they want :P
int hours = (int) ((from / 1000 + 8) % 24);
int minutes = (int) (60 * (from % 1000) / 1000);
return String.format("%d:%02d", hours, minutes);
}
@Override
public Long deserialize(String serialized, Class<Long> wanted) throws IllegalPropertyValueException {
if (TIME_ALIASES.containsKey(serialized.toLowerCase())) {
serialized = TIME_ALIASES.get(serialized.toLowerCase());
}
// Regex that extracts a time in the following formats:
// 11:11pm, 11:11, 23:11, 1111, 1111p, and the aliases at the top of this file.
Pattern pattern = Pattern.compile(TIME_REGEX, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(serialized);
matcher.find();
int hour = 0;
double minute = 0;
int count = matcher.groupCount();
if (count >= 2) {
hour = Integer.parseInt(matcher.group(1));
minute = Integer.parseInt(matcher.group(2));
}
// If there were 4 matches (all, hour, min, am/pm)
if (count == 4) {
// We want 24 hour time for calcs, but if they
// added a p[m], turn it into a 24 hr one.
if (matcher.group(3).equals("p")) {
hour += 12;
}
}
// Translate 24th hour to 0th hour.
if (hour == 24) {
hour = 0;
}
// Clamp the hour
if (hour > 23 || hour < 0) {
throw new IllegalPropertyValueException("Illegal hour!");
}
// Clamp the minute
if (minute > 59 || minute < 0) {
throw new IllegalPropertyValueException("Illegal minute!");
}
// 60 seconds in a minute, time needs to be in hrs * 1000, per
// the bukkit docs.
double totaltime = (hour + (minute / 60.0)) * 1000;
// Somehow there's an 8 hour offset...
totaltime -= 8000;
if (totaltime < 0) {
totaltime = 24000 + totaltime;
}
return (long) totaltime;
}
// END CHECKSTYLE-SUPPRESSION: MagicNumberCheck
}
// --------------------------------------------------------------
// Begin properties
@Property(description = "Sorry, 'hidden' must either be: true or false.")
private volatile boolean hidden;
@Property(description = "Alias must be a valid string.")
private volatile String alias;
@Property(serializor = EnumPropertySerializor.class, description = "Sorry, 'color' must be a valid color-name.")
private volatile EnglishChatColor color;
@Property(serializor = EnumPropertySerializor.class, description = "Sorry, 'style' must be a valid style-name.")
private volatile EnglishChatStyle style;
@Property(description = "Sorry, 'pvp' must either be: true or false.", virtualType = Boolean.class, persistVirtual = true)
volatile VirtualProperty<Boolean> pvp; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property(description = "Scale must be a positive double value. ex: 2.3")
private volatile double scale;
@Property(description = "You must set this to the NAME not alias of a world.")
private volatile String respawnWorld;
@Property(description = "Sorry, this must either be: true or false.")
private volatile boolean allowWeather;
@Property(serializor = DifficultyPropertySerializor.class, virtualType = Difficulty.class, persistVirtual = true,
description = "Difficulty must be set as one of the following: peaceful easy normal hard")
volatile VirtualProperty<Difficulty> difficulty; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property(description = "Sorry, 'animals' must either be: true or false.")
private volatile SpawnSettings spawning;
@Property
volatile EntryFee entryfee;
@Property(description = "Sorry, 'hunger' must either be: true or false.")
private volatile boolean hunger;
@Property(description = "Sorry, 'autoheal' must either be: true or false.")
private volatile boolean autoHeal;
@Property(description = "Sorry, 'adjustspawn' must either be: true or false.")
private volatile boolean adjustSpawn;
@Property(serializor = EnumPropertySerializor.class, description = "Allow portal forming must be NONE, ALL, NETHER or END.")
private volatile AllowedPortalType portalForm;
@Property(serializor = GameModePropertySerializor.class, description = "GameMode must be set as one of the following: survival creative")
private volatile GameMode gameMode;
@Property(description = "Sorry, this must either be: true or false.", virtualType = Boolean.class, persistVirtual = true)
volatile VirtualProperty<Boolean> keepSpawnInMemory; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property
volatile SpawnLocation spawnLocation; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property(virtualType = Location.class,
description = "There is no help available for this variable. Go bug Rigby90 about it.")
volatile VirtualProperty<Location> spawn; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property(description = "Set this to false ONLY if you don't want this world to load itself on server restart.")
private volatile boolean autoLoad;
@Property(description = "If a player dies in this world, shoudld they go to their bed?")
private volatile boolean bedRespawn;
@Property
private volatile List<String> worldBlacklist;
@Property(serializor = TimePropertySerializor.class, virtualType = Long.class,
description = "Set the time to whatever you want! (Will NOT freeze time)")
volatile VirtualProperty<Long> time; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property
volatile Environment environment; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property
volatile long seed; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property
private volatile String generator;
@Property
private volatile int playerLimit;
@Property
private volatile boolean allowFlight;
// End of properties
// --------------------------------------------------------------
void setValidator(String fieldName, Validator validator) {
registerValidator(fieldName, validator); //To change body of overridden methods use File | Settings | File Templates.
}
/**
* {@inheritDoc}
*/
@Override
public void copyValues(SerializationConfig other) {
super.copyValues(other);
}
/**
* This prepares the MVWorld for unloading.
*/
public void cacheVirtualProperties() {
try {
this.buildVPropChanges();
} catch (IllegalStateException e) {
// do nothing
}
}
/**
* {@inheritDoc}
*/
@Override
protected void setDefaults() {
this.hidden = false;
this.alias = new String();
this.color = EnglishChatColor.WHITE;
this.style = EnglishChatStyle.NORMAL;
this.scale = 1D;
this.respawnWorld = new String();
this.allowWeather = true;
this.spawning = new SpawnSettings();
this.entryfee = new EntryFee();
this.hunger = true;
this.autoHeal = true;
this.adjustSpawn = true;
this.portalForm = AllowedPortalType.ALL;
this.gameMode = GameMode.SURVIVAL;
this.spawnLocation = new NullLocation();
this.autoLoad = true;
this.bedRespawn = true;
this.worldBlacklist = new ArrayList<String>();
this.generator = null;
this.playerLimit = -1;
this.allowFlight = true;
}
private static double getDefaultScale(Environment environment) {
if (environment == Environment.NETHER) {
return 8.0; // SUPPRESS CHECKSTYLE: MagicNumberCheck
} else if (environment == Environment.THE_END) {
return 16.0; // SUPPRESS CHECKSTYLE: MagicNumberCheck
}
return 1.0;
}
/**
* getAliases().
* @return The alias-map.
* @see SerializationConfig
*/
protected static Map<String, String> getAliases() {
return PROPERTY_ALIASES;
}
void flushChanges() {
this.flushPendingVPropChanges();
}
public String getAlias() {
return this.alias;
}
public void setAlias(String alias) {
this.setPropertyValueUnchecked("alias", alias);
}
public Environment getEnvironment() {
return this.environment;
}
public void setEnvironment(Environment environment) {
this.setPropertyValueUnchecked("environment", environment);
}
public long getSeed() {
return this.seed;
}
public void setSeed(long seed) {
this.setPropertyValueUnchecked("seed", seed);
}
public String getGenerator() {
return this.generator;
}
public void setGenerator(String generator) {
this.setPropertyValueUnchecked("generator", generator);
}
public int getPlayerLimit() {
return this.playerLimit;
}
public void setPlayerLimit(int limit) {
this.setPropertyValueUnchecked("playerLimit", limit);
}
public boolean canAnimalsSpawn() {
return this.spawning.getAnimalSettings().doSpawn();
}
public void setAllowAnimalSpawn(boolean animals) {
this.setPropertyValueUnchecked("spawning.animals.spawn", animals);
}
public List<String> getAnimalList() {
// These don't fire events at the moment. Should they?
return this.spawning.getAnimalSettings().getExceptions();
}
public boolean canMonstersSpawn() {
return this.spawning.getMonsterSettings().doSpawn();
}
public void setAllowMonsterSpawn(boolean monsters) {
this.setPropertyValueUnchecked("spawning.monsters.spawn", monsters);
}
public int getAnimalSpawnRate() {
return this.spawning.getAnimalSettings().getSpawnRate();
}
public int getMonsterSpawnRate() {
return this.spawning.getMonsterSettings().getSpawnRate();
}
public List<String> getMonsterList() {
// These don't fire events at the moment. Should they?
return this.spawning.getMonsterSettings().getExceptions();
}
public boolean isPVPEnabled() {
return this.pvp.get();
}
public void setPVPMode(boolean pvp) {
this.setPropertyValueUnchecked("pvp", pvp);
}
public boolean isHidden() {
return this.hidden;
}
public void setHidden(boolean hidden) {
this.setPropertyValueUnchecked("hidden", hidden);
}
public List<String> getWorldBlacklist() {
return this.worldBlacklist;
}
public double getScaling() {
return this.scale;
}
public boolean setScaling(double scaling) {
return this.setPropertyValueUnchecked("scale", scaling);
}
public boolean setColor(String aliasColor) {
return this.setPropertyUnchecked("color", aliasColor);
}
public boolean setColor(EnglishChatColor color) {
return this.setPropertyValueUnchecked("color", color);
}
public EnglishChatColor getColor() {
return this.color;
}
public String getRespawnToWorld() {
return this.respawnWorld;
}
public boolean setRespawnToWorld(String respawnToWorld) {
return this.setPropertyValueUnchecked("respawnWorld", respawnToWorld);
}
public Material getCurrency() {
return this.entryfee.getCurrency();
}
public void setCurrency(@Nullable Material currency) {
this.setPropertyValueUnchecked("entryfee.currency", currency);
}
public double getPrice() {
return this.entryfee.getAmount();
}
public void setPrice(double price) {
this.setPropertyValueUnchecked("entryfee.amount", price);
}
public boolean setGameMode(String mode) {
return this.setPropertyUnchecked("gameMode", mode);
}
public boolean setGameMode(GameMode mode) {
return this.setPropertyValueUnchecked("gameMode", mode);
}
public GameMode getGameMode() {
return this.gameMode;
}
public void setEnableWeather(boolean weather) {
this.setPropertyValueUnchecked("allowWeather", weather);
}
public boolean isWeatherEnabled() {
return this.allowWeather;
}
public boolean isKeepingSpawnInMemory() {
if (keepSpawnInMemory == null) {
return keepSpawnFallback;
}
try {
return this.keepSpawnInMemory.get();
} catch (IllegalStateException e) {
return keepSpawnFallback;
}
}
public void setKeepSpawnInMemory(boolean value) {
this.setPropertyValueUnchecked("keepSpawnInMemory", value);
}
public boolean getHunger() {
return this.hunger;
}
public void setHunger(boolean hunger) {
this.setPropertyValueUnchecked("hunger", hunger);
}
public Location getSpawnLocation() {
return this.spawn.get();
}
public void setSpawnLocation(Location l) {
this.setPropertyValueUnchecked("spawn", l);
}
public Difficulty getDifficulty() {
return this.difficulty.get();
}
@Deprecated // SUPPRESS CHECKSTYLE: Deprecated
public boolean setDifficulty(String difficulty) {
return this.setPropertyUnchecked("difficulty", difficulty);
}
public boolean setDifficulty(Difficulty difficulty) {
return this.setPropertyValueUnchecked("difficulty", difficulty);
}
public boolean getAutoHeal() {
return this.autoHeal;
}
public void setAutoHeal(boolean heal) {
this.setPropertyValueUnchecked("autoHeal", heal);
}
public void setAdjustSpawn(boolean adjust) {
this.setPropertyValueUnchecked("adjustSpawn", adjust);
}
public boolean getAdjustSpawn() {
return this.adjustSpawn;
}
public void setAutoLoad(boolean load) {
this.setPropertyValueUnchecked("autoLoad", load);
}
public boolean getAutoLoad() {
return this.autoLoad;
}
public void setBedRespawn(boolean respawn) {
this.setPropertyValueUnchecked("bedRespawn", respawn);
}
public boolean getBedRespawn() {
return this.bedRespawn;
}
public String getAllPropertyNames() {
ChatColor myColor = ChatColor.AQUA;
StringBuilder result = new StringBuilder();
Map<String, Object> serialized = this.serialize();
for (String key : serialized.keySet()) {
result.append(myColor).append(key).append(' ');
myColor = (myColor == ChatColor.AQUA) ? ChatColor.GOLD : ChatColor.AQUA;
}
return result.toString();
}
public String getTime() {
return this.getPropertyUnchecked("time");
}
public boolean setTime(String timeAsString) {
return this.setPropertyUnchecked("time", timeAsString);
}
public AllowedPortalType getAllowedPortals() {
return portalForm;
}
public void allowPortalMaking(AllowedPortalType portalType) {
this.setPropertyValueUnchecked("portalForm", portalType);
}
public EnglishChatStyle getStyle() {
return style;
}
public boolean setStyle(String style) {
return this.setPropertyUnchecked("style", style);
}
public boolean getAllowFlight() {
return this.allowFlight;
}
public void setAllowFlight(final boolean allowFlight) {
this.setPropertyValueUnchecked("allowFlight", allowFlight);
}
}
@@ -1,79 +0,0 @@
package com.onarandombox.MultiverseCore.api;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Minecart;
import org.bukkit.entity.Vehicle;
/**
* Used to get block/location-related information.
*/
public interface BlockSafety {
/**
* This function checks whether the block at the given coordinates are above air or not.
* @param l The {@link Location} of the block.
* @return True if the block at that {@link Location} is above air.
*/
boolean isBlockAboveAir(Location l);
/**
* Checks if a player can spawn safely at the given coordinates.
* @param world The {@link World}.
* @param x The x-coordinate.
* @param y The y-coordinate.
* @param z The z-coordinate.
* @return True if a player can spawn safely at the given coordinates.
*/
boolean playerCanSpawnHereSafely(World world, double x, double y, double z);
/**
* This function checks whether the block at the coordinates given is safe or not by checking for Lava/Fire/Air
* etc. This also ensures there is enough space for a player to spawn!
*
* @param l The {@link Location}
* @return Whether the player can spawn safely at the given {@link Location}
*/
boolean playerCanSpawnHereSafely(Location l);
/**
* Gets a safe bed spawn location OR null if the bed is invalid.
* @param l The location of the bead head (block with the pillow on it).
* @return Safe location around the bed or null if no location was found.
*/
Location getSafeBedSpawn(Location l);
/**
* Gets the location of the top block at the specified {@link Location}.
* @param l Any {@link Location}.
* @return The {@link Location} of the top-block.
*/
Location getTopBlock(Location l);
/**
* Gets the location of the top block at the specified {@link Location}.
* @param l Any {@link Location}.
* @return The {@link Location} of the top-block.
*/
Location getBottomBlock(Location l);
/**
* Checks if an entity would be on track at the specified {@link Location}.
* @param l The {@link Location}.
* @return True if an entity would be on tracks at the specified {@link Location}.
*/
boolean isEntitiyOnTrack(Location l);
/**
* Checks if the specified {@link Minecart} can spawn safely.
* @param cart The {@link Minecart}.
* @return True if the minecart can spawn safely.
*/
boolean canSpawnCartSafely(Minecart cart);
/**
* Checks if the specified {@link Vehicle} can spawn safely.
* @param vehicle The {@link Vehicle}.
* @return True if the vehicle can spawn safely.
*/
boolean canSpawnVehicleSafely(Vehicle vehicle);
}
@@ -1,245 +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 buscript.Buscript;
import com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager;
import com.onarandombox.MultiverseCore.destination.DestinationFactory;
import com.onarandombox.MultiverseCore.utils.AnchorManager;
import com.onarandombox.MultiverseCore.utils.MVEconomist;
import com.onarandombox.MultiverseCore.utils.MVPermissions;
import com.onarandombox.MultiverseCore.utils.MVPlayerSession;
import com.onarandombox.MultiverseCore.utils.SimpleBlockSafety;
import com.onarandombox.MultiverseCore.utils.SimpleLocationManipulation;
import com.onarandombox.MultiverseCore.utils.SimpleSafeTTeleporter;
import com.onarandombox.MultiverseCore.utils.VaultHandler;
import com.pneumaticraft.commandhandler.CommandHandler;
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 {
/**
* Returns the Vault handler used by Multiverse. The returned object will have all methods necessary for
* interfacing with Vault.
*
* @return the Vault handler for Multiverse.
* @deprecated we are now using {@link #getEconomist()} for all economy needs.
*/
@Deprecated
VaultHandler getVaultHandler();
/**
* Retrieves Multiverse's friendly economist. The economist can be used for dealing with economies without
* worrying about any of the messy details.
*
* @return the economy manager for Multiverse.
*/
MVEconomist getEconomist();
/**
* 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 MultiverseMessaging}.
*/
MultiverseMessaging 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);
/**
* 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();
/**
* Manager for command that requires /mv confirm before execution.
*
* @return A non-null {@link CommandQueueManager}.
* @deprecated To be moved to new command manager in 5.0.0
*/
@Deprecated
CommandQueueManager getCommandQueueManager();
/**
* 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 MVWorldManager}.
*/
MVWorldManager getMVWorldManager();
/**
* Saves all configs.
*
* @return Whether the config was successfully saved
*/
boolean saveMVConfigs();
/**
* Gets the {@link AnchorManager}.
*
* @return The {@link AnchorManager}
*/
AnchorManager getAnchorManager();
/**
* Previously used by queued commands to regenerate a world on a delay.
* Do not use api method for any other purpose.
*
* @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.
*
* @deprecated Use {@link MVWorldManager#regenWorld(String, boolean, boolean, String, boolean)} instead.
*/
@Deprecated
Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed);
/**
* Used by queued commands to regenerate a world on a delay.
* Do not use api method for any other purpose.
*
* @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.
* @param keepGameRules If GameRules should be kept on world regen.
*
* @return True if success, false if fail.
*
* @deprecated Use {@link MVWorldManager#regenWorld(String, boolean, boolean, String, boolean)} instead.
*/
@Deprecated
Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed, Boolean keepGameRules);
/**
* 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();
/**
* Gets the {@link BlockSafety} this {@link Core} is using.
* @return The {@link BlockSafety} this {@link Core} is using.
* @see BlockSafety
* @see SimpleBlockSafety
*/
BlockSafety getBlockSafety();
/**
* Sets the {@link BlockSafety} this {@link Core} is using.
* @param blockSafety The new {@link BlockSafety}.
* @see BlockSafety
* @see SimpleBlockSafety
*/
void setBlockSafety(BlockSafety blockSafety);
/**
* Gets the {@link LocationManipulation} this {@link Core} is using.
* @return The {@link LocationManipulation} this {@link Core} is using.
* @see LocationManipulation
* @see SimpleLocationManipulation
*/
LocationManipulation getLocationManipulation();
/**
* Sets the {@link LocationManipulation} this {@link Core} is using.
* @param locationManipulation The new {@link LocationManipulation}.
* @see LocationManipulation
* @see SimpleLocationManipulation
*/
void setLocationManipulation(LocationManipulation locationManipulation);
/**
* Gets the {@link SafeTTeleporter} this {@link Core} is using.
* @return The {@link SafeTTeleporter} this {@link Core} is using.
* @see SafeTTeleporter
* @see SimpleSafeTTeleporter
*/
SafeTTeleporter getSafeTTeleporter();
/**
* Sets the {@link SafeTTeleporter} this {@link Core} is using.
* @param safeTTeleporter The new {@link SafeTTeleporter}.
* @see SafeTTeleporter
* @see SimpleSafeTTeleporter
*/
void setSafeTTeleporter(SafeTTeleporter safeTTeleporter);
/**
* Gets the {@link MultiverseCoreConfig}.
* @return The configuration.
*/
MultiverseCoreConfig getMVConfig();
/**
* Gets the buscript object for Multiverse. This is what handles Javascript processing.
*
* @return The Multiverse buscript object.
*/
Buscript getScriptAPI();
}
@@ -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,99 +0,0 @@
package com.onarandombox.MultiverseCore.api;
import org.bukkit.Location;
import org.bukkit.entity.Vehicle;
import org.bukkit.util.Vector;
/**
* Used to manipulate locations.
*/
public interface LocationManipulation {
/**
* Convert a Location into a Colon separated string to allow us to store it in text.
* <p>
* WORLD:X,Y,Z:yaw:pitch
* <p>
* The corresponding String2Loc function is {@link #stringToLocation}
*
* @param location The Location to save.
* @return The location as a string in this format: WORLD:x,y,z:yaw:pitch
*/
String locationToString(Location location);
/**
* This method simply does some rounding, rather than forcing a call to the server to get the blockdata.
*
* @param l The location to round to the block location
* @return A rounded location.
*/
Location getBlockLocation(Location l);
/**
* Returns a new location from a given string. The format is as follows:
* <p>
* WORLD:X,Y,Z:yaw:pitch
* <p>
* The corresponding Location2String function is {@link #stringToLocation}
*
* @param locationString The location represented as a string (WORLD:X,Y,Z:yaw:pitch)
* @return A new location defined by the string or null if the string was invalid.
*/
Location stringToLocation(String locationString);
/**
* Returns a colored string with the coords.
*
* @param l The {@link Location}
* @return The {@link String}
*/
String strCoords(Location l);
/**
* Converts a location to a printable readable formatted string including pitch/yaw.
*
* @param l The {@link Location}
* @return The {@link String}
*/
String strCoordsRaw(Location l);
/**
* Return the NESW Direction a Location is facing.
*
* @param location The {@link Location}
* @return The NESW Direction
*/
String getDirection(Location location);
/**
* Returns the float yaw position for the given cardinal direction.
*
* @param orientation The cardinal direction
* @return The yaw
*/
float getYaw(String orientation);
/**
* Returns a speed float from a given vector.
*
* @param v The {@link Vector}
* @return The speed
*/
float getSpeed(Vector v);
/**
* Returns a translated vector from the given direction.
*
* @param v The old {@link Vector}
* @param direction The new direction
* @return The translated {@link Vector}
*/
Vector getTranslatedVector(Vector v, String direction);
/**
* Returns the next Location that a {@link Vehicle} is traveling at.
*
* @param v The {@link Vehicle}
* @return The {@link Location}
*/
Location getNextBlock(Vehicle v);
}
@@ -1,36 +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.dumptruckman.minecraft.util.Logging;
import org.bukkit.Server;
import java.util.logging.Level;
/**
* A simple API to require plugins to have a log method.
*
* @deprecated Replaced by {@link Logging}.
* */
@Deprecated
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 when being teleported to this Destination.
* <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 com.onarandombox.MultiverseCore}.
*/
MultiverseCore getCore();
/**
* Sets the reference to MultiverseCore.
*
* @param core A valid {@link com.onarandombox.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,358 +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 com.onarandombox.MultiverseCore.utils.SimpleWorldPurger;
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 generateStructures If true, this world will get NPC villages.
* @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, Boolean generateStructures,
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 generateStructures If true, this world will get NPC villages.
* @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, Boolean generateStructures,
String generator, boolean useSpawnAdjust);
/**
* Make a copy of a world.
*
* @param oldName Name of world to be copied
* @param newName Name of world to be created
* @param generator The Custom generator plugin to use. Ignored.
* @return True if the world is copied successfully, false if not.
* @deprecated Use {@link #cloneWorld(String, String)} instead.
*/
@Deprecated
boolean cloneWorld(String oldName, String newName, String generator);
/**
* Make a copy of a world.
*
* @param oldName
* Name of world to be copied
* @param newName
* Name of world to be created
* @return True if the world is copied successfully, false if not.
*/
boolean cloneWorld(String oldName, String newName);
/**
* 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);
/**
*
* @param name The name of the world to remove
* @param removeFromConfig If true(default), we'll remove the entries from the
* config. If false, they'll stay and the world may come back.
* @param deleteWorldFolder If true the world folder will be completely deleted. If false
* only the contents of the world folder will be deleted
* @return True if success, false if failure.
*/
boolean deleteWorld(String name, boolean removeFromConfig, boolean deleteWorldFolder);
/**
* 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);
/**
* Unload a world from Multiverse with option to prevent calling unloadWorld in Bukkit.
*
* @param name Name of the world to unload
* @param unloadBukkit True if Bukkit world should be unloaded
* @return True if the world was unloaded, false if not.
*/
boolean unloadWorld(String name, boolean unloadBukkit);
/**
* 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 the world with name given exists, and null if it does not.
* This will search optionally for alias names.
*
* @param name The name or optionally the alias of the world to get.
* @param checkAliases Indicates whether to check for world alias name.
* @return A {@link MultiverseWorld} or null.
*/
MultiverseWorld getMVWorld(String name, boolean checkAliases);
/**
* 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}
* Searches based on world name AND alias.
*
* @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 name is a valid {@link MultiverseWorld}.
* Optionally searches by alias is specified.
*
* @param name The name or alias of the world to check.
* @param checkAliases Indicates whether to check for world alias name.
* @return True if the world exists, false if not.
*/
boolean isMVWorld(String name, boolean checkAliases);
/**
* 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 &amp; 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 &amp; 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}.
* @deprecated {@link PurgeWorlds} is deprecated!
*/
@Deprecated
PurgeWorlds getWorldPurger();
/**
* Gets the {@link WorldPurger}.
* <p>
* TODO: Remove {@link #getWorldPurger()} and replace it with this method.
* @return The {@link WorldPurger} this {@link MVWorldManager} is using.
* @see WorldPurger
* @see SimpleWorldPurger
*/
WorldPurger getTheWorldPurger();
/**
* 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();
/**
* Regenerates a world.
*
* @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);
/**
* Regenerates a world.
*
* @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.
* @param keepGameRules If GameRules should be kept on world regen.
*
* @return True if success, false if fail.
*/
boolean regenWorld(String name, boolean useNewSeed, boolean randomSeed, String seed, boolean keepGameRules);
boolean isKeepingSpawnInMemory(World world);
/**
* Checks whether Multiverse knows about a provided unloaded world. This
* method will check the parameter against the alias mappings.
*
* @param name The name of the unloaded world
* @param includeLoaded The value to return if the world is loaded
*
* @return True if the world exists and is unloaded. False if the world
* does not exist. {@code includeLoaded} if the world exists and is loaded.
*/
boolean hasUnloadedWorld(String name, boolean includeLoaded);
/**
* Get all the possible worlds that Multiverse has detected to be importable.
*
* @return A collection of world names that are deemed importable.
*/
Collection<String> getPotentialWorlds();
}
@@ -1,242 +0,0 @@
package com.onarandombox.MultiverseCore.api;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
/**
* The configuration of MultiverseCore.
*/
public interface MultiverseCoreConfig extends ConfigurationSerializable {
/**
* Sets a property using a {@link String}.
* @param property The name of the property.
* @param value The value.
* @return True on success, false if the operation failed.
*/
boolean setConfigProperty(String property, String value);
/**
* Sets portalCooldown.
* @param portalCooldown The new value.
*/
void setTeleportCooldown(int portalCooldown);
/**
* Gets portalCooldown.
* @return portalCooldown.
*/
int getTeleportCooldown();
/**
* Sets firstSpawnWorld.
* @param firstSpawnWorld The new value.
*/
void setFirstSpawnWorld(String firstSpawnWorld);
/**
* Gets firstSpawnWorld.
* @return firstSpawnWorld.
*/
String getFirstSpawnWorld();
/**
* Sets version.
* @param version The new value.
*/
void setVersion(int version);
/**
* Gets version.
* @return version.
*/
double getVersion();
/**
* Sets messageCooldown.
* @param messageCooldown The new value.
*/
void setMessageCooldown(int messageCooldown);
/**
* Gets messageCooldown.
* @return messageCooldown.
*/
int getMessageCooldown();
/**
* Sets globalDebug.
* @param globalDebug The new value.
*/
void setGlobalDebug(int globalDebug);
/**
* Gets globalDebug.
* @return globalDebug.
*/
int getGlobalDebug();
/**
* Sets displayPermErrors.
* @param displayPermErrors The new value.
*/
void setDisplayPermErrors(boolean displayPermErrors);
/**
* Gets displayPermErrors.
* @return displayPermErrors.
*/
boolean getDisplayPermErrors();
/**
* Sets enableBuscript.
* @param enableBuscript The new value.
*/
void setEnableBuscript(boolean enableBuscript);
/**
* Gets enableBuscript.
* @return enableBuscript.
*/
boolean getEnableBuscript();
/**
* Sets firstSpawnOverride.
* @param firstSpawnOverride The new value.
*/
void setFirstSpawnOverride(boolean firstSpawnOverride);
/**
* Gets firstSpawnOverride.
* @return firstSpawnOverride.
*/
boolean getFirstSpawnOverride();
/**
* Sets teleportIntercept.
* @param teleportIntercept The new value.
*/
void setTeleportIntercept(boolean teleportIntercept);
/**
* Gets teleportIntercept.
* @return teleportIntercept.
*/
boolean getTeleportIntercept();
/**
* Sets prefixChat.
* @param prefixChat The new value.
*/
void setPrefixChat(boolean prefixChat);
/**
* Gets prefixChat.
* @return prefixChat.
*/
boolean getPrefixChat();
/**
* Sets prefixChatFormat.
* @param prefixChatFormat The new value.
*/
void setPrefixChatFormat(String prefixChatFormat);
/**
* Gets prefixChatFormat.
* @return prefixChatFormat.
*/
String getPrefixChatFormat();
/**
* Sets enforceAccess.
* @param enforceAccess The new value.
*/
void setEnforceAccess(boolean enforceAccess);
/**
* Gets enforceAccess.
* @return enforceAccess.
*/
boolean getEnforceAccess();
/**
* Sets useasyncchat.
* @param useAsyncChat The new value.
*/
void setUseAsyncChat(boolean useAsyncChat);
/**
* Gets useasyncchat.
* @return useasyncchat.
*/
boolean getUseAsyncChat();
/**
* Sets whether to suppress startup messages.
*
* @param silentStart true to suppress messages.
*/
void setSilentStart(boolean silentStart);
/**
* Whether we are suppressing startup messages.
*
* @return true if we are suppressing startup messages.
*/
boolean getSilentStart();
/**
* Sets whether or not to let Bukkit determine portal search radius on its own or if Multiverse should give input.
*
* @param useDefaultPortalSearch True to let Bukkit determine portal search radius on its own.
*/
void setUseDefaultPortalSearch(boolean useDefaultPortalSearch);
/**
* Gets whether or not Bukkit will be determining portal search radius on its own or if Multiverse should help.
*
* @return True means Bukkit will use its own default values.
*/
boolean isUsingDefaultPortalSearch();
/**
* Sets the radius at which vanilla style portals will be searched for to connect to worlds together.
*
* @param searchRadius The portal search radius.
*/
void setPortalSearchRadius(int searchRadius);
/**
* Gets the radius at which vanilla style portals will be searched for to connect to worlds together.
*
* @return The portal search radius.
*/
int getPortalSearchRadius();
/**
* Gets whether or not the automatic purge of entities is enabled.
*
* @return True if automatic purge is enabled.
*/
boolean isAutoPurgeEnabled();
/**
* Sets whether or not the automatic purge of entities is enabled.
*
* @param autopurge True if automatic purge should be enabled.
*/
void setAutoPurgeEnabled(boolean autopurge);
/**
* Gets whether or not the donation/patreon messages are shown.
*
* @return True if donation/patreon messages should be shown.
*/
boolean isShowingDonateMessage();
/**
* Sets whether or not the donation/patreon messages are shown.
*
* @param idonotwanttodonate True if donation/patreon messages should be shown.
*/
void setShowDonateMessage(boolean idonotwanttodonate);
}
@@ -1,56 +0,0 @@
package com.onarandombox.MultiverseCore.api;
import java.util.Collection;
import org.bukkit.command.CommandSender;
/**
* Multiverse-messaging.
*/
public interface MultiverseMessaging {
/**
* Sets the message-cooldown.
* @param milliseconds The new message-cooldown in milliseconds.
*/
void setCooldown(int milliseconds);
/**
* Sends a message to the specified sender if the cooldown has passed.
*
* @param sender The person/console to send the message to.
* @param message The message to send.
* @param ignoreCooldown If true this message will always be sent. Useful for things like menus
* @return true if the message was sent, false if not.
*/
boolean sendMessage(CommandSender sender, String message, boolean ignoreCooldown);
/**
* Sends a group of messages to the specified sender if the cooldown has passed.
* This method is needed, since sending many messages in quick succession would violate
* the cooldown.
*
* @param sender The person/console to send the message to.
* @param messages The messages to send.
* @param ignoreCooldown If true these messages will always be sent. Useful for things like menus
* @return true if the message was sent, false if not.
*/
boolean sendMessages(CommandSender sender, String[] messages, boolean ignoreCooldown);
/**
* Sends a group of messages to the specified sender if the cooldown has passed.
* This method is needed, since sending many messages in quick succession would violate
* the cooldown.
*
* @param sender The person/console to send the message to.
* @param messages The messages to send.
* @param ignoreCooldown If true these messages will always be sent. Useful for things like menus
* @return true if the message was sent, false if not.
*/
boolean sendMessages(CommandSender sender, Collection<String> messages, boolean ignoreCooldown);
/**
* Gets the message-cooldown.
* @return The message-cooldown.
*/
int getCooldown();
}
@@ -1,161 +0,0 @@
package com.onarandombox.MultiverseCore.api;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.utils.DebugLog;
import com.pneumaticraft.commandhandler.CommandHandler;
/**
* Make things easier for MV-Plugins!
*/
public abstract class MultiversePlugin extends JavaPlugin implements MVPlugin {
private MultiverseCore core;
/**
* Prefix for standard log entrys.
*/
protected String logTag;
private DebugLog debugLog;
/**
* {@inheritDoc}
*
* Note: You can't override this, use {@link #onPluginEnable()} instead!
* @see #onPluginEnable()
*/
@Override
public final void onEnable() {
MultiverseCore theCore = (MultiverseCore) this.getServer().getPluginManager().getPlugin("Multiverse-Core");
if (theCore == null) {
this.getLogger().severe("Core not found! The plugin dev needs to add a dependency!");
this.getLogger().severe("Disabling!");
this.getServer().getPluginManager().disablePlugin(this);
return;
}
if (theCore.getProtocolVersion() < this.getProtocolVersion()) {
this.getLogger().severe("You need a newer version of Multiverse-Core!");
this.getLogger().severe("Disabling!");
this.getServer().getPluginManager().disablePlugin(this);
return;
}
this.setCore(theCore);
this.getServer().getLogger().info(String.format("%s - Version %s enabled - By %s",
this.getDescription().getName(), this.getDescription().getVersion(), getAuthors()));
getDataFolder().mkdirs();
File debugLogFile = new File(getDataFolder(), "debug.log");
try {
debugLogFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
debugLog = new DebugLog(this.getDescription().getName(), getDataFolder() + File.separator + "debug.log");
debugLog.setTag(String.format("[%s-Debug]", this.getDescription().getName()));
this.onPluginEnable();
}
/**
* Parse the Authors Array into a readable String with ',' and 'and'.
*
* @return The readable authors-{@link String}
*/
protected String getAuthors() {
String authors = "";
List<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);
}
/**
* Called when the plugin is enabled.
* @see #onEnable()
*/
protected abstract void onPluginEnable();
/**
* You can register commands here.
* @param handler The CommandHandler.
*/
protected abstract void registerCommands(CommandHandler handler);
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!this.isEnabled()) {
sender.sendMessage("This plugin is Disabled!");
return true;
}
ArrayList<String> allArgs = new ArrayList<String>(args.length + 1);
allArgs.add(command.getName());
allArgs.addAll(Arrays.asList(args));
return this.getCore().getCommandHandler().locateAndRunCommand(sender, allArgs);
}
@Override
public void log(Level level, String msg) {
int debugLevel = this.getCore().getMVConfig().getGlobalDebug();
if ((level == Level.FINE && debugLevel >= 1) || (level == Level.FINER && debugLevel >= 2)
|| (level == Level.FINEST && debugLevel >= 3)) {
debugLog.log(level, msg);
} else if (level != Level.FINE && level != Level.FINER && level != Level.FINEST) {
String message = new StringBuilder(getLogTag()).append(msg).toString();
this.getServer().getLogger().log(level, message);
debugLog.log(level, message);
}
}
private String getLogTag() {
if (logTag == null)
logTag = String.format("[%s]", this.getDescription().getName());
return logTag;
}
/**
* Sets the debug log-tag.
* @param tag The new tag.
*/
protected final void setDebugLogTag(String tag) {
this.debugLog.setTag(tag);
}
@Override
public final String dumpVersionInfo(String buffer) {
throw new UnsupportedOperationException("This is gone.");
}
@Override
public final MultiverseCore getCore() {
if (this.core == null)
throw new IllegalStateException("Core is null!");
return this.core;
}
@Override
public final void setCore(MultiverseCore core) {
this.core = core;
}
}
@@ -1,674 +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.enums.AllowedPortalType;
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.Material;
import org.bukkit.World;
import org.bukkit.WorldType;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permission;
import org.jetbrains.annotations.Nullable;
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();
/**
* Gets the name of this world. The name cannot be changed.
* <p>
* Note for plugin developers: Usually {@link #getAlias()}
* is what you want to use instead of this method.
*
* @return The name of the world as a String.
*/
String getName();
/**
* Gets the type of this world. As of 1.2 this will be:
* FLAT, NORMAL or VERSION_1_1
* <p>
* This is <b>not</b> the generator.
*
* @return The Type of this world.
*/
WorldType getWorldType();
/**
* 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 difficulty of this world.
*
* @return The difficulty of this world.
*/
Difficulty getDifficulty();
/**
* 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. {@code 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.
* @deprecated Use {@link #setDifficulty(Difficulty)} or, if you have to
* pass a string, use {@link #setPropertyValue(String, String)} instead.
*/
@Deprecated
boolean setDifficulty(String difficulty);
/**
* Sets the difficulty of this world and returns {@code true} on 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 new difficulty.
* @return True if success, false if the operation failed... for whatever reason.
*/
boolean setDifficulty(Difficulty difficulty);
/**
* 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 generator of this world.
*
* @return The name of the generator.
*/
String getGenerator();
/**
* Sets the generator of this world.
*
* @param generator The new generator's name.
*/
void setGenerator(String generator);
/**
* Gets the help-message for a property.
* @param property The name of the property.
* @return The help-message.
* @throws PropertyDoesNotExistException Thrown if the property was not found.
*/
String getPropertyHelp(String property) throws PropertyDoesNotExistException;
/**
* Gets a property as {@link String}.
*
* @param property The name of a world property to get.
* @return The string-representation of that property.
* @throws PropertyDoesNotExistException Thrown if the property was not found in the world.
*/
String getPropertyValue(String property) throws PropertyDoesNotExistException;
/**
* Sets a property to a given value.
*
* @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.
* @return True if the value was set, false if not.
* @throws PropertyDoesNotExistException Thrown if the property was not found in the world.
*/
boolean setPropertyValue(String property, String value) throws PropertyDoesNotExistException;
/**
* 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.
* @deprecated We changed the entire world-config-system. This is not compatible any more.
*/
@Deprecated
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.
* @deprecated We changed the entire world-config-system. This is not compatible any more.
*/
@Deprecated
boolean removeFromVariable(String property, String value);
/**
* 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.
* @deprecated We changed the entire world-config-system. This is not compatible any more.
*/
@Deprecated
boolean clearVariable(String property);
/**
* Clears a list property (sets it to []).
*
* @param property The property to clear.
* @return True if success, false if fail.
* @deprecated We changed the entire world-config-system. This is not compatible any more.
*/
@Deprecated
boolean clearList(String property);
// end of old config stuff
// permission stuff
/**
* 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 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();
// end of permission stuff
/**
* 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);
/**
* Gets the color that this world's name/alias will display as.
*
* @return The color of this world.
*/
ChatColor getColor();
/**
* 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 style that this world's name/alias will display as.
*
* @return The style of this world. {@code null} for "normal" style.
*/
ChatColor getStyle();
/**
* Sets the style that this world's name/alias will display as.
*
* @param style A valid style name.
* @return True if the style was set, false if not.
*/
boolean setStyle(String style);
/**
* 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.
*
* @deprecated This has been moved: {@link com.onarandombox.MultiverseCore.enums.EnglishChatColor#isValidAliasColor(String)}
*/
@Deprecated
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();
// animals&monster stuff
/**
* 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();
/**
* 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 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();
/**
* 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();
/**
* 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);
/**
* 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();
// end of animal&monster stuff
/**
* 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();
/**
* Turn pvp on or off. This setting is used to set the world's PVP mode.
*
* @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 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);
/**
* Gets whether weather is enabled in this world.
*
* @return True if weather events will occur, false if not.
*/
boolean isWeatherEnabled();
/**
* 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 or not CraftBukkit is keeping the chunks for this world in memory.
*
* @return True if CraftBukkit is keeping spawn chunks in memory.
*/
boolean isKeepingSpawnInMemory();
/**
* 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 the spawn location of this world.
*
* @return The spawn location of this world.
*/
Location getSpawnLocation();
/**
* Sets the spawn location for a world.
*
* @param spawnLocation The spawn location for a world.
*/
void setSpawnLocation(Location spawnLocation);
/**
* 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 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 the GameMode of this world.
*
* @return The GameMode of this world.
*/
GameMode getGameMode();
/**
* 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.
* @deprecated Use {@link #setGameMode(GameMode)} instead. If you have to
* pass a string, use {@link #setPropertyValue(String, String)}.
*/
@Deprecated
boolean setGameMode(String gameMode);
/**
* Sets the game mode of this world.
*
* @param gameMode The new {@link GameMode}.
* @return True if the game mode was successfully changed, false if not.
*/
boolean setGameMode(GameMode gameMode);
/**
* Gets the amount of currency it requires to enter this world.
*
* @return The amount it costs to enter this world.
*/
double getPrice();
/**
* Sets the price for entry to this world.
* You can think of this like an amount.
* The type can be set with {@link #setCurrency(Material)}
*
* @param price The Amount of money/item to enter the world.
*/
void setPrice(double price);
/**
* Gets the type of currency that will be used when users enter this world. A value of null indicates a non-item
* based currency is used.
*
* @return The type of currency that will be used when users enter this world.
*/
@Nullable
Material getCurrency();
/**
* Sets the type of item that will be required given the price is not 0.
* Use a value of null to specify a non-item based currency.
*
* @param item The Type of currency that will be used when users enter this world.
*/
void setCurrency(@Nullable Material item);
/**
* 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 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 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();
/**
* 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 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 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 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-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-load this world.
*
* @return True if Multiverse should auto-load this world.
*/
boolean getAutoLoad();
/**
* 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 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();
/**
* 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);
/**
* Sets the player limit for this world after which players without an override
* permission node will not be allowed in. A value of -1 or less signifies no limit
*
* @param limit The new limit
*/
void setPlayerLimit(int limit);
/**
* Gets the player limit for this world after which players without an override
* permission node will not be allowed in. A value of -1 or less signifies no limit
*
* @return The player limit
*/
int getPlayerLimit();
/**
* Same as {@link #getTime()}, but returns a string.
* @return The time as a short string: 12:34pm
*/
String getTime();
/**
* 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);
/**
* Sets The types of portals that are allowed in this world.
*
* @param type The type of portals allowed in this world.
*/
void allowPortalMaking(AllowedPortalType type);
/**
* Gets which type(s) of portals are allowed to be constructed in this world.
*
* @return The type of portals that are allowed.
*/
AllowedPortalType getAllowedPortals();
// properties that are not "getter+setter" style
/**
* 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();
/**
* Gets all the names of all properties that can be SET.
*
* @return All property names, with alternating colors.
*/
String getAllPropertyNames();
/**
* Whether or not players are allowed to fly in this world.
*
* @return True if players allowed to fly in this world.
*/
boolean getAllowFlight();
/**
* Sets whether or not players are allowed to fly in this world.
*
* @param allowFlight True to allow flight in this world.
*/
void setAllowFlight(final boolean allowFlight);
}
@@ -1,71 +0,0 @@
package com.onarandombox.MultiverseCore.api;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import com.onarandombox.MultiverseCore.enums.TeleportResult;
/**
* Used to safely teleport people.
*/
public interface SafeTTeleporter extends Teleporter {
/**
* Gets the next safe location around the given location.
* @param l A {@link Location}.
* @return A safe {@link Location}.
*/
Location getSafeLocation(Location l);
/**
* Gets the next safe location around the given location.
* @param l A {@link Location}.
* @param tolerance The tolerance.
* @param radius The radius.
* @return A safe {@link Location}.
*/
Location getSafeLocation(Location l, int tolerance, int radius);
/**
* Safely teleport the entity to the MVDestination. This will perform checks to see if the place is safe, and if
* it's not, will adjust the final destination accordingly.
*
* @param teleporter Person who performed the teleport command.
* @param teleportee Entity to teleport
* @param d Destination to teleport them to
* @return true for success, false for failure
*/
TeleportResult safelyTeleport(CommandSender teleporter, Entity teleportee, MVDestination d);
/**
* Safely teleport the entity to the Location. This may perform checks to
* see if the place is safe, and if
* it's not, will adjust the final destination accordingly.
*
* @param teleporter Person who issued the teleport command.
* @param teleportee Entity to teleport.
* @param location Location to teleport them to.
* @param safely Should the destination be checked for safety before teleport?
* @return true for success, false for failure.
*/
TeleportResult safelyTeleport(CommandSender teleporter, Entity teleportee, Location location,
boolean safely);
/**
* Returns a safe location for the entity to spawn at.
*
* @param e The entity to spawn
* @param d The MVDestination to take the entity to.
* @return A new location to spawn the entity at.
*/
Location getSafeLocation(Entity e, MVDestination d);
/**
* Finds a portal-block next to the specified {@link Location}.
* @param l The {@link Location}
* @return The next portal-block's {@link Location}.
*/
Location findPortalBlockNextTo(Location l);
}
@@ -1,10 +0,0 @@
package com.onarandombox.MultiverseCore.api;
import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.enums.TeleportResult;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public interface Teleporter {
TeleportResult teleport(CommandSender teleporter, Player teleportee, MVDestination destination);
}
@@ -1,68 +0,0 @@
package com.onarandombox.MultiverseCore.api;
import java.util.List;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
/**
* Used to remove animals from worlds that don't belong there.
*/
public interface WorldPurger {
/**
* Synchronizes the given worlds with their settings.
*
* @param worlds A list of {@link MultiverseWorld}
*/
void purgeWorlds(List<MultiverseWorld> worlds);
/**
* Convenience method for {@link #purgeWorld(MultiverseWorld, java.util.List, boolean, boolean)} that takes the settings from the world-config.
*
* @param world The {@link MultiverseWorld}.
*/
void purgeWorld(MultiverseWorld world);
/**
* Clear all animals/monsters that do not belong to a world according to the config.
*
* @param mvworld The {@link MultiverseWorld}.
* @param thingsToKill A {@link List} of animals/monsters to be killed.
* @param negateAnimals Whether the monsters in the list should be negated.
* @param negateMonsters Whether the animals in the list should be negated.
*/
void purgeWorld(MultiverseWorld mvworld, List<String> thingsToKill, boolean negateAnimals,
boolean negateMonsters);
/**
* Clear all animals/monsters that do not belong to a world according to the config.
*
* @param mvworld The {@link MultiverseWorld}.
* @param thingsToKill A {@link List} of animals/monsters to be killed.
* @param negateAnimals Whether the monsters in the list should be negated.
* @param negateMonsters Whether the animals in the list should be negated.
* @param sender The {@link CommandSender} that initiated the action. He will/should be notified.
*/
void purgeWorld(MultiverseWorld mvworld, List<String> thingsToKill, boolean negateAnimals,
boolean negateMonsters, CommandSender sender);
/**
* Determines whether the specified creature should be killed.
*
* @param e The creature.
* @param thingsToKill A {@link List} of animals/monsters to be killed.
* @param negateAnimals Whether the monsters in the list should be negated.
* @param negateMonsters Whether the animals in the list should be negated.
* @return {@code true} if the creature should be killed, otherwise {@code false}.
*/
boolean shouldWeKillThisCreature(Entity e, List<String> thingsToKill, boolean negateAnimals, boolean negateMonsters);
/**
* Determines whether the specified creature should be killed and automatically reads the params from a world object.
*
* @param w The world.
* @param e The creature.
* @return {@code true} if the creature should be killed, otherwise {@code false}.
*/
boolean shouldWeKillThisCreature(MultiverseWorld w, Entity e);
}
@@ -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,162 +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.Permission;
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.list", "Allows a player to list all anchors.", PermissionDefault.OP);
this.addAdditonalPermission(new Permission("multiverse.core.anchor.create",
"Allows a player to create anchors.", PermissionDefault.OP));
this.addAdditonalPermission(new Permission("multiverse.core.anchor.delete",
"Allows a player to delete anchors.", 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) {
if (!this.plugin.getMVPerms().hasPermission(sender, "multiverse.core.anchor.list", true)) {
sender.sendMessage(ChatColor.RED + "You don't have the permission to list anchors!");
return;
}
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);
} else if (filterObject.getPage() < 1) {
filterObject.setPage(1);
}
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() == 1 && (this.getPageAndFilter(args).getPage() != 1 || args.get(0).equals("1"))) {
this.showList(sender, args);
return;
}
if (args.size() == 2 && args.get(1).equalsIgnoreCase("-d")) {
if (!this.plugin.getMVPerms().hasPermission(sender, "multiverse.core.anchor.delete", true)) {
sender.sendMessage(ChatColor.RED + "You don't have the permission to delete anchors!");
} else {
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;
}
if (!this.plugin.getMVPerms().hasPermission(sender, "multiverse.core.anchor.create", true)) {
sender.sendMessage(ChatColor.RED + "You don't have the permission to create anchors!");
} else {
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,58 +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 com.onarandombox.MultiverseCore.utils.PlayerFinder;
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 = PlayerFinder.get(args.get(0), sender);
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(String.format("You asked if '%s' could go to %s%s%s,",
args.get(0), 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();
perms.tellMeWhyICantDoThis(sender, p, dest);
}
}
@@ -1,55 +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 java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
/**
* Creates a clone of a world.
*/
public class CloneCommand extends MultiverseCommand {
private MVWorldManager worldManager;
public CloneCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Clone World");
this.setCommandUsage("/mv clone" + ChatColor.GREEN + " {TARGET} {NAME}" + ChatColor.GOLD + " -g [GENERATOR[:ID]]");
this.setArgRange(2, 4); // SUPPRESS CHECKSTYLE: MagicNumberCheck
this.addKey("mvclone");
this.addKey("mvcl");
this.addKey("mv cl");
this.addKey("mv clone");
this.addCommandExample("/mv clone " + ChatColor.GOLD + "world" + ChatColor.GREEN + " world_backup");
this.addCommandExample("/mv clone " + ChatColor.GOLD + "skyblock_pristine" + ChatColor.GREEN + " skyblock");
this.setPermission("multiverse.core.clone", "Clones a world.", PermissionDefault.OP);
this.worldManager = this.plugin.getMVWorldManager();
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
String oldName = args.get(0);
if (!this.worldManager.hasUnloadedWorld(oldName, true)) {
// If no world was found, we can't clone.
sender.sendMessage("Sorry, Multiverse doesn't know about world " + oldName + ", so we can't clone it!");
sender.sendMessage("Check the " + ChatColor.GREEN + "/mv list" + ChatColor.WHITE + " command to verify it is listed.");
return;
}
if (this.plugin.getMVWorldManager().cloneWorld(oldName, args.get(1))) {
sender.sendMessage(ChatColor.GREEN + "World cloned!");
} else {
sender.sendMessage(ChatColor.RED + "World could NOT be cloned!");
}
}
}
@@ -1,72 +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.Map;
/**
* 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("/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) {
StringBuilder builder = new StringBuilder();
Map<String, Object> serializedConfig = this.plugin.getMVConfig().serialize();
for (Map.Entry<String, Object> entry : serializedConfig.entrySet()) {
builder.append(ChatColor.GREEN);
builder.append(entry.getKey());
builder.append(ChatColor.WHITE).append(" = ").append(ChatColor.GOLD);
builder.append(entry.getValue().toString());
builder.append(ChatColor.WHITE).append(", ");
}
String message = builder.toString();
message = message.substring(0, message.length() - 2);
sender.sendMessage(message);
return;
}
if (!this.plugin.getMVConfig().setConfigProperty(args.get(0).toLowerCase(), args.get(1))) {
sender.sendMessage(String.format("%sSetting '%s' to '%s' failed!", ChatColor.RED, args.get(0).toLowerCase(), args.get(1)));
return;
}
// special rule
if (args.get(0).equalsIgnoreCase("firstspawnworld")) {
// Don't forget to set the world!
this.plugin.getMVWorldManager().setFirstSpawnWorld(args.get(1));
}
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.getCommandQueueManager().runQueuedCommand(sender);
}
}
@@ -1,70 +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.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 + plugin.getLocationManipulation().strCoords(p.getLocation()));
p.sendMessage(ChatColor.AQUA + "Direction: " + ChatColor.WHITE + plugin.getLocationManipulation().getDirection(p.getLocation()));
p.sendMessage(ChatColor.AQUA + "Block: " + ChatColor.WHITE + world.getBlockAt(p.getLocation()).getType());
} else {
sender.sendMessage("This command needs to be used from a Player.");
}
}
}
@@ -1,131 +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.ArrayList;
import java.util.Arrays;
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(String.format("/mv create %s{NAME} {ENV} %s-s [SEED] -g [GENERATOR[:ID]] -t [WORLDTYPE] [-n] -a [true|false]",
ChatColor.GREEN, ChatColor.GOLD));
this.setArgRange(2, 11); // 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();
}
private String trimWorldName(String userInput) {
// Removes relative paths.
return userInput.replaceAll("^[./\\\\]+", "");
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
String worldName = trimWorldName(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);
boolean allowStructures = true;
String structureString = CommandHandler.getFlag("-a", args);
if (structureString != null) {
allowStructures = Boolean.parseBoolean(structureString);
}
String typeString = CommandHandler.getFlag("-t", args);
boolean useSpawnAdjust = true;
for (String s : args) {
if (s.equalsIgnoreCase("-n")) {
useSpawnAdjust = false;
}
}
// Make sure the world name doesn't contain the words 'plugins' and '.dat'
if(worldName.contains("plugins")||worldName.contains(".dat")){
sender.sendMessage(ChatColor.RED + "Multiverse cannot create a world that contains 'plugins' or '.dat'");
return;
}
if (this.worldManager.isMVWorld(worldName)) {
sender.sendMessage(ChatColor.RED + "Multiverse cannot create " + ChatColor.GOLD + ChatColor.UNDERLINE
+ "another" + ChatColor.RESET + ChatColor.RED + " world named " + worldName);
return;
}
if (worldFile.exists()) {
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;
}
// Determine if the generator is valid. #918
if (generator != null) {
List<String> genarray = new ArrayList<String>(Arrays.asList(generator.split(":")));
if (genarray.size() < 2) {
// If there was only one arg specified, pad with another empty one.
genarray.add("");
}
if (this.worldManager.getChunkGenerator(genarray.get(0), genarray.get(1), "test") == null) {
// We have an invalid generator.
sender.sendMessage("Invalid generator! '" + generator + "'. " + ChatColor.RED + "Aborting world creation.");
return;
}
}
Command.broadcastCommandMessage(sender, "Starting creation of world '" + worldName + "'...");
if (this.worldManager.addWorld(worldName, environment, seed, type, allowStructures, generator, useSpawnAdjust)) {
Command.broadcastCommandMessage(sender, "Complete!");
} else {
Command.broadcastCommandMessage(sender, "FAILED.");
}
}
}
@@ -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.commands;
import com.dumptruckman.minecraft.util.Logging;
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|silent]");
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")) {
plugin.getMVConfig().setGlobalDebug(0);
} else {
try {
int debugLevel = Integer.parseInt(args.get(0));
if (debugLevel > 3 || debugLevel < 0) {
throw new NumberFormatException();
}
plugin.getMVConfig().setGlobalDebug(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!)");
}
}
plugin.saveMVConfigs();
}
this.displayDebugMode(sender);
}
private void displayDebugMode(CommandSender sender) {
final int debugLevel = plugin.getMVConfig().getGlobalDebug();
if (debugLevel == 0) {
sender.sendMessage("Multiverse Debug mode is " + ChatColor.RED + "OFF");
} else {
sender.sendMessage("Multiverse Debug mode is " + ChatColor.GREEN + debugLevel);
Logging.fine("Multiverse Debug ENABLED");
}
}
}
@@ -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 com.onarandombox.MultiverseCore.commandtools.queue.QueuedCommand;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import org.jetbrains.annotations.NotNull;
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 delete " + 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) {
String worldName = args.get(0);
this.plugin.getCommandQueueManager().addToQueue(new QueuedCommand(
sender,
deleteRunnable(sender, worldName),
String.format("Are you sure you want to delete world '%s'? You cannot undo this action.", worldName)
));
}
private Runnable deleteRunnable(@NotNull CommandSender sender,
@NotNull String worldName) {
return () -> {
sender.sendMessage(String.format("Deleting world '%s'...", worldName));
if (this.plugin.getMVWorldManager().deleteWorld(worldName)) {
sender.sendMessage(String.format("%sWorld %s was deleted!", ChatColor.GREEN, worldName));
return;
}
sender.sendMessage(String.format("%sThere was an issue deleting '%s'! Please check console for errors.",
ChatColor.RED, worldName));
};
}
}
@@ -1,118 +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%s, %sFLAT, %sLARGEBIOMES %sor %sVERSION_1_1",
ChatColor.GREEN, ChatColor.WHITE, ChatColor.AQUA, ChatColor.RED, ChatColor.WHITE, ChatColor.GOLD));
}
@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";
} else if (type.equalsIgnoreCase("flat")) {
type = "FLAT";
} else if (type.equalsIgnoreCase("largebiomes")) {
type = "LARGE_BIOMES";
} else if (type.equalsIgnoreCase("amplified")) {
type = "AMPLIFIED";
}
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) {
env = env.toUpperCase();
// 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,116 +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.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameRule;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Allows management of Anchor Destinations.
*/
public class GameruleCommand extends MultiverseCommand {
public GameruleCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Set a Minecraft Game Rule for a World.");
this.setCommandUsage("/mv gamerule " + ChatColor.GREEN + "{RULE} {VALUE}" + ChatColor.GOLD + " [WORLD]");
this.setArgRange(2, 3);
this.addKey("mv gamerule");
this.addKey("mv rule");
this.addKey("mvgamerule");
this.addKey("mvrule");
this.addCommandExample("/mv gamerule " + ChatColor.GREEN + "doMobLoot false");
this.addCommandExample("/mvrule " + ChatColor.GREEN + "keepInventory true " + ChatColor.RED + "world_nether");
this.setPermission("multiverse.core.gamerule.set", "Allows a player to set a gamerule.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// We NEED a world from the command line
final Player p;
if (sender instanceof Player) {
p = (Player) sender;
} else {
p = null;
}
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;
}
final GameRule gameRule = GameRule.getByName(args.get(0));
final String value = args.get(1);
final World world;
if (args.size() == 2) {
world = p.getWorld();
} else {
world = Bukkit.getWorld(args.get(2));
if (world == null) {
sender.sendMessage(ChatColor.RED + "Failure!" + ChatColor.WHITE + " World " + ChatColor.AQUA + args.get(2)
+ ChatColor.WHITE + " does not exist.");
return;
}
}
if (gameRule == null) {
sender.sendMessage(ChatColor.RED + "Failure! " + ChatColor.AQUA + args.get(0) + ChatColor.WHITE
+ " is not a valid gamerule.");
} else {
if (gameRule.getType() == Boolean.class) {
boolean booleanValue;
if (value.equalsIgnoreCase("true")) {
booleanValue = true;
} else if (value.equalsIgnoreCase("false")) {
booleanValue = false;
} else {
sender.sendMessage(getErrorMessage(gameRule.getName(), value) + "it can only be set to true or false.");
return;
}
if (!world.setGameRule(gameRule, booleanValue)) {
sender.sendMessage(getErrorMessage(gameRule.getName(), value) + "something went wrong.");
return;
}
} else if (gameRule.getType() == Integer.class) {
try {
if (!world.setGameRule(gameRule, Integer.parseInt(value))) {
throw new NumberFormatException();
}
} catch (NumberFormatException e) {
sender.sendMessage(getErrorMessage(gameRule.getName(), value) + "it can only be set to a positive integer.");
return;
}
} else {
sender.sendMessage(ChatColor.RED + "Failure!" + ChatColor.WHITE + " Gamerule " + ChatColor.AQUA + gameRule.getName()
+ ChatColor.WHITE + " isn't supported yet, please let us know about it.");
return;
}
sender.sendMessage(ChatColor.GREEN + "Success!" + ChatColor.WHITE + " Gamerule " + ChatColor.AQUA + gameRule.getName()
+ ChatColor.WHITE + " was set to " + ChatColor.GREEN + value + ChatColor.WHITE + ".");
}
}
private String getErrorMessage(String gameRule, String value) {
return ChatColor.RED + "Failure!" + ChatColor.WHITE + " Gamerule " + ChatColor.AQUA + gameRule
+ ChatColor.WHITE + " could not be set to " + ChatColor.RED + value + ChatColor.WHITE + ", ";
}
}
@@ -1,95 +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.display.ColorAlternator;
import com.onarandombox.MultiverseCore.display.ContentDisplay;
import com.onarandombox.MultiverseCore.display.settings.MapDisplaySettings;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameRule;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Allows management of Anchor Destinations.
*/
public class GamerulesCommand extends MultiverseCommand {
public GamerulesCommand(MultiverseCore plugin) {
super(plugin);
this.setName("List the Minecraft Game Rules for a World.");
this.setCommandUsage("/mv gamerules" + ChatColor.GOLD + " [WORLD]");
this.setArgRange(0, 1);
this.addKey("mv gamerules");
this.addKey("mv rules");
this.addKey("mvgamerules");
this.addKey("mvrules");
this.addCommandExample("/mv gamerules");
this.addCommandExample("/mvrules " + ChatColor.RED + "world_nether");
this.setPermission("multiverse.core.gamerule.list", "Allows a player to list gamerules.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// We NEED a world from the command line
final Player p;
if (sender instanceof Player) {
p = (Player) sender;
} else {
p = null;
}
if (args.size() == 0 && p == null) {
sender.sendMessage("From the command line, WORLD is required.");
sender.sendMessage(this.getCommandDesc());
sender.sendMessage(this.getCommandUsage());
sender.sendMessage("Nothing changed.");
return;
}
final World world;
if (args.size() == 0) {
world = p.getWorld();
} else {
world = Bukkit.getWorld(args.get(0));
if (world == null) {
sender.sendMessage(ChatColor.RED + "Failure!" + ChatColor.WHITE + " World " + ChatColor.AQUA + args.get(0)
+ ChatColor.WHITE + " does not exist.");
return;
}
}
ContentDisplay.forContent(getGameRuleMap(world))
.header("=== Gamerules for %s%s%s ===", ChatColor.AQUA, world.getName(), ChatColor.WHITE)
.colorTool(ColorAlternator.with(ChatColor.GREEN, ChatColor.GOLD))
.setting(MapDisplaySettings.OPERATOR, ": ")
.show(sender);
}
private Map<String, Object> getGameRuleMap(World world) {
Map<String, Object> gameRuleMap = new HashMap<>();
for (GameRule<?> rule : GameRule.values()) {
Object value = world.getGameRuleValue(rule);
if (value == null) {
gameRuleMap.put(rule.getName(), "null");
continue;
}
gameRuleMap.put(rule.getName(), value);
}
return gameRuleMap;
}
}
@@ -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.dumptruckman.minecraft.util.Logging;
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;
/**
* 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) {
Logging.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,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.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) {
String expression = "(?i).*" + cleanFilter(filter) + ".*";
List<Command> filtered = new ArrayList<Command>();
for (Command c : availableItems) {
if (stitchThisString(c.getKeyStrings()).matches(expression)
|| c.getCommandName().matches(expression)
|| c.getCommandDesc().matches(expression)
|| c.getCommandUsage().matches(expression)
|| c.getCommandExamples().stream().anyMatch(eg -> eg.matches(expression))) {
filtered.add(c);
}
}
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,137 +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.utils.WorldNameChecker;
import com.pneumaticraft.commandhandler.CommandHandler;
import org.bukkit.ChatColor;
import org.bukkit.World.Environment;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.io.File;
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]");
this.setArgRange(1, 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 + "hell_world" + ChatColor.GREEN + " nether");
this.addCommandExample("To import a world that uses a generator, you'll need the generator:");
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();
}
private String getPotentialWorldStrings() {
final Collection<String> potentialWorlds = this.worldManager.getPotentialWorlds();
StringBuilder worldList = new StringBuilder();
ChatColor currColor = ChatColor.WHITE;
for (String world : potentialWorlds) {
worldList.append(currColor).append(world).append(' ');
currColor = currColor == ChatColor.WHITE ? ChatColor.YELLOW : ChatColor.WHITE;
}
return worldList.toString();
}
private String trimWorldName(String userInput) {
// Removes relative paths.
return userInput.replaceAll("^[./\\\\]+", "");
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
String worldName = trimWorldName(args.get(0));
if (worldName.toLowerCase().equals("--list") || worldName.toLowerCase().equals("-l")) {
String worldList = this.getPotentialWorldStrings();
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 || worldName.length() < 1) {
this.showHelp(sender);
return;
}
// Make sure the world name doesn't contain the words 'plugins' and '.dat'
if(worldName.contains("plugins")||worldName.contains(".dat")){
sender.sendMessage(ChatColor.RED + "Multiverse cannot create a world that contains 'plugins' or '.dat'");
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);
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 (!worldFile.exists()) {
sender.sendMessage(ChatColor.RED + "FAILED.");
String worldList = this.getPotentialWorldStrings();
sender.sendMessage("That world folder does not exist. These look like worlds to me:");
sender.sendMessage(worldList);
} else if (!WorldNameChecker.isValidWorldFolder(worldFile)) {
sender.sendMessage(ChatColor.RED + "FAILED.");
sender.sendMessage(String.format("'%s' does not appear to be a world. It is lacking a .dat file.",
worldName));
} 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 {
Command.broadcastCommandMessage(sender, String.format("Starting import of world '%s'...", worldName));
if (this.worldManager.addWorld(worldName, environment, null, null, null, generator, useSpawnAdjust))
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Complete!");
else
Command.broadcastCommandMessage(sender, ChatColor.RED + "Failed!");
}
}
}
@@ -1,274 +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 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.isMVWorld(args.get(0))) {
// then we have a world!
worldName = args.get(0);
} else if (this.worldManager.getUnloadedWorlds().contains(args.get(0))) {
sender.sendMessage("That world exists, but it is unloaded!");
sender.sendMessage(String.format("You can load it with: %s/mv load %s", ChatColor.AQUA, args.get(0)));
return;
} else {
if (sender instanceof Player) {
Player p = (Player) sender;
worldName = p.getWorld().getName();
try {
pageNum = Integer.parseInt(args.get(0)) - 1;
} catch (NumberFormatException e) {
sender.sendMessage("That world does not exist.");
return;
}
} 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.worldManager.getUnloadedWorlds().contains(worldName)) {
sender.sendMessage("That world exists, but it is unloaded!");
sender.sendMessage(String.format("You can load it with: %s/mv load %s", ChatColor.AQUA, worldName));
} 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 UID: ", world.getCBWorld().getUID().toString(), colors));
message.add(new FancyMessage("World Alias: ", world.getColoredWorldString(), colors));
message.add(new FancyMessage("Game Mode: ", world.getGameMode().toString(), colors));
message.add(new FancyMessage("Difficulty: ", world.getDifficulty().toString(), colors));
//message.add(new FancyMessage("Game Mode: ", StringUtils.capitalize(world.getGameMode().toString()), colors));
Location spawn = world.getSpawnLocation();
message.add(new FancyMessage("Spawn Location: ", plugin.getLocationManipulation().strCoords(spawn), colors));
message.add(new FancyMessage("World Scale: ", String.valueOf(world.getScaling()), colors));
message.add(new FancyMessage("World Seed: ", String.valueOf(world.getSeed()), colors));
if (world.getPrice() > 0) {
message.add(new FancyMessage("Price to enter this world: ",
plugin.getEconomist().formatPrice(world.getPrice(), world.getCurrency()),
colors));
} else if (world.getPrice() < 0) {
message.add(new FancyMessage("Reward for entering this world: ",
plugin.getEconomist().formatPrice(-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("World Type: ", world.getWorldType().toString(), colors));
message.add(new FancyMessage("Generator: ", world.getGenerator(), colors));
message.add(new FancyMessage("Structures: ", world.getCBWorld().canGenerateStructures() + "", 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.getAnimalList().size() > 0) {
if (world.canAnimalsSpawn()) {
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 static 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 static 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,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.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.display.ColorAlternator;
import com.onarandombox.MultiverseCore.display.ContentDisplay;
import com.onarandombox.MultiverseCore.display.ContentFilter;
import com.onarandombox.MultiverseCore.display.DisplayHandlers;
import com.onarandombox.MultiverseCore.display.settings.PagedDisplaySettings;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
/**
* Displays a listing of all worlds that a player can enter.
*/
public class ListCommand extends MultiverseCommand {
public ListCommand(MultiverseCore plugin) {
super(plugin);
this.setName("World Listing");
this.setCommandUsage("/mv list [filter] [page]");
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);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
ContentFilter filter = ContentFilter.DEFAULT;
int page = 1;
// Either page or filter.
if (args.size() == 1) {
try {
page = Integer.parseInt(args.get(0));
} catch (NumberFormatException ignore) {
filter = new ContentFilter(args.get(0));
}
}
// Filter then page.
if (args.size() == 2) {
filter = new ContentFilter(args.get(0));
try {
page = Integer.parseInt(args.get(1));
} catch (NumberFormatException ignore) {
sender.sendMessage(ChatColor.RED + args.get(1) + " is not valid number!");
}
}
ContentDisplay.forContent(getListContents(sender))
.header("%s====[ Multiverse World List ]====", ChatColor.GOLD)
.displayHandler(DisplayHandlers.PAGE_LIST)
.colorTool(ColorAlternator.with(ChatColor.AQUA, ChatColor.GOLD))
.filter(filter)
.setting(PagedDisplaySettings.SHOW_PAGE, page)
.show(sender);
}
private Collection<String> getListContents(@NotNull CommandSender sender) {
Player player = (sender instanceof Player) ? (Player) sender : null;
List<String> worldList = this.plugin.getMVWorldManager().getMVWorlds().stream()
.filter(world -> player == null || plugin.getMVPerms().canEnterWorld(player, world))
.filter(world -> canSeeWorld(player, world))
.map(world -> hiddenText(world) + world.getColoredWorldString() + " - " + parseColouredEnvironment(world.getEnvironment()))
.collect(Collectors.toList());
this.plugin.getMVWorldManager().getUnloadedWorlds().stream()
.filter(world -> plugin.getMVPerms().hasPermission(sender, "multiverse.access." + world, true))
.map(world -> ChatColor.GRAY + world + " - UNLOADED")
.forEach(worldList::add);
return worldList;
}
private boolean canSeeWorld(Player player, MultiverseWorld world) {
return !world.isHidden()
|| player == null
|| this.plugin.getMVPerms().hasPermission(player, "multiverse.core.modify", true);
}
private String hiddenText(MultiverseWorld world) {
return (world.isHidden()) ? String.format("%s[H] ", ChatColor.GRAY) : "";
}
private String parseColouredEnvironment(World.Environment env) {
ChatColor color = ChatColor.GOLD;
switch (env) {
case NETHER:
color = ChatColor.RED;
break;
case NORMAL:
color = ChatColor.GREEN;
break;
case THE_END:
color = ChatColor.AQUA;
break;
}
return color + env.toString();
}
}
@@ -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,95 +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: https://goo.gl/OMGwzx");
return;
}
// TODO fix this
if (world.addToVariable(property, value)) {
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA
+ value + ChatColor.WHITE + " was " + ChatColor.GREEN + "added to " + ChatColor.GREEN + property);
if (!plugin.saveWorldConfig()) {
sender.sendMessage(ChatColor.RED + "There was an issue saving worlds.yml! Your changes will only be temporary!");
}
} else {
sender.sendMessage(value + " could not be added to " + property);
}
}
}
@@ -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.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: https://goo.gl/q1h01S");
return;
}
// TODO fix this
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.");
if (!plugin.saveWorldConfig()) {
sender.sendMessage(ChatColor.RED + "There was an issue saving worlds.yml! Your changes will only be temporary!");
}
} 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,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.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: https://goo.gl/OMGwzx");
return;
}
// TODO fix this
if (world.removeFromVariable(property, value)) {
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE
+ " was " + ChatColor.RED + "removed from " + ChatColor.GREEN + property);
if (!plugin.saveWorldConfig()) {
sender.sendMessage(ChatColor.RED + "There was an issue saving worlds.yml! Your changes will only be temporary!");
}
} else {
sender.sendMessage(ChatColor.RED + "There was an error removing " + ChatColor.GRAY
+ value + ChatColor.WHITE + " from " + ChatColor.GOLD + property);
}
}
}
@@ -1,125 +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")) && !EnglishChatColor.isValidAliasColor(value)) {
sender.sendMessage(value + " is not a valid color. Please pick one of the following:");
sender.sendMessage(EnglishChatColor.getAllColors());
return;
}
try {
if (world.setPropertyValue(property, value)) {
sender.sendMessage(ChatColor.GREEN + "Success!" + ChatColor.WHITE + " Property " + ChatColor.AQUA + property
+ ChatColor.WHITE + " was set to " + ChatColor.GREEN + value);
if (!plugin.saveWorldConfig()) {
sender.sendMessage(ChatColor.RED + "There was an issue saving worlds.yml! Your changes will only be temporary!");
}
} else {
sender.sendMessage(ChatColor.RED + world.getPropertyHelp(property));
}
} catch (PropertyDoesNotExistException e) {
sender.sendMessage(ChatColor.RED + "Sorry, You can't set: '" + ChatColor.GRAY + property + ChatColor.RED + "'");
sender.sendMessage("Valid world-properties: " + world.getAllPropertyNames());
}
}
}
@@ -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.api.MultiverseMessaging;
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 MultiverseMessaging}.
*/
protected MultiverseMessaging 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,177 +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;
import java.util.regex.Pattern;
/**
* A generic paginated command.
* @param <T> The type of items on the page.
*/
public abstract class PaginatedCommand<T> extends Command {
private final Pattern REGEX_SPECIAL_CHARS = Pattern.compile("[.+*?\\[^\\]$(){}=!<>|:-\\\\]");
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);
/**
* Escape regex special characters from filter
*
* @param filter The filter-{@link String}.
* @return String with regex characters escaped
*/
protected String cleanFilter(String filter) {
return REGEX_SPECIAL_CHARS.matcher(filter).replaceAll("\\\\$0");
}
/**
* 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.api.WorldPurger;
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)) {
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));
}
WorldPurger purger = this.worldManager.getTheWorldPurger();
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(w, thingsToKill, false, false, sender);
}
}
}
@@ -1,72 +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.commandtools.queue.QueuedCommand;
import com.pneumaticraft.commandhandler.CommandHandler;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import org.jetbrains.annotations.NotNull;
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]] [--keep-gamerules]");
this.setArgRange(1, 4);
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) {
String worldName = args.get(0);
boolean useseed = CommandHandler.hasFlag("-s", args);
String seedflag = CommandHandler.getFlag("-s", args);
boolean keepGamerules = CommandHandler.hasFlag("--keep-gamerules", args);
boolean randomseed = seedflag == null || seedflag.isEmpty() || seedflag.equalsIgnoreCase("--keep-gamerules");
String seed = randomseed ? "" : seedflag;
this.plugin.getCommandQueueManager().addToQueue(new QueuedCommand(
sender,
doWorldRegen(sender, worldName, useseed, randomseed, seed, keepGamerules),
String.format("Are you sure you want to regen '%s'? You cannot undo this action.", worldName)
));
}
private Runnable doWorldRegen(@NotNull CommandSender sender,
@NotNull String worldName,
boolean useSeed,
boolean randomSeed,
@NotNull String seed,
boolean keepGamerules) {
return () -> {
if (this.plugin.getMVWorldManager().regenWorld(worldName, useSeed, randomSeed, seed, keepGamerules)) {
sender.sendMessage(ChatColor.GREEN + "World Regenerated!");
return;
}
sender.sendMessage(ChatColor.RED + "World could NOT be regenerated!");
};
}
}
@@ -1,58 +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("mvr");
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,58 +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.io.File;
import java.util.List;
/**
* States who is in what world.
*/
public class ScriptCommand extends MultiverseCommand {
public ScriptCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Runs a script.");
this.setCommandUsage("/mv script" + ChatColor.GOLD + " {script} [target]");
this.setArgRange(1, 2);
this.addKey("mv script");
this.addKey("mvscript");
this.addCommandExample(String.format("/mv script %sscript.txt", ChatColor.GOLD));
this.addCommandExample(String.format("/mv script %stest.txt %ssomeplayer", ChatColor.GOLD, ChatColor.GREEN));
this.setPermission("multiverse.core.script", "Runs a script.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (plugin.getScriptAPI() == null) {
sender.sendMessage("Buscript failed to load while the server was starting. Scripts cannot be run.");
return;
}
File file = new File(plugin.getScriptAPI().getScriptFolder(), args.get(0));
if (!file.exists()) {
sender.sendMessage("That script file does not exist in the Multiverse-Core scripts directory!");
return;
}
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
String target = null;
if (args.size() == 2) {
target = args.get(1);
}
plugin.getScriptAPI().executeScript(file, target, player);
sender.sendMessage(String.format("Script '%s%s%s' finished!", ChatColor.GOLD, file.getName(), ChatColor.WHITE));
}
}
@@ -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.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.BlockSafety;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
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;
import org.bukkit.Bukkit;
/**
* 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, 6);
this.addKey("mvsetspawn");
this.addKey("mvsets");
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);
}
/**
* Dispatches the user's command depending on the number of parameters
* @param sender The player who executes the command, may be console as well.
* @param args Command line parameters
*/
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (args.isEmpty()) {
setWorldSpawn(sender);
} else if (args.size() == 4) {
setWorldSpawn(sender, args.get(0), args.get(1), args.get(2), args.get(3));
} else if (args.size() == 6) {
setWorldSpawn(sender, args.get(0), args.get(1), args.get(2), args.get(3), args.get(4), args.get(5));
} else {
sender.sendMessage("Use no arguments for your current location, or world/x/y/z, or world/x/y/z/yaw/pitch!");
}
}
/**
* Set the world spawn when no parameters are given
* @param sender The {@link CommandSender} who executes the command.
* Everything not a {@link Player}, e.g. console, gets rejected, as we can't get coordinates from there.
*/
protected void setWorldSpawn(CommandSender sender) {
if (sender instanceof Player) {
Player p = (Player) sender;
Location l = p.getLocation();
World w = p.getWorld();
setWorldSpawn(sender, w, l);
} else {
sender.sendMessage("You need to give coordinates to use this command from the console!");
}
}
/**
* Set the world spawn when 4 parameters are given
* @param sender The {@link CommandSender} who executes the command
* @param world The world to set the spawn in
* @param x X-coordinate to set the spawn to (as a {@link String} as it's from the command line, gets parsed into a double)
* @param y Y-coordinate to set the spawn to (as a {@link String} as it's from the command line, gets parsed into a double)
* @param z Z-coordinate to set the spawn to (as a {@link String} as it's from the command line, gets parsed into a double)
*/
protected void setWorldSpawn(CommandSender sender, String world, String x, String y, String z) {
setWorldSpawn(sender, world, x, y, z, "0", "0");
}
/**
* Set the world spawn when 6 parameters are given
* @param sender The {@link CommandSender} who executes the command
* @param world The world to set the spawn in
* @param x X-coordinate to set the spawn to (as a {@link String} as it's from the command line, gets parsed into a double)
* @param y Y-coordinate to set the spawn to (as a {@link String} as it's from the command line, gets parsed into a double)
* @param z Z-coordinate to set the spawn to (as a {@link String} as it's from the command line, gets parsed into a double)
* @param yaw Yaw a newly spawned player should look at (as a {@link String} as it's from the command line, gets parsed into a float)
* @param pitch Pitch a newly spawned player should look at (as a {@link String} as it's from the command line, gets parsed into a float)
*/
protected void setWorldSpawn(CommandSender sender, String world, String x, String y, String z, String yaw, String pitch) {
double dx, dy, dz;
float fpitch, fyaw;
World bukkitWorld = Bukkit.getWorld(world);
if (bukkitWorld == null) {
sender.sendMessage("World " + world + " is unknown!");
return;
}
try {
dx = Double.parseDouble(x);
dy = Double.parseDouble(y);
dz = Double.parseDouble(z);
fpitch = Float.parseFloat(pitch);
fyaw = Float.parseFloat(yaw);
} catch (NumberFormatException ex) {
sender.sendMessage("All coordinates must be numeric");
return;
}
Location l = new Location(bukkitWorld, dx, dy, dz, fyaw, fpitch);
setWorldSpawn(sender, bukkitWorld, l);
}
/**
* Does the actual spawn-setting-work.
*
* @param sender The {@link CommandSender} that's setting the spawn.
* @param w The {@link World} to set the spawn in
* @param l The {@link Location} to set the spawn to
*/
private void setWorldSpawn(CommandSender sender, World w, Location l) {
MultiverseWorld foundWorld = this.plugin.getMVWorldManager().getMVWorld(w.getName());
if (foundWorld != null) {
foundWorld.setSpawnLocation(l);
BlockSafety bs = this.plugin.getBlockSafety();
if (!bs.playerCanSpawnHereSafely(l) && 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: " + plugin.getLocationManipulation().strCoords(l));
if (!plugin.saveWorldConfig()) {
sender.sendMessage(ChatColor.RED + "There was an issue saving worlds.yml! Your changes will only be temporary!");
}
} 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).");
}
}
}
@@ -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.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.util.List;
/**
* Enables debug-information.
*/
public class SilentCommand extends MultiverseCommand {
public SilentCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Turn silent mode on/off?");
this.setCommandUsage("/mv silent" + ChatColor.GOLD + " [true|false|on|off]");
this.setArgRange(0, 1);
this.addKey("mv silent");
this.addKey("mvsilent");
this.addCommandExample("/mv silent " + ChatColor.GOLD + "true");
this.setPermission("multiverse.core.silent", "Reduces the amount of startup messages.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (args.size() == 1) {
if (args.get(0).equalsIgnoreCase("on")) {
args.set(0, "true");
}
plugin.getMVConfig().setSilentStart(Boolean.valueOf(args.get(0)));
plugin.saveMVConfigs();
}
this.displaySilentMode(sender);
}
private void displaySilentMode(CommandSender sender) {
if (plugin.getMVConfig().getSilentStart()) {
sender.sendMessage("Multiverse Silent Start mode is " + ChatColor.GREEN + "ON");
} else {
sender.sendMessage("Multiverse Silent Start mode is " + ChatColor.RED + "OFF");
}
}
}
@@ -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,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.MultiverseWorld;
import com.onarandombox.MultiverseCore.utils.PlayerFinder;
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 = PlayerFinder.get(args.get(0), sender);
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.getSafeTTeleporter().safelyTeleport(player, player, spawnLocation, false);
}
}
@@ -1,199 +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.dumptruckman.minecraft.util.Logging;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.Teleporter;
import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.commandtools.queue.QueuedCommand;
import com.onarandombox.MultiverseCore.destination.CustomTeleporterDestination;
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.api.SafeTTeleporter;
import com.onarandombox.MultiverseCore.utils.PlayerFinder;
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;
/**
* 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 + " {DESTINATION}");
this.setArgRange(1, 2);
this.addKey("mvtp");
this.addKey("mv tp");
this.playerTeleporter = this.plugin.getSafeTTeleporter();
this.setPermission(menu);
}
private static final int UNSAFE_TELEPORT_EXPIRE_DELAY = 15;
@Override
public void runCommand(CommandSender sender, List<String> args) {
CommandSender teleporter = sender;
Player teleportee = null;
String destinationName;
if (args.size() == 2) {
teleportee = PlayerFinder.get(args.get(0), sender);
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;
}
DestinationFactory df = this.plugin.getDestFactory();
MVDestination d = df.getPlayerAwareDestination(teleportee, destinationName);
MVTeleportEvent teleportEvent = new MVTeleportEvent(d, teleportee, teleporter, true);
this.plugin.getServer().getPluginManager().callEvent(teleportEvent);
if (teleportEvent.isCancelled()) {
Logging.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 (plugin.getMVConfig().getEnforceAccess() && 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;
}
Teleporter teleportObject = (d instanceof CustomTeleporterDestination) ?
((CustomTeleporterDestination)d).getTeleporter() : this.playerTeleporter;
TeleportResult result = teleportObject.teleport(teleporter, teleportee, d);
if (result == TeleportResult.FAIL_UNSAFE) {
Logging.fine("Could not teleport " + teleportee.getName()
+ " to " + plugin.getLocationManipulation().strCoordsRaw(d.getLocation(teleportee)));
String player = "you";
if (!teleportee.equals(teleporter)) {
player = teleportee.getName();
}
this.plugin.getCommandQueueManager().addToQueue(new QueuedCommand(
sender,
doUnsafeTeleport(teleporter, teleportee, d.getLocation(teleportee)),
String.format("%sMultiverse %sdid not teleport %s%s %sto %s%s %sbecause it was unsafe. Would you like to try anyway?",
ChatColor.GREEN, ChatColor.WHITE, ChatColor.AQUA, player, ChatColor.WHITE, ChatColor.DARK_AQUA, d.getName(), ChatColor.WHITE),
UNSAFE_TELEPORT_EXPIRE_DELAY
));
}
// else: Player was teleported successfully (or the tp event was fired I should say)
}
private Runnable doUnsafeTeleport(CommandSender teleporter, Player player, Location location) {
return () -> this.plugin.getSafeTTeleporter().safelyTeleport(teleporter, player, location, false);
}
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,225 +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.dumptruckman.minecraft.util.Logging;
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 com.onarandombox.MultiverseCore.utils.webpaste.URLShortener;
import com.onarandombox.MultiverseCore.utils.webpaste.URLShortenerFactory;
import com.onarandombox.MultiverseCore.utils.webpaste.URLShortenerType;
import com.pneumaticraft.commandhandler.CommandHandler;
import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import org.bukkit.scheduler.BukkitRunnable;
import java.io.File;
import java.util.List;
import java.util.Map;
/**
* Dumps version info to the console.
*/
public class VersionCommand extends MultiverseCommand {
private static final URLShortener SHORTENER = URLShortenerFactory.getService(URLShortenerType.BITLY);
public VersionCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Multiverse Version");
this.setCommandUsage("/mv version " + ChatColor.GOLD + "[-b|-h|-p] [--include-plugin-list]");
this.setArgRange(0, 2);
this.addKey("mv version");
this.addKey("mvver");
this.addKey("mvv");
this.addKey("mvversion");
this.setPermission(
"multiverse.core.version",
"Dumps version info to the console, optionally to pastebin.com with -b, to hastebin.com using -h, or to paste.gg with -p.",
PermissionDefault.OP)
;
}
private String getLegacyString() {
return "[Multiverse-Core] Multiverse-Core Version: " + this.plugin.getDescription().getVersion() + '\n'
+ "[Multiverse-Core] Bukkit Version: " + this.plugin.getServer().getVersion() + '\n'
+ "[Multiverse-Core] Loaded Worlds: " + this.plugin.getMVWorldManager().getMVWorlds() + '\n'
+ "[Multiverse-Core] Multiverse Plugins Loaded: " + this.plugin.getPluginCount() + '\n'
+"[Multiverse-Core] Economy being used: " + plugin.getEconomist().getEconomyName() + '\n'
+ "[Multiverse-Core] Permissions Plugin: " + this.plugin.getMVPerms().getType() + '\n'
+ "[Multiverse-Core] Dumping Config Values: (version " + this.plugin.getMVConfig().getVersion() + ")" + '\n'
+ "[Multiverse-Core] enforceaccess: " + plugin.getMVConfig().getEnforceAccess() + '\n'
+ "[Multiverse-Core] prefixchat: " + plugin.getMVConfig().getPrefixChat() + '\n'
+ "[Multiverse-Core] prefixchatformat: " + plugin.getMVConfig().getPrefixChatFormat() + '\n'
+ "[Multiverse-Core] useasyncchat: " + plugin.getMVConfig().getUseAsyncChat() + '\n'
+ "[Multiverse-Core] teleportintercept: " + plugin.getMVConfig().getTeleportIntercept() + '\n'
+ "[Multiverse-Core] firstspawnoverride: " + plugin.getMVConfig().getFirstSpawnOverride() + '\n'
+ "[Multiverse-Core] displaypermerrors: " + plugin.getMVConfig().getDisplayPermErrors() + '\n'
+ "[Multiverse-Core] enablebuscript: " + plugin.getMVConfig().getEnableBuscript() + '\n'
+ "[Multiverse-Core] globaldebug: " + plugin.getMVConfig().getGlobalDebug() + '\n'
+ "[Multiverse-Core] silentstart: " + plugin.getMVConfig().getSilentStart() + '\n'
+ "[Multiverse-Core] messagecooldown: " + plugin.getMessaging().getCooldown() + '\n'
+ "[Multiverse-Core] version: " + plugin.getMVConfig().getVersion() + '\n'
+ "[Multiverse-Core] firstspawnworld: " + plugin.getMVConfig().getFirstSpawnWorld() + '\n'
+ "[Multiverse-Core] teleportcooldown: " + plugin.getMVConfig().getTeleportCooldown() + '\n'
+ "[Multiverse-Core] defaultportalsearch: " + plugin.getMVConfig().isUsingDefaultPortalSearch() + '\n'
+ "[Multiverse-Core] portalsearchradius: " + plugin.getMVConfig().getPortalSearchRadius() + '\n'
+ "[Multiverse-Core] autopurge: " + plugin.getMVConfig().isAutoPurgeEnabled() + '\n'
+ "[Multiverse-Core] Special Code: FRN002" + '\n';
}
private String getMarkdownString() {
return "# Multiverse-Core" + '\n'
+ "## Overview" + '\n'
+ "| Name | Value |" + '\n'
+ "| --- | --- |" + '\n'
+ "| Multiverse-Core Version | `" + this.plugin.getDescription().getVersion() + "` |" + '\n'
+ "| Bukkit Version | `" + this.plugin.getServer().getVersion() + "` |" + '\n'
+ "| Loaded Worlds | `" + this.plugin.getMVWorldManager().getMVWorlds() + "` |" + '\n'
+ "| Multiverse Plugins Loaded | `" + this.plugin.getPluginCount() + "` |" + '\n'
+ "| Economy being used | `" + plugin.getEconomist().getEconomyName() + "` |" + '\n'
+ "| Permissions Plugin | `" + this.plugin.getMVPerms().getType() + "` |" + '\n'
+ "## Parsed Config" + '\n'
+ "These are what Multiverse thought the in-memory values of the config were." + "\n\n"
+ "| Config Key | Value |" + '\n'
+ "| --- | --- |" + '\n'
+ "| version | `" + this.plugin.getMVConfig().getVersion() + "` |" + '\n'
+ "| messagecooldown | `" + plugin.getMessaging().getCooldown() + "` |" + '\n'
+ "| teleportcooldown | `" + plugin.getMVConfig().getTeleportCooldown() + "` |" + '\n'
+ "| worldnameprefix | `" + plugin.getMVConfig().getPrefixChat() + "` |" + '\n'
+ "| worldnameprefixFormat | `" + plugin.getMVConfig().getPrefixChatFormat() + "` |" + '\n'
+ "| enforceaccess | `" + plugin.getMVConfig().getEnforceAccess() + "` |" + '\n'
+ "| displaypermerrors | `" + plugin.getMVConfig().getDisplayPermErrors() + "` |" + '\n'
+ "| teleportintercept | `" + plugin.getMVConfig().getTeleportIntercept() + "` |" + '\n'
+ "| firstspawnoverride | `" + plugin.getMVConfig().getFirstSpawnOverride() + "` |" + '\n'
+ "| firstspawnworld | `" + plugin.getMVConfig().getFirstSpawnWorld() + "` |" + '\n'
+ "| debug | `" + plugin.getMVConfig().getGlobalDebug() + "` |" + '\n';
}
private void addVersionInfoToEvent(MVVersionEvent event) {
// add the legacy version info
event.appendVersionInfo(this.getLegacyString());
// add the legacy file, but as markdown so it's readable
// TODO Readd this in 5.0.0
// event.putDetailedVersionInfo("version.md", this.getMarkdownString());
// add config.yml
File configFile = new File(this.plugin.getDataFolder(), "config.yml");
event.putDetailedVersionInfo("multiverse-core/config.yml", configFile);
// add worlds.yml
File worldsFile = new File(this.plugin.getDataFolder(), "worlds.yml");
event.putDetailedVersionInfo("multiverse-core/worlds.yml", worldsFile);
}
@Override
public void runCommand(final CommandSender sender, final 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.");
}
MVVersionEvent versionEvent = new MVVersionEvent();
this.addVersionInfoToEvent(versionEvent);
this.plugin.getServer().getPluginManager().callEvent(versionEvent);
if (CommandHandler.hasFlag("--include-plugin-list", args)) {
versionEvent.appendVersionInfo('\n' + "Plugins: " + getPluginList());
versionEvent.putDetailedVersionInfo("plugins.txt", "Plugins: " + getPluginList());
}
final String versionInfo = versionEvent.getVersionInfo();
versionEvent.putDetailedVersionInfo("version.txt", versionInfo);
final Map<String, String> files = versionEvent.getDetailedVersionInfo();
// log to console
String[] lines = versionInfo.split("\\r?\\n");
for (String line : lines) {
if (!line.isEmpty()) {
this.plugin.getServer().getLogger().info(line);
}
}
BukkitRunnable logPoster = new BukkitRunnable() {
@Override
public void run() {
if (args.size() > 0) {
String pasteUrl;
if (CommandHandler.hasFlag("-b", args)) {
// private post to pastebin
pasteUrl = postToService(PasteServiceType.PASTEBIN, true, versionInfo, files);
} else if (CommandHandler.hasFlag("-g", args)) {
// private post to github
pasteUrl = postToService(PasteServiceType.GITHUB, true, versionInfo, files);
} else if (CommandHandler.hasFlag("-h", args)) {
// private post to hastebin
pasteUrl = postToService(PasteServiceType.HASTEBIN, true, versionInfo, files);
} else if (CommandHandler.hasFlag("-p", args)) {
// private post to paste.gg
pasteUrl = postToService(PasteServiceType.PASTEGG, true, versionInfo, files);
} else {
return;
}
if (!(sender instanceof ConsoleCommandSender)) {
sender.sendMessage("Version info dumped here: " + ChatColor.GREEN + pasteUrl);
}
Logging.info("Version info dumped here: %s", pasteUrl);
}
}
};
// Run the log posting operation asynchronously, since we don't know how long it will take.
logPoster.runTaskAsynchronously(this.plugin);
}
/**
* Send the current contents of this.pasteBinBuffer to a web service.
*
* @param type Service type to send paste data to.
* @param isPrivate Should the paste be marked as private.
* @param pasteData Legacy string only data to post to a service.
* @param pasteFiles Map of filenames/contents of debug info.
* @return URL of visible paste
*/
private static String postToService(PasteServiceType type, boolean isPrivate, String pasteData, Map<String, String> pasteFiles) {
PasteService ps = PasteServiceFactory.getService(type, isPrivate);
try {
String result;
if (ps.supportsMultiFile()) {
result = ps.postData(pasteFiles);
} else {
result = ps.postData(pasteData);
}
if (SHORTENER != null) return SHORTENER.shorten(result);
return result;
} catch (PasteFailedException e) {
e.printStackTrace();
return "Error posting to service.";
} catch (NullPointerException e) {
e.printStackTrace();
return "That service isn't supported yet.";
}
}
private String getPluginList() {
return StringUtils.join(plugin.getServer().getPluginManager().getPlugins(), ", ");
}
}
@@ -1,118 +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.Collection;
import java.util.HashSet;
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|--all]");
this.setArgRange(0, 1);
this.addKey("mv who");
this.addKey("mvw");
this.addKey("mvwho");
this.addCommandExample("/mv who");
this.addCommandExample(String.format("/mv who %s--all", ChatColor.GREEN));
this.addCommandExample(String.format("/mv who %smyworld", ChatColor.GOLD));
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;
}
final Collection onlinePlayers = plugin.getServer().getOnlinePlayers();
final Collection<Player> visiblePlayers = new HashSet<Player>(onlinePlayers.size());
for (final Object player : onlinePlayers) {
if (player instanceof Player && (p == null || p.canSee((Player) player))) {
visiblePlayers.add((Player) player);
}
}
if (args.size() == 1) {
if (args.get(0).equalsIgnoreCase("--all") || args.get(0).equalsIgnoreCase("-a")) {
showAll = true;
} else {
// single world mode
MultiverseWorld world = this.worldManager.getMVWorld(args.get(0));
if (world == null) {
sender.sendMessage(ChatColor.RED + "That world does not exist.");
return;
}
if (!this.plugin.getMVPerms().canEnterWorld(p, world)) {
sender.sendMessage(ChatColor.RED + "You aren't allowed to access to this world!");
return;
}
sender.sendMessage(String.format("%s--- Players in %s%s ---", ChatColor.AQUA,
world.getColoredWorldString(), ChatColor.AQUA));
sender.sendMessage(this.buildPlayerString(world, p, visiblePlayers));
return;
}
}
// multiworld mode
sender.sendMessage(ChatColor.AQUA + "--- Worlds and their players --- "
+ visiblePlayers.size() + "/" + plugin.getServer().getMaxPlayers());
boolean shownOne = false;
for (MultiverseWorld world : this.worldManager.getMVWorlds()) {
if (this.plugin.getMVPerms().canEnterWorld(p, world)) { // only show world if the player can access it
if (showAll || !world.getCBWorld().getPlayers().isEmpty()) { // either show all or show if the world is not empty
sender.sendMessage(String.format("%s%s - %s", world.getColoredWorldString(), ChatColor.WHITE, buildPlayerString(world, p, visiblePlayers)));
shownOne = true;
}
}
}
if (!shownOne) {
sender.sendMessage("No worlds found.");
}
return;
}
private static String buildPlayerString(MultiverseWorld world, Player viewer, final Collection<Player> visiblePlayers) {
// Retrieve the players in this world
List<Player> players = world.getCBWorld().getPlayers();
StringBuilder playerBuilder = new StringBuilder();
for (Player player : players) {
// If the viewer is the console or the viewier is allowed to see the player, show them.
// Make sure we're also ONLY showing online players.
// Since we already checked visible players, we'll just make sure who we're about to show is in that.
if (visiblePlayers.contains(player))
playerBuilder.append(player.getDisplayName()).append(", ");
}
String bString = playerBuilder.toString();
return (bString.length() == 0) ? "No players found." : bString.substring(0, bString.length() - 2);
}
}
@@ -1,4 +0,0 @@
/**
* This package contains all Commands.
*/
package com.onarandombox.MultiverseCore.commands;
@@ -1,161 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2020. *
* 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.commandtools.queue;
import com.dumptruckman.minecraft.util.Logging;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.block.data.type.CommandBlock;
import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.CommandSender;
import org.bukkit.scheduler.BukkitTask;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
import java.util.WeakHashMap;
/**
* <p>Manages the queuing of dangerous commands that require {@code /mv confirm} before executing.</p>
*
* <p>Each sender can only have one command in queue at any given time. When a queued command is added
* for a sender that already has a command in queue, it will replace the old queued command.</p>
*/
public class CommandQueueManager {
private static final long TICKS_PER_SECOND = 20;
private static final DummyCommandBlockSender COMMAND_BLOCK = new DummyCommandBlockSender();
private final MultiverseCore plugin;
private final Map<CommandSender, QueuedCommand> queuedCommandMap;
public CommandQueueManager(@NotNull MultiverseCore plugin) {
this.plugin = plugin;
this.queuedCommandMap = new WeakHashMap<>();
}
/**
* Adds a {@link QueuedCommand} into queue.
*
* @param queuedCommand The queued command to add.
*/
public void addToQueue(QueuedCommand queuedCommand) {
CommandSender targetSender = parseSender(queuedCommand.getSender());
// Since only one command is stored in queue per sender, we remove the old one.
this.removeFromQueue(targetSender);
Logging.finer("Add new command to queue for sender %s.", targetSender);
this.queuedCommandMap.put(targetSender, queuedCommand);
queuedCommand.setExpireTask(runExpireLater(queuedCommand));
queuedCommand.getSender().sendMessage(queuedCommand.getPrompt());
queuedCommand.getSender().sendMessage(String.format("Run %s/mv confirm %sto continue. This will expire in %s seconds.",
ChatColor.GREEN, ChatColor.WHITE, queuedCommand.getValidDuration()));
}
/**
* Expire task that removes a {@link QueuedCommand} from queue after valid duration defined.
*
* @param queuedCommand Command to run the expire task on.
* @return The expire {@link BukkitTask}.
*/
@NotNull
private BukkitTask runExpireLater(@NotNull QueuedCommand queuedCommand) {
return Bukkit.getScheduler().runTaskLater(
this.plugin,
expireRunnable(queuedCommand),
queuedCommand.getValidDuration() * TICKS_PER_SECOND
);
}
/**
* Runnable responsible for expiring the queued command.
*
* @param queuedCommand Command to create the expire task on.
* @return The expire runnable.
*/
@NotNull
private Runnable expireRunnable(@NotNull QueuedCommand queuedCommand) {
return () -> {
CommandSender targetSender = parseSender(queuedCommand.getSender());
QueuedCommand matchingQueuedCommand = this.queuedCommandMap.get(targetSender);
if (!queuedCommand.equals(matchingQueuedCommand) || queuedCommand.getExpireTask().isCancelled()) {
// To be safe, but this shouldn't happen since we cancel old commands before add new once.
Logging.finer("This is an old queue command already.");
return;
}
queuedCommand.getSender().sendMessage("Your queued command has expired.");
this.queuedCommandMap.remove(queuedCommand.getSender());
};
}
/**
* Runs the command in queue for the given sender, if any.
*
* @param sender {@link CommandSender} that confirmed the command.
* @return True if queued command ran successfully, else false.
*/
public boolean runQueuedCommand(@NotNull CommandSender sender) {
CommandSender targetSender = parseSender(sender);
QueuedCommand queuedCommand = this.queuedCommandMap.get(targetSender);
if (queuedCommand == null) {
sender.sendMessage(ChatColor.RED + "You do not have any commands in queue.");
return false;
}
Logging.finer("Running queued command...");
queuedCommand.getAction().run();
return removeFromQueue(targetSender);
}
/**
* Since only one command is stored in queue per sender, we remove the old one.
*
* @param sender The {@link CommandSender} that executed the command.
* @return True if queue command is removed from sender successfully, else false.
*/
public boolean removeFromQueue(@NotNull CommandSender sender) {
CommandSender targetSender = parseSender(sender);
QueuedCommand previousCommand = this.queuedCommandMap.remove(targetSender);
if (previousCommand == null) {
Logging.finer("No queue command to remove for sender %s.", targetSender.getName());
return false;
}
previousCommand.getExpireTask().cancel();
Logging.finer("Removed queue command for sender %s.", targetSender.getName());
return true;
}
/**
* To allow all CommandBlocks to be a common sender with use of {@link DummyCommandBlockSender}.
* So confirm command can be used for a queued command on another command block.
*
* @param sender The sender to parse.
* @return The sender, or if its a command block, a {@link DummyCommandBlockSender}.
*/
@NotNull
private CommandSender parseSender(@NotNull CommandSender sender) {
Logging.fine(sender.getClass().getName());
if (isCommandBlock(sender)) {
Logging.finer("Is command block.");
return COMMAND_BLOCK;
}
return sender;
}
/**
* Checks if the sender is a command block.
*
* @param sender The sender to check.
* @return True if sender is a command block, else false.
*/
private boolean isCommandBlock(@NotNull CommandSender sender) {
return sender instanceof BlockCommandSender
&& ((BlockCommandSender) sender).getBlock().getBlockData() instanceof CommandBlock;
}
}
@@ -1,104 +0,0 @@
package com.onarandombox.MultiverseCore.commandtools.queue;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Set;
/**
* Used by {@link CommandQueueManager}, so different commands block can be recognised as one.
*/
class DummyCommandBlockSender implements CommandSender {
@Override
public void sendMessage(@NotNull String message) {
throw new UnsupportedOperationException();
}
@Override
public void sendMessage(@NotNull String[] messages) {
throw new UnsupportedOperationException();
}
@Override
public @NotNull Server getServer() {
return Bukkit.getServer();
}
@Override
public @NotNull String getName() {
return "DummyCommandBlockSender";
}
@Override
public boolean isPermissionSet(@NotNull String name) {
throw new UnsupportedOperationException();
}
@Override
public boolean isPermissionSet(@NotNull Permission perm) {
throw new UnsupportedOperationException();
}
@Override
public boolean hasPermission(@NotNull String name) {
throw new UnsupportedOperationException();
}
@Override
public boolean hasPermission(@NotNull Permission perm) {
throw new UnsupportedOperationException();
}
@Override
public @NotNull PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) {
throw new UnsupportedOperationException();
}
@Override
public @NotNull PermissionAttachment addAttachment(@NotNull Plugin plugin) {
throw new UnsupportedOperationException();
}
@Override
public @Nullable PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) {
throw new UnsupportedOperationException();
}
@Override
public @Nullable PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) {
throw new UnsupportedOperationException();
}
@Override
public void removeAttachment(@NotNull PermissionAttachment attachment) {
throw new UnsupportedOperationException();
}
@Override
public void recalculatePermissions() {
throw new UnsupportedOperationException();
}
@Override
public @NotNull Set<PermissionAttachmentInfo> getEffectivePermissions() {
throw new UnsupportedOperationException();
}
@Override
public boolean isOp() {
throw new UnsupportedOperationException();
}
@Override
public void setOp(boolean value) {
throw new UnsupportedOperationException();
}
}
@@ -1,86 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2020. *
* 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.commandtools.queue;
import org.bukkit.command.CommandSender;
import org.bukkit.scheduler.BukkitTask;
import org.jetbrains.annotations.NotNull;
/**
* Represents a single command used in {@link CommandQueueManager} for confirming before running potentially
* dangerous action.
*/
public class QueuedCommand {
private static final String DEFAULT_PROMPT_MESSAGE = "The command you are trying to run is deemed dangerous.";
private static final int DEFAULT_VALID_TIME = 10;
private final CommandSender sender;
private final Runnable action;
private final String prompt;
private final int validDuration;
private BukkitTask expireTask;
public QueuedCommand(CommandSender sender, Runnable action) {
this(sender, action, DEFAULT_PROMPT_MESSAGE, DEFAULT_VALID_TIME);
}
public QueuedCommand(CommandSender sender, Runnable action, String prompt) {
this(sender, action, prompt, DEFAULT_VALID_TIME);
}
public QueuedCommand(CommandSender sender, Runnable action, int validDuration) {
this(sender, action, DEFAULT_PROMPT_MESSAGE, validDuration);
}
/**
* Creates a new queue command, to be registered at {@link CommandQueueManager#addToQueue(QueuedCommand)}.
*
* @param sender The sender that ran the command needed for confirmation.
* @param action The logic to execute upon confirming.
* @param prompt Question to ask sender to confirm.
* @param validDuration Duration in which the command is valid for confirm in seconds.
*/
public QueuedCommand(CommandSender sender, Runnable action, String prompt, int validDuration) {
this.sender = sender;
this.action = action;
this.prompt = prompt;
this.validDuration = validDuration;
}
@NotNull
CommandSender getSender() {
return sender;
}
@NotNull
String getPrompt() {
return prompt;
}
int getValidDuration() {
return validDuration;
}
@NotNull
Runnable getAction() {
return action;
}
@NotNull
BukkitTask getExpireTask() {
return expireTask;
}
void setExpireTask(@NotNull BukkitTask expireTask) {
if (this.expireTask != null) {
throw new IllegalStateException("This queue command already has an expire task. You can't register twice!");
}
this.expireTask = expireTask;
}
}
@@ -1,89 +0,0 @@
package com.onarandombox.MultiverseCore.configuration;
import java.util.Map;
import com.onarandombox.MultiverseCore.utils.MaterialConverter;
import me.main__.util.SerializationConfig.Property;
import me.main__.util.SerializationConfig.SerializationConfig;
import me.main__.util.SerializationConfig.Serializor;
import org.bukkit.Material;
import org.bukkit.configuration.serialization.SerializableAs;
import org.jetbrains.annotations.Nullable;
/**
* Entryfee-settings.
*/
@SerializableAs("MVEntryFee")
public class EntryFee extends SerializationConfig {
@Property
private double amount;
@Property(serializor = EntryFeeCurrencySerializor.class)
@Nullable
private Material currency;
private final Material DISABLED_MATERIAL = Material.AIR;
public EntryFee() {
super();
}
public EntryFee(Map<String, Object> values) {
super(values);
}
/**
* {@inheritDoc}
*/
@Override
protected void setDefaults() {
amount = 0D;
currency = null;
}
/**
* @return the amount
*/
public double getAmount() {
return amount;
}
/**
* @return the currency
*/
@Nullable
public Material getCurrency() {
if (currency == null || currency.equals(DISABLED_MATERIAL)) {
return null;
}
return currency;
}
/**
* Sets the amount.
* @param amount The new value.
*/
public void setAmount(double amount) {
this.amount = amount;
}
/**
* Sets the currency.
* @param currency The new value.
*/
public void setCurrency(@Nullable Material currency) {
this.currency = currency;
}
public static final class EntryFeeCurrencySerializor implements Serializor<Material, Object> {
@Override
public String serialize(Material material) {
return material.toString();
}
@Override
public Material deserialize(Object o, Class<Material> aClass) {
return MaterialConverter.convertTypeString(o.toString());
}
}
}
@@ -1,98 +0,0 @@
package com.onarandombox.MultiverseCore.configuration;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.SerializableAs;
/**
* Just like a regular {@link Location}, however {@code world} is usually {@code null}
* or just a weak reference and it implements {@link ConfigurationSerializable}.
*/
@SerializableAs("MVSpawnLocation")
public class SpawnLocation extends Location implements ConfigurationSerializable {
private Reference<World> worldRef;
public SpawnLocation(double x, double y, double z) {
super(null, x, y, z);
}
public SpawnLocation(double x, double y, double z, float yaw, float pitch) {
super(null, x, y, z, yaw, pitch);
}
public SpawnLocation(Location loc) {
this(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
}
/**
* {@inheritDoc}
*/
@Override
public World getWorld() {
return (this.worldRef != null) ? this.worldRef.get() : null;
}
/**
* {@inheritDoc}
*/
@Override
public void setWorld(World world) {
this.worldRef = new WeakReference<World>(world);
}
/**
* {@inheritDoc}
*/
@Override
public Chunk getChunk() {
if ((this.worldRef != null) && (this.worldRef.get() != null))
return this.worldRef.get().getChunkAt(this);
return null;
}
/**
* {@inheritDoc}
*/
@Override
public Block getBlock() {
if ((this.worldRef != null) && (this.worldRef.get() != null))
return this.worldRef.get().getBlockAt(this);
return null;
}
/**
* {@inheritDoc}
*/
@Override
public Map<String, Object> serialize() {
Map<String, Object> serialized = new HashMap<String, Object>(5); // SUPPRESS CHECKSTYLE: MagicNumberCheck
serialized.put("x", this.getX());
serialized.put("y", this.getY());
serialized.put("z", this.getZ());
serialized.put("pitch", this.getPitch());
serialized.put("yaw", this.getYaw());
return serialized;
}
/**
* Let Bukkit be able to deserialize this.
* @param args The map.
* @return The deserialized object.
*/
public static SpawnLocation deserialize(Map<String, Object> args) {
double x = ((Number) args.get("x")).doubleValue();
double y = ((Number) args.get("y")).doubleValue();
double z = ((Number) args.get("z")).doubleValue();
float pitch = ((Number) args.get("pitch")).floatValue();
float yaw = ((Number) args.get("yaw")).floatValue();
return new SpawnLocation(x, y, z, yaw, pitch);
}
}
@@ -1,50 +0,0 @@
package com.onarandombox.MultiverseCore.configuration;
import java.util.Map;
import me.main__.util.SerializationConfig.Property;
import me.main__.util.SerializationConfig.SerializationConfig;
import org.bukkit.configuration.serialization.SerializableAs;
/**
* Spawning-Settings.
*/
@SerializableAs("MVSpawnSettings")
public class SpawnSettings extends SerializationConfig {
@Property
private SubSpawnSettings animals;
@Property
private SubSpawnSettings monsters;
public SpawnSettings() {
super();
}
public SpawnSettings(Map<String, Object> values) {
super(values);
}
/**
* {@inheritDoc}
*/
@Override
public void setDefaults() {
animals = new SubSpawnSettings();
monsters = new SubSpawnSettings();
}
/**
* @return the animal-settings
*/
public SubSpawnSettings getAnimalSettings() {
return animals;
}
/**
* @return the monster-settings
*/
public SubSpawnSettings getMonsterSettings() {
return monsters;
}
}
@@ -1,76 +0,0 @@
package com.onarandombox.MultiverseCore.configuration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import me.main__.util.SerializationConfig.Property;
import me.main__.util.SerializationConfig.SerializationConfig;
import org.bukkit.configuration.serialization.SerializableAs;
/**
* SpawnSubSettings.
*/
@SerializableAs("MVSpawnSubSettings")
public class SubSpawnSettings extends SerializationConfig {
@Property
private boolean spawn;
@Property
private int spawnrate;
@Property
private List<String> exceptions;
public SubSpawnSettings() {
super();
}
public SubSpawnSettings(Map<String, Object> values) {
super(values);
}
/**
* {@inheritDoc}
*/
@Override
public void setDefaults() {
spawn = true;
exceptions = new ArrayList<String>();
spawnrate = -1;
}
/**
* @return spawn
*/
public boolean doSpawn() {
return spawn;
}
/**
* @param spawn The new value.
*/
public void setSpawn(boolean spawn) {
this.spawn = spawn;
}
/**
* @return The exceptions
*/
public List<String> getExceptions() {
return exceptions;
}
/**
* @param rate The new spawn rate
*/
public void setSpawnRate(int rate) {
this.spawnrate = rate;
}
/**
* @return The spawn rate
*/
public int getSpawnRate() {
return this.spawnrate;
}
}
@@ -1,27 +0,0 @@
package com.onarandombox.MultiverseCore.configuration;
import org.bukkit.Bukkit;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.event.MVWorldPropertyChangeEvent;
import me.main__.util.SerializationConfig.ChangeDeniedException;
import me.main__.util.SerializationConfig.ObjectUsingValidator;
/**
* Validates world-property-changes.
* @param <T> The type of the property that should be validated.
*/
public class WorldPropertyValidator<T> extends ObjectUsingValidator<T, MVWorld> {
/**
* {@inheritDoc}
*/
@Override
public T validateChange(String property, T newValue, T oldValue, MVWorld object) throws ChangeDeniedException {
MVWorldPropertyChangeEvent<T> event = new MVWorldPropertyChangeEvent<T>(object, null, property, newValue);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled())
throw new ChangeDeniedException();
return event.getTheNewValue();
}
}
@@ -1,4 +0,0 @@
/**
* This package contains the Multiverse-configuration.
*/
package com.onarandombox.MultiverseCore.configuration;
Loaded 100 of 545 files, more files were not shown because too many files have changed in this diff. Show more