fix(settings): use Purpur dialog API
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package games.dmg.spigotbase;
|
||||
|
||||
import io.papermc.paper.dialog.Dialog;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -28,6 +29,7 @@ final class BaseSettingsCommand implements CommandExecutor, TabCompleter {
|
||||
private final TeleportPolicy teleportPolicy;
|
||||
private final BaseFlightController flightController;
|
||||
private final PocketBaseManager pocketBases;
|
||||
private final DialogProvider dialogProvider;
|
||||
|
||||
BaseSettingsCommand(
|
||||
BaseStateManager stateManager,
|
||||
@@ -42,12 +44,30 @@ final class BaseSettingsCommand implements CommandExecutor, TabCompleter {
|
||||
PluginSettingsProvider settings,
|
||||
BaseFlightController flightController,
|
||||
PocketBaseManager pocketBases
|
||||
) {
|
||||
this(
|
||||
stateManager,
|
||||
settings,
|
||||
flightController,
|
||||
pocketBases,
|
||||
(owner, pocket) -> new BaseSettingsDialogFactory(settings.current())
|
||||
.create(owner, pocket)
|
||||
);
|
||||
}
|
||||
|
||||
BaseSettingsCommand(
|
||||
BaseStateManager stateManager,
|
||||
PluginSettingsProvider settings,
|
||||
BaseFlightController flightController,
|
||||
PocketBaseManager pocketBases,
|
||||
DialogProvider dialogProvider
|
||||
) {
|
||||
this.stateManager = stateManager;
|
||||
this.settings = settings;
|
||||
this.teleportPolicy = new TeleportPolicy(settings);
|
||||
this.flightController = flightController;
|
||||
this.pocketBases = pocketBases;
|
||||
this.dialogProvider = dialogProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -449,7 +469,7 @@ final class BaseSettingsCommand implements CommandExecutor, TabCompleter {
|
||||
PocketBaseState pocket = pocketBases == null
|
||||
? PocketBaseState.locked(state.playerId())
|
||||
: pocketBases.state(state.playerId());
|
||||
player.showDialog(new BaseSettingsDialogFactory(settings.current()).create(state, pocket));
|
||||
player.showDialog(dialogProvider.create(state, pocket));
|
||||
}
|
||||
|
||||
private void showStatus(Player player, PlayerState state) {
|
||||
@@ -672,6 +692,11 @@ final class BaseSettingsCommand implements CommandExecutor, TabCompleter {
|
||||
return met ? ChatColor.YELLOW : ChatColor.RED;
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
interface DialogProvider {
|
||||
Dialog create(PlayerState owner, PocketBaseState pocket);
|
||||
}
|
||||
|
||||
private static void sendUsage(Player player) {
|
||||
player.sendMessage(ChatColor.RED + "Usage: /basesettings "
|
||||
+ "[ui|status|upgrade|pocket upgrade|pocket mobs "
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package games.dmg.spigotbase;
|
||||
|
||||
import io.papermc.paper.dialog.Dialog;
|
||||
import io.papermc.paper.registry.RegistryKey;
|
||||
import io.papermc.paper.registry.data.dialog.ActionButton;
|
||||
import io.papermc.paper.registry.data.dialog.DialogBase;
|
||||
import io.papermc.paper.registry.data.dialog.action.DialogAction;
|
||||
import io.papermc.paper.registry.data.dialog.body.DialogBody;
|
||||
import io.papermc.paper.registry.data.dialog.type.DialogType;
|
||||
import io.papermc.paper.registry.set.RegistrySet;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.dialog.ConfirmationDialog;
|
||||
import net.md_5.bungee.api.dialog.Dialog;
|
||||
import net.md_5.bungee.api.dialog.DialogBase;
|
||||
import net.md_5.bungee.api.dialog.DialogListDialog;
|
||||
import net.md_5.bungee.api.dialog.MultiActionDialog;
|
||||
import net.md_5.bungee.api.dialog.NoticeDialog;
|
||||
import net.md_5.bungee.api.dialog.action.ActionButton;
|
||||
import net.md_5.bungee.api.dialog.action.RunCommandAction;
|
||||
import net.md_5.bungee.api.dialog.body.PlainMessageBody;
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
||||
final class BaseSettingsDialogFactory {
|
||||
private static final int DIALOG_WIDTH = 420;
|
||||
@@ -24,8 +22,18 @@ final class BaseSettingsDialogFactory {
|
||||
}
|
||||
|
||||
Dialog create(PlayerState owner, PocketBaseState pocket) {
|
||||
return new DialogListDialog(
|
||||
base(
|
||||
return render(specification(owner, pocket));
|
||||
}
|
||||
|
||||
DialogSpec specification(PlayerState owner, PocketBaseState pocket) {
|
||||
List<DialogSpec> dialogs = List.of(
|
||||
generalSettings(owner),
|
||||
progressReport(),
|
||||
baseUpgrade(owner),
|
||||
pocketSettings(owner, pocket)
|
||||
);
|
||||
return new ListSpec(
|
||||
content(
|
||||
"Base Settings",
|
||||
"Base Settings",
|
||||
"Base " + owner.baseLevel() + "/4 • Size " + owner.sizeLevel() + "/3"
|
||||
@@ -33,95 +41,91 @@ final class BaseSettingsDialogFactory {
|
||||
+ "Pocket Base " + pocket.level() + " • "
|
||||
+ humanize(pocket.biome().commandName())
|
||||
),
|
||||
List.of(
|
||||
generalSettings(owner),
|
||||
progressReport(),
|
||||
baseUpgrade(owner),
|
||||
pocketSettings(owner, pocket)
|
||||
),
|
||||
null,
|
||||
dialogs,
|
||||
2,
|
||||
190
|
||||
);
|
||||
}
|
||||
|
||||
private Dialog generalSettings(PlayerState owner) {
|
||||
return new MultiActionDialog(
|
||||
base(
|
||||
private DialogSpec generalSettings(PlayerState owner) {
|
||||
List<ButtonSpec> actions = List.of(
|
||||
toggle(
|
||||
"Visitors",
|
||||
owner.baseLevel() >= 4,
|
||||
owner.visitorsEnabled(),
|
||||
"Allowed",
|
||||
"Blocked",
|
||||
"basesettings visitors "
|
||||
+ (owner.visitorsEnabled() ? "blocked" : "allowed")
|
||||
),
|
||||
toggle(
|
||||
"Navigation",
|
||||
owner.baseLevel() >= 2,
|
||||
owner.navigationEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings navigation " + mode(!owner.navigationEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Flight",
|
||||
owner.flightLevel() >= 1,
|
||||
owner.flightEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings flight " + mode(!owner.flightEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Border",
|
||||
owner.baseLevel() >= 1 && owner.base().isPresent(),
|
||||
owner.borderEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings border " + mode(!owner.borderEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Spawnable Overlay",
|
||||
owner.baseLevel() >= 1
|
||||
&& owner.base().isPresent()
|
||||
&& owner.totalBlocksPlaced()
|
||||
>= settings.spawnableOverlayUnlockPlacements(),
|
||||
owner.spawnableOverlayEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings spawnable " + mode(!owner.spawnableOverlayEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Progress Boss Bar",
|
||||
true,
|
||||
owner.bossBarEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings bossbar " + mode(!owner.bossBarEnabled())
|
||||
)
|
||||
);
|
||||
return new MultiSpec(
|
||||
content(
|
||||
"Base Controls",
|
||||
"Base Controls",
|
||||
"Select a setting to change it. Locked controls remain visible and explain "
|
||||
+ "their requirement in chat when selected."
|
||||
),
|
||||
List.of(
|
||||
toggle(
|
||||
"Visitors",
|
||||
owner.baseLevel() >= 4,
|
||||
owner.visitorsEnabled(),
|
||||
"Allowed",
|
||||
"Blocked",
|
||||
"basesettings visitors "
|
||||
+ (owner.visitorsEnabled() ? "blocked" : "allowed")
|
||||
),
|
||||
toggle(
|
||||
"Navigation",
|
||||
owner.baseLevel() >= 2,
|
||||
owner.navigationEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings navigation "
|
||||
+ mode(!owner.navigationEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Flight",
|
||||
owner.flightLevel() >= 1,
|
||||
owner.flightEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings flight " + mode(!owner.flightEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Border",
|
||||
owner.baseLevel() >= 1 && owner.base().isPresent(),
|
||||
owner.borderEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings border " + mode(!owner.borderEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Spawnable Overlay",
|
||||
owner.baseLevel() >= 1
|
||||
&& owner.base().isPresent()
|
||||
&& owner.totalBlocksPlaced()
|
||||
>= settings.spawnableOverlayUnlockPlacements(),
|
||||
owner.spawnableOverlayEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings spawnable " + mode(!owner.spawnableOverlayEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Progress Boss Bar",
|
||||
true,
|
||||
owner.bossBarEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings bossbar " + mode(!owner.bossBarEnabled())
|
||||
)
|
||||
),
|
||||
2,
|
||||
null
|
||||
actions,
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
private Dialog progressReport() {
|
||||
return new NoticeDialog(base(
|
||||
"Progress Report",
|
||||
"Progress Report",
|
||||
"Display the detailed progression report in chat."
|
||||
)).action(commandButton("Show in Chat", "basesettings status"));
|
||||
private DialogSpec progressReport() {
|
||||
return new NoticeSpec(
|
||||
content(
|
||||
"Progress Report",
|
||||
"Progress Report",
|
||||
"Display the detailed progression report in chat."
|
||||
),
|
||||
commandButton("Show in Chat", "basesettings status")
|
||||
);
|
||||
}
|
||||
|
||||
private Dialog baseUpgrade(PlayerState owner) {
|
||||
private DialogSpec baseUpgrade(PlayerState owner) {
|
||||
if (owner.baseLevel() >= 4) {
|
||||
return notice("Base IV", "Base IV and visitor access are already unlocked.");
|
||||
}
|
||||
@@ -131,17 +135,22 @@ final class BaseSettingsDialogFactory {
|
||||
"Unlock and establish Base III before purchasing Base IV visitor access."
|
||||
);
|
||||
}
|
||||
int price = settings.visitorUnlockDiamondCost();
|
||||
return confirmation(
|
||||
"Unlock Base IV",
|
||||
"Purchase visitor access for " + price + " diamonds?",
|
||||
"Purchase visitor access for " + settings.visitorUnlockDiamondCost()
|
||||
+ " diamonds?",
|
||||
"basesettings upgrade"
|
||||
);
|
||||
}
|
||||
|
||||
private Dialog pocketSettings(PlayerState owner, PocketBaseState pocket) {
|
||||
return new DialogListDialog(
|
||||
base(
|
||||
private DialogSpec pocketSettings(PlayerState owner, PocketBaseState pocket) {
|
||||
List<DialogSpec> dialogs = List.of(
|
||||
pocketUpgrade(owner, pocket),
|
||||
pocketMobSettings(pocket),
|
||||
pocketBiomeSettings(pocket)
|
||||
);
|
||||
return new ListSpec(
|
||||
content(
|
||||
"Pocket Base",
|
||||
"Pocket Base " + pocket.level(),
|
||||
pocket.level() == 0
|
||||
@@ -151,18 +160,13 @@ final class BaseSettingsDialogFactory {
|
||||
+ enabled(pocket.hostileMobSpawningEnabled()) + " • Passive mobs: "
|
||||
+ enabled(pocket.passiveMobSpawningEnabled())
|
||||
),
|
||||
List.of(
|
||||
pocketUpgrade(owner, pocket),
|
||||
pocketMobSettings(pocket),
|
||||
pocketBiomeSettings(pocket)
|
||||
),
|
||||
null,
|
||||
dialogs,
|
||||
1,
|
||||
260
|
||||
);
|
||||
}
|
||||
|
||||
private Dialog pocketUpgrade(PlayerState owner, PocketBaseState pocket) {
|
||||
private DialogSpec pocketUpgrade(PlayerState owner, PocketBaseState pocket) {
|
||||
if (owner.baseLevel() < 4 || owner.base().isEmpty()) {
|
||||
return notice(
|
||||
"Pocket Upgrade — Locked",
|
||||
@@ -183,57 +187,56 @@ final class BaseSettingsDialogFactory {
|
||||
);
|
||||
}
|
||||
|
||||
private Dialog pocketMobSettings(PocketBaseState pocket) {
|
||||
private DialogSpec pocketMobSettings(PocketBaseState pocket) {
|
||||
if (pocket.level() < 1) {
|
||||
return notice(
|
||||
"Mob Spawning — Locked",
|
||||
"Unlock Pocket Base I to control natural mob spawning."
|
||||
);
|
||||
}
|
||||
return new MultiActionDialog(
|
||||
base(
|
||||
List<ButtonSpec> actions = List.of(
|
||||
toggle(
|
||||
"Hostile Mobs",
|
||||
true,
|
||||
pocket.hostileMobSpawningEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings pocket mobs hostile "
|
||||
+ mode(!pocket.hostileMobSpawningEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Passive Mobs",
|
||||
true,
|
||||
pocket.passiveMobSpawningEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings pocket mobs passive "
|
||||
+ mode(!pocket.passiveMobSpawningEnabled())
|
||||
)
|
||||
);
|
||||
return new MultiSpec(
|
||||
content(
|
||||
"Mob Spawning",
|
||||
"Mob Spawning",
|
||||
"Control natural spawning independently for each mob category."
|
||||
),
|
||||
List.of(
|
||||
toggle(
|
||||
"Hostile Mobs",
|
||||
true,
|
||||
pocket.hostileMobSpawningEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings pocket mobs hostile "
|
||||
+ mode(!pocket.hostileMobSpawningEnabled())
|
||||
),
|
||||
toggle(
|
||||
"Passive Mobs",
|
||||
true,
|
||||
pocket.passiveMobSpawningEnabled(),
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"basesettings pocket mobs passive "
|
||||
+ mode(!pocket.passiveMobSpawningEnabled())
|
||||
)
|
||||
),
|
||||
1,
|
||||
null
|
||||
actions,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
private Dialog pocketBiomeSettings(PocketBaseState pocket) {
|
||||
private DialogSpec pocketBiomeSettings(PocketBaseState pocket) {
|
||||
if (pocket.level() < 1) {
|
||||
return notice(
|
||||
"Change Biome — Locked",
|
||||
"Unlock Pocket Base I to purchase biome changes."
|
||||
);
|
||||
}
|
||||
List<Dialog> worldTypes = Arrays.stream(PocketBaseWorldType.values())
|
||||
List<DialogSpec> worldTypes = Arrays.stream(PocketBaseWorldType.values())
|
||||
.map(type -> pocketBiomeType(pocket, type))
|
||||
.map(Dialog.class::cast)
|
||||
.toList();
|
||||
return new DialogListDialog(
|
||||
base(
|
||||
return new ListSpec(
|
||||
content(
|
||||
"Change Biome",
|
||||
"Change Biome",
|
||||
"Current biome: " + pocket.biome().worldType().commandName() + "/"
|
||||
@@ -242,35 +245,32 @@ final class BaseSettingsDialogFactory {
|
||||
+ humanize(settings.pocketBaseBiomeCurrencyMaterial()) + "."
|
||||
),
|
||||
worldTypes,
|
||||
null,
|
||||
1,
|
||||
220
|
||||
);
|
||||
}
|
||||
|
||||
private DialogListDialog pocketBiomeType(
|
||||
private DialogSpec pocketBiomeType(
|
||||
PocketBaseState pocket,
|
||||
PocketBaseWorldType worldType
|
||||
) {
|
||||
List<Dialog> biomes = Arrays.stream(PocketBaseBiome.values())
|
||||
List<DialogSpec> biomes = Arrays.stream(PocketBaseBiome.values())
|
||||
.filter(biome -> biome.worldType() == worldType)
|
||||
.map(biome -> biomeConfirmation(pocket, biome))
|
||||
.map(Dialog.class::cast)
|
||||
.toList();
|
||||
return new DialogListDialog(
|
||||
base(
|
||||
return new ListSpec(
|
||||
content(
|
||||
humanize(worldType.commandName()),
|
||||
humanize(worldType.commandName()) + " Biomes",
|
||||
"Choose a biome subtype. The active biome is marked as selected."
|
||||
),
|
||||
biomes,
|
||||
null,
|
||||
2,
|
||||
190
|
||||
);
|
||||
}
|
||||
|
||||
private Dialog biomeConfirmation(PocketBaseState pocket, PocketBaseBiome biome) {
|
||||
private DialogSpec biomeConfirmation(PocketBaseState pocket, PocketBaseBiome biome) {
|
||||
String title = humanize(biome.commandName())
|
||||
+ (pocket.biome() == biome ? " — Selected" : "");
|
||||
if (pocket.biome() == biome) {
|
||||
@@ -285,16 +285,18 @@ final class BaseSettingsDialogFactory {
|
||||
);
|
||||
}
|
||||
|
||||
private static Dialog confirmation(String title, String message, String command) {
|
||||
return new ConfirmationDialog(base(title, title, message))
|
||||
.yes(commandButton("Confirm", command));
|
||||
private static DialogSpec confirmation(String title, String message, String command) {
|
||||
return new ConfirmationSpec(
|
||||
content(title, title, message),
|
||||
commandButton("Confirm", command)
|
||||
);
|
||||
}
|
||||
|
||||
private static Dialog notice(String title, String message) {
|
||||
return new NoticeDialog(base(title, title, message));
|
||||
private static DialogSpec notice(String title, String message) {
|
||||
return new NoticeSpec(content(title, title, message), null);
|
||||
}
|
||||
|
||||
private static ActionButton toggle(
|
||||
private static ButtonSpec toggle(
|
||||
String name,
|
||||
boolean unlocked,
|
||||
boolean active,
|
||||
@@ -306,29 +308,106 @@ final class BaseSettingsDialogFactory {
|
||||
String tooltip = unlocked
|
||||
? "Click to change this setting."
|
||||
: "This setting has not been unlocked yet.";
|
||||
return new ActionButton(
|
||||
text(name + ": " + state),
|
||||
text(tooltip),
|
||||
190,
|
||||
new RunCommandAction("/" + command)
|
||||
);
|
||||
return new ButtonSpec(name + ": " + state, tooltip, 190, "/" + command);
|
||||
}
|
||||
|
||||
private static ActionButton commandButton(String label, String command) {
|
||||
return new ActionButton(text(label), new RunCommandAction("/" + command));
|
||||
private static ButtonSpec commandButton(String label, String command) {
|
||||
return new ButtonSpec(label, "", 150, "/" + command);
|
||||
}
|
||||
|
||||
private static DialogBase base(String title, String externalTitle, String message) {
|
||||
return new DialogBase(text(title))
|
||||
.externalTitle(text(externalTitle))
|
||||
.body(List.of(new PlainMessageBody(text(message), DIALOG_WIDTH)))
|
||||
private static DialogContent content(
|
||||
String title,
|
||||
String externalTitle,
|
||||
String message
|
||||
) {
|
||||
return new DialogContent(title, externalTitle, message);
|
||||
}
|
||||
|
||||
private static Dialog render(DialogSpec specification) {
|
||||
DialogType type;
|
||||
if (specification instanceof ListSpec list) {
|
||||
List<Dialog> dialogs = list.dialogs().stream()
|
||||
.map(BaseSettingsDialogFactory::render)
|
||||
.toList();
|
||||
type = DialogType.dialogList(
|
||||
RegistrySet.valueSet(RegistryKey.DIALOG, dialogs),
|
||||
null,
|
||||
list.columns(),
|
||||
list.buttonWidth()
|
||||
);
|
||||
} else if (specification instanceof MultiSpec multi) {
|
||||
List<ActionButton> actions = multi.actions().stream()
|
||||
.map(BaseSettingsDialogFactory::render)
|
||||
.toList();
|
||||
type = DialogType.multiAction(actions, null, multi.columns());
|
||||
} else if (specification instanceof ConfirmationSpec confirmation) {
|
||||
ActionButton cancel = ActionButton.builder(Component.text("Cancel")).build();
|
||||
type = DialogType.confirmation(render(confirmation.confirm()), cancel);
|
||||
} else if (specification instanceof NoticeSpec notice) {
|
||||
type = notice.action() == null
|
||||
? DialogType.notice()
|
||||
: DialogType.notice(render(notice.action()));
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported dialog specification");
|
||||
}
|
||||
DialogContent content = specification.content();
|
||||
DialogBase base = DialogBase.builder(Component.text(content.title()))
|
||||
.externalTitle(Component.text(content.externalTitle()))
|
||||
.body(List.of(DialogBody.plainMessage(
|
||||
Component.text(content.message()), DIALOG_WIDTH
|
||||
)))
|
||||
.canCloseWithEscape(true)
|
||||
.pause(false)
|
||||
.afterAction(DialogBase.AfterAction.CLOSE);
|
||||
.afterAction(DialogBase.DialogAfterAction.CLOSE)
|
||||
.build();
|
||||
return Dialog.create(factory -> factory.empty().base(base).type(type));
|
||||
}
|
||||
|
||||
private static BaseComponent text(String value) {
|
||||
return new TextComponent(value);
|
||||
private static ActionButton render(ButtonSpec button) {
|
||||
ActionButton.Builder builder = ActionButton.builder(Component.text(button.label()))
|
||||
.width(button.width())
|
||||
.action(DialogAction.commandTemplate(button.command()));
|
||||
if (!button.tooltip().isEmpty()) {
|
||||
builder.tooltip(Component.text(button.tooltip()));
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
sealed interface DialogSpec permits ListSpec, MultiSpec, ConfirmationSpec, NoticeSpec {
|
||||
DialogContent content();
|
||||
}
|
||||
|
||||
record DialogContent(String title, String externalTitle, String message) {
|
||||
}
|
||||
|
||||
record ListSpec(
|
||||
DialogContent content,
|
||||
List<DialogSpec> dialogs,
|
||||
int columns,
|
||||
int buttonWidth
|
||||
) implements DialogSpec {
|
||||
}
|
||||
|
||||
record MultiSpec(
|
||||
DialogContent content,
|
||||
List<ButtonSpec> actions,
|
||||
int columns
|
||||
) implements DialogSpec {
|
||||
}
|
||||
|
||||
record ConfirmationSpec(
|
||||
DialogContent content,
|
||||
ButtonSpec confirm
|
||||
) implements DialogSpec {
|
||||
}
|
||||
|
||||
record NoticeSpec(
|
||||
DialogContent content,
|
||||
ButtonSpec action
|
||||
) implements DialogSpec {
|
||||
}
|
||||
|
||||
record ButtonSpec(String label, String tooltip, int width, String command) {
|
||||
}
|
||||
|
||||
private static String mode(boolean active) {
|
||||
|
||||
@@ -137,7 +137,7 @@ final class PocketBaseWorldService {
|
||||
World world = server.getWorld(name);
|
||||
boolean created = world == null;
|
||||
if (created) {
|
||||
WorldCreator creator = new WorldCreator(name)
|
||||
WorldCreator creator = new WorldCreator(NamespacedKey.minecraft(name))
|
||||
.environment(World.Environment.NORMAL)
|
||||
.generator(new VoidPocketChunkGenerator())
|
||||
.generateStructures(false);
|
||||
|
||||
Reference in New Issue
Block a user