Compare commits

...
1321 Commits
Author SHA1 Message Date
Ben Woo 2754c6ea0d Use version dbo-upload-action v0.1.0 2023-08-20 21:22:22 +08:00
Ben Woo ef6cd16e91 Remove end comma 2023-08-20 21:02:04 +08:00
Ben Woo b2691e979e Better format for project relation 2023-08-20 21:01:29 +08:00
Ben Woo 21e905fc83 Remove some game version that DBO doesnt have 2023-08-20 20:26:00 +08:00
Ben Woo bd6c44279d use game version by name 2023-08-20 20:13:22 +08:00
Ben Woo 743e741a92 Remove the fail 2023-08-20 16:36:17 +08:00
Ben Woo d841d9d5d0 Test without to json 2023-08-20 16:34:35 +08:00
Ben Woo 32d0e39866 Fix display name version 2023-08-20 16:28:04 +08:00
Ben Woo 71fe3de39a Use output version 2023-08-20 16:14:46 +08:00
Ben Woo b973292d0e Fix some upload field keys 2023-08-20 15:53:24 +08:00
Ben Woo 6db2cc25d6 Fix typo multiverse 2023-08-20 15:46:22 +08:00
Ben Woo c24777d282 Update regex 2023-08-20 15:45:29 +08:00
Ben Woo eeb58a05b1 Use regex 2023-08-20 15:41:39 +08:00
Ben Woo 0dd8ecaa84 Use latest version and fix copy paste issue 2023-08-20 15:39:49 +08:00
Ben Woo 01cc8e5177 Try dbo upload action 2023-08-20 15:36:10 +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
Jeremy Wood 8a69d6ad43 Merge pull request #2883 from Multiverse/artifact_pr_build
build: Add artifacting of PR build
2023-03-03 11:30:37 -05:00
Ben Woo 3b44ea218d build: Fix PR build number 2023-03-03 23:28:55 +08:00
Ben Woo 68c97f7ae6 build: Add artifacting of PR build 2023-03-03 23:21:36 +08:00
Ben Woo 3f6c3047d8 fix: Restore locales setup method (#2881) 2023-03-03 22:23:39 +08:00
Jeremy Wood e4fd23709f Merge pull request #2882 from Multiverse/dumptruckman/fix_mock_bukkit
Downgrade MockBukkit to 2.141.0.
2023-03-03 08:29:57 -05:00
Jeremy Wood a255f55b6f Downgrade MockBukkit to 2.141.0. 2023-03-03 08:27:12 -05:00
Jeremy Wood e0e2a0f0c2 Merge pull request #2879 from Multiverse/dumptruckman/new_tests
Add new test module using Kotlin and JUnit 5.
2023-03-02 08:56:39 -05:00
Jeremy Wood a4e84ad581 Use ServerMock instead of Server. 2023-03-02 08:36:43 -05:00
Jeremy Wood 65cb3f7037 Put test method after tearDown. 2023-03-02 08:35:52 -05:00
Jeremy Wood fc7509cca6 Use a better test method name. 2023-03-02 08:35:30 -05:00
Jeremy Wood eebb4a4a6d Implement initial test using MockBukkit. 2023-03-02 02:22:47 -05:00
Jeremy Wood 698d1c7954 Switch to JUnit 5 for new tests. 2023-03-02 02:10:36 -05:00
Jeremy Wood ed73fd059e Add Kotlin dependency for tests only. 2023-03-02 02:07:38 -05:00
Jeremy Wood 87225b1c65 Move old tests to old-test. 2023-03-02 01:20:38 -05:00
Jeremy Wood 6362d9fb17 Merge pull request #2878 from Multiverse/dumptruckman/merge_main
Merge main branch into MV5
2023-03-02 00:58:37 -05:00
Jeremy Wood d5ba55716b Merge remote-tracking branch 'origin/main' into dumptruckman/merge_main
# Conflicts:
#	build.gradle
2023-03-02 00:56:34 -05:00
Jeremy Wood 4eca331430 Merge pull request #2877 from Multiverse/dumptruckman/separate_test_deps
Use a separate API version for running tests.
2023-03-02 00:53:24 -05:00
Jeremy Wood b6574245b8 Remove junit exclusion from compileOnly bukkit. 2023-03-02 00:48:54 -05:00
Jeremy Wood 85d744d79f Run tests against spigot-api 1.19.3. 2023-03-02 00:44:32 -05:00
Jeremy Wood e536dff1a8 Use a separate bukkit dependency for tests. 2023-03-02 00:37:30 -05:00
Jeremy Wood 39287f55ef Delete CODEOWNERS. 2023-03-01 23:36:41 -05:00
Ben WooandJeremy Wood d5ebde53b9 Add maven central to repositories (#2859)
Co-authored-by: Jeremy Wood <farachan@gmail.com>
2023-03-02 12:32:07 +08:00
Jeremy Wood 101ddae443 Create CODEOWNERS. 2023-02-28 23:03:50 -05:00
Ben Woo e58de8d74d Merge pull request #2843 from Multiverse/help-command
feat: Implement help command
2023-02-28 23:21:36 +08:00
Ben Woo 974afb4751 feat: Implement help command 2023-02-28 23:16:09 +08:00
Ben Woo d819153690 Merge pull request #2842 from Multiverse/file-locales
feat: Improve locale support
2023-02-28 23:13:23 +08:00
Ben Woo 7dbd29b838 refactor: Shift classes and add javadocs 2023-02-28 23:07:19 +08:00
Ben Woo 560e3ab201 refactor: Make FileResClassLoader usable for other file paths. 2023-02-28 23:07:19 +08:00
Ben Woo ffc4c600c5 feat: Enable per player locale support 2023-02-28 23:07:18 +08:00
Ben Woo 44904eaef4 feat: Allow for custom locale folder path 2023-02-28 23:07:18 +08:00
Ben Woo 47a92deffd refactor: Use '&' for chat color formatting 2023-02-28 23:07:17 +08:00
Ben Woo b4549c6791 feat: Add support for loading locales from plugin dir 2023-02-28 23:07:17 +08:00
Jeremy Wood 2b97f7310f Use pull_request_target for auto labeler. 2023-02-25 20:39:56 -05:00
Jeremy Wood 073091525b Label PRs automatically as prerelease. 2023-02-25 20:34:19 -05:00
Jeremy Wood 79b9c12319 Change job name for manually promoting releases. 2023-02-25 20:29:04 -05:00
Jeremy Wood 01f745b027 Skip checking PR labels. 2023-02-25 19:39:14 -05:00
Jeremy Wood 9725bdfeeb Use ref input. 2023-02-25 14:02:01 -05:00
Jeremy Wood cdf9767959 Use target_commitish for GITHUA_SHA. 2023-02-25 13:41:26 -05:00
Jeremy Wood 66e21da6b2 Add version to publish action as well. 2023-02-25 13:39:59 -05:00
Jeremy Wood 87b14d3944 Add publish and upload. 2023-02-25 13:34:24 -05:00
Jeremy Wood 7bbeb90320 Remove dry_run. 2023-02-25 13:34:10 -05:00
Jeremy Wood cd895d03dc Remove extra } in bump_version_scheme. 2023-02-25 13:32:08 -05:00
Jeremy Wood ee2a304148 Reorder version bump types. 2023-02-25 13:31:49 -05:00
Jeremy Wood 06e9e33da4 Workflow requires version bump type. 2023-02-25 13:28:36 -05:00
Jeremy Wood 7065ffaea2 Remove checkstyle from promote workflow. 2023-02-25 13:24:24 -05:00
Jeremy Wood 1bc4e68ff9 Use promote scheme for manual workflow. 2023-02-25 13:20:40 -05:00
Jeremy Wood 4e53d13290 Add workflow for manually promoting a release. 2023-02-25 13:10:53 -05:00
Jeremy Wood 90344d36df Merge pull request #2867 from Multiverse/no_version_bump
Use "no version bump" label instead of "no release".
2023-02-24 13:19:16 -05:00
Jeremy Wood f36a56e854 Use "no version bump" label instead of "no release". 2023-02-24 13:17:39 -05:00
Jeremy Wood 5d4bacc80e Merge pull request #2866 from Multiverse/test_prerelease_2
Remove space to test pre-releases
2023-02-24 12:40:57 -05:00
Jeremy Wood d88bf6e137 Remove space to test pre-releases 2023-02-24 12:40:36 -05:00
Jeremy Wood 63f5d769d8 Merge pull request #2865 from Multiverse/prerelease-test
Add space to trigger release.
2023-02-24 11:57:39 -05:00
Jeremy Wood 9a9bfc03b9 Add space to trigger release. 2023-02-24 11:57:02 -05:00
Jeremy Wood 28112ef4d8 Merge pull request #2864 from Multiverse/simplify_release_name
Drop "Release" prefix on release names.
2023-02-24 11:46:47 -05:00
Jeremy Wood 7e5a3238b8 Drop "Release" prefix on release names. 2023-02-24 11:44:06 -05:00
Jeremy Wood 3279a6a38d Merge pull request #2863 from Multiverse/prerelease_snapshot
Check if the tag name contains pre instead of checking PR labels.
2023-02-24 11:34:18 -05:00
Jeremy Wood b64e48769d Check if the tag name contains pre instead of checking PR labels. 2023-02-24 11:29:28 -05:00
Jeremy Wood ff8002fc13 Merge pull request #2862 from Multiverse/prerelease_snapshot
Publish prerelease versions as snapshots.
2023-02-24 11:21:09 -05:00
Jeremy Wood 2af835f0c3 Publish prerelease versions as snapshots. 2023-02-24 11:15:36 -05:00
Jeremy Wood bf25b65f09 Merge pull request #2861 from Multiverse/test_prerelease
Test prerelease workflow.
2023-02-24 10:53:54 -05:00
Jeremy Wood 52eb3d820f Test out the prerelease action. 2023-02-24 09:58:10 -05:00
Ben Woo d90210d70f Merge pull request #2855 from Multiverse/gradle-build
build: Make MV5 build with gradle
2023-02-20 20:34:56 +08:00
Ben Woo ec254c2989 build: Make MV5 build with gradle 2023-02-20 20:29:08 +08:00
Ben Woo 36549294b7 Merge branch 'main' into gradle-build 2023-02-20 20:25:47 +08:00
Jeremy Wood 908fcb1e44 Merge pull request #2854 from Multiverse/dumptruckman/fix_release_8
Combine release and publish into a single workflow.
2023-02-20 07:20:05 -05:00
Jeremy Wood 73cd26aea3 Combine release and publish into a single workflow. 2023-02-20 07:17:37 -05:00
Jeremy Wood 758d25812b Merge pull request #2853 from Multiverse/fix-gha-release
Fix upload release artifact
2023-02-20 06:42:31 -05:00
Ben Woo fa0ef421c7 Merge branch 'main' into fix-gha-release 2023-02-20 14:57:52 +08:00
Ben Woo e936a6271f Fix upload release artifact 2023-02-20 14:57:01 +08:00
Jeremy Wood 7362e543da Merge pull request #2851 from Multiverse/dumptruckman/fix_release_7
Use new action for uploading artifact.
2023-02-20 00:58:06 -05:00
Jeremy Wood 8a46d70301 Use new action for uploading artifact. 2023-02-20 00:57:21 -05:00
Jeremy Wood a168e5cb48 Merge pull request #2850 from Multiverse/dumptruckman/fix_release_6
Massage the strange release upload url.
2023-02-20 00:38:53 -05:00
Jeremy Wood ae578f9491 Massage the strange release upload url. 2023-02-20 00:36:45 -05:00
Jeremy Wood e72122378d Merge pull request #2849 from Multiverse/dumptruckman/fix_release_5
Fix name of consumed output variable on get_release in more places.
2023-02-20 00:06:05 -05:00
Jeremy Wood fd2ea3df09 Remove tag prefix. 2023-02-20 00:04:43 -05:00
Jeremy Wood e94e071c6e Fix name of consumed output variable on get_release in more places. 2023-02-19 23:58:26 -05:00
Jeremy Wood 0e19236cdc Merge pull request #2848 from Multiverse/dumptruckman/fix_release_4
Use lowercase artifact id.
2023-02-19 23:53:45 -05:00
Jeremy Wood 1c12756acf Use lowercase artifact id. 2023-02-19 23:51:14 -05:00
Jeremy Wood bcfde80c07 Merge pull request #2847 from Multiverse/dumptruckman/fix_release_3
Fix name for consumed output variable on get_release.
2023-02-19 23:39:16 -05:00
Jeremy Wood 8dc9e864eb Fix name for consumed output variable on get_release. 2023-02-19 23:37:25 -05:00
Jeremy Wood fec820f4ba Merge pull request #2846 from Multiverse/dumptruckman/fix_release_2
Use PAT to create release.
2023-02-19 23:27:49 -05:00
Jeremy Wood ff9ffad302 Use organization PAT for creating release. 2023-02-19 23:25:10 -05:00
Jeremy Wood fc2cb6aeae Move publish jobs back into publish action. 2023-02-19 23:24:44 -05:00
Jeremy Wood d2776ef448 Merge pull request #2844 from Multiverse/dumptruckman/fix_release
Fix build & publish.
2023-02-19 22:55:44 -05:00
Jeremy Wood 36ef41b710 Release and publish in the same action. 2023-02-19 22:51:30 -05:00
Jeremy Wood 9258ebd8c7 Remove Intellij gradle plugin. :( 2023-02-19 21:57:13 -05:00
Jeremy Wood d528cbcafd Merge pull request #2826 from Multiverse/dumptruckman/gradle
Switch from Maven to Gradle.
2023-02-19 20:48:01 -05:00
Jeremy Wood 760c193b0e Readd test workflow. 2023-02-19 19:36:20 -05:00
Jeremy Wood 7c6edcb081 Fix the required label names. 2023-02-19 19:09:02 -05:00
Jeremy Wood 009a94f74d Publish releases. 2023-02-19 19:03:45 -05:00
Jeremy Wood bd6fb4e51c Correctly disable useless IntelliJ plugin tasks. 2023-02-19 19:03:40 -05:00
Jeremy Wood 2fdef44744 Create release on push to main branch. 2023-02-19 19:03:40 -05:00
Jeremy Wood 5b991f44e2 Require release related label on PRs against main branch. 2023-02-19 19:03:39 -05:00
zax71 871ba16b67 Implement requested changes 2023-02-19 19:03:39 -05:00
zax71 e90c50d170 Add Caching to GitHub actions and update README.md to reflect Gradle 2023-02-19 19:03:39 -05:00
zax71 d1be3bd0be Update GitHub Actions to Gradle 2023-02-19 19:03:37 -05:00
Jeremy Wood 4d40b3f7e4 Switch from Maven to Gradle. 2023-02-19 19:02:52 -05:00
Ben Woo 20ba6f130a feat: Implement remove and import command (#2839)
* feat: Implement remove and import command

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

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

* Chore: Accept sugguestion

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

* Chore: Implement (most) suggestions from Ben

* feat: Implement gamerule context

* feat: Implement MVworld[] array context

* feat: Implement context for gamerule value

---------

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

* chore: Some formatting update

* chore: Implement suggested command changes

* feat: Add world name validation

* feat: Implement locale support for create command

* fix: World exist checking should include unloaded worlds

* fix: Add default null to generator output

* fix: Allow Unloaded worlds to be cloned

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

* feat!: Move all destinations to new API

* feat: Fully implement teleport and check command

* chore: Improve autocomplete permission checking

* chore: Fine tune tab completion

* chore: Implement suggested changes

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

* Trigger Test Build

* Fix build

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

* docs: Add javadocs and annotation

* chore: Implement suggested improvements

* chore: Add shortcuts for flaggroup in MultiverseCommand

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

    Implement suggested improvements.

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

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

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

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

* Add @FunctionalInterface annotation to displaytools interfaces.

* Use static factory method to create Builder with contents.

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

* Rename Builder#display to show and require CommandSender.

* Rename package from displaytools to display.

* Move DisplayHandler impls into their own package.

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

* Pass CommandSender to send command.

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

* Rename ContentDisplay#send to #show.

* Split DisplaySettings into separate classes.

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

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

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

* Re-add old player bed for backwards compatibility

* Remove second bed destination name

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

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

Fixes issue where unloaded worlds can't be deleted.

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

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

* Fixed wildcard imports

* Use Pattern regex check for worldname validation

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

* fix NPE in gamerules command and remove deprecated method

* catch buscript initialization errors

* update gamerule command to be more descriptive

* undo GameruleCommand style changes

* update legacy version reporting to include all config options

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

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

* Remove wildcard imports

* Added unit testing for ignoring files as well

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

* Fixed a typo

* Added more details to template

Added dev build link

Need to enter `/server` output

Declaration that issue is reproducible with only mv plugins

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

* Simplify the creation of metrics.

* Clean up new metrics.

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

* I don't think we need this

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

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

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

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

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

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

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

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

line ending derp

---

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

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

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

For now, I've added a special case for nullterrains, which uses the new -n param to skip checking.
2012-01-24 20:32:39 -07:00
main() 33afa4d0d7 Now using the new listeners from ecb97fd5c1 2012-01-24 19:18:03 -07:00
main() 0980e0a201 Merge branch 'master' of github.com:Multiverse/Multiverse-Core into new-tests
Conflicts:
	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
2012-01-23 19:05:21 +01:00
main() c7d35f13f4 _Never_ System.out.println() exceptions! 2012-01-23 17:43:21 +01:00
main() eebc5c6e62 Mocking is better than implementing mock-classes.
(déjà vu ... ;) )
2012-01-23 16:02:44 +01:00
Eric Stokes ecb97fd5c1 Migrate to the new event system 2012-01-22 21:44:43 -07:00
Eric Stokes bf76b77cf6 Add New api methods, Write location format better
Closes #411
2012-01-22 14:21:18 -07:00
Eric Stokes 21571bf54b Made MockBlock compatible with latest 1.1 builds 2012-01-22 14:20:45 -07:00
Eric Stokes 7b8f73f0af Bump Allpay version.
This adds EconXP support.
2012-01-16 19:45:29 -07:00
Eric Stokes 9313ff82ae Bump protocol to 11, since we changed the api classes 2012-01-15 14:17:51 -07:00
Eric Stokes c22acd6dd1 Fix arg range errors, add examples of WorldType. 2012-01-15 13:29:35 -07:00
Eric Stokes 0f3fd89228 Add new WorldTypes to Multiverse
This closed #394
2012-01-15 13:15:08 -07:00
Eric Stokes 7f93eedbac Spout fixed mentioned issue!
Commit it was fixed in:
https://github.com/SpoutDev/SpoutPlugin/commit/1157e6b6422ae156dd692f38e895ae0c5c5570a2

Build it was fixed in:
http://ci.spout.org/job/SpoutPlugin/681/
2012-01-14 13:57:31 -07:00
Eric Stokes b2457f38b1 Bump version to 2.3 2012-01-13 18:48:16 -07:00
Eric Stokes 04366dd50e Fix Properties not loading properly
Closes #397
This also fixes Active Properties not saving properly
2012-01-13 17:49:22 -07:00
main() dc0121509a Fixed shouldWeKillThisCreature() in MVEntityListener. 2012-01-12 19:01:10 +01:00
main() 8bab4ae606 Merge branch 'master' of github.com:Multiverse/Multiverse-Core into new-tests 2012-01-11 16:44:59 +01:00
Eric Stokes 91c9e175d0 Add setActualDifficulty; Fixes #382
I also changed the difficulty properties to use setActualDifficulty.
2012-01-10 19:29:55 -07:00
main() a1299239a2 Added more checks 2012-01-07 21:26:51 +01:00
main() 7cdb52e740 Yay for colored messages! 2012-01-07 21:26:23 +01:00
main() e2d6652ef1 One single missing char that kept breaking everything.
It took me half an hour to find this -.-
RAGE!
2012-01-07 17:13:00 +01:00
main() 814725a2ba Merge branch 'master' of github.com:Multiverse/Multiverse-Core into new-tests
Conflicts:
	src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
2012-01-07 16:10:18 +01:00
main() da6e6145f2 (Re)designed MVMessaging for extension. 2012-01-07 16:05:16 +01:00
main() ee715b13b0 (Re)designed LocationManipulation for extension. 2012-01-07 16:02:23 +01:00
Tim Ekl b006a458db Make syncMobs() public and Javadoc it 2012-01-06 20:53:38 -05:00
main() a18611fb76 (Re)designed BlockSafety for extension. 2012-01-06 21:11:51 +01:00
main() 1af30dad1d Added collection-support for sendMessages in MVMessaging. 2012-01-06 18:00:34 +01:00
Eric Stokes 79c06b5c42 Fix null worlds blowing up player money; Closes #373 2012-01-05 22:16:34 -07:00
main() 6861021c7a C'mon, avoiding bad style can't be that hard! 2012-01-05 11:49:01 +01:00
Eric Stokes 5435fca6b3 Fix pvp and a few other active settings 2012-01-04 23:00:40 -07:00
Eric Stokes 53c801bb81 Move to ActiveConfig Properties.
This still needs some cleanup, but works well.

I'd like some users to test (and comment here) on the following
commands:
mvm set pvp true/false (can't test this by myself)

Everything else looks good. All tests pass. Think this one (due to the
active properties) fixes #322
2012-01-04 21:46:19 -07:00
main() bb0b26e03c Another huge commit. Style once again, hopefully for the last time.
And we're now using CheckStyle-suppression-comments, thanks @lithium3141.
2012-01-04 13:17:10 +01:00
Eric Stokes 10d849dc51 Add time, remove global gamemode, see below:
- Add Time as a settable (but not stored) function proptery.
 - Add Function properties (They're called tempStringConfigProperties until I make them more generic. deal with it :P)
 - Remove the globalgamemode setting, since it's already covered with the new perms.

When I move TempStringConfigProperty to a seperate superclass (ActiveConfigProperty) we won't have the issue of things getting set anymore, as ActiveConfigProperties will change an active setting (gamemode for example) **when** they're set, not after some cleanup function gets run. Hell. Yes.

Off to bed... I promised this commit to someone which is why it's a lil' sloppy. Sorry :( Will fix tomorrow!
2012-01-03 21:01:51 -07:00
main() b69403e00c I knew it... 2012-01-03 16:30:23 +01:00
main() 120009c6b4 Let's go ahead and see if everything explodes. 2012-01-03 16:26:26 +01:00
main() 940dfa4a7e Removed unused PermissionTools in MVEntityListener 2012-01-03 15:06:47 +01:00
main() b7d3ae039c Improved the MVPlayerListener (style). 2012-01-03 15:03:28 +01:00
main() 5b056388a0 Style-fixes... They're driving me mad... 2012-01-03 15:01:44 +01:00
main() 9d16b7c445 Whitespace is allowed when arrays are initialized. 2012-01-03 15:00:39 +01:00
main() cf21793262 package-info.java 2012-01-03 13:41:49 +01:00
main() 632e926098 Added missing copyright-notice 2012-01-02 11:54:29 +01:00
main() aaa1d18865 Added MultiverseCoreListener. 2012-01-02 11:42:10 +01:00
Eric Stokes 851c6de3eb Prettied upthe buffer, added missing values 2012-01-01 15:06:51 -07:00
Eric Stokes 9963e6f29f Merge branch 'master' of github.com:Multiverse/Multiverse-Core 2012-01-01 13:56:33 -07:00
Eric Stokes d31ee6a5b8 Implement MVMessaging in the Teleport command 2012-01-01 13:56:20 -07:00
main() a5650f1f35 New "/mv version"-system. 2012-01-01 21:10:51 +01:00
main() 426a3bf252 I forgot to put that back in... 2012-01-01 21:09:52 +01:00
Eric Stokes 736eff06ea Add Messaging! (finally) 2012-01-01 12:56:36 -07:00
main() ac5f249164 Fixing the next bunch of CheckStyle-warnings.
I just pushed this without checking it, could somebody please review this commit?
2012-01-01 20:38:37 +01:00
Eric Stokes 0841362c26 Remove * imports. 2012-01-01 11:24:19 -07:00
Eric Stokes e344b0860d Changed priorities of the listeners to not cancel events too soon.
- Add the MVPortal Adjust Listener (lowest)
 - Change the PlayerListener to (High)
Remember that the priories are really just order, so if PlayerListener
was set to lowest, and cancelled the event, no one else would see it.

These changes are required for the fix that i'm finishing up for NPs
and SPs
2012-01-01 11:24:19 -07:00
main() c0d029c71d Fixed tests (I forgot that in 07247a1afd) 2012-01-01 17:32:32 +01:00
main() 07247a1afd ImportCommand now checks if the world was successfully imported.
Fixes #359
2012-01-01 17:28:44 +01:00
main() 47e052d180 Style-fixes. Tons of them. I was too lazy to pack them into different commits. 2012-01-01 17:22:05 +01:00
main() da0bed3b5e Added missing javadoc in the configuration-package. 2011-12-31 20:49:17 +01:00
main() c9b409844f Fixed redundant modifiers in MVWorldManager
... and changed Boolean to boolean
2011-12-31 20:40:28 +01:00
main() 2c392a53e6 Added missing javadoc for MVPlugin 2011-12-31 20:39:10 +01:00
main() f18d457a83 Added javadoc for FancyText 2011-12-31 20:38:53 +01:00
main() 6f884c9308 Style-fixes in MultiverseCore.
Oh, and String.format is better than string concatenation.
2011-12-31 20:30:09 +01:00
main() a45bfa4dc3 Nobody needs that anymore. 2011-12-31 20:29:20 +01:00
main() 1529f3e6dc Lines too long... -.- 2011-12-31 19:57:22 +01:00
main() d48927787b Fixed MagicNumberCheck in MVWorld 2011-12-31 19:56:53 +01:00
main() 9173a15eb9 Started work on tons of new tests 2011-12-31 18:34:04 +01:00
main() 76629ebd25 Now you can't set "respawnworld" to invalid values. 2011-12-31 18:32:58 +01:00
main() 659301a808 MVWorld wants a toString()! :P 2011-12-31 18:32:58 +01:00
Rusty Burchfield 408c09541a Add build instructions to README; Fix double-slash 2011-12-31 10:28:14 -07:00
Eric Stokes 29ddb5e5c1 Hmm apparently Beer helps with coding, but not version control... 2011-12-30 20:15:57 -07:00
Eric Stokes 4429bdcf8e Not sure how this stuff got left out... 2011-12-30 20:15:31 -07:00
Eric Stokes 9f12f6362b Bump config, Add workaround for spout issue.
Closes #355, Closes #149, Closes #349

This adds a new config var: firstspawnoverride that defaults to true.
You should disable this if you don't want mv to do your spawning (if
you have Spout, a warning will print and it will be disabled
automatically. The firstspawn feature will NOT work with spout at this
time.) When the spout bug is fixed, someone should open an issue. I
will not be monitoring this :)
2011-12-30 20:14:44 -07:00
Eric Stokes 9fa29bcde7 Minor Fix: Don't warn when players join the server. That's normal :) 2011-12-29 19:05:10 -07:00
Eric Stokes 346f1591ef Fix OPs/multiverse.* always having gamemode bypass.
I've added a separate namespace:
mv.bypass.gamemode.[*|X]
where X is a world name.

If a player has the * one, they ignore game mode changes GLOBALLY.

This perm defaults to FALSE, meaning OPS will NOT get it by default.
2011-12-29 18:55:24 -07:00
Eric Stokes 749ea12b4a Change warnings to fine/finer, ref #338 (and other issues) 2011-12-25 08:53:42 -07:00
Tim Ekl 20ad724e5a Merge branch 'plugin-smackdown'
Closes #328
2011-12-22 22:01:38 -06:00
Tim Ekl 8f44a8e77a Remove redundant TeleportIntercept check 2011-12-22 09:50:06 -06:00
Tim Ekl 8345c83afd Add config value (teleportintercept)
New config value sets whether to attempt to block non-permissible
teleport attempts initiated from other plugins. Previous behavior
was new config value `false` - MV would not intercept these outside
teleports. New default configured value is `true` - MV will intercept
(and possibly block) other plugins' teleports.
2011-12-21 23:34:35 -06:00
Tim Ekl 6761be6952 Intercept other plugins' teleports properly
This commit will eventually provide a fix for #328, when it gets merged
2011-12-21 23:20:58 -06:00
Tim Ekl 2879c2a96e Add bonus log messages for teleport permissions 2011-12-21 22:44:26 -06:00
dumptruckman a092dd8760 Added permission check with permissions "multiverse.gamemode.ignore.NAME" and of course "multiverse.gamemode.ignore.*" 2011-12-20 07:54:14 -05:00
dumptruckman 4246149bf2 Added checking for gamemode restriction bypass before trying to change gamemode
removed unreachable statement.
2011-12-20 07:54:10 -05:00
dumptruckman c2ad331ca5 added playerCanIgnoreGameModeRestriction() to be checked before changing game modes. 2011-12-20 07:52:33 -05:00
Eric Stokes fc24062f66 Add firstworldspawn, safe spawn disabling, fix a few neat bugs. 2011-12-19 20:03:36 -07:00
main() 8164f484dd Why is an if() without braces bad style!? Seriously!? 2011-12-19 20:53:38 +01:00
main() 2721419324 Added MVWorldDeleteEvent. 2011-12-19 20:48:14 +01:00
Tim Ekl 251b66a8d0 Additional null check; fix signportals issue 17 2011-12-18 21:16:13 -05:00
Tim Ekl fdb8c862f9 Merge branch 'perm-errors'
Closes #286
2011-12-18 15:37:06 -05:00
Tim Ekl 3d518f2e8e Update CommandHandler 2011-12-18 01:29:52 -05:00
Tim Ekl 9cfc75b7db Mark anchor destinations valid if they pass location checks
This commit closes portals bug #92
2011-12-17 14:27:58 -05:00
Tim Ekl 528b448450 Condense color alternation on generator lists; closes #318 2011-12-17 13:32:34 -05:00
Tim Ekl 48f8e033b6 Add a null check around some block safety checks 2011-12-16 00:41:57 -05:00
Tim Ekl 761c3b95d9 Implement support for CommandHandler's optional error displays
This commit relates to #286 and will eventually close it when it gets
merged
2011-12-15 23:19:14 -05:00
Tim Ekl ac229bfcd6 Update CommandHandler lib to v5; relates to #286 2011-12-15 23:07:14 -05:00
Tim Ekl 1894a2e4e7 Set up config support for suppressing perms errors; relates to #286 2011-12-15 22:57:54 -05:00
main() 327f0ce7c4 Pulled some methods up into the Core-interface
(amended, sorry)
2011-12-12 20:59:00 +01:00
main() 5ae12022d1 Lots of javadoc-fixes 2011-12-12 20:48:55 +01:00
main() 18ccb32bfe Javadoc-fixes + added missing @Overrides + fixed one name hiding in MVWorld 2011-12-12 20:09:21 +01:00
main() d7303f1289 Making the constructor private broke MVA...
Thanks to Jenkins for immediately reporting that!
2011-12-12 19:26:00 +01:00
main() cab8aaf040 JavadocStyleCheck: First sentence should end with a period.
Yes, one character can be that important. *sigh*
2011-12-12 17:40:33 +01:00
main() ca21047859 Fixed HideUtilityClassConstructorCheck 2011-12-12 17:26:17 +01:00
main() ae27a34bb0 Empty catch blocks are okay. 2011-12-12 17:22:47 +01:00
main() 90305a4379 Changed ITEMS_PER_PAGE to itemsPerPage since it's not a constant. 2011-12-12 17:15:23 +01:00
main() 033df2f407 Inline conditionals are awesome! 2011-12-12 17:14:54 +01:00
main() b2b1f91f38 Fixed warnings about RedundantModifierCheck. 2011-12-12 17:07:38 +01:00
main() 947235fa72 Parameters are allowed to hide fields. 2011-12-12 16:58:19 +01:00
main() 329ded9615 CheckStyle for Eclipse! :D 2011-12-12 16:57:44 +01:00
main() 86cfa9d98f Fixed another bunch of CheckStyle-warnings (VisibilityModifierCheck)
This time because of default visibility instead of private.

We need a better way for these global config variables in MultiverseCore.java
2011-12-12 16:45:54 +01:00
main() 1bdca7e615 TODO-Comments are a nice information, but no big deal.
CheckStyle, stop erroring about them!
2011-12-12 16:39:01 +01:00
main() 36c33fba14 We don't need javadoc for private stuff and constructors 2011-12-12 16:33:29 +01:00
main() 71794e0164 No @author tags! 2011-12-12 16:31:04 +01:00
main() 3b784b64c0 CheckStyle-warnings about AvoidStarImport should now be fixed! 2011-12-12 16:25:10 +01:00
Tim Ekl 06f3bb4f63 Remove remnants of old Pneumaticsystem repo; add distro information 2011-12-11 21:09:58 -05:00
Eric Stokes 7685af770c Add b to build # 2011-12-11 15:03:29 -07:00
Eric Stokes 80510a778b Add the onarandombox repo back! Yay! 2011-12-11 13:08:30 -07:00
Eric Stokes d7c1b8b0e2 Fix AIOOB. Fixes #303
Fixed an AIOOB when players had the list perm, but not perm to view any
world.
2011-12-11 12:02:01 -07:00
Eric Stokes bf0b70cbcd Let's try a png rather than a psd. 2011-12-11 11:44:36 -07:00
Eric Stokes 1fa79af412 Add 2 new logos 2011-12-11 11:42:35 -07:00
Eric Stokes 42f5d28b77 Add a properly sized logo. 2011-12-11 11:11:49 -07:00
Eric Stokes a5cfb81cc4 Add the logo to the config. 2011-12-11 10:54:45 -07:00
main() 4b53a8dfea Mocking is better than implementing Mock-classes 2011-12-11 13:33:50 +01:00
main() 32ccfe3458 General test-cleanups 2011-12-11 13:33:49 +01:00
Eric Stokes fe71006542 Keep the docs directory. 2011-12-10 22:38:40 -07:00
Eric Stokes 8a337fbf2a Add Doxygen files. 2011-12-10 22:33:59 -07:00
Eric Stokes ff514f8663 Testing Git Build Hook 2011-12-10 18:37:54 -07:00
Eric Stokes 97d905cf51 Add initial check style plugin. Default settings. 2011-12-10 17:44:11 -07:00
Eric Stokes ddc2850632 Merge branch 'master' of github.com:Multiverse/Multiverse-Core 2011-12-10 14:15:27 -07:00
Eric Stokes ea6b020850 Add test for Failure to select a valid command 2011-12-10 14:15:18 -07:00
main() d40ae35505 The config was awesome, but now it's REALLY AWESOME.
Java generics might be weak, but they can avoid permanent casting, resulting in better code :D
2011-12-10 21:04:34 +01:00
main() c9cd2a0f5c Prevented properties from getting null if they were invalid in worlds.yml 2011-12-10 21:03:38 +01:00
main() c0ae0e3eea Javadoc wants <p>, not <p/> 2011-12-10 11:21:26 +01:00
main() 0b2233cf7b We have to use the WorldContainer in the CreateCommand, too.
(This should have been changed in af439b678e)
2011-12-10 11:04:29 +01:00
Eric Stokes d8cb6497f0 Display the spawn location when changing it. Closes #295.
I'm closing this issue and "moving" the rest of it, the ability to
import/create a world without using the checker to Issue #300
2011-12-10 00:53:02 -07:00
Eric Stokes e5d468f03f Fix properties not reporting when the value was wrong, but the key was. 2011-12-10 00:41:28 -07:00
Eric Stokes a33d1420ba Add game mode test.
This test should pass, but alas it fails :(
2011-12-10 00:36:40 -07:00
Eric Stokes 70f03e80bc Update the POM to use parallelized tests.
Don't try and run our cool classes.
2011-12-09 19:58:11 -07:00
main() f091a32174 Now saving mob exceptions correctly. Fixes #287 2011-12-09 16:53:50 +01:00
Tim Ekl ff8b9eb3b7 Remove onarandombox repo; fix the build version number replacement 2011-12-09 10:04:46 -05:00
fernferret 08736cca16 Time for bed. Too many mistakes. Fixed the Core Pom (again) 2011-12-09 01:00:49 -07:00
fernferret 10a4ec1c0b Add WorldContainer to tests, they pass again. Yay! 2011-12-09 00:39:57 -07:00
fernferret 5159fe7a17 Add new repo to the POM. 2011-12-09 00:06:34 -07:00
Eric Stokes fe52040b48 Merge pull request #298 from 4am/master
Fixed Importing from a world container directory which is not the default
2011-12-08 19:35:32 -08:00
4am af439b678e Changed runCommand to look in world container directory (defined in bukkit.yml) instead of in the server folder when attempting to load world files. 2011-12-08 19:19:17 -05:00
Tim Ekl 77ced857ea Merge branch 'master' of github.com:Multiverse/Multiverse-Core 2011-12-08 18:25:38 -05:00
Tim Ekl 24efbf2ea9 Remove UNKNOWN version number from pom.xml 2011-12-08 18:25:05 -05:00
main() 5b17df65e9 Removed unused imports 2011-12-08 19:59:20 +01:00
main() 8b721886f5 Yes, the MVConfigMigrator is old and uses deprecated stuff. 2011-12-08 19:59:10 +01:00
main() dbf109f051 Raw types are evil. 2011-12-08 19:17:55 +01:00
main() 56e4e493b1 Fixed all javadoc warnings and some typos. 2011-12-08 19:08:07 +01:00
Tim Ekl 8916f0dbbc Combine JUnit dependencies 2011-12-07 00:16:42 -05:00
Eric Stokes 3a5bc6adda Actually fixed #294 2011-12-06 18:40:09 -07:00
Eric Stokes f6e49bd8eb Fix pitch/yaw switched for mvss on reload 2011-12-06 18:14:34 -07:00
Eric Stokes 15ce10671e Fix colors bleeding into the next name, Fixes #285 2011-12-02 18:19:26 -07:00
Eric Stokes a0ab24a132 Merge branch 'master' of github.com:Multiverse/Multiverse-Core 2011-11-30 19:38:58 -07:00
Eric Stokes ee75392a9e Fix anchor direction, Fixes #283 2011-11-30 19:38:35 -07:00
Tim Ekl 6fd7c84276 Fix Javadoc on PasteService interface 2011-11-30 11:44:18 -05:00
Tim Ekl df5bfdde80 Allow posting to pastie.org or pastebin.com (pastie.org is the new default); closes #277 2011-11-29 20:55:13 -07:00
Tim Ekl 8e74945b7e Add null check for files returned in world check; closes #278 2011-11-29 20:14:11 -05:00
Eric Stokes 5d2a1e478c Fix Anchors not being saved proplery, Fix safe spawn disabling, closes #207, Remove server.properties code, that bukkit bug is gone, closes #275 2011-11-28 00:08:39 -07:00
Eric Stokes e110b1f6a5 Add anchors 2011-11-27 18:50:42 -07:00
Eric Stokes 803eb84f3f Commit paginated changes, Add PermissionsTools 2011-11-27 01:42:18 -07:00
Eric Stokes 562de0f002 Fix tp perms to take into account teleporter and teleportee. This may eat your server 2011-11-26 19:38:57 -07:00
Eric Stokes 156e7ce373 Fix tests, and caught NPE 2011-11-26 17:42:58 -07:00
Eric Stokes 939a2e8b1f Add paginated commands, Closes #203, Add folder suggestions when your import fails 2011-11-26 17:24:17 -07:00
Eric Stokes 792d2ce5e6 Remove PaginatedCommand 2011-11-26 15:20:08 -07:00
Eric Stokes 03424165a4 Fix world.dat being adjusted every time, Fixes #268 2011-11-26 15:00:52 -07:00
Eric Stokes f2a65b4fd9 Fix bedrespawn not being checked. Fixes #240 2011-11-26 13:01:45 -07:00
Eric Stokes 6afbd1d13d Bump API version to 8, Remove junk, Update CommandHandler (Closes #267) 2011-11-26 12:33:12 -07:00
Eric Stokes d2a5898e53 Fix seeds (Closes #266), Allow Regeneration of map (Closes #202)
Fixed long seeds not loading properly (this happened with the new
config), Add Regenning of worlds. This works for the same seed, but new
seeds are still in the works.
2011-11-26 11:28:44 -07:00
main() fa0c843f39 Improved (or broke) tests. 2011-11-26 12:07:28 +01:00
main() 459aad2d2b Fixed NPE when there was no worlds-section in bukkit.yml 2011-11-26 12:07:28 +01:00
Eric Stokes 0fa8f4e824 Force default worlds to be imported, Closes #265 2011-11-26 01:49:46 -07:00
Eric Stokes 82eff21dbf Revert earlier changes about using the repo, fix awesome unload bug. Now you can't unload defaultly loaded worlds 2011-11-26 00:35:07 -07:00
Eric Stokes 6bf9d1c9bb Add Help to the Import Command 2011-11-25 22:59:06 -07:00
Eric Stokes 71bfd2a1ad Remove submodules in favor of deployments 2011-11-25 22:45:27 -07:00
Eric Stokes 4b2152a05c Add new world delete method (Closes #260), Remove world from unloaded list when it's removed from the configs 2011-11-25 19:29:00 -07:00
Eric Stokes 6a80c8c1de Merge branch 'fixed-tests' Closes #261
Tested, and the tests all pass!
2011-11-25 18:17:32 -07:00
Eric Stokes c4dd2e3005 Much needed code re-format 2011-11-25 18:13:14 -07:00
Eric Stokes 4006e53243 Fix formatting with pullrequest, remove dragon, to @Rigby90's point, this will be bad for 3rd party addons. 2011-11-25 18:07:46 -07:00
Eric Stokes f894859df9 Fix the pastebin.com poster (Bad API request bug) 2011-11-25 17:44:52 -07:00
sthycb c9a33350ac Added Support for EnderDragon purging now Supports Dragon or EnderDragon as the keyword (No changes needed to this file if this functionality is not desired) Ie: With the old code player must enter the correct "enderdragon" entering "dragon" on any other invalid keyword will report "0 - mobs purged". NOTE: This change would break for a player has a mod that has an entity called "Dragon". 2011-11-25 17:23:31 -07:00
Eric Stokes 0c847eefdf Add more fixes that I broke when fixing #255 2011-11-25 16:57:01 -07:00
Eric Stokes 9710501a03 Fix lots of bad things with #255 2011-11-25 16:56:36 -07:00
main() 11fe1aee10 Fixed the tests. Closes #252 2011-11-25 18:02:41 +01:00
Eric Stokes 3e3990eba4 Add WorldPropertyChang event Fixes #255, reduce the search radius until we can find a better place in the end. 2011-11-24 18:41:09 -07:00
Tim Ekl 06f53a0b47 Fix NPE on incorrect world chat color & correct in config 2011-11-23 20:02:06 -06:00
Eric Stokes 9a7c6202cc Add bedrespawn as a per-world property. Fixes #192. Fixes #221. 2011-11-22 21:52:18 -07:00
Eric Stokes 5d932060ee Removed deprecated items, Add autoload (Fixes #241) 2011-11-22 21:01:00 -07:00
Eric Stokes 8803374126 Fix colors not persisting through reloads 2011-11-22 19:50:52 -07:00
Eric Stokes 3c424c1c33 Fix aliases not working when setting 2011-11-22 19:41:56 -07:00
Eric Stokes 9f8e1689f6 Fix silly list mistake in worlds, fix gamemode not switching, fix a bunch of npes 2011-11-22 19:27:03 -07:00
Eric Stokes 2717a7bbee Attempted fix for npe on worldmanager 2011-11-22 00:14:54 -07:00
Eric Stokes 29bc8bfbfc Fix massive NPEs for real, Don't comment out tests, use @Ignore, Thanks @main-- 2011-11-21 22:44:36 -07:00
Eric Stokes af428a236d Merge with betterproperties 2011-11-21 21:56:34 -07:00
Eric Stokes 25be687762 Fix NPE 2011-11-21 21:55:28 -07:00
Eric Stokes d6b5fb9a25 Update for MC 1.0.0 2011-11-21 21:07:20 -07:00
Eric Stokes e818b1ee73 Merge with test branch 2011-11-06 10:00:44 -07:00
Eric Stokes 92db828e3a Merge branch 'master' into better-properties 2011-11-05 12:08:10 -06:00
Tim Ekl 61bed8e72d Merge pull request #229 from Multiverse/broadcasts
Broadcast-Messages
2011-11-03 08:22:02 -07:00
Eric Stokes f774d861c2 Fix typos 2011-10-23 11:01:42 -06:00
Eric Stokes 65b375edeb Added item specific help to config properties. 2011-10-23 10:47:46 -06:00
Eric Stokes b19799f764 Cleanup old variables 2011-10-22 17:45:03 -06:00
Eric Stokes 2e41d149fe Done converting MVWorld, now needs testing 2011-10-22 17:38:00 -06:00
Eric Stokes c576d5a3a2 Add the new style of saving/loading world properties.
All properties have been converted, but are not all implemented yet. I'm just committing because it's been several hours... o.O
2011-10-22 14:16:00 -06:00
Eric Stokes 6b95be4ca5 Add new interface, and a new paginated command, both shells 2011-10-22 11:01:05 -06:00
Eric Stokes 1712b175d8 Add autoheal and adjustSpawn as per-world properties 2011-10-22 11:00:32 -06:00
Eric Stokes 46db76a6cc Add new test stuff 2011-10-21 18:37:18 -06:00
Eric Stokes 0e708a1f51 Move utils to a different package, add skylands to import test 2011-10-21 18:03:34 -06:00
Eric Stokes 65369b6a4b refactor rests even more 2011-10-21 17:48:28 -06:00
Eric Stokes ab311dd8d9 Reorged the tests, LOTS OF CLEANUP 2011-10-20 18:36:33 -06:00
Eric Stokes 2b2a406cce Merge branch 'master' into test 2011-10-20 17:31:39 -06:00
Eric Stokes 3ad1bfad2b Woohoo! All tests passgsgs 2011-10-20 17:30:29 -06:00
Eric Stokes b028811d36 Merge branch 'master' into test 2011-10-20 16:44:02 -06:00
main() 6a6b29923d Bump version to 2.2 2011-10-19 19:59:03 +02:00
main() 0581415ae5 Added broadcast-messages (Closes #197) 2011-10-19 19:48:43 +02:00
Eric Stokes d473ac3f78 Bump API to v7 for 2.1 release 2011-10-18 20:48:23 -06:00
Eric Stokes 093e01d865 Change priority to Low, so MV can fix portal locations 2011-10-18 18:13:22 -06:00
Eric Stokes 2d7626684f Fix initial configs not loading properly 2011-10-18 16:45:55 -06:00
Eric Stokes 698671c700 Fix spawn not loading from config. Closes #195 2011-10-17 20:51:51 -06:00
Eric Stokes 0d06fb8a0d Reload the config after save for the initial creation 2011-10-17 19:09:22 -06:00
Eric Stokes 6e6c40bd3b Cannon destinations are basically exact destinations, don't perform the safety check. 2011-10-17 18:06:16 -06:00
Eric Stokes 4067d0cd28 Detect bad worlds and tell the user to use chunkster 2011-10-16 13:59:13 -06:00
Eric Stokes 5b19404c13 Clean up some comments. 2011-10-16 13:53:23 -06:00
Eric Stokes e6f81b01d6 Move the enforce access flag to canEnterWorld so other plugins don't have to check it also, Add "mv conf show" 2011-10-16 13:38:05 -06:00
Eric Stokes 25d9231d30 Check all parent perms if the player's normal perm wasn't found. Closes #174
I consider this a workaround. At the moment, when we add a node AND
recalc the permissions, until the perms plugin reloads, when MV asks
the API if a player has a perm, it reports that they do NOT. For the
moment, we're going to check all of this node's parents to see if the
user has those. It stops when if finds a true or there are no more
parents.
2011-10-16 11:06:40 -06:00
Eric Stokes 3284670153 Fix Difficulty and GameMode not reloading properly. Closes #190 2011-10-16 10:14:02 -06:00
Eric Stokes ea920c1252 Merge branch 'master' of github.com:Multiverse/Multiverse-Core 2011-10-16 09:56:47 -06:00
Eric Stokes 987e2eff51 Reorder the loading of fakepvp so it doesn't override regular pvp. 2011-10-16 09:41:47 -06:00
main() 67c165ff25 Fixed #191 (WorldManager.deleteWorld()). 2011-10-16 17:36:18 +02:00
main() e7aa563352 Revert "Fix startup error on Windows."
This reverts commit 01bed7cc4b.
Because that commit CAUSED a startup error instead of fixing one.
2011-10-16 15:29:09 +02:00
Eric Stokes 56926dc14c State when a perm has been found in debug, Fix The TeleportCommand not obeying enforce access 2011-10-16 02:06:18 -06:00
Eric Stokes 2d0eb7e7bb If enforceaccess == false, show all players all worlds (unless they're hidden) also for mv who 2011-10-16 00:38:49 -06:00
Eric Stokes 54e7bc454a If enforceaccess == false, show all players all worlds (unless they're hidden) 2011-10-16 00:34:40 -06:00
Eric Stokes 01bed7cc4b Fix startup error on Windows.
Psh who uses Windows anyways :P
2011-10-16 00:01:09 -06:00
Eric Stokes 728002ecce Still not working :/ Need to simulate worlds now... 2011-10-15 12:38:34 -06:00
Eric Stokes e45ae8f9dc Much farther with testing. Keep testing... 2011-10-15 12:23:13 -06:00
main() 5d11e27eb0 Fixed javadoc of the WorldManager. 2011-10-15 17:24:12 +02:00
Rigby fbc5c6f0d2 Removed Doxygen stuff as it is no longer required.
Added the ability to generate a Source JAR and pass to Artifactory.
2011-10-15 15:33:03 +01:00
Eric Stokes edb999578a Seperated MockWorld tests 2011-10-15 08:20:29 -06:00
fernferret d1f51acb1c Add Broken tests 2011-10-15 09:47:07 -04:00
fernferret b867df7315 Add main-- to the authors 2011-10-14 15:12:44 -04:00
fernferret a8068a5669 Protocol Bump to v6 2011-10-13 21:39:17 -04:00
fernferret ab17064006 Route all teleports through the SafeTTeleporter
There are still some access caveats. When you request that a player be
tp'd to you, there's currently not a good way to tell the teleport
event that… So we either get full control of all plugins and limited
control to override it, or unlimited control to override and no access
to other plugins' access to teleport players to potentially restricted
locations…

This will break the latest other Plugin builds.
2011-10-13 21:38:44 -04:00
fernferret d3c1538083 Fix config.yml overwriting worlds.yml, Fix invalid spawn locations 2011-10-13 16:37:53 -04:00
fernferret b2ef10a699 Revamp config to simpler 2.4 format 2011-10-12 21:50:03 -04:00
fernferret fba3f71238 Fix invalid values in /mv config, Closes #178 2011-10-12 17:04:21 -04:00
fernferret af3dcf049d Remove outdated values from config.yml, Fix Configs and reloading, Closes #186 2011-10-12 16:50:04 -04:00
fernferret a30222bec7 Show whether or not gamemode is being enforced, Fix enum Config Property 2011-10-11 22:51:30 -04:00
fernferret 86af11b662 Fixes for hidden worlds displaying as null 2011-10-11 21:57:35 -04:00
fernferret 750adcf376 Fix color checking, fix price reporting failure on successful set 2011-10-11 17:01:56 -04:00
fernferret c200d43f51 Bunch of NPE fixes 2011-10-11 16:45:47 -04:00
fernferret f4093cbe51 Implement new config items 2011-10-10 21:37:58 -04:00
fernferret 4366b16a74 Start using the new config 2011-10-10 20:40:31 -04:00
fernferret cfdd1ac38c Remove naming conflict with bukkit 2011-10-10 20:12:22 -04:00
fernferret 3e10f18079 Add a bunch of examples, add loadworld to the plugin.yml 2011-10-10 13:02:29 -06:00
fernferret c7c73e7094 Implement Check Command 2011-10-10 12:28:02 -06:00
fernferret c7e5816b2e Add better debug for world access 2011-10-10 11:57:45 -06:00
fernferret 50a89b7b1a Update Config.yml, implement enforceaccess
Cache enforceaccess and enforcegamemodes, as both of these get accessed
a lot.
2011-10-10 11:49:53 -06:00
fernferret 1aad872333 Start adding the Config Command 2011-10-10 11:31:22 -06:00
fernferret 73b42b5430 Merge branch 'master' of https://github.com/Multiverse/Multiverse-Core 2011-10-10 09:36:36 -06:00
fernferret e93fec45ac Much needed code reformat 2011-10-10 09:34:04 -06:00
Eric Stokes 23933c4706 Correct some javadoc 2011-10-10 07:50:03 -06:00
Eric Stokes 9e14daac1f Implement getMvWorld 2011-10-09 21:03:05 -06:00
Eric Stokes aa079b2920 Add Colored string to the alias, remove Double, use double 2011-10-09 20:26:23 -06:00
Eric Stokes bac24e1c97 Use the MultiverseWorld instead of MVWorld 2011-10-09 20:10:59 -06:00
Eric Stokes c72f602045 Fix MVINFO NPE, Fix NPE on startup with addWorld, Remove deprecated methods 2011-10-09 18:25:42 -06:00
Eric Stokes c22a8a9d18 Implement new world creation methods 2011-10-09 18:11:36 -06:00
Eric Stokes 2759d75125 Finalize API v5 2011-10-09 16:36:05 -06:00
Eric Stokes 980381194b Continue updating API. Fix squids not being monitored, Closes #181 2011-10-09 15:38:18 -06:00
Eric Stokes 8370a72776 Add hunger API, bump protocol to 5 2011-10-09 11:48:09 -06:00
Eric Stokes e0f9344d20 Merge branch 'master' of github.com:Multiverse/Multiverse-Core 2011-10-09 11:43:13 -06:00
Eric Stokes 3fde98049f Add a bunch more to the API 2011-10-09 11:31:50 -06:00
main() 40c04a1f4e Made removePlayersFromWorld() visible from the API and moved the javadoc 2011-10-09 19:27:40 +02:00
Eric Stokes 5386aadbb7 Add new api items for hiding worlds, Move the severe perms error to a level 2 log 2011-10-09 08:51:29 -06:00
Eric Stokes 5e0903086e Display API version, fix difficulty enums missing 2011-10-08 14:59:47 -06:00
Eric Stokes ff47610424 Bump protocol to 4 2011-10-08 14:29:44 -06:00
Eric Stokes 84e178d12e Bump API to version 3 2011-10-08 12:38:54 -06:00
Eric Stokes f2a263f86c Merge WorldManager Changes to keep the API happy 2011-10-08 12:38:23 -06:00
Eric Stokes 3c750104a5 rename some methods in the WorldManagerAPI 2011-10-08 12:36:57 -06:00
main() f69c85e6b0 Added loadWorld(String name) to the WorldManager and made it accessible with a command
Added some "'" around log-messages
2011-10-08 12:28:27 -06:00
Eric Stokes 6e4de79bfb Add WorldManager API, API is now level 2 2011-10-08 11:57:50 -06:00
Eric Stokes 2d112edee5 Start writing the Core API 2011-10-08 11:42:35 -06:00
Eric Stokes 4a634e8418 Final backwards compatability checks 2011-10-08 10:57:48 -06:00
Eric Stokes e31f2c79ac Fix breakages with SignPortals 2011-10-08 10:14:52 -06:00
Eric Stokes cc3889b166 Increment v to 2.1, start adding dummy files 2011-10-08 08:22:19 -06:00
Eric Stokes 7bbdac9012 Move a bunch of classes into utils 2011-10-07 18:47:39 -06:00
Eric Stokes d04a42ee92 Move utils package inside multiversecore 2011-10-07 18:26:40 -06:00
Eric Stokes fa80b66ac2 Pull changes from master 2011-10-07 18:22:54 -06:00
Eric Stokes ae19604eab Add difficulty to the info command 2011-10-03 19:59:29 -06:00
Eric Stokes 6e7daf4e85 And this is why we need unit tests... 2011-10-03 19:40:21 -06:00
Eric Stokes 86d3628b1c Actually save the difficulty 2011-10-03 19:24:38 -06:00
Rigby 9be14a2a0c You just can't get the right staff these days... 2011-10-04 01:28:42 +01:00
Eric Stokes 091c5a9621 Move GameMode check to onPlayerChangeWorld, fix difficulty case settings 2011-10-03 17:43:57 -06:00
Eric Stokes c566ead9ef Add multiworld difficulty 2011-10-02 21:18:25 -06:00
Eric Stokes d97bbfb1b1 Fixed Hunger/Food setting Closes #119 2011-09-28 19:56:41 -06:00
Eric Stokes ea6e94d99d Fix Signportals not going anywhere 2011-09-28 19:34:00 -06:00
Eric Stokes f0ae8cbb8e Ensure that the world players are going to is not null 2011-09-28 17:02:21 -06:00
Eric Stokes 1a6e93f0df Add aditional checks for onPlayerPortal 2011-09-28 16:28:09 -06:00
Eric Stokes 8fe128ec0f Add more api items 2011-09-26 20:21:39 -06:00
Eric Stokes f3cd433e80 Remove ALL perms3 refs 2011-09-25 12:11:42 -06:00
Eric Stokes 0964f461eb Remove Permissions 3 support 2011-09-25 12:02:28 -06:00
Eric Stokes fa409ac4f5 Remove fakePvp from the API 2011-09-25 11:05:48 -06:00
Eric Stokes 3753256611 Move destinations to their own package 2011-09-25 10:46:07 -06:00
Eric Stokes b378b0cf79 Update World API's comments to reflect new API changes 2011-09-25 10:43:22 -06:00
Eric Stokes e5646bbbfd Remove silly nullable reference 2011-09-25 10:41:43 -06:00
Eric Stokes 66538ccd02 Moved API around, added more docs 2011-09-25 10:40:23 -06:00
Eric Stokes d63c043368 New code format 2011-09-25 09:14:17 -06:00
Eric Stokes 65dce752d4 Don't set the hunger, only cancel the events 2011-09-22 19:47:14 -06:00
Eric Stokes 268b272f4d Implement Hunger. Untested 2011-09-21 22:15:16 -06:00
Eric Stokes eb0b83c507 Add getHunger api. No implementation yet 2011-09-21 19:26:02 -06:00
Eric Stokes f009ad6dd6 Merge branch 'master' into development 2011-09-21 17:50:16 -06:00
Eric Stokes 6b543a793a Add BedDestination 2011-09-21 17:45:10 -06:00
Rigby 05de5055ab Lets try this. 2011-09-21 19:16:25 +01:00
Rigby 688ea7a1d3 Merge branch 'master' of github.com:Herocraft/Multiverse-Core 2011-09-21 18:43:18 +01:00
Rigby fc02efd90f Added Doxygen... hopefully we'll have pretty JavaDocs. 2011-09-21 18:42:44 +01:00
Eric Stokes 6039009e3f Merge branch 'master' into development 2011-09-18 13:53:36 -06:00
Eric Stokes a9cb378eab Fixed the from worlds being the to worlds. 2011-09-18 13:51:28 -06:00
Eric Stokes fcfa45717c Fix Change Gamemode with NetherPortals, Fix NetherPortals allowing you entry to worlds you shouldn't be able to access. 2011-09-18 13:22:48 -06:00
Eric Stokes 9333f70add Working on messaging 2011-09-18 13:04:37 -06:00
Eric Stokes 30704338e6 Require spawn permission if you're using mvtp to go back to spawn (Thanks Verrier!) 2011-09-18 12:31:41 -06:00
Eric Stokes 17a519f961 Add the teleport permissions to the teleport command... oops 2011-09-18 11:45:06 -06:00
Eric Stokes 74aba9d6e8 Refactor so a Teleporter can be a CommandSender 2011-09-18 10:03:59 -06:00
Eric Stokes 43fcbc9af9 Add new messaging stuff 2011-09-18 09:48:46 -06:00
Eric Stokes fa3e0d6186 Check for console, Closes #118 2011-09-18 09:48:23 -06:00
Eric Stokes 20ce518d33 Added Copyright notice and remove trailing whitespace. 2011-09-17 12:59:37 -06:00
Eric Stokes f9481db5a6 Document WorldManager.java 2011-09-17 12:55:28 -06:00
Eric Stokes 1b42a25ccb Only set the velocity if a player did successfully teleport. Issue #72 2011-09-17 11:12:02 -06:00
Eric Stokes e3edcb88df Remove JDK 6 dependency 2011-09-17 10:05:01 -06:00
Eric Stokes bef22ba534 Add Per-Destination perms, Closes #61 2011-09-17 09:59:38 -06:00
Eric Stokes 10d6a7e1dc Add Documentation to MVDestination 2011-09-17 08:27:10 -06:00
Eric Stokes b39098a592 Move Mode to page 1: Closes #111, Fix nether imports not defaulting to 8: Closes #103. 2011-09-17 07:35:39 -06:00
Eric Stokes a2c6dad243 Remove my silly printlines 2011-09-16 19:18:36 -06:00
Eric Stokes b76da91013 Merge branch 'master' of github.com:Herocraft/Multiverse-Core 2011-09-16 18:35:22 -06:00
Eric Stokes e7f97a8ae7 Add new debugging 2011-09-16 18:35:17 -06:00
Rigby e792c338aa Fern's FAULT. 2011-09-16 11:19:52 +01:00
Rigby 133810550f Allow the per world Game Modes to not be enforced. 2011-09-16 10:11:30 +01:00
Eric Stokes 97168043ff Fix && should be ||, Allow Creative mode, Set all players in a world to a specific mode when it's changed 2011-09-14 20:06:03 -06:00
Tim Ekl 40c4ce0a37 Merge branch 'master' into gamemodes 2011-09-14 19:11:47 -04:00
Eric Stokes 318564ccf2 Add new CH and CH checks 2011-09-13 20:13:27 -06:00
Eric Stokes 9c1a9769b2 Update to new AllPay version 2011-09-13 19:54:06 -06:00
Eric Stokes 89ea09fba2 Minor changes
Update CommandHandler
Fix typo in Debug
Version now posts as a Multiverse user
2011-09-11 17:37:32 -06:00
Rigby 9384f96549 Getting ready for 1.8 GameModes.
This setup will allow different worlds to be setup under different gamemodes, it handles per player modes during teleportation to and from Worlds.
2011-09-09 12:25:21 +01:00
Rigby 69b143ada6 Believe this should be a set :). 2011-09-09 12:16:54 +01:00
Jeff Wardian a97b6f80d2 Fixed ArrayIndexOutofBounds on translateTempSpawn() 2011-09-02 16:26:36 -07:00
Eric Stokes ad47ce7d1b Add Bed Respawns back in! Thanks @Vaht 2011-09-01 19:18:56 -06:00
Eric Stokes d09d340e0f Fix "There are players in <Java Object>" 2011-08-31 21:05:53 -06:00
Eric Stokes 751ed5a8e8 Check for null creature types. Closes #83 2011-08-29 17:03:59 -06:00
Eric Stokes a0667d49b8 Fix our Custom PTA not obeying useSafeTeleporter 2011-08-25 19:42:52 -06:00
Eric Stokes 8c45d0b76a Exact destinations now don't use the safeTeleport check. Add API hook to allow this to be configurable per destination. 2011-08-25 19:31:46 -06:00
Eric Stokes 319567eb67 Fix the console spewing many many errors. Sorry. 2011-08-24 20:01:50 -06:00
Eric Stokes 7a38806134 Remove Additional Private Deprecations, Must keep methods until Portals 2.1 is out. 2011-08-24 19:05:20 -06:00
Eric Stokes b6755a1047 Return the Permission if it was created, or the old one if it existed. 2011-08-24 18:49:13 -06:00
Eric Stokes 69360a49ec Move World Functions to a new WorldManager. 2011-08-24 17:25:30 -06:00
Eric Stokes 3876c0f47f Remove prints. 2011-08-24 16:38:08 -06:00
Eric Stokes 5fe8f76c34 Add MVTeleportEvent back in. 2011-08-23 16:48:11 -06:00
Eric Stokes e556261e84 Small changes to BlockSafety for MVPortals, Remove hard spout dependency for real this time. Thanks @lithium3141 2011-08-22 19:53:00 -06:00
Eric Stokes 8d09c19988 Add the MVTravelAgent to Core since NetherPortals, Portals _and_ SignPortals use it. 2011-08-22 17:58:54 -06:00
Eric Stokes 4fd0150945 Add ability to query all generator plugins via /mv generators 2011-08-21 16:57:17 -06:00
Eric Stokes f96f3151f9 Allow you to set debug in the config. 2011-08-21 14:30:12 -06:00
Eric Stokes 047e0d8001 Remove hard Spout dependency. Sorry. Thanks Fetch! 2011-08-21 12:10:18 -06:00
Eric Stokes 5f88247810 More fixes to the new World Destinations that support pitch and yaw. 2011-08-21 11:38:01 -06:00
Eric Stokes d12725ca0e Deprecate 2 location methods in favor of using MVDestination instead of Location to preserver velocity. 2011-08-21 10:32:07 -06:00
Eric Stokes dc9f2fc360 Use DisplayName in mvwho Closes #62 2011-08-21 08:36:43 -06:00
Eric Stokes 2c865aa0ff Allow our own spawns to be more accurate, including decimal precision on XYZ and Pitch/Yaw.
We still set the spawn in the bukkit worlds to the inaccurate setting.
No migrator is included for this change, just do /mvss in game.
2011-08-21 08:34:07 -06:00
Eric Stokes f11f3dd88e Allow us to add permissions safely via the Permissions object. 2011-08-20 22:50:06 -06:00
Eric Stokes c503849107 Exposed getSafeLocation 2011-08-20 16:36:39 -06:00
Eric Stokes ce8b042919 Merge branch 'master' into development 2011-08-20 09:16:14 -06:00
Eric Stokes 92a762e5e4 Add MV Debug, Attempted fix for Portal teleportation fail, Water and Doors are now safe materials 2011-08-20 09:07:40 -06:00
Eric Stokes eb4f9700bc Made World Access by default OP. However, opfallback is still set to true by default 2011-08-19 16:48:55 -06:00
Eric Stokes 49e3a42550 Give an easy way of using cannons without portals
Behold: /mvtp cannon-2
2011-08-17 16:49:24 -06:00
Eric Stokes 1ab56096f8 Increment AllPay to 1.0.3 2011-08-16 18:32:05 -06:00
Eric Stokes afc388637f Update AllPay, Hopefully fix the BOSEcon bug 2011-08-16 18:02:43 -06:00
Eric Stokes 93fab486ff Add iCo 6 Support, update to AllPay 1.0.1 2011-08-15 20:53:16 -06:00
Eric Stokes e36210b99a Add spout tests 2011-08-13 14:58:43 -06:00
Eric Stokes f6299c60a0 Fix scale named scaling (thanks krinsdeath) 2011-08-11 18:28:45 -06:00
Eric Stokes 06bc0dea02 Fix not being able to set world scaling. (Thanks krinsdeath) Add pitch to mvcoord, add missing variables to mvinfo 2011-08-11 18:20:35 -06:00
Eric Stokes 11ce604938 Fix NPE when a world was not known by MV Thanks Rockstar04! 2011-08-10 19:35:48 -06:00
301 changed files with 25002 additions and 5876 deletions

No files matched your search

+77
View File
@@ -0,0 +1,77 @@
name: 🐛 Report a Bug
description: Report a problem with Multiverse-Core.
title: "[Bug]: "
labels: ["Bug: Unconfirmed"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
If you are having issues with other submodules of Multiverse, please go to their respective git repo:
Multiverse-Portals: https://github.com/Multiverse/Multiverse-Portals/issues/new/choose
Multiverse-NetherPortals: https://github.com/Multiverse/Multiverse-NetherPortals/issues/new/choose
Multiverse-Inventories: https://github.com/Multiverse/Multiverse-Inventories/issues/new/choose
Multiverse-SignPortals: https://github.com/Multiverse/Multiverse-SignPortals/issues/new/choose
Not sure if this is a bug with Multiverse-Core? Feel free to ask on our Discord server: https://discord.gg/NZtfKky
When completing the report, please ensure all fields are filled with the correct details requested. Failure to do so will result in your issue being closed.
- type: input
id: mutliverse-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.
validations:
required: true
- type: input
id: server-logs
attributes:
label: Server logs
description: >
Include full startup log and console error (if any). upload all relevant logs to either https://paste.gg
or https://gist.github.com, save and the paste the link in this box.
validations:
required: true
- type: textarea
id: server-version
attributes:
label: Server Version
description: Output of `/version` command.
placeholder: server version info
render: shell
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Bug Description
description: Describe in detail what the bug is about. Include the expected behaviour and actual behaviour.
placeholder: "Example: When running `/mv` it cause the server to crash..."
validations:
required: true
- type: textarea
id: reproduce-steps
attributes:
label: Steps to reproduce
description: Provide detailed intructions to trigger the bug.
placeholder: |
Example:
1. Start a server with only multiverse installed.
2. Run `/mv` command.
3. Players all get kicked with a "server closed" message.
...
validations:
required: true
- type: checkboxes
id: agreements
attributes:
label: Agreements
description: Ensure you have done the following being submitting this issue.
options:
- label: I have searched for and ensured there isn't already an open or resolved issue(s) regarding this.
required: true
- label: >
I was able to reproduce my issue on a freshly setup and up-to-date server with the latest
version of Multiverse plugins with no other plugins and with no kinds of other server or client mods.
required: true
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 💬 Multiverse Discord Server
url: https://discord.gg/NZtfKky
about: Need help with using Multiverse-Core or just want to chat with the devs? Join the Multiverse Discord Server for help!
@@ -0,0 +1,41 @@
name: 💡 Request a Feature
description: Suggest a feature you want to see in Multiverse-Core!
title: "[Idea]: "
labels: ["Type: Idea"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to share your ideas!
If you are look for other submodules of Multiverse, go to their respective git repo:
Multiverse-Portals: https://github.com/Multiverse/Multiverse-Portals/issues/new/choose
Multiverse-NetherPortals: https://github.com/Multiverse/Multiverse-NetherPortals/issues/new/choose
Multiverse-Inventories: https://github.com/Multiverse/Multiverse-Inventories/issues/new/choose
Multiverse-SignPortals: https://github.com/Multiverse/Multiverse-SignPortals/issues/new/choose
Not sure if your feature fits in Multiverse-Core? Feel free to ask on our Discord server: https://discord.gg/NZtfKky
- type: textarea
id: feature-description
attributes:
label: Describe the feature
description: What feature are you suggesting?
placeholder: "Example: I hope multiverse can implement random teleport feature..."
validations:
required: true
- type: textarea
id: feature-reasoning
attributes:
label: How is the feature useful to all Multiverse users?
description: How is the feature useful to all players, server owners and/or developers?
placeholder: "Example: Random teleporting can be integrated into many multiverse modules such as mv-portals..."
validations:
required: true
- type: checkboxes
id: agreements
attributes:
label: Agreements
description: Ensure you have done the following being submitting this issue.
options:
- label: I have searched for and ensured there isn't already an open issue regarding this.
required: true
+2
View File
@@ -0,0 +1,2 @@
prerelease:
- '*'
+38
View File
@@ -0,0 +1,38 @@
name: Create Release Version & Publish Package
on:
push:
branches: [dbo-test]
jobs:
dbo_upload_test:
runs-on: ubuntu-latest
steps:
- name: Download release artifact
id: release-artifact
uses: dsaltares/fetch-gh-release-asset@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
# version: tags/${{ github.event.inputs.version }}
regex: true
file: multiverse-core-(.*)\.jar
target: 'subdir/'
- name: Upload to dev.bukkit.org
uses: benwoo1110/dbo-upload-action@v0.1.0
with:
api_token: ${{ secrets.DBO_UPLOAD_API_TOKEN }}
project_id: 30765
changelog: ${{ steps.release-artifact.outputs.body }}
changelog_type: markdown
display_name: ${{ steps.release-artifact.outputs.version }}
game_versions: 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1
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 }}/subdir/multiverse-core-${{ steps.release-artifact.outputs.version }}.jar
debug: true
+17
View File
@@ -0,0 +1,17 @@
name: "Pull Request Labeler"
on:
pull_request_target:
types: [opened]
branches: [main]
jobs:
prerelease_labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
+90
View File
@@ -0,0 +1,90 @@
name: Manually promote last prerelease to release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to promote'
required: true
version-bump:
description: 'Version bump to apply - should usually match the version bump used for the prerelease since last release'
required: true
type: choice
options:
- 'patch'
- 'minor'
- 'major'
jobs:
manually_promote_release:
runs-on: ubuntu-latest
steps:
- name: Verify input version is prerelease
run: |
if [[ "${{ github.event.inputs.version }}" != *"pre"* ]]; then
echo "Version must be a prerelease"
exit 1
fi
- name: Get release info
id: get-release
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag: ${{ github.event.inputs.version }}
- uses: actions/checkout@v3
with:
ref: ${{ steps.get-release.outputs.tag_name }}
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Remove prerelease tag
run: |
echo "Removing prerelease tag from version"
echo "VERSION=$(echo ${{ steps.get-release.outputs.tag_name }} | sed -E 's/-pre.*//')" >> $GITHUB_ENV
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: clean build -x test -x checkstyleMain -x checkstyleTest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_VERSION: ${{ env.VERSION }}
- name: Create release
id: release
uses: Multiverse/release-on-push-action@skip_prs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bump_version_scheme: ${{ github.event.inputs.version-bump }}
tag_prefix: ''
release_name: "<RELEASE_VERSION>"
use_github_release_notes: true
ref: ${{ steps.get-release.outputs.target_commitish }}
skip_prs: true
- name: Publish package
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_VERSION: ${{ env.VERSION }}
- name: Upload release artifact
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/multiverse-core-${{ env.VERSION }}.jar
asset_name: multiverse-core-${{ steps.release.outputs.tag_name }}.jar
tag: ${{ steps.release.outputs.tag_name }}
+64
View File
@@ -0,0 +1,64 @@
name: Create Release Version & Publish Package
on:
push:
branches: [main]
jobs:
release_on_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Test & Build
uses: gradle/gradle-build-action@v2
with:
arguments: clean build -x assemble -x shadowJar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
id: release
uses: Multiverse/release-on-push-action@support_prerelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bump_version_scheme: norelease
tag_prefix: ''
release_name: "<RELEASE_VERSION>"
use_github_release_notes: true
- name: Modify version scheme
run: |
if [[ "${{ steps.release.outputs.tag_name }}" == *"pre"* ]]; then
echo "Replacing prerelease version scheme with SNAPSHOT"
echo "VERSION=$(echo ${{ steps.release.outputs.tag_name }} | sed -E 's/-pre.*/-SNAPSHOT/')" >> $GITHUB_ENV
else
echo "Using release version scheme"
echo "VERSION=${{ steps.release.outputs.tag_name }}" >> $GITHUB_ENV
fi
- name: Publish package
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
GITHUB_VERSION: ${{ env.VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release artifact
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/multiverse-core-${{ env.VERSION }}.jar
asset_name: multiverse-core-${{ steps.release.outputs.tag_name }}.jar
tag: ${{ steps.release.outputs.tag_name }}
+18
View File
@@ -0,0 +1,18 @@
name: Require PR Labels
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
branches: [main]
jobs:
require_label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
mode: exactly
count: 1
labels: "release:major, release:minor, release:patch, no version bump"
+36
View File
@@ -0,0 +1,36 @@
name: Run unit tests against all PRs
on:
pull_request:
types: [opened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
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 -x checkstyleMain -x checkstyleTest -x javadoc
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
+16 -1
View File
@@ -2,6 +2,7 @@
/.classpath
/.project
/.settings
/.checkstyle
# netbeans
/nbproject
@@ -11,6 +12,7 @@
# maven
/target
dependency-reduced-pom.xml
# vim
.*.sw[a-p]
@@ -30,4 +32,17 @@
*.iml
*.ipr
*.iws
.idea/
.idea/
# Fern's utils
uploadtoserver.sh
# Testing files:
debug.log
# Doxygen
/docs/html
debug.txt
# Gradle
.gradle
-7
View File
@@ -1,7 +0,0 @@
[submodule "lib/allpay"]
path = lib/allpay
url = git://github.com/FernFerret/AllPay.git
[submodule "lib/commandhandler"]
path = lib/commandhandler
url = git://github.com/PneumatiCraft/CommandHandler.git
branch = notrie
+6
View File
@@ -0,0 +1,6 @@
Copyright (c) 2011, The Multiverse Team All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the The Multiverse Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+42 -3
View File
@@ -1,5 +1,44 @@
Copyright (c) 2011, The Multiverse Team All rights reserved.
![Multiverse 2](config/multiverse2-long.png)
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
[![Maven CI/CD](https://github.com/Multiverse/Multiverse-Core/actions/workflows/build.yml/badge.svg)](https://github.com/Multiverse/Multiverse-Core/actions/workflows/build.yml)
[![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 me 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)
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the The Multiverse Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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!
<br><br>
Now it's time to create your very own Multiverse server, do check out our [Wiki](https://github.com/Multiverse/Multiverse-Core/wiki) and [Usage Guide](https://github.com/Multiverse/Multiverse-Core/wiki/Basics) to get started. Feel free to hop onto our [Discord](https://discord.gg/NZtfKky) if you have any question or just want to have a chat with us!
### Amazing sub-modules available:
* [Multiverse-NetherPortals](https://github.com/Multiverse/Multiverse-NetherPortals) -> Have separate nether and end worlds for each of your overworlds!
* [Multiverse-Portals](https://github.com/Multiverse/Multiverse-Portals) -> Make custom portals to go to any destination!
* [Multiverse-Inventories](https://github.com/Multiverse/Multiverse-Inventories) -> Have separated players stats and inventories per world or per group of worlds.
* [Multiverse-SignPortals](https://github.com/Multiverse/Multiverse-SignPortals) -> Signs as teleprompters!
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.
* 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)!
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!
License
=======
Multiverse-Core is licensed under BSD-3-Clause License. Please see [LICENSE.md](LICENSE.md) for more info.
+286
View File
@@ -0,0 +1,286 @@
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 "org.jetbrains.kotlin.jvm" version "1.8.10"
}
version = System.getenv('GITHUB_VERSION') ?: 'local'
group = 'com.onarandombox.multiversecore'
description = 'Multiverse-Core'
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
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 = 'https://repo.glaremasters.me/repository/towny/'
}
maven {
name = 'PlaceholderAPI'
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
}
}
configurations {
oldTestImplementation.extendsFrom implementation
oldTestRuntime.extendsFrom runtime
relocatedApi
compileClasspath.extendsFrom relocatedApi
runtimeClasspath.extendsFrom relocatedApi
testCompileClasspath.extendsFrom relocatedApi
testRuntimeClasspath.extendsFrom relocatedApi
oldTestCompileClasspath.extendsFrom relocatedApi
oldTestRuntimeClasspath.extendsFrom relocatedApi
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
// Economy
implementation('com.github.MilkBowl:VaultAPI:1.7.1') {
exclude group: 'org.bukkit', module: 'bukkit'
}
// PlaceholderAPI
implementation 'me.clip:placeholderapi:2.11.3'
// Command Framework
relocatedApi 'co.aikar:acf-paper:0.5.1-SNAPSHOT'
// Config
relocatedApi('me.main__.util:SerializationConfig:1.7') {
exclude group: 'org.bukkit', module: 'bukkit'
}
relocatedApi('io.github.townyadvanced.commentedconfiguration:CommentedConfiguration:1.0.1') {
exclude group: 'org.spigotmc', module: 'spigot-api'
}
// Utils
relocatedApi 'io.vavr:vavr:0.10.4'
relocatedApi 'org.glassfish.hk2:hk2-locator:3.0.3'
relocatedApi('com.dumptruckman.minecraft:Logging:1.1.1') {
exclude group: 'junit', module: 'junit'
}
relocatedApi 'de.themoep.idconverter:mappings:1.2-SNAPSHOT'
relocatedApi 'org.bstats:bstats-bukkit:2.2.1'
relocatedApi 'net.minidev:json-smart:2.4.8'
relocatedApi 'org.jetbrains:annotations:22.0.0'
relocatedApi 'io.papermc:paperlib:1.0.8'
// Tests
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:2.141.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'
// Old Tests
oldTestImplementation 'org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT'
oldTestImplementation('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'junit', module: 'junit'
}
oldTestImplementation 'junit:junit:4.13.1'
oldTestImplementation 'org.mockito:mockito-core:3.11.2'
oldTestImplementation 'commons-io:commons-io:2.7'
// Annotation Processors
annotationProcessor 'org.glassfish.hk2:hk2-metadata-generator:3.0.3'
testAnnotationProcessor 'org.glassfish.hk2:hk2-metadata-generator:3.0.3'
}
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)
}
}
sourceSets {
oldTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/old-test/java')
}
resources.srcDir file('src/old-test/resources')
}
}
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
}
tasks.withType(JavaCompile) {
configure(options) {
options.compilerArgs << '-Aorg.glassfish.hk2.metadata.location=META-INF/hk2-locator/Multiverse-Core'
}
}
compileKotlin {
// We're not using Kotlin in the plugin itself, just tests!
enabled = false
}
configurations.findAll { !it.name.startsWith('test') }.each {
it.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}
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 'co.aikar.commands', 'com.onarandombox.acf'
relocate 'com.dumptruckman.minecraft.util.Logging', 'com.onarandombox.MultiverseCore.utils.CoreLogging'
relocate 'com.dumptruckman.minecraft.util.DebugLog', 'com.onarandombox.MultiverseCore.utils.DebugFileLogger'
relocate 'de.themoep.idconverter', 'com.onarandombox.idconverter'
relocate 'io.github.townyadvanced.commentedconfiguration', 'com.onarandombox.commentedconfiguration'
relocate 'me.main__.util', 'com.onarandombox.serializationconfig'
relocate 'org.bstats', 'com.onarandombox.bstats'
relocate 'com.sun', 'com.onarandombox.sun'
relocate 'net.minidev', 'com.onarandombox.minidev'
relocate 'org.objectweb', 'com.onarandombox.objectweb'
relocate 'io.vavr', 'com.onarandombox.vavr'
relocate 'jakarta', 'com.onarandombox.jakarta'
relocate 'javassist', 'com.onarandombox.javassist'
relocate 'org.aopalliance', 'com.onarandombox.aopalliance'
relocate 'org.glassfish', 'com.onarandombox.glassfish'
relocate 'org.jvnet', 'com.onarandombox.jvnet'
relocate 'org.intellij', 'com.onarandombox.intellij'
relocate 'org.jetbrains', 'com.onarandombox.jetbrains'
relocate 'io.papermc.lib', 'com.onarandombox.paperlib'
configurations = [project.configurations.api, project.configurations.relocatedApi]
archiveFileName = "$baseName-$version.$extension"
dependencies {
exclude(dependency {
it.moduleGroup == 'org.jetbrains.kotlin'
})
}
}
build.dependsOn shadowJar
jar.enabled = false
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}
+1813
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

+141
View File
@@ -0,0 +1,141 @@
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ 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. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!-- Future reference: valid severity values are 'ignore', 'info', 'warning', 'error' -->
<module name="Checker">
<module name="JavadocPackage">
<property name="allowLegacy" value="true"/>
</module>
<module name="NewlineAtEndOfFile" />
<module name="Translation"/>
<module name="FileLength"/>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<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"/>
</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>
<module name="TreeWalker">
<!-- Make suppression possible -->
<module name="FileContentsHolder"/>
<!-- Actual checks -->
<module name="LineLength">
<property name="max" value="160"/>
<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>
<module name="JavadocType"/>
<module name="JavadocVariable">
<property name="scope" value="package"/><!-- We don't need javadoc for private variables -->
</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.commandsold,com.onarandombox.MultiverseCore.destination"/>
</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">
<property name="severity" value="info"/>
</module>
<module name="UpperEll"/>
<module name="Indentation"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
</module>
</module>
View File
Whitespace-only changes.
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored Executable
+244
View File
@@ -0,0 +1,244 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
Vendored
+92
View File
@@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
Submodule lib/allpay deleted from b6b450e8b6.
-160
View File
@@ -1,160 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.onarandombox.multiversecore</groupId>
<artifactId>Multiverse-Core</artifactId>
<version>2.0</version>
<name>Multiverse-Core</name>
<description>World Management Plugin</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.number>UNKNOWN</project.build.number>
</properties>
<repositories>
<repository>
<id>OnARandomBox</id>
<url>http://repo.onarandombox.com/artifactory/repo</url>
</repository>
</repositories>
<build>
<defaultGoal>clean package</defaultGoal>
<plugins>
<!-- Compiler -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- Build Helper - Additional Source Folders -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-wsdl-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/lib/allpay/src</source>
<source>${project.basedir}/lib/commandhandler/src</source>
<source>${project.basedir}/lib/commandhandler/lib/ShellParser/src</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
<version>1.3.8</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>target/classes/plugin.yml</file>
<replacements>
<replacement>
<token>maven-version-number</token>
<value>${project.version}-${project.build.number}</value>
</replacement>
</replacements>
</configuration>
</plugin>
<!-- Jar Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifestEntries>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Bukkit Dependency -->
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Bukkit Dependency -->
<!-- Start of Economy Dependencies -->
<dependency>
<groupId>cosine.boseconomy</groupId>
<artifactId>BOSEconomy</artifactId>
<version>0.6.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>fr.crafter.tickleman.RealShop</groupId>
<artifactId>RealShop</artifactId>
<version>0.63</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.iConomy</groupId>
<artifactId>iConomy</artifactId>
<version>5.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nijiko.coelho.iConomy</groupId>
<artifactId>iConomy</artifactId>
<version>4.65</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.earth2me.essentials</groupId>
<artifactId>Essentials</artifactId>
<version>2.4.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- End of Economy Dependencies -->
<!-- Start of Permissions Dependencies -->
<dependency>
<groupId>com.nijikokun.bukkit</groupId>
<artifactId>Permissions</artifactId>
<version>3.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
</dependency>
<!-- End of Permissions Dependencies -->
</dependencies>
</project>
+5
View File
@@ -0,0 +1,5 @@
/*
* This file was generated by the Gradle 'init' task.
*/
rootProject.name = 'multiverse-core'
@@ -0,0 +1,13 @@
package co.aikar.commands;
import org.bukkit.command.CommandSender;
/**
* Exists just so we can extend BukkitCommandIssuer since it has a package-private constructor.
*/
public abstract class OpenBukkitCommandIssuer extends BukkitCommandIssuer {
protected OpenBukkitCommandIssuer(BukkitCommandManager manager, CommandSender sender) {
super(manager, sender);
}
}
@@ -1,11 +0,0 @@
package com.onarandombox.MultiverseCore;
import java.util.logging.Level;
import org.bukkit.Server;
public interface LoggablePlugin {
public void log(Level level, String msg);
public Server getServer();
}
@@ -1,176 +0,0 @@
package com.onarandombox.MultiverseCore;
import java.util.List;
import java.util.logging.Level;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.nijiko.permissions.PermissionHandler;
import com.nijikokun.bukkit.Permissions.Permissions;
import com.onarandombox.utils.MVDestination;
import com.pneumaticraft.commandhandler.PermissionsInterface;
public class MVPermissions implements PermissionsInterface {
private MultiverseCore plugin;
private PermissionHandler permissions = null;
/**
* Constructor FTW
*
* @param plugin Pass along the Core Plugin.
*/
public MVPermissions(MultiverseCore plugin) {
this.plugin = plugin;
// We have to see if permissions was loaded before MV was
if (this.plugin.getServer().getPluginManager().getPlugin("Permissions") != null) {
this.setPermissions(((Permissions) this.plugin.getServer().getPluginManager().getPlugin("Permissions")).getHandler());
this.plugin.log(Level.INFO, "- Attached to Permissions");
}
}
/**
* Check if a Player can teleport to the Destination world from there current world.
*
* @param p
* @param w
* @return
*/
public Boolean canTravelFromWorld(Player p, MVWorld w) {
List<String> blackList = w.getWorldBlacklist();
boolean returnValue = true;
for (String s : blackList) {
if (s.equalsIgnoreCase(p.getWorld().getName())) {
returnValue = false;
break;
}
}
return returnValue;
}
public boolean canTravelFromLocation(Player teleporter, Location location) {
if (!this.plugin.isMVWorld(location.getWorld().getName())) {
return false;
}
return canTravelFromWorld(teleporter, this.plugin.getMVWorld(location.getWorld().getName()));
}
/**
* Check if the Player has the permissions to enter this world.
*
* @param p
* @param w
* @return
*/
public Boolean canEnterWorld(Player p, MVWorld w) {
return this.hasPermission(p, "multiverse.access." + w.getName(), false);
}
public Boolean canEnterLocation(Player p, Location l) {
if (l == null) {
return false;
}
String worldName = l.getWorld().getName();
if (!this.plugin.isMVWorld(worldName)) {
return false;
}
return this.hasPermission(p, "multiverse.access." + worldName, false);
}
public Boolean canEnterDestination(Player p, MVDestination d) {
if (d == null || d.getLocation(p) == null) {
return false;
}
String worldName = d.getLocation(p).getWorld().getName();
if (!this.plugin.isMVWorld(worldName)) {
return false;
}
if(!canEnterLocation(p, d.getLocation(p))) {
return false;
}
return this.hasPermission(p, d.getRequiredPermission(), false);
}
public void setPermissions(PermissionHandler handler) {
this.permissions = handler;
}
public boolean hasPermission(CommandSender sender, String node, boolean isOpRequired) {
if (!(sender instanceof Player)) {
return true;
}
// NO one can access a null permission (mainly used for destinations):w
if(node == null) {
return false;
}
// Everyone can access an empty permission
// Currently used for the PlayerDestination
if(node.equals("")) {
return true;
}
Player player = (Player) sender;
boolean opFallback = this.plugin.getConfig().getBoolean("opfallback", true);
if (this.permissions != null && this.permissions.has(player, node)) {
// If Permissions is enabled we check against them.
// this.plugin.log(Level.WARNING, "Allowed by P3/P2 ");
return true;
} else if (sender.hasPermission(node)) {
// If Now check the bukkit permissions
// this.plugin.log(Level.WARNING, "Allowed by BukkitPerms");
return true;
} else if (player.isOp() && opFallback) {
// If Player is Op we always let them use it if they have the fallback enabled!
// this.plugin.log(Level.WARNING, "Allowed by OP");
return true;
}
// If the Player doesn't have Permissions and isn't an Op then
// we return true if OP is not required, otherwise we return false
// This allows us to act as a default permission guidance
// If they have the op fallback disabled, NO commands will work without a permissions plugin.
return !isOpRequired && opFallback;
}
public String getType() {
String opsfallback = "";
if(this.plugin.getConfig().getBoolean("opfallback", true)) {
opsfallback = " WITH OPs.txt fallback";
}
if (this.permissions != null) {
return "Permissions " + this.plugin.getServer().getPluginManager().getPlugin("Permissions").getDescription().getVersion() + opsfallback;
}
return "Bukkit Permissions" + opsfallback;
}
public boolean hasAnyPermission(CommandSender sender, List<String> nodes, boolean isOpRequired) {
for (String node : nodes) {
if (this.hasPermission(sender, node, isOpRequired)) {
return true;
}
}
return false;
}
@Override
public boolean hasAllPermission(CommandSender sender, List<String> nodes, boolean isOpRequired) {
for (String node : nodes) {
if (!this.hasPermission(sender, node, isOpRequired)) {
return false;
}
}
return true;
}
}
@@ -1,96 +0,0 @@
package com.onarandombox.MultiverseCore;
import java.util.Date;
import org.bukkit.entity.Player;
import org.bukkit.util.config.Configuration;
public class MVPlayerSession {
private Player player; // Player holder, may be unnecessary.
private Long teleportLast = 0L; // Timestamp for the Players last Portal Teleportation.
private Long messageLast = 0L; // Timestamp for the Players last Alert Message.
// private Location bedSpawn;
//
// // Beds are 2 blocks, thus we need to store both places
// private Location bedA;
// private Location bedB;
private Configuration config; // Configuration file to find out Cooldown Timers.
public MVPlayerSession(Player player, Configuration config, MultiverseCore multiVerseCore) {
this.player = player;
this.config = config;
// this.bedSpawn = null;
}
/**
* Update the Teleport time.
*/
public void teleport() {
this.teleportLast = (new Date()).getTime();
}
/**
* Grab whether the cooldown on Portal use has expired or not.
*
* @return
*/
public boolean getTeleportable() {
Long time = (new Date()).getTime();
if ((time - this.teleportLast) > this.config.getInt("portalcooldown", 5000)) {
return true;
} else {
return false;
}
}
/**
* Send a Message to the Player as long as enough time has passed since the last message.
*
* @param msg
*/
public void message(String msg) {
Long time = (new Date()).getTime();
if ((time - this.messageLast) > this.config.getInt("messagecooldown", 2000)) {
this.player.sendMessage(msg);
this.messageLast = time;
}
}
// Commented out bed code, i'll get rid of it soon.
// --FF
// public void setRespawnLocation(Location location) {
// this.bedSpawn = location;
// }
// // This one simply spawns the player closer to the bed.
// public Location getBedRespawnLocation() {
// // There is a bedrespawn set
// if (this.bedSpawn != null) {
// if (!this.bs.playerCanSpawnHereSafely(this.bedSpawn) || !bedStillExists(this.bedSpawn)) {
// this.bedSpawn = null;
// return this.bedSpawn;
// }
// Location actualRespawn = this.bedSpawn;
// Location bedRespawn = new Location(actualRespawn.getWorld(), actualRespawn.getX(), actualRespawn.getY(), actualRespawn.getZ());
// bedRespawn.setY(bedRespawn.getY() - .25);
// return bedRespawn;
// }
// return null;
// }
//
// private boolean bedStillExists(Location bedSpawn) {
// //System.out.print("Dangers:");
// //this.bs.showDangers(bedSpawn);
// Location locationDown = new Location(bedSpawn.getWorld(), bedSpawn.getX(), bedSpawn.getY(), bedSpawn.getZ());
// locationDown.setY(locationDown.getY() - 1);
// if (locationDown.getBlock().getType() != Material.BED_BLOCK) {
// return false;
// }
// return true;
// }
}
@@ -1,7 +0,0 @@
package com.onarandombox.MultiverseCore;
public interface MVPlugin extends LoggablePlugin {
public String dumpVersionInfo(String buffer);
public MultiverseCore getCore();
public void setCore(MultiverseCore core);
}
@@ -1,216 +0,0 @@
package com.onarandombox.MultiverseCore;
import java.util.logging.Level;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Minecart;
import org.bukkit.entity.Player;
import org.bukkit.entity.Vehicle;
import com.onarandombox.utils.BlockSafety;
public class MVTeleport {
MultiverseCore plugin;
BlockSafety bs = new BlockSafety();
public MVTeleport(MultiverseCore plugin) {
this.plugin = plugin;
}
/**
* This method will be specific to beds, and check on top of the bed then around it.
*
* @return
*/
public Location getSafeBedDestination(Location bedLocation) {
// System.out.print(bedLocation);
Location idealLocation = bedLocation;
idealLocation.setY(idealLocation.getY() + 1);
idealLocation.setX(idealLocation.getX() + .5);
idealLocation.setZ(idealLocation.getZ() + .5);
// System.out.print(idealLocation);
if (this.bs.playerCanSpawnHereSafely(idealLocation)) {
// System.out.print(idealLocation);
return bedLocation;
}
return null;
}
private Location getSafeLocation(Location l) {
// Check around the player first in a configurable radius:
// TODO: Make this configurable
Location safe = checkAboveAndBelowLocation(l, 6, 9);
if (safe != null) {
safe.setX(safe.getBlockX() + .5);
safe.setZ(safe.getBlockZ() + .5);
}
return safe;
}
private Location checkAboveAndBelowLocation(Location l, int tolerance, int radius) {
// Tolerance must be an even number:
if (tolerance % 2 != 0) {
tolerance += 1;
}
// We want half of it, so we can go up and down
tolerance /= 2;
// For now this will just do a straight up block.
Location locToCheck = l.clone();
// Check the main level
Location safe = this.checkAroundLocation(locToCheck, radius);
if (safe != null) {
return safe;
}
// We've already checked zero right above this.
int currentLevel = 1;
while (currentLevel <= tolerance) {
// Check above
locToCheck = l.clone();
locToCheck.add(0, currentLevel, 0);
safe = this.checkAroundLocation(locToCheck, radius);
if (safe != null) {
return safe;
}
// Check below
locToCheck = l.clone();
locToCheck.subtract(0, currentLevel, 0);
safe = this.checkAroundLocation(locToCheck, radius);
if (safe != null) {
return safe;
}
currentLevel++;
}
return null;
}
/**
* For my crappy algorithm, radius MUST be odd
*
* @param l
* @param radius
* @return
*/
private Location checkAroundLocation(Location l, int diameter) {
if (diameter % 2 == 0) {
diameter += 1;
}
Location checkLoc = l.clone();
// Start at 3, the min diameter around a block
int loopcounter = 3;
while (loopcounter <= diameter) {
boolean foundSafeArea = checkAroundSpecificDiameter(checkLoc, loopcounter);
// If a safe area was found:
if (foundSafeArea) {
// Return the checkLoc, it is the safe location.
return checkLoc;
}
// Otherwise, let's reset our location
checkLoc = l.clone();
// And increment the radius
loopcounter += 2;
}
return null;
}
private boolean checkAroundSpecificDiameter(Location checkLoc, int circle) {
// Adjust the circle to get how many blocks to step out.
// A radius of 3 makes the block step 1
// A radius of 5 makes the block step 2
// A radius of 7 makes the block step 3
// ...
int adjustedCircle = ((circle - 1) / 2);
checkLoc.add(adjustedCircle, 0, 0);
if (this.bs.playerCanSpawnHereSafely(checkLoc)) {
return true;
}
// Now we go to the right that adjustedCircle many
for (int i = 0; i < adjustedCircle; i++) {
checkLoc.add(0, 0, 1);
if (this.bs.playerCanSpawnHereSafely(checkLoc)) {
return true;
}
}
// Then down adjustedCircle *2
for (int i = 0; i < adjustedCircle * 2; i++) {
checkLoc.add(-1, 0, 0);
if (this.bs.playerCanSpawnHereSafely(checkLoc)) {
return true;
}
}
// Then left adjustedCircle *2
for (int i = 0; i < adjustedCircle * 2; i++) {
checkLoc.add(0, 0, -1);
if (this.bs.playerCanSpawnHereSafely(checkLoc)) {
return true;
}
}
// Then up Then left adjustedCircle *2
for (int i = 0; i < adjustedCircle * 2; i++) {
checkLoc.add(1, 0, 0);
if (this.bs.playerCanSpawnHereSafely(checkLoc)) {
return true;
}
}
// Then finish up by doing adjustedCircle - 1
for (int i = 0; i < adjustedCircle - 1; i++) {
checkLoc.add(0, 0, 1);
if (this.bs.playerCanSpawnHereSafely(checkLoc)) {
return true;
}
}
return false;
}
public boolean safelyTeleport(Entity e, Location l) {
if (this.bs.playerCanSpawnHereSafely(l)) {
e.teleport(l);
//this.plugin.log(Level.WARNING, "The first location you gave me was safe.");
return true;
}
if(e instanceof Minecart) {
Minecart m = (Minecart)e;
if(!this.bs.canSpawnCartSafely(m)) {
return false;
}
}
else if(e instanceof Vehicle) {
Vehicle v = (Vehicle)e;
if(!this.bs.canSpawnVehicleSafely(v)) {
return false;
}
}
Location safeLocation = this.getSafeLocation(l);
if (safeLocation != null) {
// Add offset to account for a vehicle on dry land!
if (!this.bs.isEntitiyOnTrack(e, safeLocation)) {
safeLocation.setY(safeLocation.getBlockY() + .5);
}
e.teleport(safeLocation);
//this.plugin.log(Level.WARNING, "Had to look for a bit, but I found a safe place for ya!");
return true;
}
if (e instanceof Player) {
Player p = (Player) e;
p.sendMessage("No safe locations found!");
}
else if (e.getPassenger() instanceof Player) {
Player p = (Player) e.getPassenger();
p.sendMessage("No safe locations found!");
}
this.plugin.log(Level.WARNING, "Sorry champ, you're basically trying to teleport into a minefield. I should just kill you now.");
return false;
}
}
@@ -1,645 +0,0 @@
package com.onarandombox.MultiverseCore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import org.bukkit.util.config.Configuration;
enum EnglishChatColor {
AQUA("AQUA", ChatColor.AQUA),
BLACK("BLACK", ChatColor.BLACK),
BLUE("BLUE", ChatColor.BLUE),
DARKAQUA("DARKAQUA", ChatColor.DARK_AQUA),
DARKBLUE("DARKBLUE", ChatColor.DARK_BLUE),
DARKGRAY("DARKGRAY", ChatColor.DARK_GRAY),
DARKGREEN("DARKGREEN", ChatColor.DARK_GREEN),
DARKPURPLE("DARKPURPLE", ChatColor.DARK_PURPLE),
DARKRED("DARKRED", ChatColor.DARK_RED),
GOLD("GOLD", ChatColor.GOLD),
GRAY("GRAY", ChatColor.GRAY),
GREEN("GREEN", ChatColor.GREEN),
LIGHTPURPLE("LIGHTPURPLE", ChatColor.LIGHT_PURPLE),
RED("RED", ChatColor.RED),
YELLOW("YELLOW", ChatColor.YELLOW),
WHITE("WHITE", ChatColor.WHITE);
private ChatColor color;
private String text;
EnglishChatColor(String name, ChatColor color) {
this.color = color;
this.text = name;
}
public String getText() {
return this.text;
}
public ChatColor getColor() {
return this.color;
}
public static EnglishChatColor fromString(String text) {
if (text != null) {
for (EnglishChatColor c : EnglishChatColor.values()) {
if (text.equalsIgnoreCase(c.text)) {
return c;
}
}
}
return EnglishChatColor.WHITE;
}
}
public class MVWorld {
private MultiverseCore plugin; // Hold the Plugin Instance.
private Configuration config; // Hold the Configuration File.
private World world; // The World Instance.
private Environment environment; // Hold the Environment type EG Environment.NETHER / Environment.NORMAL
private Long seed;
private String name; // The Worlds Name, EG its folder name.
private String alias = ""; // Short Alias for the World, this will be used in Chat Prefixes.
private ChatColor aliasColor; // Color for this world
private boolean allowAnimals; // Does this World allow Animals to Spawn?
private boolean allowMonsters; // Does this World allow Monsters to Spawn?
private boolean keepSpawnInMemory; // Does the World have the spawn loaded all the time?
private Boolean pvp; // Does this World allow PVP?
private Boolean fakepvp; // Should this world have fakePVP on? (used for PVP zones)
private String respawnWorld; // Contains the name of the World to respawn the player to
private List<Integer> blockBlacklist; // Contain a list of Blocks which we won't allow on this World.
private HashMap<String, List<String>> masterList;
private Double scaling; // How stretched/compressed distances are
private Double price; // How much does it cost to enter this world
private int currency = -1; // What is the currency
/**
* The generator as a string. This is used only for reporting. ex: BukkitFullOfMoon:GenID
*/
private String generator;
private Permission permission;
private Permission exempt;
private boolean canSave = false; // Prevents all the setters from constantly saving to the config when being called from the constructor.
private boolean allowWeather;
public MVWorld(World world, Configuration config, MultiverseCore instance, Long seed, String generatorString) {
this.config = config;
this.plugin = instance;
// Set local values that CANNOT be changed by user
this.world = world;
this.name = world.getName();
this.generator = generatorString;
this.seed = seed;
this.environment = world.getEnvironment();
// Initialize our lists
this.initLists();
// Write these files to the config (once it's saved)
if (generatorString != null) {
config.setProperty("worlds." + this.name + ".generator", this.generator);
}
if (seed != null) {
config.setProperty("worlds." + this.name + ".seed", this.seed);
}
config.setProperty("worlds." + this.name + ".environment", this.environment.toString());
// Set local values that CAN be changed by the user
this.setAlias(config.getString("worlds." + this.name + ".alias.name", ""));
this.setAliasColor(config.getString("worlds." + this.name + ".alias.color", ChatColor.WHITE.toString()));
this.setPvp(config.getBoolean("worlds." + this.name + ".pvp", true));
this.setScaling(config.getDouble("worlds." + this.name + ".scale", 1.0));
this.setRespawnToWorld(config.getString("worlds." + this.name + ".respawnworld", ""));
this.setEnableWeather(config.getBoolean("worlds." + this.name + ".allowweather", true));
this.setAnimals(config.getBoolean("worlds." + this.name + ".animals.spawn", true));
this.setMonsters(config.getBoolean("worlds." + this.name + ".monsters.spawn", true));
this.setPrice(config.getDouble("worlds." + this.name + ".entryfee.amount", 0.0));
this.setCurrency(config.getInt("worlds." + this.name + ".entryfee.currency", -1));
this.getMobExceptions();
this.setSpawnInMemory(config.getBoolean("worlds." + this.name + ".keepspawninmemory", true));
this.getWorldBlacklist().addAll(config.getStringList("worlds." + this.name + ".worldblacklist", new ArrayList<String>()));
this.getBlockBlacklist().addAll(config.getIntList("worlds." + this.name + ".blockblacklist", new ArrayList<Integer>()));
this.translateTempSpawn(config);
this.canSave = true;
saveConfig();
this.permission = new Permission("multiverse.access." + this.getName(), "Allows access to " + this.getName(), PermissionDefault.TRUE);
this.exempt = new Permission("multiverse.exempt." + this.getName(), "A player who has this does not pay to enter this world, or use any MV portals in it " + this.getName(), PermissionDefault.OP);
try {
this.plugin.getServer().getPluginManager().addPermission(this.permission);
this.plugin.getServer().getPluginManager().addPermission(this.exempt);
addToUpperLists(this.permission);
} catch (IllegalArgumentException e) {
}
}
private void setEnableWeather(boolean weather) {
this.allowWeather = weather;
// Disable any current weather
if (!weather) {
this.getCBWorld().setStorm(false);
this.getCBWorld().setThundering(false);
}
this.config.setProperty("worlds." + this.name + ".allowweather", weather);
saveConfig();
}
private void addToUpperLists(Permission permission) {
Permission all = this.plugin.getServer().getPluginManager().getPermission("multiverse.*");
Permission allWorlds = this.plugin.getServer().getPluginManager().getPermission("multiverse.access.*");
Permission allExemption = this.plugin.getServer().getPluginManager().getPermission("multiverse.exempt.*");
if (allWorlds == null) {
allWorlds = new Permission("multiverse.access.*");
this.plugin.getServer().getPluginManager().addPermission(allWorlds);
}
allWorlds.getChildren().put(permission.getName(), true);
if (allExemption == null) {
allExemption = new Permission("multiverse.exempt.*");
this.plugin.getServer().getPluginManager().addPermission(allExemption);
}
allExemption.getChildren().put(this.exempt.getName(), true);
if (all == null) {
all = new Permission("multiverse.*");
this.plugin.getServer().getPluginManager().addPermission(all);
}
all.getChildren().put("multiverse.access.*", true);
all.getChildren().put("multiverse.exempt.*", true);
this.plugin.getServer().getPluginManager().recalculatePermissionDefaults(all);
this.plugin.getServer().getPluginManager().recalculatePermissionDefaults(allWorlds);
}
private void translateTempSpawn(Configuration config) {
String tempspawn = config.getString("worlds." + this.name + ".tempspawn", "");
if (tempspawn.length() > 0) {
String[] coordsString = tempspawn.split(":");
if (coordsString.length >= 3) {
int[] coords = new int[3];
try {
for (int i = 0; i < 3; i++) {
coords[i] = Integer.parseInt(coordsString[i]);
}
this.world.setSpawnLocation(coords[0], coords[1], coords[2]);
} catch (NumberFormatException e) {
this.plugin.log(Level.WARNING, "A MV1 spawn value was found, but it could not be migrated. Format Error. Sorry.");
}
} else {
this.plugin.log(Level.WARNING, "A MV1 spawn value was found, but it could not be migrated. Format Error. Sorry.");
}
this.config.removeProperty("worlds." + this.name + ".tempspawn");
}
}
public String getColoredWorldString() {
ChatColor color = this.getAliasColor();
if (color == null) {
if (this.environment == Environment.NETHER) {
color = ChatColor.RED;
} else if (this.environment == Environment.NORMAL) {
color = ChatColor.GREEN;
} else if (this.environment == Environment.SKYLANDS) {
color = ChatColor.AQUA;
}
}
return this.getAliasColor() + this.getAlias() + ChatColor.WHITE;
}
private void getMobExceptions() {
List<String> temp;
temp = this.config.getStringList("worlds." + this.name + ".animals.exceptions", new ArrayList<String>());
// Add Animals to the exclusion list
for (String s : temp) {
this.masterList.get("animals").add(s.toUpperCase());
}
temp = this.config.getStringList("worlds." + this.name + ".monsters.exceptions", new ArrayList<String>());
// Add Monsters to the exclusion list
for (String s : temp) {
this.masterList.get("monsters").add(s.toUpperCase());
}
}
public World getCBWorld() {
return this.world;
}
private void initLists() {
this.masterList = new HashMap<String, List<String>>();
this.blockBlacklist = new ArrayList<Integer>();
// Only int list, we don't need to add it to the masterlist
this.masterList.put("worldblacklist", new ArrayList<String>());
this.masterList.put("animals", new ArrayList<String>());
this.masterList.put("monsters", new ArrayList<String>());
}
public boolean clearVariable(String property) {
if (property.equalsIgnoreCase("blockblacklist")) {
this.blockBlacklist.clear();
} else if (this.masterList.keySet().contains(property)) {
this.masterList.get(property).clear();
} else {
return false;
}
this.config.setProperty("worlds." + this.name + "." + property.toLowerCase(), this.blockBlacklist);
this.saveConfig();
return true;
}
public boolean addToList(String list, String value) {
if (list.equalsIgnoreCase("blockblacklist")) {
try {
int intVal = Integer.parseInt(value);
return addToList(list, intVal);
} catch (Exception e) {
}
} else if (this.masterList.keySet().contains(list)) {
if (list.equalsIgnoreCase("animals") || list.equalsIgnoreCase("monsters")) {
this.masterList.get(list).add(value.toUpperCase());
this.config.setProperty("worlds." + this.name + "." + list.toLowerCase() + ".exceptions", this.masterList.get(list));
this.syncMobs();
} else {
this.masterList.get(list).add(value);
this.config.setProperty("worlds." + this.name + "." + list.toLowerCase(), this.masterList.get(list));
}
saveConfig();
return true;
}
return false;
}
public boolean removeFromList(String list, String value) {
if (list.equalsIgnoreCase("blockblacklist")) {
try {
int intVal = Integer.parseInt(value);
return removeFromList(list, intVal);
} catch (Exception e) {
}
}
if (this.masterList.keySet().contains(list)) {
if (list.equalsIgnoreCase("animals") || list.equalsIgnoreCase("monsters")) {
this.masterList.get(list).remove(value.toUpperCase());
this.config.setProperty("worlds." + this.name + "." + list.toLowerCase() + ".exceptions", this.masterList.get(list));
this.syncMobs();
} else {
this.masterList.get(list).remove(value);
this.config.setProperty("worlds." + this.name + "." + list.toLowerCase(), this.masterList.get(list));
}
saveConfig();
return true;
}
return false;
}
private void syncMobs() {
if (this.getAnimalList().isEmpty()) {
this.world.setSpawnFlags(this.world.getAllowMonsters(), this.allowAnimals);
} else {
this.world.setSpawnFlags(this.world.getAllowMonsters(), true);
}
if (this.getMonsterList().isEmpty()) {
this.world.setSpawnFlags(this.allowMonsters, this.world.getAllowAnimals());
} else {
this.world.setSpawnFlags(true, this.world.getAllowAnimals());
}
this.plugin.getWorldPurger().purgeWorld(null, this);
}
private boolean addToList(String list, Integer value) {
if (list.equalsIgnoreCase("blockblacklist")) {
this.blockBlacklist.add(value);
this.config.setProperty("worlds." + this.name + ".blockblacklist", this.blockBlacklist);
saveConfig();
}
return false;
}
private boolean removeFromList(String list, Integer value) {
if (list.equalsIgnoreCase("blockblacklist")) {
this.blockBlacklist.remove(value);
this.config.setProperty("worlds." + this.name + ".blockblacklist", this.blockBlacklist);
saveConfig();
}
return false;
}
private boolean setVariable(String name, boolean value) {
if (name.equalsIgnoreCase("pvp")) {
this.setPvp(value);
} else if (name.equalsIgnoreCase("animals")) {
this.setAnimals(value);
} else if (name.equalsIgnoreCase("monsters")) {
this.setMonsters(value);
} else if (name.equalsIgnoreCase("memory") || name.equalsIgnoreCase("spawnmemory")) {
this.setSpawnInMemory(value);
} else if (name.equalsIgnoreCase("weather") || name.equalsIgnoreCase("storm")) {
this.setEnableWeather(value);
} else {
return false;
}
return true;
}
private void setSpawnInMemory(boolean value) {
this.world.setKeepSpawnInMemory(value);
this.keepSpawnInMemory = value;
this.config.setProperty("worlds." + this.name + ".keepspawninmemory", value);
saveConfig();
}
private boolean setVariable(String name, double value) {
if (name.equalsIgnoreCase("scaling") || name.equalsIgnoreCase("scale")) {
this.setScaling(value);
return true;
}
if (name.equalsIgnoreCase("price")) {
this.setPrice(value);
return true;
}
return false;
}
/**
* This is the one people have access to. It'll handle the rest.
*
* @param name
* @param value
* @return
*/
public boolean setVariable(String name, String value) {
if (name.equalsIgnoreCase("alias")) {
this.setAlias(value);
return true;
}
if (name.equalsIgnoreCase("respawn")) {
this.setRespawnToWorld(value);
return true;
}
if (name.equalsIgnoreCase("aliascolor") || name.equalsIgnoreCase("color")) {
this.setAliasColor(value);
return true;
}
if (name.equalsIgnoreCase("currency") || name.equalsIgnoreCase("curr")) {
try {
int intValue = Integer.parseInt(value);
this.setCurrency(intValue);
return true;
} catch (Exception e) {
}
}
if (name.equalsIgnoreCase("price")) {
try {
double doubValue = Double.parseDouble(value);
return this.setPrice(doubValue);
} catch (Exception e) {
}
}
try {
boolean boolValue = Boolean.parseBoolean(value);
return this.setVariable(name, boolValue);
} catch (Exception e) {
}
try {
double doubValue = Double.parseDouble(value);
return this.setVariable(name, doubValue);
} catch (Exception e) {
}
return false;
}
public Environment getEnvironment() {
return this.environment;
}
public void setEnvironment(Environment environment) {
this.environment = environment;
}
public Long getSeed() {
return this.seed;
}
public void setSeed(Long seed) {
this.seed = seed;
}
public String getName() {
return this.name;
}
public String getAlias() {
if (this.alias == null || this.alias.length() == 0) {
return this.name;
}
return this.alias;
}
public void setAlias(String alias) {
this.alias = alias;
this.config.setProperty("worlds." + this.name + ".alias.name", alias);
saveConfig();
}
public Boolean allowAnimalSpawning() {
return this.allowAnimals;
}
private void setAnimals(Boolean animals) {
this.allowAnimals = animals;
// If animals are a boolean, then we can turn them on or off on the server
// If there are ANY exceptions, there will be something spawning, so turn them on
this.config.setProperty("worlds." + this.name + ".animals.spawn", animals);
saveConfig();
this.syncMobs();
}
public List<String> getAnimalList() {
return this.masterList.get("animals");
}
public Boolean allowMonsterSpawning() {
return this.allowMonsters;
}
private void setMonsters(Boolean monsters) {
this.allowMonsters = monsters;
// If monsters are a boolean, then we can turn them on or off on the server
// If there are ANY exceptions, there will be something spawning, so turn them on
this.config.setProperty("worlds." + this.name + ".monsters.spawn", monsters);
saveConfig();
this.syncMobs();
}
public List<String> getMonsterList() {
return this.masterList.get("monsters");
}
public Boolean getPvp() {
return this.pvp;
}
public void setPvp(Boolean pvp) {
this.fakepvp = this.plugin.getConfig().getBoolean("fakepvp", false);
if (this.fakepvp) {
this.world.setPVP(true);
} else {
this.world.setPVP(pvp);
}
this.pvp = pvp;
this.config.setProperty("worlds." + this.name + ".pvp", pvp);
saveConfig();
}
public List<Integer> getBlockBlacklist() {
return this.blockBlacklist;
}
public List<String> getWorldBlacklist() {
return this.masterList.get("worldblacklist");
}
public Double getScaling() {
return this.scaling;
}
public void setScaling(Double scaling) {
if (scaling <= 0) {
// Disallow negative or 0 scalings.
scaling = 1.0;
}
this.scaling = scaling;
this.config.setProperty("worlds." + this.name + ".scaling", scaling);
saveConfig();
}
/**
* Sets the chat color from a string.
*
* @param aliasColor
*/
public void setAliasColor(String aliasColor) {
EnglishChatColor color = EnglishChatColor.fromString(aliasColor);
if (color == null) {
color = EnglishChatColor.WHITE;
}
this.aliasColor = color.getColor();
this.config.setProperty("worlds." + this.name + ".alias.color", color.getText());
saveConfig();
return;
}
public boolean isValidAliasColor(String aliasColor) {
return (EnglishChatColor.fromString(aliasColor) != null);
}
public ChatColor getAliasColor() {
return this.aliasColor;
}
public boolean clearList(String property) {
if (property.equalsIgnoreCase("blockblacklist")) {
this.blockBlacklist.clear();
this.config.setProperty("worlds." + this.name + ".blockblacklist", this.blockBlacklist);
saveConfig();
return true;
} else if (this.masterList.containsKey(property)) {
this.masterList.get(property).clear();
this.config.setProperty("worlds." + this.name + "." + property.toLowerCase(), this.masterList.get(property));
this.syncMobs();
saveConfig();
return true;
}
return false;
}
public boolean getFakePVP() {
return this.fakepvp;
}
public String getRespawnToWorld() {
return this.respawnWorld;
}
public void setRespawnToWorld(String respawnToWorld) {
this.respawnWorld = respawnToWorld;
this.config.setProperty("worlds." + this.name + ".respawnworld", respawnToWorld);
saveConfig();
}
public Permission getPermission() {
return this.permission;
}
public int getCurrency() {
return this.currency;
}
public double getPrice() {
return this.price;
}
private boolean setCurrency(int currency) {
this.currency = currency;
config.getInt("worlds." + this.name + ".entryfee.currency", currency);
saveConfig();
return true;
}
private boolean setPrice(double price) {
this.price = price;
config.setProperty("worlds." + this.name + ".entryfee.amount", price);
saveConfig();
return true;
}
public boolean isExempt(Player p) {
return (this.plugin.getPermissions().hasPermission(p, this.exempt.getName(), true));
}
public Permission getExempt() {
return this.exempt;
}
private void saveConfig() {
if (this.canSave) {
this.config.save();
}
}
public boolean getWeatherEnabled() {
return this.allowWeather;
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,18 @@
package com.onarandombox.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVCore;
import com.onarandombox.MultiverseCore.inject.binder.JavaPluginBinder;
import org.glassfish.hk2.utilities.binding.ScopedBindingBuilder;
import org.jetbrains.annotations.NotNull;
class MultiverseCorePluginBinder extends JavaPluginBinder<MultiverseCore> {
protected MultiverseCorePluginBinder(@NotNull MultiverseCore plugin) {
super(plugin);
}
@Override
protected ScopedBindingBuilder<MultiverseCore> bindPluginClass(ScopedBindingBuilder<MultiverseCore> bindingBuilder) {
return super.bindPluginClass(bindingBuilder).to(MVCore.class).to(MultiverseCore.class);
}
}
@@ -0,0 +1,188 @@
/******************************************************************************
* 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.anchor;
import com.dumptruckman.minecraft.util.Logging;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.LocationManipulation;
import com.onarandombox.MultiverseCore.config.MVCoreConfig;
import jakarta.inject.Inject;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.jvnet.hk2.annotations.Service;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* Manages anchors.
*/
@Service
public class AnchorManager {
private Map<String, Location> anchors;
private FileConfiguration anchorConfig;
private final Plugin plugin;
private final LocationManipulation locationManipulation;
private final MVCoreConfig config;
@Inject
public AnchorManager(
MultiverseCore plugin,
LocationManipulation locationManipulation,
MVCoreConfig config
) {
this.plugin = plugin;
this.locationManipulation = locationManipulation;
this.config = config;
this.anchors = new HashMap<String, Location>();
}
/**
* Loads all anchors.
*/
public void loadAnchors() {
this.anchors = new HashMap<String, Location>();
this.anchorConfig = YamlConfiguration.loadConfiguration(new File(this.plugin.getDataFolder(), "anchors.yml"));
this.ensureConfigIsPrepared();
ConfigurationSection anchorsSection = this.anchorConfig.getConfigurationSection("anchors");
Set<String> anchorKeys = anchorsSection.getKeys(false);
for (String key : anchorKeys) {
//world:x,y,z:pitch:yaw
Location anchorLocation = this.locationManipulation.stringToLocation(anchorsSection.getString(key, ""));
if (anchorLocation != null) {
Logging.config("Loading anchor: '%s'...", key);
this.anchors.put(key, anchorLocation);
} else {
Logging.warning("The location for anchor '%s' is INVALID.", key);
}
}
}
private void ensureConfigIsPrepared() {
if (this.anchorConfig.getConfigurationSection("anchors") == null) {
this.anchorConfig.createSection("anchors");
}
}
/**
* Saves all anchors.
* @return True if all anchors were successfully saved.
*/
public boolean saveAnchors() {
try {
this.anchorConfig.save(new File(this.plugin.getDataFolder(), "anchors.yml"));
return true;
} catch (IOException e) {
Logging.severe("Failed to save anchors.yml. Please check your file permissions.");
return false;
}
}
/**
* Gets the {@link Location} associated with an anchor.
* @param anchor The name of the anchor.
* @return The {@link Location}.
*/
public Location getAnchorLocation(String anchor) {
if (this.anchors.containsKey(anchor)) {
return this.anchors.get(anchor);
}
return null;
}
/**
* Saves an anchor.
* @param anchor The name of the anchor.
* @param location The location of the anchor as string.
* @return True if the anchor was successfully saved.
*/
public boolean saveAnchorLocation(String anchor, String location) {
Location parsed = this.locationManipulation.stringToLocation(location);
return parsed != null && this.saveAnchorLocation(anchor, parsed);
}
/**
* Saves an anchor.
* @param anchor The name of the anchor.
* @param l The {@link Location} of the anchor.
* @return True if the anchor was successfully saved.
*/
public boolean saveAnchorLocation(String anchor, Location l) {
if (l == null) {
return false;
}
this.anchorConfig.set("anchors." + anchor, this.locationManipulation.locationToString(l));
this.anchors.put(anchor, l);
return this.saveAnchors();
}
/**
* Gets all anchors.
* @return An unmodifiable {@link Set} containing all anchors.
*/
public Set<String> getAllAnchors() {
return Collections.unmodifiableSet(this.anchors.keySet());
}
/**
* Gets all anchors that the specified {@link Player} can access.
* @param p The {@link Player}.
* @return An unmodifiable {@link Set} containing all anchors the specified {@link Player} can access.
*/
public Set<String> getAnchors(Player p) {
if (p == null) {
return this.anchors.keySet();
}
Set<String> myAnchors = new HashSet<String>();
for (String anchor : this.anchors.keySet()) {
Location ancLoc = this.anchors.get(anchor);
if (ancLoc == null) {
continue;
}
String worldPerm = "multiverse.access." + ancLoc.getWorld().getName();
// Add to the list if we're not enforcing access
// OR
// We are enforcing access and the user has the permission.
if (!config.getEnforceAccess() ||
(config.getEnforceAccess() && p.hasPermission(worldPerm))) {
myAnchors.add(anchor);
} else {
Logging.finer(String.format("Not adding anchor %s to the list, user %s doesn't have the %s " +
"permission and 'enforceaccess' is enabled!",
anchor, p.getName(), worldPerm));
}
}
return Collections.unmodifiableSet(myAnchors);
}
/**
* Deletes the specified anchor.
* @param s The name of the anchor.
* @return True if the anchor was successfully deleted.
*/
public boolean deleteAnchor(String s) {
if (this.anchors.containsKey(s)) {
this.anchors.remove(s);
this.anchorConfig.set("anchors." + s, null);
return this.saveAnchors();
}
return false;
}
}
@@ -0,0 +1,4 @@
/**
* this package contains the classes that are used for the anchor system.
*/
package com.onarandombox.MultiverseCore.anchor;
@@ -0,0 +1,81 @@
package com.onarandombox.MultiverseCore.api;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Minecart;
import org.bukkit.entity.Vehicle;
import org.jvnet.hk2.annotations.Contract;
/**
* Used to get block/location-related information.
*/
@Contract
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);
}
@@ -0,0 +1,58 @@
package com.onarandombox.MultiverseCore.api;
import java.util.Collection;
import co.aikar.commands.BukkitCommandIssuer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jvnet.hk2.annotations.Contract;
@Contract
public interface Destination<T extends DestinationInstance> {
/**
* 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!</p>
*
* @return The identifier or prefix that is required for this destination.
*/
@NotNull String getIdentifier();
/**
* Returns the destination instance for the given destination parameters.
*
* @param destinationParams The destination parameters. ex: p:MyPortal:nw
* @return The destination instance, or null if the destination parameters are invalid.
*/
@Nullable T getDestinationInstance(@Nullable String destinationParams);
/**
* Returns a list of possible destinations for the given destination parameters.
*
* @param issuer The command issuer.
* @param destinationParams The destination parameters. ex: p:MyPortal:nw
* @return A list of possible destinations.
*/
@NotNull Collection<String> suggestDestinations(@NotNull BukkitCommandIssuer issuer, @Nullable String destinationParams);
/**
* Should the Multiverse SafeTeleporter be used?
*
* <p>If not, MV will blindly take people to the location specified.</p>
*
* @return True if the SafeTeleporter will be used, false if not.
*/
boolean checkTeleportSafety();
/**
* Returns the teleporter to use for this destination.
*
* <p>By default, Multiverse will automatically use SafeTeleporter. If you want to use a different teleporter, you can
* override this method.</p>
*
* @return The custom teleporter to use for this destination. Return null to use the default teleporter.
*/
@Nullable Teleporter getTeleporter();
}
@@ -0,0 +1,45 @@
package com.onarandombox.MultiverseCore.api;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface DestinationInstance {
/**
* Gets the exact location to teleport an entity to.
*
* @param teleportee The entity to teleport.
* @return The location to teleport to.
*/
@Nullable Location getLocation(@NotNull Entity teleportee);
/**
* Gets the velocity to apply to an entity after teleporting.
*
* @param teleportee The entity to teleport.
* @return A vector representing the speed/direction the player should travel when arriving at the destination.
*/
@Nullable Vector getVelocity(@NotNull Entity teleportee);
/**
* Gets the permission suffix to check for when teleporting to this destination.
* This is used for finer per world/player permissions, such as "multiverse.teleport.self.worldname".
*
* <p>For example, if the destination is "w:world", the permission suffix is "world".</p>
*
* @return The permission suffix.
*/
@Nullable String getFinerPermissionSuffix();
/**
* Serialises the destination instance to a savable string.
*
* <p>This is used when plugins save destinations to configuration,
* and when the destination is displayed to the user.</p>
*
* @return The serialised destination instance.
*/
@NotNull String serialise();
}
@@ -0,0 +1,101 @@
package com.onarandombox.MultiverseCore.api;
import org.bukkit.Location;
import org.bukkit.entity.Vehicle;
import org.bukkit.util.Vector;
import org.jvnet.hk2.annotations.Contract;
/**
* Used to manipulate locations.
*/
@Contract
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);
}
@@ -0,0 +1,231 @@
package com.onarandombox.MultiverseCore.api;
import com.onarandombox.MultiverseCore.configuration.node.NodeGroup;
import com.onarandombox.MultiverseCore.placeholders.MultiverseCorePlaceholders;
import io.vavr.control.Try;
import org.jvnet.hk2.annotations.Contract;
@Contract
public interface MVConfig {
/**
* Loads the config from disk.
* @return True if the config was loaded successfully.
*/
boolean load();
/**
* Whether the config has been loaded.
* @return True if the config has been loaded.
*/
boolean isLoaded();
/**
* Saves the config to disk.
*/
boolean save();
/**
* Gets the nodes for the config.
*
* @return The nodes for the config.
*/
NodeGroup getNodes();
/**
* Gets a property from the config.
*
* @param name The name of the property.
* @return A {@link Try} with the value of the property, otherwise a {@link Try.Failure} if there is no property by
* that name.
*/
Try<Object> getProperty(String name);
/**
* Sets a property in the config.
*
* @param name The name of the property.
* @param value The value of the property.
* @return An empty {@link Try} if the property was set successfully, otherwise a {@link Try.Failure} with the
* exception explaining why the property could not be set.
*/
Try<Void> setProperty(String name, Object value);
/**
* Sets world access permissions should be enforced.
* @param enforceAccess The new value.
*/
void setEnforceAccess(boolean enforceAccess);
/**
* Gets enforceAccess.
* @return enforceAccess.
*/
boolean getEnforceAccess();
/**
* Sets whether the game mode should be enforced.
* @param enforceGameMode The new value.
*/
void setEnforceGameMode(boolean enforceGameMode);
/**
* Gets enforceGameMode value.
* @return True if game mode should be enforced.
*/
boolean getEnforceGameMode();
/**
* Sets whether or not the automatic purge of entities is enabled.
*
* @param autopurge True if automatic purge should be enabled.
*/
void setAutoPurgeEntities(boolean autopurge);
/**
* Gets whether or not the automatic purge of entities is enabled.
*
* @return True if automatic purge is enabled.
*/
boolean isAutoPurgeEntities();
/**
* Sets teleportIntercept.
* @param teleportIntercept The new value.
*/
void setTeleportIntercept(boolean teleportIntercept);
/**
* Gets teleportIntercept.
* @return teleportIntercept.
*/
boolean getTeleportIntercept();
/**
* Sets firstSpawnOverride.
* @param firstSpawnOverride The new value.
*/
void setFirstSpawnOverride(boolean firstSpawnOverride);
/**
* Gets firstSpawnOverride.
* @return firstSpawnOverride.
*/
boolean getFirstSpawnOverride();
/**
* Sets firstSpawnWorld.
* @param firstSpawnWorld The new value.
*/
void setFirstSpawnLocation(String firstSpawnWorld);
/**
* Gets firstSpawnWorld.
* @return firstSpawnWorld.
*/
String getFirstSpawnLocation();
/**
* 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 setUseCustomPortalSearch(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 isUsingCustomPortalSearch();
/**
* Sets the radius at which vanilla style portals will be searched for to connect to worlds together.
*
* @param searchRadius The portal search radius.
*/
void setCustomPortalSearchRadius(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 getCustomPortalSearchRadius();
/**
* Sets prefixChat.
* @param prefixChat The new value.
*/
void setEnablePrefixChat(boolean prefixChat);
/**
* Gets prefixChat.
* @return prefixChat.
*/
boolean isEnablePrefixChat();
/**
* Sets prefixChatFormat.
* @param prefixChatFormat The new value.
*/
void setPrefixChatFormat(String prefixChatFormat);
/**
* Gets prefixChatFormat.
* @return prefixChatFormat.
*/
String getPrefixChatFormat();
/**
* Sets whether to register the {@link MultiverseCorePlaceholders} class with PlaceholderAPI plugin.
* @param registerPapiHook The new value.
*/
void setRegisterPapiHook(boolean registerPapiHook);
/**
* Gets whether to register the {@link MultiverseCorePlaceholders} class with PlaceholderAPI plugin.
* @return registerPapiHook.
*/
boolean isRegisterPapiHook();
/**
* Sets globalDebug.
* @param globalDebug The new value.
*/
void setGlobalDebug(int globalDebug);
/**
* Gets globalDebug.
* @return globalDebug.
*/
int getGlobalDebug();
/**
* 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 the donation/patreon messages are shown.
*
* @param idonotwanttodonate True if donation/patreon messages should be shown.
*/
void setShowDonateMessage(boolean idonotwanttodonate);
/**
* Gets whether or not the donation/patreon messages are shown.
*
* @return True if donation/patreon messages should be shown.
*/
boolean isShowingDonateMessage();
}
@@ -0,0 +1,40 @@
/******************************************************************************
* 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;
/**
* Multiverse 2 Core API
* <p>
* This API contains a bunch of useful things you can get out of Multiverse in general!
*/
public interface MVCore extends MVPlugin {
/**
* Saves all configs.
*
* @return Whether the config was successfully saved
*/
boolean saveAllConfigs();
/**
* 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();
}
@@ -0,0 +1,142 @@
/******************************************************************************
* 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!
*/
@Deprecated
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();
}
@@ -0,0 +1,36 @@
/******************************************************************************
* 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;
/**
* This interface is implemented by every official Multiverse-plugin.
*/
public interface MVPlugin {
/**
* Gets the reference to MultiverseCore.
*
* @return A valid {@link com.onarandombox.MultiverseCore}.
*/
MVCore getCore();
/**
* 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();
/**
* Parse the Authors Array into a readable String with ',' and 'and'.
*
* @return The readable authors-{@link String}
*/
String getAuthors();
}
@@ -0,0 +1,675 @@
/******************************************************************************
* 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 java.util.List;
import com.onarandombox.MultiverseCore.exceptions.PropertyDoesNotExistException;
import com.onarandombox.MultiverseCore.world.configuration.AddProperties;
import com.onarandombox.MultiverseCore.world.configuration.AllowedPortalType;
import com.onarandombox.MultiverseCore.world.configuration.EnglishChatColor;
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.permissions.Permission;
import org.jetbrains.annotations.Nullable;
/**
* The API for a Multiverse Handled World.
*/
public interface MVWorld {
/**
* 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 AddProperties}.
*
* @param property The name of a {@link 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 AddProperties}.
*
* @param property The name of a {@link 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 AddProperties}.
*
* @param property The name of a {@link 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 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);
}
@@ -0,0 +1,325 @@
/******************************************************************************
* 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 java.util.Collection;
import java.util.List;
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 org.jvnet.hk2.annotations.Contract;
/**
* Multiverse 2 World Manager API
* <p>
* This API contains all of the world managing
* functions that your heart desires!
*/
@Contract
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
* @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 MVWorld}.
*/
Collection<MVWorld> getMVWorlds();
/**
* Returns a {@link MVWorld} 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 MVWorld} or null.
*/
MVWorld getMVWorld(String name);
/**
* Returns a {@link MVWorld} 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 MVWorld} or null.
*/
MVWorld getMVWorld(String name, boolean checkAliases);
/**
* Returns a {@link MVWorld} if it exists, and null if it does not.
*
* @param world The Bukkit world to check.
* @return A {@link MVWorld} or null.
*/
MVWorld getMVWorld(World world);
/**
* Checks to see if the given name is a valid {@link MVWorld}
* 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 MVWorld}.
* 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 MVWorld}.
*
* @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();
/**
* 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.
*/
MVWorld 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.
*
* @return A loaded configuration.
*/
FileConfiguration loadWorldsConfig();
/**
* 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 MVWorld} new players should spawn in.
*/
MVWorld 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();
}
@@ -0,0 +1,87 @@
package com.onarandombox.MultiverseCore.api;
import java.util.concurrent.CompletableFuture;
import co.aikar.commands.BukkitCommandIssuer;
import com.onarandombox.MultiverseCore.destination.ParsedDestination;
import com.onarandombox.MultiverseCore.teleportation.TeleportResult;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.jvnet.hk2.annotations.Contract;
/**
* Used to safely teleport people.
*/
@Contract
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 destination Destination to teleport them to
* @return true for success, false for failure
*/
@Deprecated
TeleportResult safelyTeleport(BukkitCommandIssuer teleporter, Entity teleportee, ParsedDestination<?> destination);
/**
* 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 destination Destination to teleport them to
* @return true for success, false for failure
*/
CompletableFuture<TeleportResult> safelyTeleportAsync(BukkitCommandIssuer teleporter, Entity teleportee, ParsedDestination<?> destination);
/**
* 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 entity The entity to spawn
* @param destination The MVDestination to take the entity to.
* @return A new location to spawn the entity at.
*/
Location getSafeLocation(Entity entity, DestinationInstance destination);
/**
* 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);
}
@@ -0,0 +1,33 @@
package com.onarandombox.MultiverseCore.api;
import java.util.concurrent.CompletableFuture;
import co.aikar.commands.BukkitCommandIssuer;
import com.onarandombox.MultiverseCore.destination.ParsedDestination;
import com.onarandombox.MultiverseCore.teleportation.TeleportResult;
import org.bukkit.entity.Entity;
import org.jvnet.hk2.annotations.Contract;
@Contract
public interface Teleporter {
/**
* Teleport the entity to the Multiverse Destination.
*
* @param teleporter Person who performed the teleport command.
* @param teleportee Entity to teleport
* @param destination Destination to teleport them to
* @return true for success, false for failure
*/
@Deprecated
TeleportResult teleport(BukkitCommandIssuer teleporter, Entity teleportee, ParsedDestination<?> destination);
/**
* Teleport the entity to the Multiverse Destination.
*
* @param teleporter Person who performed the teleport command.
* @param teleportee Entity to teleport
* @param destination Destination to teleport them to
* @return true for success, false for failure
*/
CompletableFuture<TeleportResult> teleportAsync(BukkitCommandIssuer teleporter, Entity teleportee, ParsedDestination<?> destination);
}
@@ -0,0 +1,70 @@
package com.onarandombox.MultiverseCore.api;
import java.util.List;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.jvnet.hk2.annotations.Contract;
/**
* Used to remove animals from worlds that don't belong there.
*/
@Contract
public interface WorldPurger {
/**
* Synchronizes the given worlds with their settings.
*
* @param worlds A list of {@link MVWorld}
*/
void purgeWorlds(List<MVWorld> worlds);
/**
* Convenience method for {@link #purgeWorld(MVWorld, java.util.List, boolean, boolean)} that takes the settings from the world-config.
*
* @param world The {@link MVWorld}.
*/
void purgeWorld(MVWorld world);
/**
* Clear all animals/monsters that do not belong to a world according to the config.
*
* @param mvworld The {@link MVWorld}.
* @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(MVWorld 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 MVWorld}.
* @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(MVWorld 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(MVWorld w, Entity e);
}
@@ -0,0 +1,5 @@
/**
* The Multiverse-API, containing lots of interfaces that can be quite useful for other
* plugins when interacting with Multiverse.
*/
package com.onarandombox.MultiverseCore.api;
@@ -0,0 +1,53 @@
package com.onarandombox.MultiverseCore.commands;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.destination.DestinationsProvider;
import com.onarandombox.MultiverseCore.destination.ParsedDestination;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class CheckCommand extends MultiverseCommand {
private final DestinationsProvider destinationsProvider;
@Inject
public CheckCommand(@NotNull MVCommandManager commandManager, @NotNull DestinationsProvider destinationsProvider) {
super(commandManager);
this.destinationsProvider = destinationsProvider;
}
@Subcommand("check")
@CommandPermission("multiverse.core.check")
@CommandCompletion("@players @destinations|@mvworlds")
@Syntax("<player> <destination>")
@Description("{@@mv-core.check.description}")
public void onCheckCommand(BukkitCommandIssuer issuer,
@Syntax("<player>")
@Description("{@@mv-core.check.player.description}")
Player player,
@Syntax("<destination>")
@Description("{@@mv-core.check.destination.description}")
ParsedDestination<?> destination
) {
issuer.sendInfo(MVCorei18n.CHECK_CHECKING,
"{player}", player.getName(),
"{destination}", destination.toString());
//TODO More detailed output on permissions required.
this.destinationsProvider.checkTeleportPermissions(issuer, player, destination);
}
}
@@ -0,0 +1,61 @@
package com.onarandombox.MultiverseCore.commands;
import co.aikar.commands.CommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Conditions;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Single;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class CloneCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
@Inject
public CloneCommand(@NotNull MVCommandManager commandManager, @NotNull MVWorldManager worldManager) {
super(commandManager);
this.worldManager = worldManager;
}
@Subcommand("clone")
@CommandPermission("multiverse.core.clone")
@CommandCompletion("@mvworlds:scope=both @empty")
@Syntax("<world> <new world name>")
@Description("{@@mv-core.clone.description}")
public void onCloneCommand(CommandIssuer issuer,
@Conditions("validWorldName:scope=both")
@Syntax("<world>")
@Description("{@@mv-core.clone.world.description}")
String worldName,
@Single
@Conditions("validWorldName:scope=new")
@Syntax("<new world name>")
@Description("{@@mv-core.clone.newWorld.description}")
String newWorldName
) {
issuer.sendInfo(MVCorei18n.CLONE_CLONING,
"{world}", worldName,
"{newWorld}", newWorldName);
if (!this.worldManager.cloneWorld(worldName, newWorldName)) {
issuer.sendError(MVCorei18n.CLONE_FAILED);
return;
}
issuer.sendInfo(MVCorei18n.CLONE_SUCCESS,
"{world}", newWorldName);
}
}
@@ -0,0 +1,73 @@
package com.onarandombox.MultiverseCore.commands;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Optional;
import co.aikar.commands.annotation.Single;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.commandtools.MVCommandIssuer;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.commandtools.context.MVConfigValue;
import com.onarandombox.MultiverseCore.config.MVCoreConfig;
import com.onarandombox.MultiverseCore.exceptions.MultiverseException;
import io.vavr.control.Option;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class ConfigCommand extends MultiverseCommand {
private final MVCoreConfig config;
@Inject
public ConfigCommand(@NotNull MVCommandManager commandManager, @NotNull MVCoreConfig config) {
super(commandManager);
this.config = config;
}
@Subcommand("config")
@CommandPermission("multiverse.core.config")
@CommandCompletion("@mvconfigs")
@Syntax("<name> [new-value]")
@Description("") //TODO
public void onConfigCommand(MVCommandIssuer issuer,
@Syntax("<name>")
@Description("") //TODO
String name,
@Optional
@Single
@Syntax("[new-value]")
@Description("") //TODO
MVConfigValue value
) {
if (value == null) {
showConfigValue(issuer, name);
return;
}
updateConfigValue(issuer, name, value.getValue());
}
private void showConfigValue(MVCommandIssuer issuer, String name) {
config.getProperty(name)
.onSuccess(value -> issuer.sendMessage(name + "is currently set to " + value))
.onFailure(e -> issuer.sendMessage(e.getMessage()));
}
private void updateConfigValue(MVCommandIssuer issuer, String name, Object value) {
config.setProperty(name, value)
.onSuccess(ignore -> {
config.save();
issuer.sendMessage("Successfully set " + name + " to " + value);
})
.onFailure(ignore -> issuer.sendMessage("Unable to set " + name + " to " + value + "."))
.onFailure(MultiverseException.class, e -> Option.of(e.getMVMessage()).peek(issuer::sendError));
}
}
@@ -1,29 +1,29 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Subcommand;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
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.setPermission("multiverse.core.confirm", "If you have not been prompted to use this, it will not do anything.", PermissionDefault.OP);
@Inject
public ConfirmCommand(@NotNull MVCommandManager commandManager) {
super(commandManager);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
this.plugin.getCommandHandler().confirmQueuedCommand(sender);
@Subcommand("confirm")
@CommandPermission("multiverse.core.confirm")
@Description("{@@mv-core.confirm.description}")
public void onConfirmCommand(@NotNull BukkitCommandIssuer issuer) {
this.commandManager.getCommandQueueManager().runQueuedCommand(issuer.getIssuer());
}
}
@@ -1,57 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
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 com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.utils.LocationManipulation;
public class CoordCommand extends MultiverseCommand {
private LocationManipulation locMan = new LocationManipulation();
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.setPermission("multiverse.core.coord", "Returns detailed information on the Players where abouts.", PermissionDefault.OP);
}
@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.plugin.isMVWorld(world.getName())) {
this.plugin.showNotMVWorldMessage(sender, world.getName());
return;
}
MVWorld mvworld = this.plugin.getMVWorld(world.getName());
// TODO: Convert to fancy stuff
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());
p.sendMessage(ChatColor.AQUA + "Coordinates: " + ChatColor.WHITE + this.locMan.strCoords(p.getLocation()));
p.sendMessage(ChatColor.AQUA + "Direction: " + ChatColor.WHITE + LocationManipulation.getDirection(p.getLocation()));
p.sendMessage(ChatColor.AQUA + "Block: " + ChatColor.WHITE + Material.getMaterial(world.getBlockTypeIdAt(p.getLocation())));
} else {
sender.sendMessage("This command needs to be used from a Player.");
}
}
}
@@ -1,63 +1,143 @@
package com.onarandombox.MultiverseCore.commands;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import org.bukkit.ChatColor;
import org.bukkit.World.Environment;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.pneumaticraft.commandhandler.CommandHandler;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.InvalidCommandArgument;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Conditions;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Optional;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlag;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagGroup;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandValueFlag;
import com.onarandombox.MultiverseCore.commandtools.flags.ParsedCommandFlags;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import com.onarandombox.MultiverseCore.utils.UnsafeCallWrapper;
import jakarta.inject.Inject;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldType;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class CreateCommand extends MultiverseCommand {
public CreateCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Create World");
this.setCommandUsage("/mv create" + ChatColor.GREEN + " {NAME} {ENV}" + ChatColor.GOLD + " -s [SEED] -g [GENERATOR[:ID]]");
this.setArgRange(2, 6);
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 + " skylands");
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");
private final MVWorldManager worldManager;
@Inject
public CreateCommand(
@NotNull MVCommandManager commandManager,
@NotNull MVWorldManager worldManager,
@NotNull UnsafeCallWrapper unsafeCallWrapper
) {
super(commandManager);
this.worldManager = worldManager;
registerFlagGroup(CommandFlagGroup.builder("mvcreate")
.add(CommandValueFlag.builder("--seed", String.class)
.addAlias("-s")
.completion(() -> Collections.singleton(String.valueOf(new Random().nextLong())))
.build())
.add(CommandValueFlag.builder("--generator", String.class)
.addAlias("-g")
.completion(() -> Arrays.stream(Bukkit.getServer().getPluginManager().getPlugins())
.filter(Plugin::isEnabled)
.filter(genplugin -> unsafeCallWrapper.wrap(
() -> genplugin.getDefaultWorldGenerator("world", ""),
genplugin.getName(),
"Get generator"
) != null)
.map(genplugin -> genplugin.getDescription().getName())
.collect(Collectors.toList()))
.build())
.add(CommandValueFlag.builder("--world-type", WorldType.class)
.addAlias("-t")
.context((value) -> {
try {
return WorldType.valueOf(value.toUpperCase());
} catch (IllegalArgumentException e) {
throw new InvalidCommandArgument("Invalid world type: " + value);
}
})
.completion(() -> {
List<String> types = new ArrayList<>();
for (WorldType type : WorldType.values()) {
types.add(type.name().toLowerCase());
}
return types;
})
.build())
.add(CommandFlag.builder("--adjust-spawn")
.addAlias("-n")
.build())
.add(CommandFlag.builder("--no-structures")
.addAlias("-a")
.build())
.build());
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (args.size() % 2 != 0) {
sender.sendMessage("You must preface your SEED with -s OR your GENERATOR with -g. Type /mv for help");
return;
}
String worldName = args.get(0);
String env = args.get(1);
String seed = CommandHandler.getFlag("-s", args);
String generator = CommandHandler.getFlag("-g", args);
@Subcommand("create")
@CommandPermission("multiverse.core.create")
@CommandCompletion("@empty @flags:groupName=mvcreate")
@Syntax("<name> <environment> --seed [seed] --generator [generator[:id]] --world-type [worldtype] --adjust-spawn --no-structures")
@Description("{@@mv-core.create.description}")
public void onCreateCommand(BukkitCommandIssuer issuer,
if (new File(worldName).exists() || this.plugin.isMVWorld(worldName)) {
sender.sendMessage(ChatColor.RED + "A Folder/World already exists with this name!");
sender.sendMessage(ChatColor.RED + "If you are confident it is a world you can import with /mvimport");
return;
}
@Conditions("validWorldName:scope=new")
@Syntax("<name>")
@Description("{@@mv-core.create.name.description}")
String worldName,
Environment environment = this.plugin.getEnvFromString(env);
if (environment == null) {
sender.sendMessage(ChatColor.RED + "That is not a valid environment.");
EnvironmentCommand.showEnvironments(sender);
@Syntax("<environment>")
@Description("{@@mv-core.create.environment.description}")
World.Environment environment,
@Optional
@Syntax("--seed [seed] --generator [generator[:id]] --world-type [worldtype] --adjust-spawn --no-structures")
@Description("{@@mv-core.create.flags.description}")
String[] flags
) {
ParsedCommandFlags parsedFlags = parseFlags(flags);
issuer.sendInfo(MVCorei18n.CREATE_PROPERTIES, "{worldName}", worldName);
issuer.sendInfo(MVCorei18n.CREATE_PROPERTIES_ENVIRONMENT, "{environment}", environment.name());
issuer.sendInfo(MVCorei18n.CREATE_PROPERTIES_SEED, "{seed}", parsedFlags.flagValue("--seed", "RANDOM", String.class));
issuer.sendInfo(MVCorei18n.CREATE_PROPERTIES_WORLDTYPE, "{worldType}", parsedFlags.flagValue("--world-type", WorldType.NORMAL, WorldType.class).name());
issuer.sendInfo(MVCorei18n.CREATE_PROPERTIES_ADJUSTSPAWN, "{adjustSpawn}", String.valueOf(parsedFlags.hasFlag("--adjust-spawn")));
issuer.sendInfo(MVCorei18n.CREATE_PROPERTIES_GENERATOR, "{generator}", parsedFlags.flagValue("--generator", "null", String.class));
issuer.sendInfo(MVCorei18n.CREATE_PROPERTIES_STRUCTURES, "{structures}", String.valueOf(!parsedFlags.hasFlag("--no-structures")));
issuer.sendInfo(MVCorei18n.CREATE_LOADING);
if (!worldManager.addWorld(
worldName,
environment,
parsedFlags.flagValue("--seed", String.class),
parsedFlags.flagValue("--world-type", WorldType.NORMAL, WorldType.class),
parsedFlags.hasFlag("--adjust-spawn"),
parsedFlags.flagValue("--generator", String.class),
parsedFlags.hasFlag("--no-structures")
)) {
issuer.sendError(MVCorei18n.CREATE_FAILED, "{worldName}", worldName);
return;
}
sender.sendMessage(ChatColor.AQUA + "Starting world creation...");
if (this.plugin.addWorld(worldName, environment, seed, generator)) {
sender.sendMessage(ChatColor.GREEN + "Complete!");
} else {
sender.sendMessage(ChatColor.RED + "FAILED.");
}
return;
issuer.sendInfo(MVCorei18n.CREATE_SUCCESS, "{worldName}", worldName);
}
}
@@ -0,0 +1,63 @@
package com.onarandombox.MultiverseCore.commands;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.dumptruckman.minecraft.util.Logging;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.config.MVCoreConfig;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class DebugCommand extends MultiverseCommand {
private final MVCoreConfig config;
@Inject
public DebugCommand(@NotNull MVCommandManager commandManager, @NotNull MVCoreConfig config) {
super(commandManager);
this.config = config;
}
@Subcommand("debug")
@CommandPermission("multiverse.core.debug")
@Description("{@@mv-core.debug.info.description}")
public void onShowDebugCommand(BukkitCommandIssuer issuer) {
this.displayDebugMode(issuer);
}
@Subcommand("debug")
@CommandPermission("multiverse.core.debug")
@CommandCompletion("@range:3")
@Syntax("<{@@mv-core.debug.change.syntax}>")
@Description("{@@mv-core.debug.change.description}")
public void onChangeDebugCommand(BukkitCommandIssuer issuer,
@Syntax("<{@@mv-core.debug.change.syntax}>")
@Description("{@@mv-core.debug.change.level.description}")
int level) {
config.setGlobalDebug(level);
config.save();
this.displayDebugMode(issuer);
}
private void displayDebugMode(BukkitCommandIssuer issuer) {
final int debugLevel = config.getGlobalDebug();
if (debugLevel == 0) {
issuer.sendInfo(MVCorei18n.DEBUG_INFO_OFF);
return;
}
issuer.sendInfo(MVCorei18n.DEBUG_INFO_ON, "{level}", String.valueOf(debugLevel));
Logging.fine("Multiverse Debug ENABLED.");
}
}
@@ -1,30 +1,67 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.MessageType;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Conditions;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Single;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.commandtools.queue.QueuedCommand;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
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.setPermission("multiverse.core.delete", "Deletes a world on your server. " + ChatColor.RED + "PERMANENTLY.", PermissionDefault.OP);
private final MVWorldManager worldManager;
@Inject
public DeleteCommand(@NotNull MVCommandManager commandManager, @NotNull MVWorldManager worldManager) {
super(commandManager);
this.worldManager = worldManager;
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
Class<?> paramTypes[] = { String.class };
List<Object> objectArgs = new ArrayList<Object>(args);
this.plugin.getCommandHandler().queueCommand(sender, "mvdelete", "deleteWorld", objectArgs, paramTypes, ChatColor.GREEN + "World Deleted!", ChatColor.RED + "World could NOT be deleted!");
@Subcommand("delete")
@CommandPermission("multiverse.core.delete")
@CommandCompletion("@mvworlds:scope=both")
@Syntax("<world>")
@Description("{@@mv-core.delete.description}")
public void onDeleteCommand(BukkitCommandIssuer issuer,
@Single
@Conditions("validWorldName:scope=both")
@Syntax("<world>")
@Description("The world you want to delete.")
String worldName
) {
this.commandManager.getCommandQueueManager().addToQueue(new QueuedCommand(
issuer.getIssuer(),
() -> {
issuer.sendInfo(MVCorei18n.DELETE_DELETING,
"{world}", worldName);
if (!this.worldManager.deleteWorld(worldName)) {
issuer.sendError(MVCorei18n.DELETE_FAILED,
"{world}", worldName);
return;
}
issuer.sendInfo(MVCorei18n.DELETE_SUCCESS,
"{world}", worldName);
},
this.commandManager.formatMessage(
issuer,
MessageType.INFO,
MVCorei18n.DELETE_PROMPT,
"{world}", worldName)
));
}
}
@@ -1,38 +0,0 @@
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;
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 environment");
this.addKey("mv environments");
this.setPermission("multiverse.core.list.environments", "Lists valid known environments.", PermissionDefault.OP);
}
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 + "SKYLANDS");
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
EnvironmentCommand.showEnvironments(sender);
}
}
@@ -0,0 +1,79 @@
package com.onarandombox.MultiverseCore.commands;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Flags;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.api.MVWorld;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.commandtools.context.GameRuleValue;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.bukkit.GameRule;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class GameruleCommand extends MultiverseCommand {
@Inject
public GameruleCommand(@NotNull MVCommandManager commandManager) {
super(commandManager);
}
@Subcommand("gamerule")
@CommandPermission("multiverse.core.gamerule")
@CommandCompletion("@gamerules true|false|@range:1-10 @mvworlds:multiple|*")
@Syntax("<Gamerule> <Gamerule value> [World or *]")
@Description("{@@mv-core.gamerule.description}")
public void onGameruleCommand(BukkitCommandIssuer issuer,
@Syntax("<Gamerule>")
@Description("{@@mv-core.gamerule.gamerule.description}")
GameRule gamerule,
@Syntax("<Value>")
@Description("{@@mv-core.gamerule.value.description}")
GameRuleValue gameRuleValue,
@Flags("resolve=issuerAware")
@Syntax("[World or *]")
@Description("{@@mv-core.gamerule.world.description}")
MVWorld[] worlds
) {
Object value = gameRuleValue.getValue();
boolean success = true;
for(MVWorld world : worlds) {
// Set gamerules and add false to list if it fails
if (!world.getCBWorld().setGameRule(gamerule, value)) {
issuer.sendError(MVCorei18n.GAMERULE_FAILED,
"{gamerule}", gamerule.getName(),
"{value}", value.toString(),
"{world}", world.getName(),
"{type}", gamerule.getType().getName());
success = false;
}
}
// Tell user if it was successful
if (success) {
if (worlds.length == 1) {
issuer.sendInfo(MVCorei18n.GAMERULE_SUCCESS_SINGLE,
"{gamerule}", gamerule.getName(),
"{value}", value.toString(),
"{world}", worlds[0].getName());
}
else if (worlds.length > 1) {
issuer.sendInfo(MVCorei18n.GAMERULE_SUCCESS_MULTIPLE,
"{gamerule}", gamerule.getName(),
"{value}", value.toString(),
"{count}", String.valueOf(worlds.length));
}
}
}
}
@@ -1,128 +0,0 @@
// This file is no longer licensed under that silly CC license. I have blanked it out and will start implementaiton of my own in a few days. For now there is no help.
package com.onarandombox.MultiverseCore.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.pneumaticraft.commandhandler.Command;
public class HelpCommand extends MultiverseCommand {
private static final int CMDS_PER_PAGE = 7;
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.setPermission("multiverse.help", "Displays a nice help menu.", PermissionDefault.TRUE);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
sender.sendMessage(ChatColor.AQUA + "====[ Multiverse Help ]====");
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;
}
}
List<Command> availableCommands = new ArrayList<Command>(this.plugin.getCommandHandler().getCommands(sender));
if (filter.length() > 0) {
availableCommands = this.getFilteredCommands(availableCommands, filter);
if (availableCommands.size() == 0) {
sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE + "No commands matched your filter: " + ChatColor.AQUA + filter);
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() / (CMDS_PER_PAGE + 0.0));
if (page > totalPages) {
page = totalPages;
}
sender.sendMessage(ChatColor.AQUA + " Page " + page + " of " + totalPages);
sender.sendMessage(ChatColor.AQUA + " Add a '" + ChatColor.DARK_PURPLE + "?" + ChatColor.AQUA + "' after a command to see more about it.");
this.showPage(page, sender, availableCommands);
}
private List<Command> getFilteredCommands(List<Command> availableCommands, String filter) {
List<Command> filtered = new ArrayList<Command>();
for (Command c : availableCommands) {
if (stitchThisString(c.getKeyStrings()).matches("(?i).*" + filter + ".*")) {
filtered.add(c);
} else if (c.getCommandName().matches("(?i).*" + filter + ".*")) {
filtered.add(c);
} else if (c.getCommandDesc().matches("(?i).*" + filter + ".*")) {
filtered.add(c);
}else if (c.getCommandUsage().matches("(?i).*" + filter + ".*")) {
filtered.add(c);
}
}
return filtered;
}
private String stitchThisString(List<String> list) {
String returnstr = "";
for (String s : list) {
returnstr += s + " ";
}
return returnstr;
}
private void showPage(int page, CommandSender sender, List<Command> cmds) {
int start = (page - 1) * CMDS_PER_PAGE;
int end = start + CMDS_PER_PAGE;
for (int i = start; i < end; i++) {
// For consistancy, print some extra lines if it's a player:
if (i < cmds.size()) {
sender.sendMessage(ChatColor.AQUA + cmds.get(i).getCommandUsage());
} else if (sender instanceof Player) {
sender.sendMessage(" ");
}
}
}
}
@@ -1,61 +1,104 @@
package com.onarandombox.MultiverseCore.commands;
import java.io.File;
import java.util.List;
import java.util.Arrays;
import java.util.stream.Collectors;
import org.bukkit.ChatColor;
import org.bukkit.World.Environment;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Conditions;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Optional;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlag;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagGroup;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandValueFlag;
import com.onarandombox.MultiverseCore.commandtools.flags.ParsedCommandFlags;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import com.onarandombox.MultiverseCore.utils.UnsafeCallWrapper;
import jakarta.inject.Inject;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class ImportCommand extends MultiverseCommand {
public ImportCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Import World");
this.setCommandUsage("/mv import" + ChatColor.GREEN + " {NAME} {ENV} " + ChatColor.GOLD + "[GENERATOR[:ID]]");
this.setArgRange(2, 3);
this.addKey("mvimport");
this.addKey("mvim");
this.addKey("mv import");
this.setPermission("multiverse.core.import", "Imports a new world of the specified type.", PermissionDefault.OP);
private final MVWorldManager worldManager;
@Inject
public ImportCommand(
@NotNull MVCommandManager commandManager,
@NotNull MVWorldManager worldManager,
@NotNull UnsafeCallWrapper unsafeCallWrapper
) {
super(commandManager);
this.worldManager = worldManager;
registerFlagGroup(CommandFlagGroup.builder("mvimport")
.add(CommandValueFlag.builder("--generator", String.class)
.addAlias("-g")
.completion(() -> Arrays.stream(Bukkit.getServer().getPluginManager().getPlugins())
.filter(Plugin::isEnabled)
.filter(genplugin -> unsafeCallWrapper.wrap(
() -> genplugin.getDefaultWorldGenerator("world", ""),
genplugin.getName(),
"Get generator"
) != null)
.map(genplugin -> genplugin.getDescription().getName())
.collect(Collectors.toList()))
.build())
.add(CommandFlag.builder("--adjust-spawn")
.addAlias("-a")
.build())
.build());
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
String worldName = args.get(0);
if (this.plugin.isMVWorld(worldName) && new File(worldName).exists()) {
sender.sendMessage(ChatColor.RED + "Multiverse already knows about this world!");
@Subcommand("import")
@CommandPermission("multiverse.core.import")
@CommandCompletion("@mvworlds:scope=potential @flags:groupName=mvimport")
@Syntax("<name> <env> --generator [generator[:id]] --adjust-spawn")
@Description("{@@mv-core.import.description")
public void onImportCommand(BukkitCommandIssuer issuer,
@Conditions("validWorldName:scope=new")
@Syntax("<name>")
@Description("{@@mv-core.import.name.description}")
String worldName,
@Syntax("<env>")
@Description("{@@mv-core.import.env.description}")
World.Environment environment,
@Optional
@Syntax("--generator [generator[:id]] --adjust-spawn")
@Description("{@@mv-core.import.other.description}")
String[] flags) {
ParsedCommandFlags parsedFlags = parseFlags(flags);
issuer.sendInfo(MVCorei18n.IMPORT_IMPORTING,
"{world}", worldName);
if (!this.worldManager.addWorld(
worldName, environment,
null,
null,
null,
parsedFlags.flagValue("--generator", String.class),
parsedFlags.hasFlag("--adjust-spawn"))
) {
issuer.sendError(MVCorei18n.IMPORT_FAILED);
return;
}
String generator = null;
if (args.size() == 3) {
generator = args.get(2);
}
String env = args.get(1);
Environment environment = this.plugin.getEnvFromString(env);
if (environment == null) {
sender.sendMessage(ChatColor.RED + "That is not a valid environment.");
EnvironmentCommand.showEnvironments(sender);
return;
}
if (new File(worldName).exists() && env != null) {
sender.sendMessage(ChatColor.AQUA + "Starting world import...");
this.plugin.addWorld(worldName, environment, null, generator);
sender.sendMessage(ChatColor.GREEN + "Complete!");
return;
} else if (env == null) {
sender.sendMessage(ChatColor.RED + "FAILED.");
sender.sendMessage("That world type did not exist.");
sender.sendMessage("For a list of available world types, type: /mvenv");
} else {
sender.sendMessage(ChatColor.RED + "FAILED.");
sender.sendMessage("That world folder does not exist...");
}
issuer.sendInfo(MVCorei18n.IMPORT_SUCCESS);
}
}
@@ -1,226 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.utils.FancyColorScheme;
import com.onarandombox.utils.FancyHeader;
import com.onarandombox.utils.FancyMessage;
import com.onarandombox.utils.FancyText;
public class InfoCommand extends MultiverseCommand {
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.setPermission("multiverse.core.info", "Returns detailed information on the world.", PermissionDefault.OP);
}
@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.plugin.getMVWorld(args.get(0)) != null) {
// then we have a world!
worldName = args.get(0);
} else {
if (sender instanceof Player) {
Player p = (Player) sender;
worldName = p.getWorld().getName();
try {
pageNum = Integer.parseInt(args.get(0)) - 1;
} catch (NumberFormatException e) {
pageNum = 0;
}
} else {
sender.sendMessage("You must enter a" + ChatColor.LIGHT_PURPLE + " world" + ChatColor.WHITE + " from the console!");
return;
}
}
}
else if (args.size() == 2) {
worldName = args.get(0);
try {
pageNum = Integer.parseInt(args.get(1)) - 1;
} catch (NumberFormatException e) {
pageNum = 0;
}
}
if (this.plugin.isMVWorld(worldName)) {
showPage(pageNum, sender, this.buildEntireCommand(this.plugin.getMVWorld(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(MVWorld world) {
List<FancyText> message = new ArrayList<FancyText>();
List<List<FancyText>> worldInfo = new ArrayList<List<FancyText>>();
// Page 1
FancyColorScheme colors = new FancyColorScheme(ChatColor.AQUA, ChatColor.AQUA, ChatColor.GOLD, ChatColor.WHITE);
message.add(new FancyHeader("General Info", colors));
message.add(new FancyMessage("World Name: ", world.getName(), colors));
message.add(new FancyMessage("World Alias: ", world.getColoredWorldString(), colors));
message.add(new FancyMessage("Seed: ", world.getCBWorld().getSeed() + "", colors));
Location spawn = world.getCBWorld().getSpawnLocation();
message.add(new FancyMessage("Spawn Location: ", "(" + spawn.getBlockX() + ", " + spawn.getBlockY() + ", " + spawn.getBlockZ() + ")", colors));
message.add(new FancyMessage("World Scale: ", world.getScaling().toString(), colors));
if (world.getPrice() > 0) {
message.add(new FancyMessage("Price to enter this world: ", this.plugin.getBank().getFormattedAmount(world.getPrice(), world.getCurrency()), colors));
} else {
message.add(new FancyMessage("Price to enter this world: ", ChatColor.GREEN + "FREE!", colors));
}
if (world.getRespawnToWorld() != null) {
MVWorld respawn = this.plugin.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("PVP Settings", colors));
message.add(new FancyMessage("Multiverse Setting: ", world.getPvp().toString(), colors));
message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getPVP() + "", colors));
message.add(new FancyMessage("Fake PVP Enabled: ", world.getFakePVP() + "", colors));
worldInfo.add(message);
// Page 3
message = new ArrayList<FancyText>();
message.add(new FancyHeader("Monster Settings", colors));
message.add(new FancyMessage("Multiverse Setting: ", world.allowMonsterSpawning().toString(), colors));
message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getAllowMonsters() + "", colors));
if (MultiverseCore.MobsDisabledInDefaultWorld) {
message.add(new FancyMessage(ChatColor.RED + "WARNING: ", "Monsters WILL NOT SPAWN IN THIS WORLD.", colors));
message.add(new FancyMessage(ChatColor.RED + "WARNING: ", "Check your server log for more details.", colors));
}
if (world.getMonsterList().size() > 0) {
if (world.allowMonsterSpawning()) {
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.allowMonsterSpawning() ? "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.allowAnimalSpawning().toString(), colors));
message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getAllowAnimals() + "", colors));
if (world.getMonsterList().size() > 0) {
if (world.allowMonsterSpawning()) {
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.allowAnimalSpawning() ? "ALL" : "NONE", colors));
}
worldInfo.add(message);
return worldInfo;
}
private String toCommaSeperated(List<String> list) {
if(list == null || list.size() == 0) {
return "";
}
if(list.size() == 1) {
return list.get(0);
}
String result = list.get(0);
for (int i = 1; i < list.size() - 1; i++) {
result += ", " + list.get(i);
}
result += " and " + list.get(list.size() - 1);
return result;
}
protected ChatColor getChatColor(boolean positive) {
return positive ? ChatColor.GREEN : ChatColor.RED;
}
private void showPage(int page, CommandSender sender, List<List<FancyText>> doc) {
page = page < 0 ? 0 : page;
page = page > doc.size() - 1 ? doc.size() - 1 : page;
boolean altColor = false;
boolean appendedPageNum = false;
if (sender instanceof Player) {
List<FancyText> list = doc.get(page);
for (FancyText fancyT : list) {
if (fancyT instanceof FancyMessage) {
FancyMessage text = (FancyMessage) fancyT;
text.setAltColor(altColor);
altColor = !altColor;
sender.sendMessage(text.getFancyText());
} else if (fancyT instanceof FancyHeader) {
FancyHeader text = (FancyHeader) fancyT;
if (!appendedPageNum) {
text.appendText(ChatColor.DARK_PURPLE + " [ Page " + (page + 1) + " of " + doc.size() + " ]");
appendedPageNum = true;
}
sender.sendMessage(text.getFancyText());
altColor = false;
}
}
} else {
for (List<FancyText> list : doc) {
for (FancyText fancyT : list) {
if (fancyT instanceof FancyMessage) {
FancyMessage text = (FancyMessage) fancyT;
text.setAltColor(altColor);
altColor = !altColor;
sender.sendMessage(text.getFancyText());
} else {
FancyText text = fancyT;
if (appendedPageNum) {
sender.sendMessage(" ");
} else {
appendedPageNum = true;
}
sender.sendMessage(text.getFancyText());
altColor = false;
}
}
}
}
}
}
@@ -1,58 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.World.Environment;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.MultiverseCore;
public class ListCommand extends MultiverseCommand {
public ListCommand(MultiverseCore plugin) {
super(plugin);
this.setName("World Listing");
this.setCommandUsage("/mv list");
this.setArgRange(0, 0);
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) {
Player p = null;
if (sender instanceof Player) {
p = (Player) sender;
}
String output = ChatColor.LIGHT_PURPLE + "Worlds which you can view:\n";
for (MVWorld world : this.plugin.getMVWorlds()) {
if (p != null && (!this.plugin.getPermissions().canEnterWorld(p, world))) {
continue;
}
ChatColor color = ChatColor.GOLD;
Environment env = world.getEnvironment();
if (env == Environment.NETHER) {
color = ChatColor.RED;
} else if (env == Environment.NORMAL) {
color = ChatColor.GREEN;
} else if (env == Environment.SKYLANDS) {
color = ChatColor.AQUA;
}
output += world.getColoredWorldString() + ChatColor.WHITE + " - " + color + world.getEnvironment() + " \n";
}
String[] response = output.split("\n");
for (String msg : response) {
sender.sendMessage(msg);
}
}
}
@@ -0,0 +1,56 @@
package com.onarandombox.MultiverseCore.commands;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Conditions;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Single;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class LoadCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
@Inject
public LoadCommand(@NotNull MVCommandManager commandManager, @NotNull MVWorldManager worldManager) {
super(commandManager);
this.worldManager = worldManager;
}
@Subcommand("load")
@CommandPermission("multiverse.core.load")
@CommandCompletion("@mvworlds:scope=unloaded")
@Syntax("<world>")
@Description("{@@mv-core.load.description}")
public void onLoadCommand(BukkitCommandIssuer issuer,
@Single
@Conditions("validWorldName:scope=unloaded")
@Syntax("<world>")
@Description("{@@mv-core.load.world.description}")
String worldName
) {
issuer.sendInfo(MVCorei18n.LOAD_LOADING,
"{world}", worldName);
if (!this.worldManager.loadWorld(worldName)) {
issuer.sendError(MVCorei18n.LOAD_FAILED,
"{world}", worldName);
return;
}
issuer.sendInfo(MVCorei18n.LOAD_SUCCESS,
"{world}", worldName);
}
}
@@ -1,73 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.MultiverseCore;
// This will contain all the properties that support the ADD/REMOVE
// Anything not in here will only support the SET action
public class ModifyAddCommand extends MultiverseCommand {
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.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);
}
@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;
}
MVWorld world;
String value = args.get(0);
String property = args.get(1);
if (args.size() == 2) {
world = this.plugin.getMVWorld(p.getWorld().getName());
} else {
world = this.plugin.getMVWorld(args.get(2));
}
if (world == null) {
sender.sendMessage("That world does not exist!");
return;
}
if (!ModifyCommand.validateAction(Action.Add, property)) {
sender.sendMessage("Sorry, you can't ADD to " + property);
sender.sendMessage("Please visit our Github Wiki for more information: http://goo.gl/4W8cY");
return;
}
if (world.addToList(property, value)) {
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE + " was " + ChatColor.GREEN + "added to " + ChatColor.GREEN + property);
} else {
sender.sendMessage(value + " could not be added to " + property);
}
}
}
@@ -1,69 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.MultiverseCore;
public class ModifyClearCommand extends MultiverseCommand {
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.setPermission("multiverse.core.modify.clear", "Removes all values from a property. This will work on properties that contain lists.", PermissionDefault.OP);
}
@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;
}
MVWorld world;
String property = args.get(0);
if (args.size() == 1) {
world = this.plugin.getMVWorld(p.getWorld().getName());
} else {
world = this.plugin.getMVWorld(args.get(1));
}
if (world == null) {
sender.sendMessage("That world does not exist!");
return;
}
if (!ModifyCommand.validateAction(Action.Clear, property)) {
sender.sendMessage("Sorry, you can't use CLEAR with " + property);
sender.sendMessage("Please visit our Github Wiki for more information: http://goo.gl/cgB2B");
return;
}
if (world.clearList(property)) {
sender.sendMessage(property + " was cleared. It contains 0 values now.");
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + property + ChatColor.WHITE + " was " + ChatColor.GREEN + "CLEARED" + ChatColor.WHITE + ". It contains " + ChatColor.LIGHT_PURPLE + "0" + ChatColor.WHITE + " values now.");
} else {
sender.sendMessage(ChatColor.RED + "Error: " + ChatColor.GOLD + property + ChatColor.WHITE + " was " + ChatColor.GOLD + "NOT" + ChatColor.WHITE + " cleared.");
}
}
}
@@ -1,72 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
enum AddProperties {
blockblacklist, playerwhitelist, playerblacklist, worldblacklist, animals, monsters
}
enum Action {
Set, Add, Remove, Clear
}
// Color == Aliascolor
enum SetProperties {
alias, animals, monsters, pvp, scaling, aliascolor, color, respawn, currency, curr, price, scale, spawnmemory, memory, weather, storm
}
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. 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, children);
this.setPermission(modify);
}
protected static boolean validateAction(Action action, String property) {
if (action == Action.Set) {
try {
SetProperties.valueOf(property);
return true;
} catch (IllegalArgumentException e) {
return false;
}
} else {
try {
AddProperties.valueOf(property);
return true;
} catch (IllegalArgumentException e) {
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,74 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.MultiverseCore;
public class ModifyRemoveCommand extends MultiverseCommand {
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.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);
}
@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;
}
MVWorld world;
String value = args.get(0);
String property = args.get(1);
if (args.size() == 2) {
world = this.plugin.getMVWorld(p.getWorld().getName());
} else {
world = this.plugin.getMVWorld(args.get(2));
}
if (world == null) {
sender.sendMessage("That world does not exist!");
return;
}
if (!ModifyCommand.validateAction(Action.Remove, property)) {
sender.sendMessage("Sorry, you can't REMOVE anything from" + property);
sender.sendMessage("Please visit our Github Wiki for more information: http://goo.gl/4W8cY");
return;
}
if (world.removeFromList(property, value)) {
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE + " was " + ChatColor.RED + "removed from " + ChatColor.GREEN + property);
} else {
sender.sendMessage(ChatColor.RED + "There was an error removing " + ChatColor.GRAY + value + ChatColor.WHITE + " from " + ChatColor.GOLD + property);
}
}
}
@@ -1,71 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.MultiverseCore;
public class ModifySetCommand extends MultiverseCommand {
public ModifySetCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Modify a World (Set a value)");
this.setCommandUsage("/mv modify" + ChatColor.GREEN + " set {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD]");
this.setArgRange(2, 3);
this.addKey("mvm set");
this.addKey("mvmset");
this.addKey("mv modify set");
this.addKey("mvmodify set");
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) {
// 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;
}
MVWorld world;
String value = args.get(1);
String property = args.get(0);
if (args.size() == 2) {
world = this.plugin.getMVWorld(p.getWorld().getName());
} else {
world = this.plugin.getMVWorld(args.get(2));
}
if (world == null) {
sender.sendMessage("That world does not exist!");
return;
}
if (!ModifyCommand.validateAction(Action.Set, property)) {
sender.sendMessage("Sorry, you can't SET " + property);
sender.sendMessage("Please visit our Github Wiki for more information: http://goo.gl/l54PH");
return;
}
if ((property.equalsIgnoreCase("aliascolor") || property.equalsIgnoreCase("color")) && !world.isValidAliasColor(value)) {
sender.sendMessage(value + " is not a valid color. Please see our Github Wiki for the complete color list.");
} else if (world.setVariable(property, value)) {
sender.sendMessage(ChatColor.GREEN + "Success!" + ChatColor.WHITE + " Property " + ChatColor.AQUA + property + ChatColor.WHITE + " was set to " + ChatColor.GREEN + value);
} else {
sender.sendMessage(ChatColor.RED + "There was an error setting " + ChatColor.GRAY + property);
}
}
}
@@ -1,21 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
import org.bukkit.command.CommandSender;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.pneumaticraft.commandhandler.Command;
public abstract class MultiverseCommand extends Command {
protected MultiverseCore plugin;
public MultiverseCommand(MultiverseCore plugin) {
super(plugin);
this.plugin = plugin;
}
@Override
public abstract void runCommand(CommandSender sender, List<String> args);
}
@@ -1,77 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.utils.PurgeWorlds;
public class PurgeCommand extends MultiverseCommand {
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.setPermission("multiverse.core.purge", "Removed the specified type of mob from the specified world.", PermissionDefault.OP);
}
@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.plugin.isMVWorld(worldName)) {
((MultiverseCore)this.plugin).showNotMVWorldMessage(sender, worldName);
sender.sendMessage("It cannot be purged.");
return;
}
List<MVWorld> worldsToRemoveEntitiesFrom = new ArrayList<MVWorld>();
// Handle all case any user who names a world "all" should know better...
if (worldName.equalsIgnoreCase("all")) {
worldsToRemoveEntitiesFrom.addAll(this.plugin.getMVWorlds());
} else {
worldsToRemoveEntitiesFrom.add(this.plugin.getMVWorld(worldName));
}
PurgeWorlds purger = this.plugin.getWorldPurger();
ArrayList<String> thingsToKill = new ArrayList<String>();
if (deathName.equalsIgnoreCase("all") || deathName.equalsIgnoreCase("animals") || deathName.equalsIgnoreCase("monsters")) {
thingsToKill.add(deathName.toUpperCase());
} else {
Collections.addAll(thingsToKill, deathName.toUpperCase().split(","));
}
for (MVWorld w : worldsToRemoveEntitiesFrom) {
purger.purgeWorld(sender, w, thingsToKill, false, false);
}
return;
}
}
@@ -0,0 +1,97 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.Collections;
import java.util.Random;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.MessageType;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Conditions;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Optional;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlag;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagGroup;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandValueFlag;
import com.onarandombox.MultiverseCore.commandtools.flags.ParsedCommandFlags;
import com.onarandombox.MultiverseCore.commandtools.queue.QueuedCommand;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class RegenCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
@Inject
public RegenCommand(@NotNull MVCommandManager commandManager, @NotNull MVWorldManager worldManager) {
super(commandManager);
this.worldManager = worldManager;
registerFlagGroup(CommandFlagGroup.builder("mvregen")
.add(CommandValueFlag.builder("--seed", String.class)
.addAlias("-s")
.completion(() -> Collections.singleton(String.valueOf(new Random().nextLong())))
.optional()
.build())
.add(CommandFlag.builder("--keep-gamerules")
.addAlias("-k")
.build())
.build());
}
@Subcommand("regen")
@CommandPermission("multiverse.core.regen")
@CommandCompletion("@mvworlds:scope=both @flags:groupName=mvregen")
@Syntax("<world> --seed [seed] --keep-gamerules")
@Description("{@@mv-core.regen.description}")
public void onRegenCommand(BukkitCommandIssuer issuer,
@Conditions("validWorldName:scope=both")
@Syntax("<world>")
@Description("{@@mv-core.regen.world.description}")
String worldName,
@Optional
@Syntax("--seed [seed] --keep-gamerules")
@Description("{@@mv-core.regen.other.description}")
String[] flags
) {
ParsedCommandFlags parsedFlags = parseFlags(flags);
this.commandManager.getCommandQueueManager().addToQueue(new QueuedCommand(
issuer.getIssuer(),
() -> {
issuer.sendInfo(MVCorei18n.REGEN_REGENERATING,
"{world}", worldName);
if (!this.worldManager.regenWorld(
worldName,
parsedFlags.hasFlag("--seed"),
!parsedFlags.hasFlagValue("--seed"),
parsedFlags.flagValue("--seed", String.class),
parsedFlags.hasFlag("--keep-gamerules")
)) {
issuer.sendError(MVCorei18n.REGEN_FAILED,
"{world}", worldName);
return;
}
issuer.sendInfo(MVCorei18n.REGEN_SUCCESS,
"{world}", worldName);
},
this.commandManager.formatMessage(
issuer,
MessageType.INFO,
MVCorei18n.REGEN_PROMPT,
"{world}", worldName)
));
}
}
@@ -3,42 +3,69 @@ package com.onarandombox.MultiverseCore.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Subcommand;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.anchor.AnchorManager;
import com.onarandombox.MultiverseCore.api.MVCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.config.MVCoreConfig;
import com.onarandombox.MultiverseCore.event.MVConfigReloadEvent;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.bukkit.plugin.PluginManager;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class ReloadCommand extends MultiverseCommand {
public ReloadCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Reload Configs");
this.setCommandUsage("/mv reload");
this.setArgRange(0, 0);
this.addKey("mvreload");
this.addKey("mv reload");
this.setPermission("multiverse.core.reload", "Reloads worlds.yml and config.yml.", PermissionDefault.OP);
private final MVCoreConfig config;
private final AnchorManager anchorManager;
private final MVWorldManager worldManager;
private final PluginManager pluginManager;
@Inject
public ReloadCommand(
@NotNull MVCommandManager commandManager,
@NotNull MVCoreConfig config,
@NotNull AnchorManager anchorManager,
@NotNull MVWorldManager worldManager,
@NotNull PluginManager pluginManager
) {
super(commandManager);
this.config = config;
this.anchorManager = anchorManager;
this.worldManager = worldManager;
this.pluginManager = pluginManager;
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
sender.sendMessage(ChatColor.GOLD + "Reloading all Multiverse Plugin configs...");
this.plugin.loadConfigs();
this.plugin.loadWorlds(true);
// Create the event
List<String> configsLoaded = new ArrayList<String>();
@Subcommand("reload")
@CommandPermission("multiverse.core.reload")
@Description("{@@mv-core.reload.description}")
public void onReloadCommand(@NotNull BukkitCommandIssuer issuer) {
issuer.sendInfo(MVCorei18n.RELOAD_RELOADING);
this.config.load();
this.worldManager.loadWorldsConfig();
this.worldManager.loadWorlds(true);
this.anchorManager.loadAnchors();
List<String> configsLoaded = new ArrayList<>();
configsLoaded.add("Multiverse-Core - config.yml");
configsLoaded.add("Multiverse-Core - worlds.yml");
MVConfigReloadEvent configReload = new MVConfigReloadEvent(configsLoaded);
this.plugin.getServer().getPluginManager().callEvent(configReload);
for(String s : configReload.getAllConfigsLoaded()) {
sender.sendMessage(s);
}
sender.sendMessage(ChatColor.GREEN + "Reload Complete!");
}
configsLoaded.add("Multiverse-Core - anchors.yml");
MVConfigReloadEvent configReload = new MVConfigReloadEvent(configsLoaded);
this.pluginManager.callEvent(configReload);
// @TODO: replace this sendMessage and format the configsLoaded above, maybe?
configReload.getAllConfigsLoaded().forEach(issuer::sendMessage);
issuer.sendInfo(MVCorei18n.RELOAD_SUCCESS);
}
}
@@ -1,31 +1,52 @@
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 co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Conditions;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Single;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
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.setPermission("multiverse.core.remove", "Unloads a world from Multiverse and removes it from worlds.yml, this does NOT remove the world folder.", PermissionDefault.OP);
private final MVWorldManager worldManager;
@Inject
public RemoveCommand(@NotNull MVCommandManager commandManager, @NotNull MVWorldManager worldManager) {
super(commandManager);
this.worldManager = worldManager;
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (this.plugin.removeWorldFromConfig(args.get(0))) {
sender.sendMessage("World removed from config!");
} else {
sender.sendMessage("Error trying to remove world from config!");
@Subcommand("remove")
@CommandPermission("multiverse.core.remove")
@CommandCompletion("@mvworlds:scope=both")
@Syntax("<world>")
@Description("{@@mv-core.remove.description}")
public void onRemoveCommand(BukkitCommandIssuer issuer,
@Single
@Conditions("mvworlds:scope=both")
@Syntax("<world>")
@Description("{@@mv-core.remove.world.description}")
String worldName
) {
if (!this.worldManager.removeWorldFromConfig(worldName)) {
issuer.sendError(MVCorei18n.REMOVE_FAILED);
return;
}
issuer.sendInfo(MVCorei18n.REMOVE_SUCCESS,
"{world}", worldName);
}
}
@@ -0,0 +1,34 @@
package com.onarandombox.MultiverseCore.commands;
import co.aikar.commands.CommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
public class RootCommand extends MultiverseCommand {
private final Plugin plugin;
@Inject
public RootCommand(@NotNull MVCommandManager commandManager, @NotNull MultiverseCore plugin) {
super(commandManager);
this.plugin = plugin;
}
@CommandAlias("mv")
public void onRootCommand(CommandIssuer issuer) {
PluginDescriptionFile description = this.plugin.getDescription();
issuer.sendInfo(MVCorei18n.ROOT_TITLE,
"{name}", description.getName(),
"{version}", description.getVersion());
issuer.sendInfo(MVCorei18n.ROOT_HELP);
}
}
@@ -1,40 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
public class SetSpawnCommand extends MultiverseCommand {
public SetSpawnCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Set World Spawn");
this.setCommandUsage("/mv setspawn");
this.setArgRange(0, 0);
this.addKey("mvsetspawn");
this.addKey("mvss");
this.addKey("mv set spawn");
this.addKey("mv setspawn");
this.addKey("mvset spawn");
this.setPermission("multiverse.core.spawn.set", "Sets the spawn for the current world.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (sender instanceof Player) {
Player p = (Player) sender;
Location l = p.getLocation();
World w = p.getWorld();
w.setSpawnLocation(l.getBlockX(), l.getBlockY(), l.getBlockZ());
p.sendMessage(w.getName() + " - Spawn set to X: " + l.getBlockX() + " Y: " + l.getBlockY() + " Z: " + l.getBlockZ());
} else {
sender.sendMessage("You cannot use this command from the console.");
}
}
}
@@ -1,41 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
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;
}
// MVPlayerSession session = this.plugin.getPlayerSession(p);
// if (session.getBedRespawnLocation() != null) {
// p.teleport(session.getBedRespawnLocation());
// } else {
// sender.sendMessage("Hmm this is awkward...");
// sender.sendMessage("Something is wrong with your bed.");
// sender.sendMessage("It has either been destroyed or obstructed.");
// }
}
}
@@ -1,66 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.List;
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 com.onarandombox.MultiverseCore.MultiverseCore;
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.getPermissions().hasPermission(player, "multiverse.core.spawn.other", true)) {
sender.sendMessage("You don't have permission to teleport another player to spawn. (multiverse.core.spawn.other)");
return;
}
Player target = this.plugin.getServer().getPlayer(args.get(0));
if (target != null) {
target.sendMessage("Teleporting to this world's spawn...");
target.teleport(target.getWorld().getSpawnLocation());
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.getPermissions().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...");
player.teleport(player.getWorld().getSpawnLocation());
} else {
sender.sendMessage("From the console, you must provide a PLAYER.");
}
}
}
}
@@ -1,118 +1,69 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
import java.util.concurrent.CompletableFuture;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.CommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Flags;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.destination.DestinationsProvider;
import com.onarandombox.MultiverseCore.destination.ParsedDestination;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MVTeleport;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.utils.MVDestination;
import com.onarandombox.utils.DestinationFactory;
import com.onarandombox.utils.InvalidDestination;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class TeleportCommand extends MultiverseCommand {
private MVTeleport playerTeleporter;
public TeleportCommand(MultiverseCore plugin) {
super(plugin);
Permission self = new Permission("multiverse.core.tp.self", "Allows you to teleport yourself to other worlds.", PermissionDefault.OP);
Permission other = new Permission("multiverse.core.tp.other", "Allows you to teleport others to other worlds.", PermissionDefault.OP);
private final DestinationsProvider destinationsProvider;
this.setName("Teleport");
this.setCommandUsage("/mv tp " + ChatColor.GOLD + "[PLAYER]" + ChatColor.GREEN + " {WORLD}");
this.setArgRange(1, 2);
this.addKey("mvtp");
this.addKey("mv tp");
this.playerTeleporter = new MVTeleport(this.plugin);
// setPermission in some for is REQUIRED
this.setPermission(self);
this.addAdditonalPermission(other);
@Inject
public TeleportCommand(MVCommandManager commandManager, DestinationsProvider destinationsProvider) {
super(commandManager);
this.destinationsProvider = destinationsProvider;
}
@Subcommand("teleport|tp")
@CommandCompletion("@players|@mvworlds:playerOnly|@destinations:playerOnly @mvworlds|@destinations")
@Syntax("[player] <destination>")
@Description("{@@mv-core.teleport.description}")
public void onTeleportCommand(BukkitCommandIssuer issuer,
@Flags("resolve=issuerAware")
@Syntax("[player]")
@Description("{@@mv-core.teleport.player.description}")
Player[] players,
@Syntax("<destination>")
@Description("{@@mv-core.teleport.destination.description}")
ParsedDestination<?> destination
) {
// TODO Add warning if teleporting too many players at once.
CompletableFuture.allOf(Arrays.stream(players)
.map(player -> this.destinationsProvider.playerTeleportAsync(issuer, player, destination))
.toArray(CompletableFuture[]::new))
.thenRun(() -> {
String playerName = players.length == 1
? issuer.getPlayer() == players[0] ? "you" : players[0].getName()
: players.length + " players";
issuer.sendInfo(MVCorei18n.TELEPORT_SUCCESS,
"{player}", playerName, "{destination}", destination.toString());
});
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// Check if the command was sent from a Player.
Player teleporter = null;
Player teleportee = null;
if (sender instanceof Player) {
teleporter = (Player) sender;
}
String destinationName;
if (args.size() == 2) {
if (teleporter != null && !this.plugin.getPermissions().hasPermission(sender, "multiverse.core.tp.other", true)) {
sender.sendMessage("You don't have permission to teleport another player. (multiverse.core.tp.other)");
return;
}
teleportee = this.plugin.getServer().getPlayer(args.get(0));
if (teleportee == null) {
sender.sendMessage("Sorry, I couldn't find player: " + args.get(0));
return;
}
destinationName = args.get(1);
} else {
destinationName = args.get(0);
if (teleporter != null && !this.plugin.getPermissions().hasPermission(sender, "multiverse.core.tp.self", true)) {
sender.sendMessage("You don't have permission to teleport yourself between worlds. (multiverse.core.tp.self)");
return;
}
if (!(sender instanceof Player)) {
sender.sendMessage("From the console, you must specifiy a player to teleport");
return;
}
teleporter = (Player) sender;
teleportee = (Player) sender;
}
DestinationFactory df = this.plugin.getDestinationFactory();// .parseDestination(worldName, (MultiverseCore) this.plugin);
MVDestination d = df.getDestination(destinationName);
if (d != null && d instanceof InvalidDestination) {
sender.sendMessage("Multiverse does not know how to take you to: " + ChatColor.RED + destinationName);
return;
}
if (teleporter != null && !this.plugin.getPermissions().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.getPermissions().canTravelFromLocation(teleporter, d.getLocation(teleportee))) {
if (teleportee.equals(teleporter)) {
teleporter.sendMessage("DOH! Doesn't look like you can get to " + ChatColor.RED + "THERE from " + ChatColor.GREEN + teleporter.getWorld().getName());
} else {
teleporter.sendMessage("DOH! Doesn't look like " + ChatColor.GREEN + teleporter.getWorld().getName() + " can get to " + ChatColor.RED + "THERE from where they are...");
}
return;
}
Location l = d.getLocation(teleportee);
if (l == null) {
teleporter.sendMessage("Sorry Boss, I tried everything, but just couldn't teleport ya there!");
return;
}
if (!this.playerTeleporter.safelyTeleport(teleportee, l)) {
Class<?> paramTypes[] = { Player.class, Location.class };
List<Object> items = new ArrayList<Object>();
items.add(teleportee);
items.add(l);
String player = "you";
if (!teleportee.equals(teleporter)) {
player = teleportee.getName();
}
String message = ChatColor.GREEN + "Multiverse" + ChatColor.WHITE + " did not teleport " + ChatColor.AQUA + player + ChatColor.WHITE + " to " + ChatColor.DARK_AQUA + d.getName() + ChatColor.WHITE + " because it was unsafe.";
this.plugin.getCommandHandler().queueCommand(sender, "mvteleport", "teleportPlayer", items, paramTypes, message, "Would you like to try anyway?", "", "", 15);
} else {
teleportee.setVelocity(d.getVelocity());
}
public boolean hasPermission(CommandIssuer issuer) {
return this.destinationsProvider.hasAnyTeleportPermission(issuer);
}
}
@@ -1,31 +1,54 @@
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 co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.api.MVWorld;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
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);
private final MVWorldManager worldManager;
@Inject
public UnloadCommand(@NotNull MVCommandManager commandManager, @NotNull MVWorldManager worldManager) {
super(commandManager);
this.worldManager = worldManager;
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
if (this.plugin.removeWorldFromList(args.get(0))) {
sender.sendMessage("World Unloaded!");
} else {
sender.sendMessage("Error trying to unload world!");
@Subcommand("unload")
@CommandPermission("multiverse.core.unload")
@CommandCompletion("@mvworlds")
@Syntax("<world>")
@Description("{@@mv-core.unload.description}")
public void onUnloadCommand(BukkitCommandIssuer issuer,
@Syntax("<world>")
@Description("{@@mv-core.unload.world.description}")
MVWorld world
) {
issuer.sendInfo(MVCorei18n.UNLOAD_UNLOADING,
"{world}", world.getColoredWorldString());
//TODO API: Should be able to use MVWorld object directly
if (!this.worldManager.unloadWorld(world.getName())) {
issuer.sendError(MVCorei18n.UNLOAD_FAILURE,
"{world}", world.getColoredWorldString());
return;
}
issuer.sendInfo(MVCorei18n.UNLOAD_SUCCESS,
"{world}", world.getColoredWorldString());
}
}
@@ -0,0 +1,39 @@
package com.onarandombox.MultiverseCore.commands;
import co.aikar.commands.CommandHelp;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.HelpCommand;
import co.aikar.commands.annotation.Subcommand;
import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
@CommandAlias("mv")
public class UsageCommand extends MultiverseCommand {
@Inject
public UsageCommand(@NotNull MVCommandManager commandManager) {
super(commandManager);
}
@HelpCommand
@Subcommand("help")
@CommandPermission("multiverse.core.help")
@CommandCompletion("@commands:mv")
@Syntax("[filter] [page]")
@Description("{@@mv-core.usage.description}")
public void onUsageCommand(CommandHelp help) {
if (help.getIssuer().isPlayer()) {
// Prevent flooding the chat
help.setPerPage(4);
}
this.commandManager.showUsage(help);
}
}
@@ -1,100 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.List;
import java.util.logging.Level;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.event.MVVersionRequestEvent;
public class VersionCommand extends MultiverseCommand {
public VersionCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Multiverse Version");
this.setCommandUsage("/mv version " + ChatColor.GOLD + "-p");
this.setArgRange(0, 1);
this.addKey("mv version");
this.addKey("mvv");
this.addKey("mvversion");
this.setPermission("multiverse.core.version", "Dumps version info to the console, optionally to pastebin.com with a -p.", PermissionDefault.TRUE);
}
private String pasteBinBuffer = "";
@Override
public void runCommand(CommandSender sender, List<String> args) {
// Check if the command was sent from a Player.
if (sender instanceof Player) {
sender.sendMessage("Version info dumped to console. Please check your server logs.");
}
logAndAddToPasteBinBuffer("Multiverse-Core Version: " + this.plugin.getDescription().getVersion());
logAndAddToPasteBinBuffer("Bukkit Version: " + this.plugin.getServer().getVersion());
logAndAddToPasteBinBuffer("Loaded Worlds: " + this.plugin.getMVWorlds().size());
logAndAddToPasteBinBuffer("Multiverse Plugins Loaded: " + this.plugin.getPluginCount());
logAndAddToPasteBinBuffer("Economy being used: " + this.plugin.getBank().getEconUsed());
logAndAddToPasteBinBuffer("Permissions Plugin: " + this.plugin.getPermissions().getType());
logAndAddToPasteBinBuffer("Dumping Config Values: (version " + this.plugin.getConfig().getString("version", "NOT SET") + ")");
logAndAddToPasteBinBuffer("messagecooldown: " + this.plugin.getConfig().getString("messagecooldown", "NOT SET"));
logAndAddToPasteBinBuffer("teleportcooldown: " + this.plugin.getConfig().getString("teleportcooldown", "NOT SET"));
logAndAddToPasteBinBuffer("worldnameprefix: " + this.plugin.getConfig().getString("worldnameprefix", "NOT SET"));
logAndAddToPasteBinBuffer("opfallback: " + this.plugin.getConfig().getString("opfallback", "NOT SET"));
logAndAddToPasteBinBuffer("disableautoheal: " + this.plugin.getConfig().getString("disableautoheal", "NOT SET"));
logAndAddToPasteBinBuffer("fakepvp: " + this.plugin.getConfig().getString("fakepvp", "NOT SET"));
logAndAddToPasteBinBuffer("Special Code: FRN001");
MVVersionRequestEvent versionEvent = new MVVersionRequestEvent(pasteBinBuffer);
this.plugin.getServer().getPluginManager().callEvent(versionEvent);
pasteBinBuffer = versionEvent.getPasteBinBuffer();
if (args.size() == 1 && args.get(0).equalsIgnoreCase("-p")) {
String pasteBinUrl = postToPasteBin();
sender.sendMessage("Version info dumped here: " + ChatColor.GREEN + pasteBinUrl);
this.plugin.log(Level.INFO, "Version info dumped here: " + pasteBinUrl);
}
}
private void logAndAddToPasteBinBuffer(String string) {
this.pasteBinBuffer += "[Multiverse-Core] " + string + "\n";
this.plugin.log(Level.INFO, string);
}
private String postToPasteBin() {
try {
String data = URLEncoder.encode("api_dev_key", "UTF-8") + "=" + URLEncoder.encode("33ab32380506d99d872b69d35dc9d007", "UTF-8");
data += "&" + URLEncoder.encode("api_option", "UTF-8") + "=" + URLEncoder.encode("paste", "UTF-8");
data += "&" + URLEncoder.encode("api_paste_code", "UTF-8") + "=" + URLEncoder.encode(this.pasteBinBuffer, "UTF-8");
URL url = new URL("http://pastebin.com/api/api_post.php");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
String pasteBinUrl = "";
while ((line = rd.readLine()) != null) {
pasteBinUrl = line;
}
wr.close();
rd.close();
return pasteBinUrl;
} catch (Exception e) {
System.out.print(e);
return "Error Posting to pastebin.com";
}
}
}
@@ -1,88 +0,0 @@
package com.onarandombox.MultiverseCore.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.MultiverseCore;
public class WhoCommand extends MultiverseCommand {
public WhoCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Who?");
this.setCommandUsage("/mv who" + ChatColor.GOLD + " [WORLD]");
this.setArgRange(0, 1);
this.addKey("mv who");
this.addKey("mvw");
this.addKey("mvwho");
this.setPermission("multiverse.core.list.who", "States who is in what world.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
// If this command was sent from a Player then we need to check Permissions
Player p = null;
// By default, show all from the console
boolean showAll = true;
if (sender instanceof Player) {
p = (Player) sender;
showAll = false;
}
List<MVWorld> worlds = new ArrayList<MVWorld>();
if (args.size() > 0) {
if (args.get(0).equalsIgnoreCase("--all") || args.get(0).equalsIgnoreCase("-a")) {
showAll = true;
worlds = new ArrayList<MVWorld>(this.plugin.getMVWorlds());
} else if (this.plugin.isMVWorld(args.get(0))) {
worlds.add(this.plugin.getMVWorld(args.get(0)));
} else {
sender.sendMessage(ChatColor.RED + "World does not exist");
return;
}
} else {
worlds = new ArrayList<MVWorld>(this.plugin.getMVWorlds());
}
if (worlds.size() == 0) {
sender.sendMessage("Multiverse does not know about any of your worlds :(");
} else if (worlds.size() == 1) {
sender.sendMessage(ChatColor.AQUA + "--- " + "Players in" + ChatColor.YELLOW + worlds.get(0) + ChatColor.AQUA + " ---");
} else {
sender.sendMessage(ChatColor.AQUA + "--- There are players in ---");
}
for (MVWorld world : worlds) {
if (!(this.plugin.isMVWorld(world.getName()))) {
continue;
}
if (p != null && (!this.plugin.getPermissions().canEnterWorld(p, world))) {
continue;
}
List<Player> players = world.getCBWorld().getPlayers();
String result = "";
if (players.size() <= 0 && !showAll) {
continue;
}
if (players.size() <= 0) {
result = "Empty";
} else {
for (Player player : players) {
result += player.getName() + " ";
}
}
sender.sendMessage(world.getColoredWorldString() + ChatColor.WHITE + " - " + result);
}
}
}
@@ -0,0 +1,4 @@
/**
* This package contains all the commands for Multiverse-Core.
*/
package com.onarandombox.MultiverseCore.commands;
@@ -0,0 +1,146 @@
package com.onarandombox.MultiverseCore.commandtools;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import co.aikar.commands.BukkitCommandCompletionContext;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.CommandIssuer;
import co.aikar.commands.PaperCommandCompletions;
import co.aikar.commands.RegisteredCommand;
import co.aikar.commands.RootCommand;
import com.google.common.collect.Sets;
import com.onarandombox.MultiverseCore.api.MVWorld;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.config.MVCoreConfig;
import com.onarandombox.MultiverseCore.destination.DestinationsProvider;
import com.onarandombox.MultiverseCore.destination.ParsedDestination;
import jakarta.inject.Inject;
import org.bukkit.GameRule;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
public class MVCommandCompletions extends PaperCommandCompletions {
protected final MVCommandManager commandManager;
private final MVWorldManager worldManager;
private final DestinationsProvider destinationsProvider;
@Inject
public MVCommandCompletions(
@NotNull MVCommandManager mvCommandManager,
@NotNull MVWorldManager worldManager,
@NotNull DestinationsProvider destinationsProvider,
@NotNull MVCoreConfig config
) {
super(mvCommandManager);
this.commandManager = mvCommandManager;
this.worldManager = worldManager;
this.destinationsProvider = destinationsProvider;
registerAsyncCompletion("commands", this::suggestCommands);
registerAsyncCompletion("destinations", this::suggestDestinations);
registerAsyncCompletion("flags", this::suggestFlags);
registerStaticCompletion("gamerules", this::suggestGamerules);
registerStaticCompletion("mvconfigs", config.getNodes().getNames());
registerAsyncCompletion("mvworlds", this::suggestMVWorlds);
setDefaultCompletion("destinations", ParsedDestination.class);
setDefaultCompletion("flags", String[].class);
setDefaultCompletion("gamerules", GameRule.class);
setDefaultCompletion("mvworlds", MVWorld.class);
}
private Collection<String> suggestCommands(BukkitCommandCompletionContext context) {
String rootCmdName = context.getConfig();
if (rootCmdName == null) {
return Collections.emptyList();
}
RootCommand rootCommand = this.commandManager.getRegisteredRootCommands().stream()
.unordered()
.filter(c -> c.getCommandName().equals(rootCmdName))
.findFirst()
.orElse(null);
if (rootCommand == null) {
return Collections.emptyList();
}
return rootCommand.getSubCommands().entries().stream()
.filter(entry -> checkPerms(context.getIssuer(), entry.getValue()))
.map(Map.Entry::getKey)
.filter(cmdName -> !cmdName.startsWith("__"))
.collect(Collectors.toList());
}
private boolean checkPerms(CommandIssuer issuer, RegisteredCommand<?> command) {
return this.commandManager.hasPermission(issuer, command.getRequiredPermissions());
}
private Collection<String> suggestDestinations(BukkitCommandCompletionContext context) {
if (context.hasConfig("playerOnly") && !context.getIssuer().isPlayer()) {
return Collections.emptyList();
}
return this.destinationsProvider
.suggestDestinations((BukkitCommandIssuer)context.getIssuer(), context.getInput());
}
private Collection<String> suggestFlags(@NotNull BukkitCommandCompletionContext context) {
return this.commandManager.getFlagsManager().suggest(
context.getConfig("groupName", ""), context.getContextValue(String[].class));
}
private Collection<String> suggestGamerules() {
return Arrays.stream(GameRule.values()).map(GameRule::getName).collect(Collectors.toList());
}
private Collection<String> suggestMVWorlds(BukkitCommandCompletionContext context) {
if (context.hasConfig("playerOnly") && !context.getIssuer().isPlayer()) {
return Collections.emptyList();
}
if (!context.hasConfig("multiple")) {
return getMVWorldNames(context);
}
String input = context.getInput();
int lastComma = input.lastIndexOf(',');
String currentWorldsString = input.substring(0, lastComma + 1);
Set<String> currentWorlds = Sets.newHashSet(input.split(","));
return getMVWorldNames(context).stream()
.filter(world -> !currentWorlds.contains(world))
.map(world -> currentWorldsString + world)
.collect(Collectors.toList());
}
private List<String> getMVWorldNames(BukkitCommandCompletionContext context) {
String scope = context.getConfig("scope", "loaded");
List<String> worlds = new ArrayList<>();
switch (scope) {
case "both":
worlds.addAll(worldManager.getUnloadedWorlds());
case "loaded":
worldManager.getMVWorlds()
.stream()
.map(MVWorld::getName)
.forEach(worlds::add);
break;
case "unloaded":
worlds.addAll(worldManager.getUnloadedWorlds());
break;
case "potential":
worlds.addAll(worldManager.getPotentialWorlds());
break;
}
return worlds;
}
}
@@ -0,0 +1,80 @@
package com.onarandombox.MultiverseCore.commandtools;
import co.aikar.commands.BukkitCommandExecutionContext;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.BukkitConditionContext;
import co.aikar.commands.CommandConditions;
import co.aikar.commands.ConditionContext;
import co.aikar.commands.ConditionFailedException;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.world.WorldNameChecker;
import jakarta.annotation.PostConstruct;
import org.jetbrains.annotations.NotNull;
public class MVCommandConditions {
static void load(MVCommandManager commandManager, MVWorldManager worldManager) {
new MVCommandConditions(commandManager, worldManager);
}
private final MVWorldManager worldManager;
private final MVCommandManager commandManager;
private MVCommandConditions(@NotNull MVCommandManager commandManager, @NotNull MVWorldManager worldManager) {
this.worldManager = worldManager;
this.commandManager = commandManager;
}
@PostConstruct
private void registerConditions() {
CommandConditions<BukkitCommandIssuer, BukkitCommandExecutionContext, BukkitConditionContext> conditions
= commandManager.getCommandConditions();
conditions.addCondition(String.class, "validWorldName", this::checkValidWorldName);
}
private void checkValidWorldName(ConditionContext<BukkitCommandIssuer> context,
BukkitCommandExecutionContext executionContext,
String worldName
) {
String scope = context.getConfigValue("scope", "loaded");
switch (scope) {
// Worlds that are loaded
case "loaded":
if (!this.worldManager.isMVWorld(worldName)) {
throw new ConditionFailedException("World with name '" + worldName + "' does not exist or is not loaded!");
}
break;
// Worlds that are unloaded
case "unloaded":
if (!this.worldManager.hasUnloadedWorld(worldName, false)) {
if (this.worldManager.isMVWorld(worldName)) {
throw new ConditionFailedException("World with name '" + worldName + "' is loaded already!");
}
throw new ConditionFailedException("World with name '" + worldName + "' does not exist!");
}
break;
// World that are loaded or unloaded
case "both":
if (!this.worldManager.hasUnloadedWorld(worldName, true)) {
throw new ConditionFailedException("World with name '" + worldName + "' does not exist!");
}
break;
// World that are does not exist
case "new":
if (this.worldManager.hasUnloadedWorld(worldName, true)) {
throw new ConditionFailedException("World with name '" + worldName + "' already exists!");
}
switch (WorldNameChecker.checkName(worldName)) {
case INVALID_CHARS:
throw new ConditionFailedException("World name '" + worldName + "' contains invalid characters!");
case BLACKLISTED:
throw new ConditionFailedException("World name '" + worldName + "' is used for critical server operations and is blacklisted!");
}
break;
// Probably a typo happened here
default:
throw new ConditionFailedException("Unknown scope '" + scope + "'!");
}
}
}
@@ -0,0 +1,356 @@
package com.onarandombox.MultiverseCore.commandtools;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import co.aikar.commands.BukkitCommandExecutionContext;
import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.InvalidCommandArgument;
import co.aikar.commands.PaperCommandContexts;
import co.aikar.commands.contexts.ContextResolver;
import com.google.common.base.Strings;
import com.onarandombox.MultiverseCore.api.MVWorld;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.context.GameRuleValue;
import com.onarandombox.MultiverseCore.commandtools.context.MVConfigValue;
import com.onarandombox.MultiverseCore.config.MVCoreConfig;
import com.onarandombox.MultiverseCore.configuration.node.Node;
import com.onarandombox.MultiverseCore.configuration.node.ValueNode;
import com.onarandombox.MultiverseCore.destination.DestinationsProvider;
import com.onarandombox.MultiverseCore.destination.ParsedDestination;
import com.onarandombox.MultiverseCore.display.filters.ContentFilter;
import com.onarandombox.MultiverseCore.display.filters.DefaultContentFilter;
import com.onarandombox.MultiverseCore.display.filters.RegexContentFilter;
import com.onarandombox.MultiverseCore.utils.PlayerFinder;
import io.vavr.control.Option;
import jakarta.inject.Inject;
import org.bukkit.GameRule;
import org.bukkit.entity.Player;
import org.jvnet.hk2.annotations.Service;
@Service
public class MVCommandContexts extends PaperCommandContexts {
private final MVCommandManager mvCommandManager;
private final DestinationsProvider destinationsProvider;
private final MVWorldManager worldManager;
private final MVCoreConfig config;
@Inject
public MVCommandContexts(
MVCommandManager mvCommandManager,
DestinationsProvider destinationsProvider,
MVWorldManager worldManager,
MVCoreConfig config
) {
super(mvCommandManager);
this.mvCommandManager = mvCommandManager;
this.destinationsProvider = destinationsProvider;
this.worldManager = worldManager;
this.config = config;
registerIssuerOnlyContext(BukkitCommandIssuer.class, BukkitCommandExecutionContext::getIssuer);
registerIssuerOnlyContext(MVCommandIssuer.class, this::parseMVCommandIssuer);
registerOptionalContext(ContentFilter.class, this::parseContentFilter);
registerContext(ParsedDestination.class, this::parseDestination);
registerContext(GameRule.class, this::parseGameRule);
registerContext(GameRuleValue.class, this::parseGameRuleValue);
registerContext(MVConfigValue.class, this::parseMVConfigValue);
registerIssuerAwareContext(MVWorld.class, this::parseMVWorld);
registerIssuerAwareContext(MVWorld[].class, this::parseMVWorldArray);
registerIssuerAwareContext(Player.class, this::parsePlayer);
registerIssuerAwareContext(Player[].class, this::parsePlayerArray);
}
private MVCommandIssuer parseMVCommandIssuer(BukkitCommandExecutionContext context) {
if (context.getIssuer() instanceof MVCommandIssuer) {
return (MVCommandIssuer) context.getIssuer();
}
return mvCommandManager.getCommandIssuer(context.getSender());
}
private ContentFilter parseContentFilter(BukkitCommandExecutionContext context) {
if (Strings.isNullOrEmpty(context.getFirstArg())) {
return DefaultContentFilter.get();
}
String filterString = context.popFirstArg();
return RegexContentFilter.fromString(filterString);
}
private ParsedDestination<?> parseDestination(BukkitCommandExecutionContext context) {
String destination = context.popFirstArg();
if (Strings.isNullOrEmpty(destination)) {
throw new InvalidCommandArgument("No destination specified.");
}
ParsedDestination<?> parsedDestination = destinationsProvider.parseDestination(destination);
if (parsedDestination == null) {
throw new InvalidCommandArgument("The destination " + destination + " is not valid.");
}
return parsedDestination;
}
private GameRule<?> parseGameRule(BukkitCommandExecutionContext context) {
String gameRuleName = context.popFirstArg();
if (Strings.isNullOrEmpty(gameRuleName)) {
throw new InvalidCommandArgument("No game rule specified.");
}
GameRule<?> gameRule = GameRule.getByName(gameRuleName);
if (gameRule == null) {
throw new InvalidCommandArgument("The game rule " + gameRuleName + " is not valid.");
}
return gameRule;
}
private GameRuleValue parseGameRuleValue(BukkitCommandExecutionContext context) {
GameRule<?> gameRule = (GameRule<?>) context.getResolvedArg(GameRule.class);
if (gameRule == null) {
throw new InvalidCommandArgument("No game rule specified.");
}
String valueString = context.getFirstArg();
if (Strings.isNullOrEmpty(valueString)) {
throw new InvalidCommandArgument("No game rule value specified.");
}
ContextResolver<?, BukkitCommandExecutionContext> resolver = getResolver(gameRule.getType());
if (resolver == null) {
return new GameRuleValue(valueString);
}
Object resolvedValue = resolver.getContext(context);
if (resolvedValue == null) {
throw new InvalidCommandArgument("The game rule value " + valueString + " is not valid for game rule " + gameRule.getName() + ".");
}
return new GameRuleValue(resolvedValue);
}
private MVConfigValue parseMVConfigValue(BukkitCommandExecutionContext context) {
String configName = (String) context.getResolvedArg(String.class);
if (Strings.isNullOrEmpty(configName)) {
throw new InvalidCommandArgument("No config name specified.");
}
Option<Node> node = config.getNodes().findNode(configName);
if (node.isEmpty()) {
throw new InvalidCommandArgument("The config " + configName + " is not valid.");
}
String valueString = context.getFirstArg();
if (Strings.isNullOrEmpty(valueString)) {
throw new InvalidCommandArgument("No config value specified.");
}
if (!(node.get() instanceof ValueNode)) {
context.popFirstArg();
return new MVConfigValue(valueString);
}
ContextResolver<?, BukkitCommandExecutionContext> resolver = getResolver(((ValueNode<?>) node.get()).getType());
if (resolver == null) {
context.popFirstArg();
return new MVConfigValue(valueString);
}
Object resolvedValue = resolver.getContext(context);
if (resolvedValue == null) {
throw new InvalidCommandArgument("The config value " + valueString + " is not valid for config " + configName + ".");
}
return new MVConfigValue(resolvedValue);
}
private MVWorld parseMVWorld(BukkitCommandExecutionContext context) {
String resolve = context.getFlagValue("resolve", "");
// Get world based on sender only
if (resolve.equals("issuerOnly")) {
if (context.getIssuer().isPlayer()) {
return worldManager.getMVWorld(context.getIssuer().getPlayer().getWorld());
}
if (context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("This command can only be used by a player in a Multiverse World.");
}
String worldName = context.getFirstArg();
MVWorld world = worldManager.getMVWorld(worldName);
// Get world based on input, fallback to sender if input is not a world
if (resolve.equals("issuerAware")) {
if (world != null) {
context.popFirstArg();
return world;
}
if (context.getIssuer().isPlayer()) {
return worldManager.getMVWorld(context.getIssuer().getPlayer().getWorld());
}
if (context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("Player is not in a Multiverse World.");
}
// Get world based on input only
if (world != null) {
context.popFirstArg();
return world;
}
if (!context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("World " + worldName + " is not a loaded multiverse world.");
}
private MVWorld[] parseMVWorldArray(BukkitCommandExecutionContext context) {
String resolve = context.getFlagValue("resolve", "");
MVWorld playerWorld = null;
if (context.getIssuer().isPlayer()) {
playerWorld = worldManager.getMVWorld(context.getIssuer().getPlayer().getWorld());
}
// Get world based on sender only
if (resolve.equals("issuerOnly")) {
if (playerWorld != null) {
return new MVWorld[]{playerWorld};
}
if (context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("This command can only be used by a player in a Multiverse World.");
}
String worldStrings = context.getFirstArg();
String[] worldNames = worldStrings.split(",");
Set<MVWorld> worlds = new HashSet<>(worldNames.length);
for (String worldName : worldNames) {
if ("*".equals(worldName)) {
worlds.addAll(worldManager.getMVWorlds());
break;
}
MVWorld world = worldManager.getMVWorld(worldName);
if (world == null) {
throw new InvalidCommandArgument("World " + worldName + " is not a loaded multiverse world.");
}
worlds.add(world);
}
// Get world based on input, fallback to sender if input is not a world
if (resolve.equals("issuerAware")) {
if (!worlds.isEmpty()) {
context.popFirstArg();
return worlds.toArray(new MVWorld[0]);
}
if (playerWorld != null) {
return new MVWorld[]{playerWorld};
}
if (context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("Player is not in a Multiverse World.");
}
// Get world based on input only
if (!worlds.isEmpty()) {
context.popFirstArg();
return worlds.toArray(new MVWorld[0]);
}
if (!context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("World " + worldStrings + " is not a loaded multiverse world.");
}
private Player parsePlayer(BukkitCommandExecutionContext context) {
String resolve = context.getFlagValue("resolve", "");
// Get player based on sender only
if (resolve.equals("issuerOnly")) {
if (context.getIssuer().isPlayer()) {
return context.getIssuer().getPlayer();
}
if (context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("This command can only be used by a player.");
}
String playerIdentifier = context.getFirstArg();
Player player = PlayerFinder.get(playerIdentifier, context.getSender());
// Get player based on input, fallback to sender if input is not a player
if (resolve.equals("issuerAware")) {
if (player != null) {
context.popFirstArg();
return player;
}
if (context.getIssuer().isPlayer()) {
return context.getIssuer().getPlayer();
}
if (context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("Invalid player: " + playerIdentifier
+ ". Either specify an online player or use this command as a player.");
}
// Get player based on input only
if (player != null) {
context.popFirstArg();
return player;
}
if (!context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("Player " + playerIdentifier + " not found.");
}
private Player[] parsePlayerArray(BukkitCommandExecutionContext context) {
String resolve = context.getFlagValue("resolve", "");
// Get player based on sender only
if (resolve.equals("issuerOnly")) {
if (context.getIssuer().isPlayer()) {
return new Player[]{context.getIssuer().getPlayer()};
}
if (context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("This command can only be used by a player.");
}
String playerIdentifier = context.getFirstArg();
Player[] players = PlayerFinder.getMulti(playerIdentifier, context.getSender()).toArray(new Player[0]);
// Get player based on input, fallback to sender if input is not a player
if (resolve.equals("issuerAware")) {
if (players.length > 0) {
context.popFirstArg();
return players;
}
if (context.getIssuer().isPlayer()) {
return new Player[]{context.getIssuer().getPlayer()};
}
if (context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("Invalid player: " + playerIdentifier
+ ". Either specify an online player or use this command as a player.");
}
// Get player based on input only
if (players.length > 0) {
context.popFirstArg();
return players;
}
if (!context.isOptional()) {
return null;
}
throw new InvalidCommandArgument("Player " + playerIdentifier + " not found.");
}
}
@@ -0,0 +1,48 @@
package com.onarandombox.MultiverseCore.commandtools;
import co.aikar.commands.MessageType;
import co.aikar.commands.OpenBukkitCommandIssuer;
import co.aikar.locales.MessageKeyProvider;
import com.onarandombox.MultiverseCore.utils.message.Message;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
public class MVCommandIssuer extends OpenBukkitCommandIssuer {
private final MVCommandManager commandManager;
MVCommandIssuer(@NotNull MVCommandManager commandManager, @NotNull CommandSender sender) {
super(commandManager, sender);
this.commandManager = commandManager;
}
@Override
public MVCommandManager getManager() {
return commandManager;
}
public void sendError(Message message) {
sendMessage(MessageType.ERROR, message);
}
public void sendSyntax(Message message) {
sendMessage(MessageType.SYNTAX, message);
}
public void sendInfo(Message message) {
sendMessage(MessageType.INFO, message);
}
private void sendMessage(MessageType messageType, Message message) {
if (message instanceof MessageKeyProvider) {
sendMessage(messageType, (MessageKeyProvider) message, message.getReplacements());
} else {
var formatter = getManager().getFormat(messageType);
if (formatter != null) {
sendMessage(formatter.format(message.formatted()));
} else {
sendMessage(message.formatted());
}
}
}
}
@@ -0,0 +1,136 @@
package com.onarandombox.MultiverseCore.commandtools;
import java.util.List;
import co.aikar.commands.BukkitCommandCompletionContext;
import co.aikar.commands.BukkitCommandExecutionContext;
import co.aikar.commands.BukkitLocales;
import co.aikar.commands.CommandCompletions;
import co.aikar.commands.CommandContexts;
import co.aikar.commands.CommandHelp;
import co.aikar.commands.HelpEntry;
import co.aikar.commands.PaperCommandManager;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagsManager;
import com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager;
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
/**
* Main class to manage permissions.
*/
@Service
public class MVCommandManager extends PaperCommandManager {
private final CommandFlagsManager flagsManager;
private final CommandQueueManager commandQueueManager;
private final Provider<MVCommandContexts> commandContextsProvider;
private final Provider<MVCommandCompletions> commandCompletionsProvider;
@Inject
public MVCommandManager(
@NotNull MultiverseCore plugin,
@NotNull CommandFlagsManager flagsManager,
@NotNull CommandQueueManager commandQueueManager,
@NotNull Provider<MVCommandContexts> commandContextsProvider,
@NotNull Provider<MVCommandCompletions> commandCompletionsProvider,
@NotNull MVWorldManager worldManager
) {
super(plugin);
this.flagsManager = flagsManager;
this.commandQueueManager = commandQueueManager;
this.commandContextsProvider = commandContextsProvider;
this.commandCompletionsProvider = commandCompletionsProvider;
MVCommandConditions.load(this, worldManager);
this.enableUnstableAPI("help");
}
void loadLanguages(PluginLocales locales) {
if (this.locales == null) {
this.locales = locales;
this.locales.loadLanguages();
}
}
@Override
public BukkitLocales getLocales() {
return this.locales;
}
/**
* Gets class responsible for flag handling.
*
* @return A not-null {@link CommandFlagsManager}.
*/
public synchronized @NotNull CommandFlagsManager getFlagsManager() {
return flagsManager;
}
/**
* Manager for command that requires /mv confirm before execution.
*
* @return A non-null {@link CommandQueueManager}.
*/
public synchronized @NotNull CommandQueueManager getCommandQueueManager() {
return commandQueueManager;
}
/**
* Gets class responsible for parsing string args into objects.
*
* @return A not-null {@link CommandContexts}.
*/
@Override
public synchronized @NotNull CommandContexts<BukkitCommandExecutionContext> getCommandContexts() {
if (this.contexts == null) {
this.contexts = commandContextsProvider.get();
}
return this.contexts;
}
/**
* Gets class responsible for tab-completion handling.
*
* @return A not-null {@link CommandCompletions}.
*/
@Override
public synchronized @NotNull CommandCompletions<BukkitCommandCompletionContext> getCommandCompletions() {
if (this.completions == null) {
this.completions = commandCompletionsProvider.get();
}
return this.completions;
}
/**
* Standardise usage command formatting for all mv modules.
*
* @param help The target {@link CommandHelp}.
*/
public void showUsage(@NotNull CommandHelp help) {
List<HelpEntry> entries = help.getHelpEntries();
if (entries.size() == 1) {
getHelpFormatter().showDetailedHelp(help, entries.get(0));
return;
}
help.showHelp();
}
public @NotNull MVCommandIssuer getConsoleCommandIssuer() {
return getCommandIssuer(Bukkit.getConsoleSender());
}
@Override
public @NotNull MVCommandIssuer getCommandIssuer(Object issuer) {
if (!(issuer instanceof CommandSender)) {
throw new IllegalArgumentException(issuer.getClass().getName() + " is not a Command Issuer.");
} else {
return new MVCommandIssuer(this, (CommandSender)issuer);
}
}
}
@@ -0,0 +1,35 @@
package com.onarandombox.MultiverseCore.commandtools;
import co.aikar.commands.BaseCommand;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagGroup;
import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagsManager;
import com.onarandombox.MultiverseCore.commandtools.flags.ParsedCommandFlags;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Contract;
@Contract
public abstract class MultiverseCommand extends BaseCommand {
protected final MVCommandManager commandManager;
private String flagGroupName;
protected MultiverseCommand(@NotNull MVCommandManager commandManager) {
this.commandManager = commandManager;
}
protected CommandFlagsManager getFlagsManager() {
return commandManager.getFlagsManager();
}
protected void registerFlagGroup(@NotNull CommandFlagGroup flagGroup) {
if (flagGroupName != null) {
throw new IllegalStateException("Flag group already registered! (name: " + flagGroupName + ")");
}
getFlagsManager().registerFlagGroup(flagGroup);
flagGroupName = flagGroup.getName();
}
protected @NotNull ParsedCommandFlags parseFlags(@NotNull String[] flags) {
return getFlagsManager().parse(flagGroupName, flags);
}
}
@@ -0,0 +1,49 @@
package com.onarandombox.MultiverseCore.commandtools;
import co.aikar.commands.BukkitLocales;
import com.onarandombox.MultiverseCore.utils.file.FileResClassLoader;
import jakarta.inject.Inject;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
/**
* Locale manager with additional methods for loading locales from plugin's locales folder.
*/
@Service
public class PluginLocales extends BukkitLocales {
private static final String DEFAULT_LOCALE_FOLDER_PATH = "locales";
/**
* Creates a new instance of {@link PluginLocales}.
*
* @param manager The command manager.
*/
@Inject
public PluginLocales(MVCommandManager manager) {
super(manager);
manager.loadLanguages(this);
}
/**
* Adds a {@link FileResClassLoader} to the list of class loaders to load locales data from.
*
* @param plugin The plugin.
* @return True if the class loader was added successfully.
*/
public boolean addFileResClassLoader(@NotNull Plugin plugin) {
return this.addBundleClassLoader(new FileResClassLoader(plugin, DEFAULT_LOCALE_FOLDER_PATH));
}
/**
* Adds a {@link FileResClassLoader} to the list of class loaders to load locales data from.
*
* @param plugin The plugin.
* @param localesFolderPath The path to the folder containing the locales.
* @return True if the class loader was added successfully.
*/
public boolean addFileResClassLoader(@NotNull Plugin plugin, @NotNull String localesFolderPath) {
return this.addBundleClassLoader(new FileResClassLoader(plugin, localesFolderPath));
}
}
@@ -0,0 +1,13 @@
package com.onarandombox.MultiverseCore.commandtools.context;
public class GameRuleValue {
private final Object value;
public GameRuleValue(Object value) {
this.value = value;
}
public Object getValue() {
return value;
}
}
@@ -0,0 +1,13 @@
package com.onarandombox.MultiverseCore.commandtools.context;
public class MVConfigValue {
private final Object value;
public MVConfigValue(Object value) {
this.value = value;
}
public Object getValue() {
return value;
}
}
Loaded 100 of 301 files, more files were not shown because too many files have changed in this diff. Show more