mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-10 21:01:17 +01:00
Add interface for keeping world settings for options.
This commit is contained in:
parent
f556f6f98a
commit
6b40c3a190
@ -6,7 +6,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* Options for customizing the cloning of a world.
|
||||
*/
|
||||
public class CloneWorldOptions {
|
||||
public final class CloneWorldOptions implements KeepWorldSettingsOptions {
|
||||
|
||||
/**
|
||||
* Creates a new {@link CloneWorldOptions} instance with the given world.
|
||||
@ -55,6 +55,7 @@ public class CloneWorldOptions {
|
||||
* @param keepGameRule Whether to keep the game rule of the world during cloning.
|
||||
* @return This {@link CloneWorldOptions} instance.
|
||||
*/
|
||||
@Override
|
||||
public @NotNull CloneWorldOptions keepGameRule(boolean keepGameRule) {
|
||||
this.keepGameRule = keepGameRule;
|
||||
return this;
|
||||
@ -65,10 +66,12 @@ public class CloneWorldOptions {
|
||||
*
|
||||
* @return Whether to keep the game rule of the world during cloning.
|
||||
*/
|
||||
@Override
|
||||
public boolean keepGameRule() {
|
||||
return keepGameRule;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull CloneWorldOptions keepWorldConfig(boolean keepWorldConfig) {
|
||||
this.keepWorldConfig = keepWorldConfig;
|
||||
return this;
|
||||
@ -79,10 +82,12 @@ public class CloneWorldOptions {
|
||||
*
|
||||
* @return Whether to keep the world config of the world during cloning.
|
||||
*/
|
||||
@Override
|
||||
public boolean keepWorldConfig() {
|
||||
return keepWorldConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull CloneWorldOptions keepWorldBorder(boolean keepWorldBorder) {
|
||||
this.keepWorldBorder = keepWorldBorder;
|
||||
return this;
|
||||
@ -93,6 +98,7 @@ public class CloneWorldOptions {
|
||||
*
|
||||
* @return Whether to keep the world border of the world during cloning.
|
||||
*/
|
||||
@Override
|
||||
public boolean keepWorldBorder() {
|
||||
return keepWorldBorder;
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
package com.onarandombox.MultiverseCore.worldnew.options;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public sealed interface KeepWorldSettingsOptions permits CloneWorldOptions, RegenWorldOptions {
|
||||
|
||||
/**
|
||||
* Sets whether to keep the game rule of the world.
|
||||
*
|
||||
* @param keepGameRule Whether to keep the game rule of the world.
|
||||
* @return This {@link KeepWorldSettingsOptions} instance.
|
||||
*/
|
||||
@NotNull KeepWorldSettingsOptions keepGameRule(boolean keepGameRule);
|
||||
|
||||
/**
|
||||
* Gets whether to keep the game rule of the world.
|
||||
*
|
||||
* @return Whether to keep the game rule of the world.
|
||||
*/
|
||||
boolean keepGameRule();
|
||||
|
||||
/**
|
||||
* Sets whether to keep the world config of the world.
|
||||
*
|
||||
* @param keepWorldConfig Whether to keep the world config of the world.
|
||||
* @return This {@link KeepWorldSettingsOptions} instance.
|
||||
*/
|
||||
@NotNull KeepWorldSettingsOptions keepWorldConfig(boolean keepWorldConfig);
|
||||
|
||||
/**
|
||||
* Gets whether to keep the world config of the world.
|
||||
*
|
||||
* @return Whether to keep the world config of the world.
|
||||
*/
|
||||
boolean keepWorldConfig();
|
||||
|
||||
/**
|
||||
* Sets whether to keep the world border of the world.
|
||||
*
|
||||
* @param keepWorldBorder Whether to keep the world border of the world.
|
||||
* @return This {@link KeepWorldSettingsOptions} instance.
|
||||
*/
|
||||
@NotNull KeepWorldSettingsOptions keepWorldBorder(boolean keepWorldBorder);
|
||||
|
||||
/**
|
||||
* Gets whether to keep the world border of the world.
|
||||
*
|
||||
* @return Whether to keep the world border of the world.
|
||||
*/
|
||||
boolean keepWorldBorder();
|
||||
}
|
@ -9,7 +9,7 @@ import java.util.Random;
|
||||
/**
|
||||
* Options for customizing the regeneration of a world.
|
||||
*/
|
||||
public class RegenWorldOptions {
|
||||
public final class RegenWorldOptions implements KeepWorldSettingsOptions {
|
||||
|
||||
/**
|
||||
* Creates a new {@link RegenWorldOptions} instance with the given world.
|
||||
@ -48,6 +48,7 @@ public class RegenWorldOptions {
|
||||
* @param keepGameRule Whether to keep the game rule of the world during regeneration.
|
||||
* @return This {@link RegenWorldOptions} instance.
|
||||
*/
|
||||
@Override
|
||||
public @NotNull RegenWorldOptions keepGameRule(boolean keepGameRule) {
|
||||
this.keepGameRule = keepGameRule;
|
||||
return this;
|
||||
@ -58,6 +59,7 @@ public class RegenWorldOptions {
|
||||
*
|
||||
* @return Whether to keep the game rule of the world during regeneration.
|
||||
*/
|
||||
@Override
|
||||
public boolean keepGameRule() {
|
||||
return keepGameRule;
|
||||
}
|
||||
@ -68,6 +70,7 @@ public class RegenWorldOptions {
|
||||
* @param keepWorldConfig Whether to keep the world config of the world during regeneration.
|
||||
* @return This {@link RegenWorldOptions} instance.
|
||||
*/
|
||||
@Override
|
||||
public @NotNull RegenWorldOptions keepWorldConfig(boolean keepWorldConfig) {
|
||||
this.keepWorldConfig = keepWorldConfig;
|
||||
return this;
|
||||
|
Loading…
Reference in New Issue
Block a user