Skip to content

Commit

Permalink
Drop Depricated 1.13 SIGN object.
Browse files Browse the repository at this point in the history
Update to 1.7 BentoBox.
  • Loading branch information
BONNe committed Sep 8, 2019
1 parent 4e6d37c commit 449890d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<powermock.version>1.7.4</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.14.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.7.0-SNAPSHOT</bentobox.version>
<bentobox.version>1.7.0</bentobox.version>
<level.version>1.6.0</level.version>
<vault.version>1.7</vault.version>
<!-- Revision variable removes warning about dynamic version -->
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/world/bentobox/challenges/ChallengesAddon.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package world.bentobox.challenges;


import org.bukkit.Bukkit;
import org.bukkit.Material;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -100,14 +99,6 @@ public class ChallengesAddon extends Addon {
new Flag.Builder("CHALLENGES_ISLAND_PROTECTION", Material.COMMAND_BLOCK).defaultRank(RanksManager.VISITOR_RANK).build();


/**
* This ir ugly way how to fix comparability issues between 1.13 and 1.14 versions.
* @deprecated Should be removed as soon as 1.13 support are dropped down.
*/
@Deprecated
public static final Material SIGN_MATERIAL = Bukkit.getBukkitVersion().startsWith("1.13") ? Material.getMaterial("SIGN") : Material.getMaterial("OAK_SIGN");


// ---------------------------------------------------------------------
// Section: Methods
// ---------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/world/bentobox/challenges/panel/CommonGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ protected PanelItem getButton(CommonButtons button)
{
name = this.user.getTranslation("challenges.gui.buttons.next");
description = Collections.emptyList();
icon = new ItemStack(ChallengesAddon.SIGN_MATERIAL);
icon = new ItemStack(Material.OAK_SIGN);
clickHandler = (panel, user, clickType, slot) -> {
this.pageIndex++;
this.build();
Expand All @@ -286,7 +286,7 @@ protected PanelItem getButton(CommonButtons button)
{
name = this.user.getTranslation("challenges.gui.buttons.previous");
description = Collections.emptyList();
icon = new ItemStack(ChallengesAddon.SIGN_MATERIAL);
icon = new ItemStack(Material.OAK_SIGN);
clickHandler = (panel, user, clickType, slot) -> {
this.pageIndex--;
this.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ private PanelItem getSettingsButton(Button button)
this.user.getTranslation("challenges.gui.descriptions.enabled") :
this.user.getTranslation("challenges.gui.descriptions.disabled")));
name = this.user.getTranslation("challenges.gui.buttons.admin.title-enable");
icon = new ItemStack(ChallengesAddon.SIGN_MATERIAL);
icon = new ItemStack(Material.OAK_SIGN);
clickHandler = (panel, user1, clickType, i) -> {
this.settings.setShowCompletionTitle(!this.settings.isShowCompletionTitle());

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


import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.inventory.ItemStack;
import java.util.List;
Expand Down Expand Up @@ -167,7 +168,7 @@ private void addFreeChallenges(PanelBuilder panelBuilder, int firstItemIndex)
if (this.freeChallengeIndex > 0)
{
panelBuilder.item(index++, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> {
this.freeChallengeIndex--;
Expand All @@ -191,7 +192,7 @@ private void addFreeChallenges(PanelBuilder panelBuilder, int firstItemIndex)
else if (currentIndex < freeChallengesCount)
{
panelBuilder.item(index, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> {
this.freeChallengeIndex++;
Expand Down Expand Up @@ -243,7 +244,7 @@ private void addChallenges(PanelBuilder panelBuilder, int firstItemIndex)
if (this.pageIndex > 0)
{
panelBuilder.item(index++, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> {
this.pageIndex--;
Expand All @@ -267,7 +268,7 @@ private void addChallenges(PanelBuilder panelBuilder, int firstItemIndex)
else if (currentIndex < challengesCount)
{
panelBuilder.item(index, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> {
this.pageIndex++;
Expand Down Expand Up @@ -304,7 +305,7 @@ private void addChallengeLevels(PanelBuilder panelBuilder, int firstItemIndex)
if (this.levelIndex > 0)
{
panelBuilder.item(index++, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> {
this.levelIndex--;
Expand All @@ -328,7 +329,7 @@ private void addChallengeLevels(PanelBuilder panelBuilder, int firstItemIndex)
else if (currentIndex < levelCounts)
{
panelBuilder.item(index, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> {
this.levelIndex++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ else if (pageIndex > (this.elements.size() / MAX_ELEMENTS))

panelBuilder.item(18,
new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage - 1);
Expand All @@ -154,7 +154,7 @@ else if (pageIndex > (this.elements.size() / MAX_ELEMENTS))

panelBuilder.item(26,
new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ else if (pageIndex > (this.challengesList.size() / MAX_ELEMENTS))

panelBuilder.item(18,
new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage - 1);
Expand All @@ -85,7 +85,7 @@ else if (pageIndex > (this.challengesList.size() / MAX_ELEMENTS))

panelBuilder.item(26,
new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ else if (pageIndex > (this.entities.size() / MAX_ELEMENTS))

panelBuilder.item(18,
new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage - 1);
Expand All @@ -124,7 +124,7 @@ else if (pageIndex > (this.entities.size() / MAX_ELEMENTS))

panelBuilder.item(26,
new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL).
icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage + 1);
Expand Down

0 comments on commit 449890d

Please sign in to comment.