mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-06-29 08:14:56 +02: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.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
import world.bentobox.bentobox.api.configuration.ConfigComment;
|
import world.bentobox.bentobox.api.configuration.ConfigComment;
|
||||||
import world.bentobox.bentobox.api.configuration.ConfigEntry;
|
import world.bentobox.bentobox.api.configuration.ConfigEntry;
|
||||||
import world.bentobox.bentobox.api.configuration.ConfigObject;
|
import world.bentobox.bentobox.api.configuration.ConfigObject;
|
||||||
|
@ -120,6 +121,10 @@ public class Settings implements ConfigObject {
|
||||||
@ConfigEntry(path = "panel.close-on-click-outside")
|
@ConfigEntry(path = "panel.close-on-click-outside")
|
||||||
private boolean closePanelOnClickOutside = true;
|
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
|
* Logs
|
||||||
*/
|
*/
|
||||||
|
@ -685,8 +690,27 @@ public class Settings implements ConfigObject {
|
||||||
/**
|
/**
|
||||||
* Set the MongoDB client connection URI.
|
* Set the MongoDB client connection URI.
|
||||||
* @param mongodbConnectionUri connection URI.
|
* @param mongodbConnectionUri connection URI.
|
||||||
|
* @since 1.14.0
|
||||||
*/
|
*/
|
||||||
public void setMongodbConnectionUri(String mongodbConnectionUri) {
|
public void setMongodbConnectionUri(String mongodbConnectionUri) {
|
||||||
this.mongodbConnectionUri = 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) {
|
private void setupHeader(Tab tab, TreeMap<Integer, PanelItem> items) {
|
||||||
// Set up top
|
// Set up top
|
||||||
for (int i = 0; i < 9; i++) {
|
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
|
// Add icons
|
||||||
for (Entry<Integer, Tab> tabPanel : tpb.getTabs().entrySet()) {
|
for (Entry<Integer, Tab> tabPanel : tpb.getTabs().entrySet()) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class CatalogPanel {
|
||||||
|
|
||||||
// Setup header and corners
|
// Setup header and corners
|
||||||
for (int i : PANES) {
|
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()
|
PanelItemBuilder gamemodesButton = new PanelItemBuilder()
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class CreditsPanel {
|
||||||
|
|
||||||
// Setup header and corners
|
// Setup header and corners
|
||||||
for (int i : PANES) {
|
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()) {
|
if (plugin.getWebManager().getContributors(repository).isEmpty()) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class ManagementPanel {
|
||||||
// Setup header and corner
|
// Setup header and corner
|
||||||
setupHeader(builder, user, view);
|
setupHeader(builder, user, view);
|
||||||
for (int i : PANES) {
|
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
|
// Setup the views
|
||||||
|
|
Loading…
Reference in New Issue
Block a user