Skip to content

Commit

Permalink
Update to BentoBox 1.4.0 API Changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Mar 29, 2019
1 parent 98b6051 commit 1d6633b
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
19 changes: 16 additions & 3 deletions src/main/java/world/bentobox/biomes/panel/CommonPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;

import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.biomes.BiomesAddon;
import world.bentobox.biomes.objects.Settings.UpdateMode;
Expand Down Expand Up @@ -299,10 +300,16 @@ protected PanelItem createCommonButton(CommonButtons button, PanelItem.ClickHand
}
default:
// All buttons should be in switch case.
return null;
return new PanelItemBuilder().build();
}

return new PanelItem(icon, name, description, glow, handler == null ? clickHandler : handler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(glow).
clickHandler(handler == null ? clickHandler : handler).
build();
}


Expand Down Expand Up @@ -460,7 +467,13 @@ else if (reduce)
};
}

return new PanelItem(icon, name, Collections.emptyList(), false, handler == null ? clickHandler : handler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(Collections.emptyList()).
glow(false).
clickHandler(handler == null ? clickHandler : handler).
build();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.wesjd.anvilgui.AnvilGUI;
import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.biomes.BiomesAddon;
import world.bentobox.biomes.objects.BiomesObject;
Expand Down Expand Up @@ -645,7 +646,13 @@ private PanelItem createPropertyButton(PropertyButtons button)
clickHandler = (panel, user1, clickType, slot) -> true;
}

return new PanelItem(icon, name, description, this.currentEditMode.equals(button), clickHandler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(this.currentEditMode.equals(button)).
clickHandler(clickHandler).
build();
}


Expand Down Expand Up @@ -680,7 +687,13 @@ private PanelItem reopenAnvilGui()
return true;
};

return new PanelItem(icon, name, description, false, clickHandler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(false).
clickHandler(clickHandler).
build();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.biomes.BiomesAddon;
import world.bentobox.biomes.panel.CommonPanel;
Expand Down Expand Up @@ -223,7 +224,13 @@ private PanelItem createButton(ButtonType buttonType)
};
}

return new PanelItem(icon, name, description, glow, clickHandler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(glow).
clickHandler(clickHandler).
build();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.biomes.BiomesAddon;
import world.bentobox.biomes.objects.Settings.UpdateMode;
Expand Down Expand Up @@ -444,7 +445,13 @@ else if (visibilityMode.equals(VisibilityMode.ACCESSIBLE))
return null;
}

return new PanelItem(icon, name, description, glow, clickHandler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(glow).
clickHandler(clickHandler).
build();
}


Expand Down

0 comments on commit 1d6633b

Please sign in to comment.