mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-10 17:31:32 +01:00
Added config option to define the item to use to fill gaps in Panels
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1344 Addons should also use this setting as much as possible when dealing with Panels
This commit is contained in:
parent
321637b9b9
commit
f66fafd0aa
@ -3,6 +3,7 @@ package world.bentobox.bentobox;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import world.bentobox.bentobox.api.configuration.ConfigComment;
|
||||
import world.bentobox.bentobox.api.configuration.ConfigEntry;
|
||||
import world.bentobox.bentobox.api.configuration.ConfigObject;
|
||||
@ -115,11 +116,15 @@ public class Settings implements ConfigObject {
|
||||
private Set<String> fakePlayers = new HashSet<>();
|
||||
|
||||
/* PANELS */
|
||||
|
||||
|
||||
@ConfigComment("Toggle whether panels should be closed or not when the player clicks anywhere outside of the inventory view.")
|
||||
@ConfigEntry(path = "panel.close-on-click-outside")
|
||||
private boolean closePanelOnClickOutside = true;
|
||||
|
||||
@ConfigComment("Defines the Material of the item that fills the gaps (in the header, etc.) of most panels.")
|
||||
@ConfigEntry(path = "panel.filler-material", since = "1.14.0")
|
||||
private Material panelFillerMaterial = Material.LIGHT_BLUE_STAINED_GLASS_PANE;
|
||||
|
||||
/*
|
||||
* Logs
|
||||
*/
|
||||
@ -685,8 +690,27 @@ public class Settings implements ConfigObject {
|
||||
/**
|
||||
* Set the MongoDB client connection URI.
|
||||
* @param mongodbConnectionUri connection URI.
|
||||
* @since 1.14.0
|
||||
*/
|
||||
public void setMongodbConnectionUri(String mongodbConnectionUri) {
|
||||
this.mongodbConnectionUri = mongodbConnectionUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Material of the item to preferably use when one needs to fill gaps in Panels.
|
||||
* @return the Material of the item to preferably use when one needs to fill gaps in Panels.
|
||||
* @since 1.14.0
|
||||
*/
|
||||
public Material getPanelFillerMaterial() {
|
||||
return panelFillerMaterial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Material of the item to preferably use when one needs to fill gaps in Panels.
|
||||
* @param panelFillerMaterial the Material of the item to preferably use when one needs to fill gaps in Panels.
|
||||
* @since 1.14.0
|
||||
*/
|
||||
public void setPanelFillerMaterial(Material panelFillerMaterial) {
|
||||
this.panelFillerMaterial = panelFillerMaterial;
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ public class TabbedPanel extends Panel implements PanelListener {
|
||||
private void setupHeader(Tab tab, TreeMap<Integer, PanelItem> items) {
|
||||
// Set up top
|
||||
for (int i = 0; i < 9; i++) {
|
||||
items.put(i, new PanelItemBuilder().icon(Material.LIGHT_BLUE_STAINED_GLASS_PANE).name(" ").build());
|
||||
items.put(i, new PanelItemBuilder().icon(plugin.getSettings().getPanelFillerMaterial()).name(" ").build());
|
||||
}
|
||||
// Add icons
|
||||
for (Entry<Integer, Tab> tabPanel : tpb.getTabs().entrySet()) {
|
||||
|
@ -35,7 +35,7 @@ public class CatalogPanel {
|
||||
|
||||
// Setup header and corners
|
||||
for (int i : PANES) {
|
||||
builder.item(i, new PanelItemBuilder().icon(Material.LIGHT_BLUE_STAINED_GLASS_PANE).name(" ").build());
|
||||
builder.item(i, new PanelItemBuilder().icon(plugin.getSettings().getPanelFillerMaterial()).name(" ").build());
|
||||
}
|
||||
|
||||
PanelItemBuilder gamemodesButton = new PanelItemBuilder()
|
||||
|
@ -33,7 +33,7 @@ public class CreditsPanel {
|
||||
|
||||
// Setup header and corners
|
||||
for (int i : PANES) {
|
||||
builder.item(i, new PanelItemBuilder().icon(Material.LIGHT_BLUE_STAINED_GLASS_PANE).name(" ").build());
|
||||
builder.item(i, new PanelItemBuilder().icon(plugin.getSettings().getPanelFillerMaterial()).name(" ").build());
|
||||
}
|
||||
|
||||
if (plugin.getWebManager().getContributors(repository).isEmpty()) {
|
||||
|
@ -44,7 +44,7 @@ public class ManagementPanel {
|
||||
// Setup header and corner
|
||||
setupHeader(builder, user, view);
|
||||
for (int i : PANES) {
|
||||
builder.item(i, new PanelItemBuilder().icon(Material.LIGHT_BLUE_STAINED_GLASS_PANE).name(" ").build());
|
||||
builder.item(i, new PanelItemBuilder().icon(plugin.getSettings().getPanelFillerMaterial()).name(" ").build());
|
||||
}
|
||||
|
||||
// Setup the views
|
||||
|
Loading…
Reference in New Issue
Block a user