Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/world/bentobox/bentobox/BentoBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import world.bentobox.bentobox.api.panels.Panel;
import world.bentobox.bentobox.api.user.Notifier;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.blueprints.BlueprintPreview;
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
import world.bentobox.bentobox.database.DatabaseSetup;
import world.bentobox.bentobox.hooks.BentoBoxHookRegistrar;
Expand Down Expand Up @@ -343,6 +344,7 @@ public void onDisable() {
shutdown = true;

HeadGetter.shutdown();
BlueprintPreview.endAll(this);

if (addonsManager != null) {
addonsManager.disableAddons();
Expand Down
45 changes: 45 additions & 0 deletions src/main/java/world/bentobox/bentobox/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,19 @@ public enum BorderColor {
@ConfigEntry(path = "island.locked-border.color", since = "3.24.0")
private BorderColor lockedBorderColor = BorderColor.RED;

@ConfigComment("Let players preview a blueprint bundle before they choose it. A right click on a")
@ConfigComment("bundle in the island creation panel takes the player to an empty world kept for")
@ConfigComment("previews, where they can fly around the bundle's overworld blueprint. Only that")
@ConfigComment("player sees the blocks; nothing is built. They are put back when the preview ends.")
@ConfigComment("Only the default bundle can be previewed until other bundles are allowed in the")
@ConfigComment("blueprint management panel.")
@ConfigEntry(path = "island.blueprint-preview.enabled", since = "3.25.0")
private boolean blueprintPreview = true;

@ConfigComment("How long a preview lasts, in seconds, before the player is put back.")
@ConfigEntry(path = "island.blueprint-preview.duration", since = "3.25.0")
private int blueprintPreviewDuration = 60;

@ConfigComment("Modal dialog options. Dialogs are the 'menu they can't click away' shown to")
@ConfigComment("players for high-friction flows. They require a server that supports dialogs")
@ConfigComment("(Minecraft 26+); on older servers every option below falls back automatically")
Expand Down Expand Up @@ -1164,6 +1177,38 @@ public void setDialogGameModeSelection(boolean dialogGameModeSelection) {
this.dialogGameModeSelection = dialogGameModeSelection;
}

/**
* @return whether players may preview blueprint bundles
* @since 3.25.0
*/
public boolean isBlueprintPreview() {
return blueprintPreview;
}

/**
* @param blueprintPreview whether players may preview blueprint bundles
* @since 3.25.0
*/
public void setBlueprintPreview(boolean blueprintPreview) {
this.blueprintPreview = blueprintPreview;
}

/**
* @return how long a blueprint preview lasts, in seconds
* @since 3.25.0
*/
public int getBlueprintPreviewDuration() {
return blueprintPreviewDuration;
}

/**
* @param blueprintPreviewDuration how long a blueprint preview lasts, in seconds
* @since 3.25.0
*/
public void setBlueprintPreviewDuration(int blueprintPreviewDuration) {
this.blueprintPreviewDuration = blueprintPreviewDuration;
}

/**
* @return whether typed input is asked for in a dialog instead of in chat
* @since 3.25.0
Expand Down
Loading
Loading