mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-02-15 12:02:48 +01:00
Make config set methods return Try<Void>
This commit is contained in:
parent
d6a70bbb9b
commit
b646937d23
@ -51,9 +51,10 @@ public interface MVCoreConfig {
|
||||
* Sets world access permissions should be enforced.
|
||||
*
|
||||
* @param enforceAccess The new value.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setEnforceAccess(boolean enforceAccess);
|
||||
Try<Void> setEnforceAccess(boolean enforceAccess);
|
||||
|
||||
/**
|
||||
* Gets enforceAccess.
|
||||
@ -67,9 +68,10 @@ public interface MVCoreConfig {
|
||||
* Sets whether the game mode should be enforced.
|
||||
*
|
||||
* @param enforceGameMode The new value.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setEnforceGameMode(boolean enforceGameMode);
|
||||
Try<Void> setEnforceGameMode(boolean enforceGameMode);
|
||||
|
||||
/**
|
||||
* Gets enforceGameMode value.
|
||||
@ -83,9 +85,10 @@ public interface MVCoreConfig {
|
||||
* Sets whether or not the automatic purge of entities is enabled.
|
||||
*
|
||||
* @param autopurge True if automatic purge should be enabled.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setAutoPurgeEntities(boolean autopurge);
|
||||
Try<Void> setAutoPurgeEntities(boolean autopurge);
|
||||
|
||||
/**
|
||||
* Gets whether or not the automatic purge of entities is enabled.
|
||||
@ -98,9 +101,10 @@ public interface MVCoreConfig {
|
||||
* Sets whether to use finer teleport permissions.
|
||||
*
|
||||
* @param useFinerTeleportPermissions The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setUseFinerTeleportPermissions(boolean useFinerTeleportPermissions);
|
||||
Try<Void> setUseFinerTeleportPermissions(boolean useFinerTeleportPermissions);
|
||||
|
||||
/**
|
||||
* Gets whether to use finer teleport permissions.
|
||||
@ -113,9 +117,10 @@ public interface MVCoreConfig {
|
||||
* Sets the number of players allowed to teleport at once.
|
||||
*
|
||||
* @param concurrentTeleportLimit The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setConcurrentTeleportLimit(int concurrentTeleportLimit);
|
||||
Try<Void> setConcurrentTeleportLimit(int concurrentTeleportLimit);
|
||||
|
||||
/**
|
||||
* Gets the number of players allowed to teleport at once.
|
||||
@ -129,9 +134,10 @@ public interface MVCoreConfig {
|
||||
* Sets teleportIntercept.
|
||||
*
|
||||
* @param teleportIntercept The new value.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setTeleportIntercept(boolean teleportIntercept);
|
||||
Try<Void> setTeleportIntercept(boolean teleportIntercept);
|
||||
|
||||
/**
|
||||
* Gets teleportIntercept.
|
||||
@ -141,36 +147,13 @@ public interface MVCoreConfig {
|
||||
*/
|
||||
boolean getTeleportIntercept();
|
||||
|
||||
/**
|
||||
* Sets resolveAliasInCommands.
|
||||
*
|
||||
* @param resolveAliasInCommands The new value.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setResolveAliasName(boolean resolveAliasInCommands);
|
||||
|
||||
/**
|
||||
* Gets resolveAliasInCommands.
|
||||
*
|
||||
* @return resolveAliasInCommands.
|
||||
* @since 5.0
|
||||
*/
|
||||
boolean getResolveAliasName();
|
||||
|
||||
/**
|
||||
* Sets firstSpawnOverride.
|
||||
*
|
||||
* @param firstSpawnOverride The new value.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setFirstSpawnOverride(boolean firstSpawnOverride);
|
||||
|
||||
/**
|
||||
* Sets safeLocationHorizontalSearchRadius
|
||||
* @param searchRadius The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setSafeLocationHorizontalSearchRadius(int searchRadius);
|
||||
Try<Void> setSafeLocationHorizontalSearchRadius(int searchRadius);
|
||||
|
||||
/**
|
||||
* Gets safeLocationHorizontalSearchRadius
|
||||
@ -181,15 +164,30 @@ public interface MVCoreConfig {
|
||||
int getSafeLocationHorizontalSearchRadius();
|
||||
|
||||
/**
|
||||
* Gets safeLocationVerticalSearchRadius
|
||||
* Sets safeLocationVerticalSearchRadius
|
||||
*
|
||||
* @param searchRadius The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setSafeLocationVerticalSearchRadius(int searchRadius);
|
||||
Try<Void> setSafeLocationVerticalSearchRadius(int searchRadius);
|
||||
|
||||
/**
|
||||
* Gets safeLocationVerticalSearchRadius
|
||||
*
|
||||
* @return safeLocationVerticalSearchRadius
|
||||
* @since 5.0
|
||||
*/
|
||||
int getSafeLocationVerticalSearchRadius();
|
||||
|
||||
/**
|
||||
* Sets firstSpawnOverride.
|
||||
*
|
||||
* @param firstSpawnOverride The new value.
|
||||
* @since 5.0
|
||||
*/
|
||||
Try<Void> setFirstSpawnOverride(boolean firstSpawnOverride);
|
||||
|
||||
/**
|
||||
* Gets firstSpawnOverride.
|
||||
*
|
||||
@ -202,9 +200,10 @@ public interface MVCoreConfig {
|
||||
* Sets firstSpawnWorld.
|
||||
*
|
||||
* @param firstSpawnWorld The new value.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setFirstSpawnLocation(String firstSpawnWorld);
|
||||
Try<Void> setFirstSpawnLocation(String firstSpawnWorld);
|
||||
|
||||
/**
|
||||
* Gets firstSpawnWorld.
|
||||
@ -218,9 +217,10 @@ public interface MVCoreConfig {
|
||||
* Sets whether join destination should be enabled.
|
||||
*
|
||||
* @param enableJoinDestination The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setEnableJoinDestination(boolean enableJoinDestination);
|
||||
Try<Void> setEnableJoinDestination(boolean enableJoinDestination);
|
||||
|
||||
/**
|
||||
* Gets enableJoinDestination.
|
||||
@ -234,9 +234,10 @@ public interface MVCoreConfig {
|
||||
* Sets alwaysSpawnDestination.
|
||||
*
|
||||
* @param alwaysSpawnDestination The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setJoinDestination(String alwaysSpawnDestination);
|
||||
Try<Void> setJoinDestination(String alwaysSpawnDestination);
|
||||
|
||||
/**
|
||||
* Gets alwaysSpawnDestination.
|
||||
@ -250,9 +251,10 @@ public interface MVCoreConfig {
|
||||
* Sets defaultRespawnToWorldSpawn.
|
||||
*
|
||||
* @param defaultRespawnToWorldSpawn The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setDefaultRespawnWithinSameWorld(boolean defaultRespawnToWorldSpawn);
|
||||
Try<Void> setDefaultRespawnWithinSameWorld(boolean defaultRespawnToWorldSpawn);
|
||||
|
||||
/**
|
||||
* Gets defaultRespawnToWorldSpawn
|
||||
@ -266,9 +268,10 @@ public interface MVCoreConfig {
|
||||
* Sets enforceRespawnAtWorldSpawn
|
||||
*
|
||||
* @param enforceRespawnAtWorldSpawn The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setEnforceRespawnAtWorldSpawn(boolean enforceRespawnAtWorldSpawn);
|
||||
Try<Void> setEnforceRespawnAtWorldSpawn(boolean enforceRespawnAtWorldSpawn);
|
||||
|
||||
/**
|
||||
* Gets enforceRespawnAtWorldSpawn
|
||||
@ -281,9 +284,10 @@ public interface MVCoreConfig {
|
||||
* 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.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setUseCustomPortalSearch(boolean useDefaultPortalSearch);
|
||||
Try<Void> setUseCustomPortalSearch(boolean useDefaultPortalSearch);
|
||||
|
||||
/**
|
||||
* Gets whether or not Bukkit will be determining portal search radius on its own or if Multiverse should help.
|
||||
@ -297,9 +301,10 @@ public interface MVCoreConfig {
|
||||
* Sets the radius at which vanilla style portals will be searched for to connect to worlds together.
|
||||
*
|
||||
* @param searchRadius The portal search radius.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setCustomPortalSearchRadius(int searchRadius);
|
||||
Try<Void> setCustomPortalSearchRadius(int searchRadius);
|
||||
|
||||
/**
|
||||
* Gets the radius at which vanilla style portals will be searched for to connect to worlds together.
|
||||
@ -313,9 +318,10 @@ public interface MVCoreConfig {
|
||||
* Sets prefixChat.
|
||||
*
|
||||
* @param prefixChat The new value.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setEnablePrefixChat(boolean prefixChat);
|
||||
Try<Void> setEnablePrefixChat(boolean prefixChat);
|
||||
|
||||
/**
|
||||
* Gets prefixChat.
|
||||
@ -329,9 +335,10 @@ public interface MVCoreConfig {
|
||||
* Sets prefixChatFormat.
|
||||
*
|
||||
* @param prefixChatFormat The new value.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setPrefixChatFormat(String prefixChatFormat);
|
||||
Try<Void> setPrefixChatFormat(String prefixChatFormat);
|
||||
|
||||
/**
|
||||
* Gets prefixChatFormat.
|
||||
@ -345,9 +352,10 @@ public interface MVCoreConfig {
|
||||
* Sets whether to register with PlaceholderAPI plugin.
|
||||
*
|
||||
* @param registerPapiHook The new value.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setRegisterPapiHook(boolean registerPapiHook);
|
||||
Try<Void> setRegisterPapiHook(boolean registerPapiHook);
|
||||
|
||||
/**
|
||||
* Gets whether to register with PlaceholderAPI plugin.
|
||||
@ -361,9 +369,10 @@ public interface MVCoreConfig {
|
||||
* Sets default locale used for messages
|
||||
*
|
||||
* @param defaultLocale The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setDefaultLocale(Locale defaultLocale);
|
||||
Try<Void> setDefaultLocale(Locale defaultLocale);
|
||||
|
||||
/**
|
||||
* Gets default locale used for messages
|
||||
@ -377,9 +386,10 @@ public interface MVCoreConfig {
|
||||
* Sets whether to use each player's client locale.
|
||||
*
|
||||
* @param perPlayerLocale the new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setPerPlayerLocale(boolean perPlayerLocale);
|
||||
Try<Void> setPerPlayerLocale(boolean perPlayerLocale);
|
||||
|
||||
/**
|
||||
* Gets whether to use each player's client locale.
|
||||
@ -388,13 +398,30 @@ public interface MVCoreConfig {
|
||||
*/
|
||||
boolean getPerPlayerLocale();
|
||||
|
||||
/**
|
||||
* Sets resolveAliasInCommands.
|
||||
*
|
||||
* @param resolveAliasInCommands The new value.
|
||||
* @since 5.0
|
||||
*/
|
||||
Try<Void> setResolveAliasName(boolean resolveAliasInCommands);
|
||||
|
||||
/**
|
||||
* Gets resolveAliasInCommands.
|
||||
*
|
||||
* @return resolveAliasInCommands.
|
||||
* @since 5.0
|
||||
*/
|
||||
boolean getResolveAliasName();
|
||||
|
||||
/**
|
||||
* Sets the mode to use for confirming dangerous commands
|
||||
*
|
||||
* @param confirmMode The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setConfirmMode(ConfirmMode confirmMode);
|
||||
Try<Void> setConfirmMode(ConfirmMode confirmMode);
|
||||
|
||||
/**
|
||||
* Gets the mode to use for confirming dangerous commands
|
||||
@ -408,19 +435,27 @@ public interface MVCoreConfig {
|
||||
* Sets whether to use confirm otp
|
||||
*
|
||||
* @param useConfirmOtp The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setUseConfirmOtp(boolean useConfirmOtp);
|
||||
Try<Void> setUseConfirmOtp(boolean useConfirmOtp);
|
||||
|
||||
/**
|
||||
* Gets whether to use confirm otp
|
||||
*
|
||||
* @return useConfirmOtp
|
||||
* @since 5.0
|
||||
*/
|
||||
boolean getUseConfirmOtp();
|
||||
|
||||
/**
|
||||
* Sets globalDebug.
|
||||
*
|
||||
* @param globalDebug The new value.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setGlobalDebug(int globalDebug);
|
||||
Try<Void> setGlobalDebug(int globalDebug);
|
||||
|
||||
/**
|
||||
* Gets globalDebug.
|
||||
@ -434,9 +469,10 @@ public interface MVCoreConfig {
|
||||
* Sets debugPermissions
|
||||
*
|
||||
* @param debugPermissions The new value
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setDebugPermissions(boolean debugPermissions);
|
||||
Try<Void> setDebugPermissions(boolean debugPermissions);
|
||||
|
||||
/**
|
||||
* gets debugPermissions.
|
||||
@ -450,9 +486,10 @@ public interface MVCoreConfig {
|
||||
* Sets whether to suppress startup messages.
|
||||
*
|
||||
* @param silentStart true to suppress messages.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setSilentStart(boolean silentStart);
|
||||
Try<Void> setSilentStart(boolean silentStart);
|
||||
|
||||
/**
|
||||
* Whether we are suppressing startup messages.
|
||||
@ -466,9 +503,10 @@ public interface MVCoreConfig {
|
||||
* Sets whether or not the donation/patreon messages are shown.
|
||||
*
|
||||
* @param showDonateMessage True if donation/patreon messages should be shown.
|
||||
* @return Result of setting property.
|
||||
* @since 5.0
|
||||
*/
|
||||
void setShowDonateMessage(boolean showDonateMessage);
|
||||
Try<Void> setShowDonateMessage(boolean showDonateMessage);
|
||||
|
||||
/**
|
||||
* Gets whether or not the donation/patreon messages are shown.
|
||||
|
@ -141,8 +141,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setEnforceAccess(boolean enforceAccess) {
|
||||
configHandle.set(configNodes.ENFORCE_ACCESS, enforceAccess);
|
||||
public Try<Void> setEnforceAccess(boolean enforceAccess) {
|
||||
return configHandle.set(configNodes.ENFORCE_ACCESS, enforceAccess);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -157,8 +157,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setEnforceGameMode(boolean enforceGameMode) {
|
||||
configHandle.set(configNodes.ENFORCE_GAMEMODE, enforceGameMode);
|
||||
public Try<Void> setEnforceGameMode(boolean enforceGameMode) {
|
||||
return configHandle.set(configNodes.ENFORCE_GAMEMODE, enforceGameMode);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -173,8 +173,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setAutoPurgeEntities(boolean autopurge) {
|
||||
configHandle.set(configNodes.AUTO_PURGE_ENTITIES, autopurge);
|
||||
public Try<Void> setAutoPurgeEntities(boolean autopurge) {
|
||||
return configHandle.set(configNodes.AUTO_PURGE_ENTITIES, autopurge);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -189,8 +189,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setUseFinerTeleportPermissions(boolean useFinerTeleportPermissions) {
|
||||
configHandle.set(configNodes.USE_FINER_TELEPORT_PERMISSIONS, useFinerTeleportPermissions);
|
||||
public Try<Void> setUseFinerTeleportPermissions(boolean useFinerTeleportPermissions) {
|
||||
return configHandle.set(configNodes.USE_FINER_TELEPORT_PERMISSIONS, useFinerTeleportPermissions);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -205,8 +205,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setConcurrentTeleportLimit(int concurrentTeleportLimit) {
|
||||
configHandle.set(configNodes.CONCURRENT_TELEPORT_LIMIT, concurrentTeleportLimit);
|
||||
public Try<Void> setConcurrentTeleportLimit(int concurrentTeleportLimit) {
|
||||
return configHandle.set(configNodes.CONCURRENT_TELEPORT_LIMIT, concurrentTeleportLimit);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -221,8 +221,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setTeleportIntercept(boolean teleportIntercept) {
|
||||
configHandle.set(configNodes.TELEPORT_INTERCEPT, teleportIntercept);
|
||||
public Try<Void> setTeleportIntercept(boolean teleportIntercept) {
|
||||
return configHandle.set(configNodes.TELEPORT_INTERCEPT, teleportIntercept);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -237,16 +237,16 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setFirstSpawnOverride(boolean firstSpawnOverride) {
|
||||
configHandle.set(configNodes.FIRST_SPAWN_OVERRIDE, firstSpawnOverride);
|
||||
public Try<Void> setFirstSpawnOverride(boolean firstSpawnOverride) {
|
||||
return configHandle.set(configNodes.FIRST_SPAWN_OVERRIDE, firstSpawnOverride);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setSafeLocationHorizontalSearchRadius(int searchRadius) {
|
||||
configHandle.set(configNodes.SAFE_LOCATION_HORIZONTAL_SEARCH_RADIUS, searchRadius);
|
||||
public Try<Void> setSafeLocationHorizontalSearchRadius(int searchRadius) {
|
||||
return configHandle.set(configNodes.SAFE_LOCATION_HORIZONTAL_SEARCH_RADIUS, searchRadius);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -261,8 +261,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setSafeLocationVerticalSearchRadius(int searchRadius) {
|
||||
configHandle.set(configNodes.SAFE_LOCATION_VERTICAL_SEARCH_RADIUS, searchRadius);
|
||||
public Try<Void> setSafeLocationVerticalSearchRadius(int searchRadius) {
|
||||
return configHandle.set(configNodes.SAFE_LOCATION_VERTICAL_SEARCH_RADIUS, searchRadius);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -285,8 +285,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setFirstSpawnLocation(String firstSpawnWorld) {
|
||||
configHandle.set(configNodes.FIRST_SPAWN_LOCATION, firstSpawnWorld);
|
||||
public Try<Void> setFirstSpawnLocation(String firstSpawnWorld) {
|
||||
return configHandle.set(configNodes.FIRST_SPAWN_LOCATION, firstSpawnWorld);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -301,8 +301,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setEnableJoinDestination(boolean enableJoinDestination) {
|
||||
configHandle.set(configNodes.ENABLE_JOIN_DESTINATION, enableJoinDestination);
|
||||
public Try<Void> setEnableJoinDestination(boolean enableJoinDestination) {
|
||||
return configHandle.set(configNodes.ENABLE_JOIN_DESTINATION, enableJoinDestination);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -317,8 +317,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setJoinDestination(String alwaysSpawnDestination) {
|
||||
configHandle.set(configNodes.JOIN_DESTINATION, alwaysSpawnDestination);
|
||||
public Try<Void> setJoinDestination(String alwaysSpawnDestination) {
|
||||
return configHandle.set(configNodes.JOIN_DESTINATION, alwaysSpawnDestination);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -333,8 +333,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setDefaultRespawnWithinSameWorld(boolean defaultRespawnToWorldSpawn) {
|
||||
configHandle.set(configNodes.DEFAULT_RESPAWN_WITHIN_SAME_WORLD, defaultRespawnToWorldSpawn);
|
||||
public Try<Void> setDefaultRespawnWithinSameWorld(boolean defaultRespawnToWorldSpawn) {
|
||||
return configHandle.set(configNodes.DEFAULT_RESPAWN_WITHIN_SAME_WORLD, defaultRespawnToWorldSpawn);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -349,8 +349,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setEnforceRespawnAtWorldSpawn(boolean enforceRespawnAtWorldSpawn) {
|
||||
configHandle.set(configNodes.ENFORCE_RESPAWN_AT_WORLD_SPAWN, enforceRespawnAtWorldSpawn);
|
||||
public Try<Void> setEnforceRespawnAtWorldSpawn(boolean enforceRespawnAtWorldSpawn) {
|
||||
return configHandle.set(configNodes.ENFORCE_RESPAWN_AT_WORLD_SPAWN, enforceRespawnAtWorldSpawn);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -365,8 +365,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setUseCustomPortalSearch(boolean useDefaultPortalSearch) {
|
||||
configHandle.set(configNodes.USE_CUSTOM_PORTAL_SEARCH, useDefaultPortalSearch);
|
||||
public Try<Void> setUseCustomPortalSearch(boolean useDefaultPortalSearch) {
|
||||
return configHandle.set(configNodes.USE_CUSTOM_PORTAL_SEARCH, useDefaultPortalSearch);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -381,8 +381,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setCustomPortalSearchRadius(int searchRadius) {
|
||||
configHandle.set(configNodes.CUSTOM_PORTAL_SEARCH_RADIUS, searchRadius);
|
||||
public Try<Void> setCustomPortalSearchRadius(int searchRadius) {
|
||||
return configHandle.set(configNodes.CUSTOM_PORTAL_SEARCH_RADIUS, searchRadius);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -397,8 +397,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setEnablePrefixChat(boolean prefixChat) {
|
||||
configHandle.set(configNodes.ENABLE_CHAT_PREFIX, prefixChat);
|
||||
public Try<Void> setEnablePrefixChat(boolean prefixChat) {
|
||||
return configHandle.set(configNodes.ENABLE_CHAT_PREFIX, prefixChat);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -413,8 +413,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setPrefixChatFormat(String prefixChatFormat) {
|
||||
configHandle.set(configNodes.CHAT_PREFIX_FORMAT, prefixChatFormat);
|
||||
public Try<Void> setPrefixChatFormat(String prefixChatFormat) {
|
||||
return configHandle.set(configNodes.CHAT_PREFIX_FORMAT, prefixChatFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -429,8 +429,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setRegisterPapiHook(boolean registerPapiHook) {
|
||||
configHandle.set(configNodes.REGISTER_PAPI_HOOK, registerPapiHook);
|
||||
public Try<Void> setRegisterPapiHook(boolean registerPapiHook) {
|
||||
return configHandle.set(configNodes.REGISTER_PAPI_HOOK, registerPapiHook);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -445,8 +445,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setDefaultLocale(Locale defaultLocale) {
|
||||
configHandle.set(configNodes.DEFAULT_LOCALE, defaultLocale);
|
||||
public Try<Void> setDefaultLocale(Locale defaultLocale) {
|
||||
return configHandle.set(configNodes.DEFAULT_LOCALE, defaultLocale);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -461,8 +461,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setPerPlayerLocale(boolean perPlayerLocale) {
|
||||
configHandle.set(configNodes.PER_PLAYER_LOCALE, perPlayerLocale);
|
||||
public Try<Void> setPerPlayerLocale(boolean perPlayerLocale) {
|
||||
return configHandle.set(configNodes.PER_PLAYER_LOCALE, perPlayerLocale);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -477,8 +477,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setResolveAliasName(boolean resolveAliasInCommands) {
|
||||
configHandle.set(configNodes.RESOLVE_ALIAS_NAME, resolveAliasInCommands);
|
||||
public Try<Void> setResolveAliasName(boolean resolveAliasInCommands) {
|
||||
return configHandle.set(configNodes.RESOLVE_ALIAS_NAME, resolveAliasInCommands);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -493,8 +493,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setConfirmMode(ConfirmMode confirmMode) {
|
||||
configHandle.set(configNodes.CONFIRM_MODE, confirmMode);
|
||||
public Try<Void> setConfirmMode(ConfirmMode confirmMode) {
|
||||
return configHandle.set(configNodes.CONFIRM_MODE, confirmMode);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -509,8 +509,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setUseConfirmOtp(boolean useConfirmOtp) {
|
||||
configHandle.set(configNodes.USE_CONFIRM_OTP, useConfirmOtp);
|
||||
public Try<Void> setUseConfirmOtp(boolean useConfirmOtp) {
|
||||
return configHandle.set(configNodes.USE_CONFIRM_OTP, useConfirmOtp);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -525,8 +525,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setGlobalDebug(int globalDebug) {
|
||||
configHandle.set(configNodes.GLOBAL_DEBUG, globalDebug);
|
||||
public Try<Void> setGlobalDebug(int globalDebug) {
|
||||
return configHandle.set(configNodes.GLOBAL_DEBUG, globalDebug);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -541,8 +541,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setDebugPermissions(boolean debugPermissions) {
|
||||
configHandle.set(configNodes.DEBUG_PERMISSIONS, debugPermissions);
|
||||
public Try<Void> setDebugPermissions(boolean debugPermissions) {
|
||||
return configHandle.set(configNodes.DEBUG_PERMISSIONS, debugPermissions);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -557,8 +557,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setSilentStart(boolean silentStart) {
|
||||
configHandle.set(configNodes.SILENT_START, silentStart);
|
||||
public Try<Void> setSilentStart(boolean silentStart) {
|
||||
return configHandle.set(configNodes.SILENT_START, silentStart);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -573,8 +573,8 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setShowDonateMessage(boolean showDonateMessage) {
|
||||
configHandle.set(configNodes.SHOW_DONATION_MESSAGE, showDonateMessage);
|
||||
public Try<Void> setShowDonateMessage(boolean showDonateMessage) {
|
||||
return configHandle.set(configNodes.SHOW_DONATION_MESSAGE, showDonateMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -587,6 +587,7 @@ public class SimpleMVCoreConfig implements MVCoreConfig {
|
||||
|
||||
/**
|
||||
* Gets the underlying config file object
|
||||
*
|
||||
* @return The config file
|
||||
*/
|
||||
public FileConfiguration getConfig() {
|
||||
|
@ -17,7 +17,7 @@ class RegenCommandTest : AbstractCommandTest() {
|
||||
// Disable confirmation to make tests easier
|
||||
val config = serviceLocator.getActiveService(SimpleMVCoreConfig::class.java).takeIf { it != null } ?: run {
|
||||
throw IllegalStateException("MVCoreConfig is not available as a service") }
|
||||
config.confirmMode = ConfirmMode.DISABLE
|
||||
assertTrue(config.setConfirmMode(ConfirmMode.DISABLE).isSuccess)
|
||||
|
||||
testWorld = worldManager.createWorld(CreateWorldOptions.worldName("test")).get()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user